From 66fd9aa2d5ff4347401af9d1ec6030ab389b6745 Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Fri, 3 Apr 2026 19:56:40 +0200 Subject: [PATCH 001/116] refactor: reorganize imports and introduce ManifestConfiguration for bedrock pack conversion --- .../api}/cache/FileCache.java | 2 +- .../api}/cache/FileCacheEntry.java | 2 +- .../bedrock/ManifestConfiguration.java | 229 ++++++++++++++++++ .../api/format/Message.java | 2 +- .../api}/manager/FileCacheManager.java | 15 +- .../CraftEngineConverter.java | 2 +- ...EngineConverterCommandClearFilesCache.java | 2 +- .../converter/Converter.java | 4 +- .../converter/itemsadder/IAConverter.java | 4 +- .../converter/nexo/NexoConverter.java | 4 +- .../database/DataBaseManager.java | 2 +- .../utils/JsonFileValidator.java | 4 +- 12 files changed, 256 insertions(+), 16 deletions(-) rename {Common/src/main/java/fr/robie/craftengineconverter/common => API/src/main/java/fr/robie/craftengineconverter/api}/cache/FileCache.java (97%) rename {Common/src/main/java/fr/robie/craftengineconverter/common => API/src/main/java/fr/robie/craftengineconverter/api}/cache/FileCacheEntry.java (92%) create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/ManifestConfiguration.java rename {Common/src/main/java/fr/robie/craftengineconverter/common => API/src/main/java/fr/robie/craftengineconverter/api}/manager/FileCacheManager.java (82%) diff --git a/Common/src/main/java/fr/robie/craftengineconverter/common/cache/FileCache.java b/API/src/main/java/fr/robie/craftengineconverter/api/cache/FileCache.java similarity index 97% rename from Common/src/main/java/fr/robie/craftengineconverter/common/cache/FileCache.java rename to API/src/main/java/fr/robie/craftengineconverter/api/cache/FileCache.java index c069c4a6..ed610dd7 100644 --- a/Common/src/main/java/fr/robie/craftengineconverter/common/cache/FileCache.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/cache/FileCache.java @@ -1,4 +1,4 @@ -package fr.robie.craftengineconverter.common.cache; +package fr.robie.craftengineconverter.api.cache; import com.google.common.cache.Cache; import com.google.common.cache.CacheBuilder; diff --git a/Common/src/main/java/fr/robie/craftengineconverter/common/cache/FileCacheEntry.java b/API/src/main/java/fr/robie/craftengineconverter/api/cache/FileCacheEntry.java similarity index 92% rename from Common/src/main/java/fr/robie/craftengineconverter/common/cache/FileCacheEntry.java rename to API/src/main/java/fr/robie/craftengineconverter/api/cache/FileCacheEntry.java index b430245b..aca08d34 100644 --- a/Common/src/main/java/fr/robie/craftengineconverter/common/cache/FileCacheEntry.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/cache/FileCacheEntry.java @@ -1,4 +1,4 @@ -package fr.robie.craftengineconverter.common.cache; +package fr.robie.craftengineconverter.api.cache; import java.io.File; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/ManifestConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/ManifestConfiguration.java new file mode 100644 index 00000000..dd6171ae --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/ManifestConfiguration.java @@ -0,0 +1,229 @@ +package fr.robie.craftengineconverter.api.configuration.bedrock; + +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import fr.robie.craftengineconverter.api.manager.FileCacheManager; +import org.jetbrains.annotations.NotNull; + +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + +public class ManifestConfiguration { + private static final int formatVersion = 3; + + private final String packName; + private String packDescription; + private UUID packUUID; + private String packVersion; + private String minEngineVersion; + private PackScope scope; + + private UUID resourcePackUUID; + private String resourcePackVersion; + + // Metadata + private final List authors = new ArrayList<>(); + private String license; + private String productType; + private String url; + + public ManifestConfiguration(@NotNull String packName) { + this.packName = packName; + } + + public ManifestConfiguration setPackDescription(String packDescription) { + this.packDescription = packDescription; + return this; + } + + public ManifestConfiguration setPackUUID(UUID packUUID) { + this.packUUID = packUUID; + return this; + } + + public ManifestConfiguration setPackVersion(String packVersion) { + this.packVersion = packVersion; + return this; + } + + public ManifestConfiguration setMinEngineVersion(String minEngineVersion) { + this.minEngineVersion = minEngineVersion; + return this; + } + + public ManifestConfiguration setScope(PackScope scope) { + this.scope = scope; + return this; + } + + + public ManifestConfiguration addAuthor(String author) { + if (author != null && !author.isEmpty()) { + this.authors.add(author); + } + return this; + } + + public ManifestConfiguration setAuthors(List authors) { + this.authors.clear(); + if (authors != null) { + this.authors.addAll(authors); + } + return this; + } + + public List getAuthors() { + return new ArrayList<>(this.authors); + } + + public String getLicense() { + return this.license; + } + + public ManifestConfiguration setLicense(String license) { + this.license = license; + return this; + } + + public String getProductType() { + return this.productType; + } + + public ManifestConfiguration setProductType(String productType) { + this.productType = productType; + return this; + } + + public String getUrl() { + return this.url; + } + + public ManifestConfiguration setUrl(String url) { + this.url = url; + return this; + } + + public ManifestConfiguration setResourcePackUUID(UUID resourcePackUUID) { + this.resourcePackUUID = resourcePackUUID; + return this; + } + + public ManifestConfiguration setResourcePackVersion(String resourcePackVersion) { + this.resourcePackVersion = resourcePackVersion; + return this; + } + + public void saveManifest(@NotNull Path directory) { + JsonObject json = new JsonObject(); + json.addProperty("format_version", formatVersion); + + json.add("header", this.createHeader()); + json.add("modules", this.createModules()); + + JsonObject metadata = this.createMetadata(); + if (!metadata.isEmpty()) { + json.add("metadata", metadata); + } + + Path filePath = directory.resolve("manifest.json"); + FileCacheManager.saveJsonToFile(filePath, json); + } + + private JsonObject createHeader() { + JsonObject header = new JsonObject(); + + header.addProperty("name", this.packName); + if (this.packDescription != null) { + header.addProperty("description", this.packDescription); + } + header.addProperty("uuid", (this.packUUID != null ? this.packUUID : UUID.randomUUID()).toString()); + header.addProperty("version", this.packVersion != null ? this.packVersion : "1.0.0"); + header.addProperty("min_engine_version", this.minEngineVersion != null ? this.minEngineVersion : "1.26.10"); + if (this.scope != null) { + header.addProperty("scope", this.scope.name().toLowerCase()); + } + return header; + } + + private JsonArray createModules() { + JsonArray modules = new JsonArray(); + JsonObject module = new JsonObject(); + UUID resourceUUID = this.resourcePackUUID; + UUID mainUUID = this.packUUID; + if (resourceUUID == null || resourceUUID.equals(mainUUID)) { + do { + resourceUUID = UUID.randomUUID(); + } while (resourceUUID.equals(mainUUID)); + } + module.addProperty("type", "resources"); + module.addProperty("uuid", resourceUUID.toString()); + module.addProperty("version", this.resourcePackVersion != null ? this.resourcePackVersion : "1.0.0"); + modules.add(module); + return modules; + } + + private JsonObject createMetadata() { + JsonObject metadata = new JsonObject(); + if (!this.authors.isEmpty()) { + JsonArray authorsArray = new JsonArray(); + for (String author : this.authors) { + authorsArray.add(author); + } + metadata.add("authors", authorsArray); + } + if (this.license != null) { + metadata.addProperty("license", this.license); + } + if (this.productType != null) { + metadata.addProperty("product_type", this.productType); + } + if (this.url != null) { + metadata.addProperty("url", this.url); + } + return metadata; + } + + public static ManifestConfiguration fromJavaPackFormat(@NotNull JsonObject json) { + JsonObject pack = json.getAsJsonObject("pack"); + + if (pack == null) { + throw new IllegalArgumentException("Invalid Java pack format: missing 'pack' object"); + } + + ManifestConfiguration configuration = null; + JsonElement description = pack.get("description"); + + if (description != null) { + if (description.isJsonArray()) { + JsonArray arr = description.getAsJsonArray(); + if (!arr.isEmpty()) { + String first = arr.get(0).getAsString(); + configuration = new ManifestConfiguration(first); + if (arr.size() > 1) { + StringBuilder sb = new StringBuilder(); + for (int i = 1; i < arr.size(); i++) { + sb.append(arr.get(i).getAsString()); + if (i < arr.size() - 1) { + sb.append(" "); + } + } + configuration.setPackDescription(sb.toString()); + } + } + } else if (description.isJsonPrimitive()) { + configuration = new ManifestConfiguration(description.getAsString()); + } + } + + return configuration != null ? configuration : new ManifestConfiguration("Unnamed Pack"); + } + + public enum PackScope { + ANY, + GLOBAL, + WORLD + } +} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/format/Message.java b/API/src/main/java/fr/robie/craftengineconverter/api/format/Message.java index c7a13410..6f608076 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/format/Message.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/format/Message.java @@ -255,7 +255,7 @@ public enum Message { ERROR__CONVERTER__NEXO__PACK__ZIP_EXTRACT_FAILURE("Failed to extract and copy assets from ZIP: §e%file%§c"), ERROR__CONVERTER__NEXO__IMAGES__SAVE_FAILURE("Failed to save converted image file: §e%file%§c"), - ERROR__CONVERTER__NEXO__IMAGES__RELATIVE_PATH_FAILURE("Failed to compute relative path for image file: §e%file%§c"); + ERROR__CONVERTER__NEXO__IMAGES__RELATIVE_PATH_FAILURE("Failed to compute relative path for image file: §e%file%§c"), ERROR__JSON__SAVE_FAILURE("Failed to save JSON file: §e%file%§c."); private final List defaults; private List loaded; diff --git a/Common/src/main/java/fr/robie/craftengineconverter/common/manager/FileCacheManager.java b/API/src/main/java/fr/robie/craftengineconverter/api/manager/FileCacheManager.java similarity index 82% rename from Common/src/main/java/fr/robie/craftengineconverter/common/manager/FileCacheManager.java rename to API/src/main/java/fr/robie/craftengineconverter/api/manager/FileCacheManager.java index ae97e8a8..1f88caaf 100644 --- a/Common/src/main/java/fr/robie/craftengineconverter/common/manager/FileCacheManager.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/manager/FileCacheManager.java @@ -1,14 +1,16 @@ -package fr.robie.craftengineconverter.common.manager; +package fr.robie.craftengineconverter.api.manager; import com.google.gson.*; import com.google.gson.stream.JsonReader; +import fr.robie.craftengineconverter.api.cache.FileCache; import fr.robie.craftengineconverter.api.format.Message; import fr.robie.craftengineconverter.api.logger.LogType; import fr.robie.craftengineconverter.api.logger.Logger; -import fr.robie.craftengineconverter.common.cache.FileCache; import org.bukkit.configuration.file.YamlConfiguration; +import org.jetbrains.annotations.NotNull; import java.nio.file.Files; +import java.nio.file.Path; public class FileCacheManager { private static final Gson GSON = new GsonBuilder() @@ -64,4 +66,13 @@ public static FileCache getYamlCache() { public static FileCache getJsonCache() { return jsonCache; } + + public static void saveJsonToFile(@NotNull Path path, @NotNull JsonObject json) { + try (var writer = Files.newBufferedWriter(path)) { + GSON.toJson(json, writer); + } catch (Exception e) { + Logger.showException(Message.ERROR__JSON__SAVE_FAILURE, e, "file", path.toString()); + } + } + } \ No newline at end of file diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/CraftEngineConverter.java b/Plugin/src/main/java/fr/robie/craftengineconverter/CraftEngineConverter.java index e602364f..982d9f4a 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/CraftEngineConverter.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/CraftEngineConverter.java @@ -13,6 +13,7 @@ import fr.robie.craftengineconverter.api.logger.ComponentLogger; import fr.robie.craftengineconverter.api.logger.LogType; import fr.robie.craftengineconverter.api.logger.Logger; +import fr.robie.craftengineconverter.api.manager.FileCacheManager; import fr.robie.craftengineconverter.api.manager.FoliaCompatibilityManager; import fr.robie.craftengineconverter.api.packet.PacketLoader; import fr.robie.craftengineconverter.api.profile.ServerProfile; @@ -21,7 +22,6 @@ import fr.robie.craftengineconverter.command.CraftEngineConverterCommand; import fr.robie.craftengineconverter.common.CraftEngineConverterPlugin; import fr.robie.craftengineconverter.common.format.ClassicMeta; -import fr.robie.craftengineconverter.common.manager.FileCacheManager; import fr.robie.craftengineconverter.common.scanner.BlockStateMappingScanner; import fr.robie.craftengineconverter.common.utils.CraftEngineImageUtils; import fr.robie.craftengineconverter.converter.Converter; diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/command/CraftEngineConverterCommandClearFilesCache.java b/Plugin/src/main/java/fr/robie/craftengineconverter/command/CraftEngineConverterCommandClearFilesCache.java index 01930d59..3f9a2307 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/command/CraftEngineConverterCommandClearFilesCache.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/command/CraftEngineConverterCommandClearFilesCache.java @@ -3,7 +3,7 @@ import fr.robie.craftengineconverter.CraftEngineConverter; import fr.robie.craftengineconverter.api.builder.TimerBuilder; import fr.robie.craftengineconverter.api.format.Message; -import fr.robie.craftengineconverter.common.manager.FileCacheManager; +import fr.robie.craftengineconverter.api.manager.FileCacheManager; import fr.robie.craftengineconverter.common.permission.Permission; import fr.robie.craftengineconverter.utils.command.CommandType; import fr.robie.craftengineconverter.utils.command.VCommand; diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/Converter.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/Converter.java index c9ef04c1..26edc4e5 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/Converter.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/Converter.java @@ -1,6 +1,7 @@ package fr.robie.craftengineconverter.converter; import fr.robie.craftengineconverter.CraftEngineConverter; +import fr.robie.craftengineconverter.api.cache.FileCacheEntry; import fr.robie.craftengineconverter.api.configuration.Configuration; import fr.robie.craftengineconverter.api.configuration.ConfigurationKey; import fr.robie.craftengineconverter.api.configuration.ConverterSettings; @@ -10,10 +11,9 @@ import fr.robie.craftengineconverter.api.format.Message; import fr.robie.craftengineconverter.api.logger.LogType; import fr.robie.craftengineconverter.api.logger.Logger; +import fr.robie.craftengineconverter.api.manager.FileCacheManager; import fr.robie.craftengineconverter.api.progress.BukkitProgressBar; import fr.robie.craftengineconverter.api.utils.ObjectUtils; -import fr.robie.craftengineconverter.common.cache.FileCacheEntry; -import fr.robie.craftengineconverter.common.manager.FileCacheManager; import fr.robie.craftengineconverter.converter.settings.BasicConverterSettings; import fr.robie.craftengineconverter.utils.ConfigFile; import org.bukkit.configuration.ConfigurationSection; diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/itemsadder/IAConverter.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/itemsadder/IAConverter.java index 61177756..a2658068 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/itemsadder/IAConverter.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/itemsadder/IAConverter.java @@ -1,6 +1,7 @@ package fr.robie.craftengineconverter.converter.itemsadder; import fr.robie.craftengineconverter.CraftEngineConverter; +import fr.robie.craftengineconverter.api.cache.FileCacheEntry; import fr.robie.craftengineconverter.api.configuration.Configuration; import fr.robie.craftengineconverter.api.configuration.ConfigurationKey; import fr.robie.craftengineconverter.api.configuration.image.SingleCharacterBitmapConfiguration; @@ -21,12 +22,11 @@ import fr.robie.craftengineconverter.api.format.Message; import fr.robie.craftengineconverter.api.logger.LogType; import fr.robie.craftengineconverter.api.logger.Logger; +import fr.robie.craftengineconverter.api.manager.FileCacheManager; import fr.robie.craftengineconverter.api.progress.BukkitProgressBar; import fr.robie.craftengineconverter.common.BlockStatesMapper; import fr.robie.craftengineconverter.common.PluginNameMapper; -import fr.robie.craftengineconverter.common.cache.FileCacheEntry; import fr.robie.craftengineconverter.common.enums.NmsVersion; -import fr.robie.craftengineconverter.common.manager.FileCacheManager; import fr.robie.craftengineconverter.common.records.ImageConversion; import fr.robie.craftengineconverter.common.utils.CacheConversion; import fr.robie.craftengineconverter.common.utils.CraftEngineImageUtils; diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoConverter.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoConverter.java index f67dac5f..3f8fe300 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoConverter.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoConverter.java @@ -1,6 +1,7 @@ package fr.robie.craftengineconverter.converter.nexo; import fr.robie.craftengineconverter.CraftEngineConverter; +import fr.robie.craftengineconverter.api.cache.FileCacheEntry; import fr.robie.craftengineconverter.api.configuration.image.Bitmap; import fr.robie.craftengineconverter.api.configuration.image.MultipleCharactersBitmapConfiguration; import fr.robie.craftengineconverter.api.configuration.image.SingleCharacterBitmapConfiguration; @@ -19,11 +20,10 @@ import fr.robie.craftengineconverter.api.format.Message; import fr.robie.craftengineconverter.api.logger.LogType; import fr.robie.craftengineconverter.api.logger.Logger; +import fr.robie.craftengineconverter.api.manager.FileCacheManager; import fr.robie.craftengineconverter.api.progress.BukkitProgressBar; import fr.robie.craftengineconverter.common.BlockStatesMapper; import fr.robie.craftengineconverter.common.PluginNameMapper; -import fr.robie.craftengineconverter.common.cache.FileCacheEntry; -import fr.robie.craftengineconverter.common.manager.FileCacheManager; import fr.robie.craftengineconverter.common.records.ImageConversion; import fr.robie.craftengineconverter.common.utils.CraftEngineImageUtils; import fr.robie.craftengineconverter.common.utils.SnakeUtils; diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/database/DataBaseManager.java b/Plugin/src/main/java/fr/robie/craftengineconverter/database/DataBaseManager.java index d007934c..3dcea194 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/database/DataBaseManager.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/database/DataBaseManager.java @@ -9,8 +9,8 @@ import fr.robie.craftengineconverter.api.history.BlockHistory; import fr.robie.craftengineconverter.api.history.EntityHistory; import fr.robie.craftengineconverter.api.logger.LogType; +import fr.robie.craftengineconverter.api.manager.FileCacheManager; import fr.robie.craftengineconverter.common.CraftEngineConverterPlugin; -import fr.robie.craftengineconverter.common.manager.FileCacheManager; import fr.robie.craftengineconverter.database.migrations.WorldBlockConverterHistorical; import fr.robie.craftengineconverter.database.migrations.WorldEntityConverterHistorical; import fr.robie.craftengineconverter.utils.TypedCache; diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/utils/JsonFileValidator.java b/Plugin/src/main/java/fr/robie/craftengineconverter/utils/JsonFileValidator.java index 4959aa64..1e1165a1 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/utils/JsonFileValidator.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/utils/JsonFileValidator.java @@ -3,12 +3,12 @@ import com.google.gson.GsonBuilder; import com.google.gson.JsonElement; import com.google.gson.JsonObject; +import fr.robie.craftengineconverter.api.cache.FileCacheEntry; import fr.robie.craftengineconverter.api.logger.LogType; import fr.robie.craftengineconverter.api.logger.Logger; +import fr.robie.craftengineconverter.api.manager.FileCacheManager; import fr.robie.craftengineconverter.api.progress.BukkitProgressBar; import fr.robie.craftengineconverter.common.CraftEngineConverterPlugin; -import fr.robie.craftengineconverter.common.cache.FileCacheEntry; -import fr.robie.craftengineconverter.common.manager.FileCacheManager; import org.bukkit.Material; import org.bukkit.entity.Player; From 069407f5ab4a8ffb6b319981167834e125aeaf00 Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Sat, 4 Apr 2026 11:48:58 +0200 Subject: [PATCH 002/116] feat: implement JSON serialization for consume effects and introduce BedrockComponent interface --- .../mapping/MappingsConfiguration.java | 47 +++++++ .../bedrock/mapping/item/ItemMapping.java | 71 +++++++++++ .../mapping/item/ItemModelItemMapping.java | 24 ++++ .../mapping/item/LegacyItemMapping.java | 22 ++++ .../item/component/BedrockComponent.java | 8 ++ .../item/component/EquippableComponent.java | 42 +++++++ .../mapping/item/option/BedrockOptions.java | 116 ++++++++++++++++++ .../item/AbstractEffectsConfiguration.java | 74 ++++++++++- .../components/ConsumableConfiguration.java | 32 +++-- .../DeathProtectionConfiguration.java | 1 + .../item/components/FoodConfiguration.java | 16 ++- .../item/components/MaxDamageComponent.java | 28 +++++ .../components/MaxStackSizeConfiguration.java | 9 +- .../components/UseCooldownConfiguration.java | 14 ++- .../settings/EquippableConfiguration.java | 24 ++-- .../item/component/ConsumableAnimation.java | 9 ++ .../utils/item/component/ConsumeEffect.java | 11 ++ .../converter/nexo/NexoItemConverter.java | 12 +- 18 files changed, 526 insertions(+), 34 deletions(-) create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/MappingsConfiguration.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/ItemMapping.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/ItemModelItemMapping.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/LegacyItemMapping.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/component/BedrockComponent.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/component/EquippableComponent.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/option/BedrockOptions.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/MaxDamageComponent.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/enums/item/component/ConsumableAnimation.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/utils/item/component/ConsumeEffect.java diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/MappingsConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/MappingsConfiguration.java new file mode 100644 index 00000000..e36504cc --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/MappingsConfiguration.java @@ -0,0 +1,47 @@ +package fr.robie.craftengineconverter.api.configuration.bedrock.mapping; + +import com.google.gson.JsonArray; +import com.google.gson.JsonObject; +import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.ItemMapping; +import fr.robie.craftengineconverter.api.manager.FileCacheManager; +import org.bukkit.Material; +import org.jetbrains.annotations.NotNull; + +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class MappingsConfiguration { + private static final int formatVersion = 2; + + private final Map> itemMappings = new HashMap<>(); + + public MappingsConfiguration addItemMapping(@NotNull ItemMapping itemMapping) { + this.itemMappings.computeIfAbsent(itemMapping.getJavaMaterial(), k -> new ArrayList<>()).add(itemMapping); + return this; + } + + public void saveMappings(@NotNull Path directory) { + JsonObject jsonObject = new JsonObject(); + + jsonObject.addProperty("format_version", formatVersion); + + JsonObject itemsObject = new JsonObject(); + + for (var entry : this.itemMappings.entrySet()) { + Material material = entry.getKey(); + List mappings = entry.getValue(); + + JsonArray mappingsArray = new JsonArray(); + for (ItemMapping mapping : mappings) { + mappingsArray.add(mapping.serialize()); + } + itemsObject.add("minecraft:" + material.name().toLowerCase(), mappingsArray); + } + + Path mappingsFile = directory.resolve("items_mappings.json"); + FileCacheManager.saveJsonToFile(mappingsFile, jsonObject); + } +} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/ItemMapping.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/ItemMapping.java new file mode 100644 index 00000000..4be41a34 --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/ItemMapping.java @@ -0,0 +1,71 @@ +package fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item; + +import com.google.gson.JsonObject; +import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.component.BedrockComponent; +import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.option.BedrockOptions; +import org.bukkit.Material; +import org.jetbrains.annotations.NotNull; + +import java.util.ArrayList; +import java.util.List; + +public abstract class ItemMapping { + private final Material javaMaterial; + + private final String bedrockIdentifier; + + private String displayName; + private BedrockOptions bedrockOptions; + + private final List bedrockComponents = new ArrayList<>(); + + public ItemMapping(@NotNull Material javaMaterial, @NotNull String bedrockIdentifier) { + this.javaMaterial = javaMaterial; + this.bedrockIdentifier = bedrockIdentifier; + } + + public ItemMapping setDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + public ItemMapping setBedrockOptions(BedrockOptions bedrockOptions) { + this.bedrockOptions = bedrockOptions; + return this; + } + + public ItemMapping addBedrockComponent(@NotNull BedrockComponent component) { + this.bedrockComponents.add(component); + return this; + } + + public Material getJavaMaterial() { + return this.javaMaterial; + } + + public JsonObject serialize() { + JsonObject jsonObject = new JsonObject(); + jsonObject.addProperty("bedrock_identifier", this.bedrockIdentifier); + + if (this.displayName != null) { + jsonObject.addProperty("display_name", this.displayName); + } + + if (this.bedrockOptions != null) { + JsonObject serialize = this.bedrockOptions.serialize(); + if (!serialize.isEmpty()) { + jsonObject.add("bedrock_options", serialize); + } + } + + if (!this.bedrockComponents.isEmpty()) { + JsonObject componentsObject = new JsonObject(); + for (BedrockComponent component : this.bedrockComponents) { + component.applyTo(componentsObject); + } + jsonObject.add("components", componentsObject); + } + + return jsonObject; + } +} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/ItemModelItemMapping.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/ItemModelItemMapping.java new file mode 100644 index 00000000..7d5f4284 --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/ItemModelItemMapping.java @@ -0,0 +1,24 @@ +package fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item; + +import com.google.gson.JsonObject; +import org.bukkit.Material; +import org.jetbrains.annotations.NotNull; + +public class ItemModelItemMapping extends ItemMapping { + private final String bedrockModelPath; + + public ItemModelItemMapping(@NotNull Material javaMaterial, @NotNull String bedrockIdentifier, @NotNull String bedrockModelPath) { + super(javaMaterial, bedrockIdentifier); + this.bedrockModelPath = bedrockModelPath; + } + + + @Override + public JsonObject serialize() { + JsonObject jsonObject = super.serialize(); + jsonObject.addProperty("type", "definition"); + jsonObject.addProperty("model", this.bedrockModelPath); + return jsonObject; + } + +} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/LegacyItemMapping.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/LegacyItemMapping.java new file mode 100644 index 00000000..5c4f720a --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/LegacyItemMapping.java @@ -0,0 +1,22 @@ +package fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item; + +import com.google.gson.JsonObject; +import org.bukkit.Material; +import org.jetbrains.annotations.NotNull; + +public class LegacyItemMapping extends ItemMapping { + private final float customModelData; + + public LegacyItemMapping(@NotNull Material javaMaterial, @NotNull String bedrockIdentifier, float customModelData) { + super(javaMaterial, bedrockIdentifier); + this.customModelData = customModelData; + } + + @Override + public JsonObject serialize() { + JsonObject jsonObject = super.serialize(); + jsonObject.addProperty("type", "legacy"); + jsonObject.addProperty("custom_model_data", this.customModelData); + return jsonObject; + } +} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/component/BedrockComponent.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/component/BedrockComponent.java new file mode 100644 index 00000000..9146c81a --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/component/BedrockComponent.java @@ -0,0 +1,8 @@ +package fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.component; + +import com.google.gson.JsonObject; +import org.jetbrains.annotations.NotNull; + +public interface BedrockComponent { + void applyTo(@NotNull JsonObject componentObject); +} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/component/EquippableComponent.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/component/EquippableComponent.java new file mode 100644 index 00000000..6afebaad --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/component/EquippableComponent.java @@ -0,0 +1,42 @@ +package fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.component; + +import com.google.gson.JsonObject; +import fr.robie.craftengineconverter.api.configuration.item.settings.EquippableConfiguration; +import net.momirealms.craftengine.core.entity.EquipmentSlot; +import org.jetbrains.annotations.NotNull; + +public class EquippableComponent extends EquippableConfiguration implements BedrockComponent { + public EquippableComponent(EquipmentSlot equipmentSlot, String equipSound, String assetId, boolean dispensable, boolean damageOnHurt, boolean equipOnInteract, boolean canBeSheared, String shearingSound) { + super(equipmentSlot, equipSound, assetId, null, dispensable, false, damageOnHurt, equipOnInteract, null, canBeSheared, shearingSound, null); + } + + @Override + public void applyTo(@NotNull JsonObject componentObject) { + JsonObject equippableObject = new JsonObject(); + if (this.equipmentSlot != null) { + equippableObject.addProperty("slot", this.equipmentSlot.name().toLowerCase()); + } + if (this.equipSound != null && !this.equipSound.isBlank() && !this.equipSound.equals("item.armor.equip_generic")) { + equippableObject.addProperty("equip_sound", this.equipSound); + } + if (this.assetId != null && !this.assetId.isBlank()) { + equippableObject.addProperty("asset_id", this.assetId); + } + if (!this.dispensable) { + equippableObject.addProperty("dispensable", false); + } + if (!this.damageOnHurt) { + equippableObject.addProperty("damage_on_hurt", false); + } + if (this.equipOnInteract) { + equippableObject.addProperty("equip_on_interact", true); + } + if (this.canBeSheared) { + equippableObject.addProperty("can_be_sheared", true); + } + if (this.shearingSound != null && !this.shearingSound.isBlank() && !this.shearingSound.equals("item.shears.snip")) { + equippableObject.addProperty("shearing_sound", this.shearingSound); + } + componentObject.add("minecraft:equippable", equippableObject); + } +} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/option/BedrockOptions.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/option/BedrockOptions.java new file mode 100644 index 00000000..75dcc70d --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/option/BedrockOptions.java @@ -0,0 +1,116 @@ +package fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.option; + +import com.google.gson.JsonArray; +import com.google.gson.JsonObject; + +import java.util.HashSet; +import java.util.Set; + +public class BedrockOptions { + private String icon; + private boolean allowOffhand = true; + private boolean displayHandheld = false; + private int protectionValue = 0; + private CreativeCategory creativeCategory = CreativeCategory.NONE; + //TODO: creative_group + private final Set tags = new HashSet<>(); + + public JsonObject serialize() { + JsonObject jsonObject = new JsonObject(); + if (this.icon != null) { + jsonObject.addProperty("icon", this.icon); + } + if (!this.allowOffhand) { + jsonObject.addProperty("allow_offhand", false); + } + if (this.displayHandheld) { + jsonObject.addProperty("display_handheld", true); + } + if (this.protectionValue != 0) { + jsonObject.addProperty("protection_value", this.protectionValue); + } + if (this.creativeCategory != CreativeCategory.NONE) { + jsonObject.addProperty("creative_category", this.creativeCategory.name().toLowerCase()); + } + if (!this.tags.isEmpty()) { + JsonArray tagsArray = new JsonArray(); + for (String tag : this.tags) { + tagsArray.add(tag); + } + jsonObject.add("tags", tagsArray); + } + return jsonObject; + } + + public BedrockOptions setIcon(String icon) { + this.icon = icon; + return this; + } + + public String getIcon() { + return this.icon; + } + + public BedrockOptions setAllowOffhand(boolean allowOffhand) { + this.allowOffhand = allowOffhand; + return this; + } + + public boolean isAllowOffhand() { + return this.allowOffhand; + } + + public BedrockOptions setDisplayHandheld(boolean displayHandheld) { + this.displayHandheld = displayHandheld; + return this; + } + + public boolean isDisplayHandheld() { + return this.displayHandheld; + } + + public BedrockOptions setProtectionValue(int protectionValue) { + this.protectionValue = protectionValue; + return this; + } + + public int getProtectionValue() { + return this.protectionValue; + } + + public BedrockOptions setCreativeCategory(CreativeCategory creativeCategory) { + this.creativeCategory = creativeCategory; + return this; + } + + public CreativeCategory getCreativeCategory() { + return this.creativeCategory; + } + + public BedrockOptions addTag(String tag) { + if (tag != null && !tag.isEmpty()) { + this.tags.add(tag); + } + return this; + } + + public BedrockOptions setTags(Set tags) { + this.tags.clear(); + if (tags != null) { + this.tags.addAll(tags); + } + return this; + } + + public Set getTags() { + return new HashSet<>(this.tags); + } + + public enum CreativeCategory { + NONE, + CONSTRUCTION, + NATURE, + EQUIPMENT, + ITEMS + } +} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/AbstractEffectsConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/AbstractEffectsConfiguration.java index 2ae9931f..ccfa2eeb 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/AbstractEffectsConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/AbstractEffectsConfiguration.java @@ -1,6 +1,10 @@ package fr.robie.craftengineconverter.api.configuration.item; +import com.google.gson.JsonArray; +import com.google.gson.JsonObject; +import fr.robie.craftengineconverter.api.utils.item.component.ConsumeEffect; + import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -8,10 +12,6 @@ public abstract class AbstractEffectsConfiguration implements ItemConfigurationSerializable { - public interface ConsumeEffect { - Map serialize(); - } - public record ApplyEffectsConsumeEffect(List effects) implements ConsumeEffect { public record ApplyEffect( @@ -44,6 +44,26 @@ public Map serialize() { result.put("effects", serializedEffects); return result; } + + @Override + public JsonObject serializeToJson() { + JsonArray effectsArray = new JsonArray(); + for (ApplyEffect effect : this.effects) { + JsonObject effectObject = new JsonObject(); + effectObject.addProperty("id", effect.id()); + effectObject.addProperty("amplifier", effect.amplifier()); + effectObject.addProperty("duration", effect.duration()); + effectObject.addProperty("ambient", effect.ambient()); + effectObject.addProperty("show_particles", effect.showParticles()); + effectObject.addProperty("show_icon", effect.showIcon()); + effectObject.addProperty("probability", effect.probability()); + effectsArray.add(effectObject); + } + JsonObject result = new JsonObject(); + result.addProperty("type", "apply_effects"); + result.add("effects", effectsArray); + return result; + } } public record RemoveEffectsConsumeEffect(List effects) implements ConsumeEffect { @@ -54,6 +74,18 @@ public Map serialize() { result.put("effects", this.effects); return result; } + + @Override + public JsonObject serializeToJson() { + JsonArray effectsArray = new JsonArray(); + for (String effect : this.effects) { + effectsArray.add(effect); + } + JsonObject result = new JsonObject(); + result.addProperty("type", "remove_effects"); + result.add("effects", effectsArray); + return result; + } } public record ClearAllEffectsConsumeEffect() implements ConsumeEffect { @@ -63,6 +95,13 @@ public Map serialize() { result.put("type", "clear_all_effects"); return result; } + + @Override + public JsonObject serializeToJson() { + JsonObject result = new JsonObject(); + result.addProperty("type", "clear_all_effects"); + return result; + } } public record TeleportRandomlyConsumeEffect(double diameter) implements ConsumeEffect { @@ -73,6 +112,14 @@ public Map serialize() { result.put("diameter", this.diameter); return result; } + + @Override + public JsonObject serializeToJson() { + JsonObject result = new JsonObject(); + result.addProperty("type", "teleport_randomly"); + result.addProperty("diameter", this.diameter); + return result; + } } public record PlaySoundConsumeEffect(String soundId, double range) implements ConsumeEffect { @@ -86,6 +133,17 @@ public Map serialize() { result.put("sound", soundMap); return result; } + + @Override + public JsonObject serializeToJson() { + JsonObject soundObject = new JsonObject(); + soundObject.addProperty("sound_id", this.soundId); + soundObject.addProperty("range", this.range); + JsonObject result = new JsonObject(); + result.addProperty("type", "play_sound"); + result.add("sound", soundObject); + return result; + } } protected List> serializeEffects(List effects) { @@ -95,4 +153,12 @@ protected List> serializeEffects(List effects } return serialized; } + + protected JsonArray serializeEffectsToJsonArray(List effects) { + JsonArray jsonArray = new JsonArray(); + for (ConsumeEffect effect : effects) { + jsonArray.add(effect.serializeToJson()); + } + return jsonArray; + } } \ No newline at end of file diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/ConsumableConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/ConsumableConfiguration.java index 96e09113..159ee67e 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/ConsumableConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/ConsumableConfiguration.java @@ -1,21 +1,25 @@ package fr.robie.craftengineconverter.api.configuration.item.components; +import com.google.gson.JsonObject; +import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.component.BedrockComponent; import fr.robie.craftengineconverter.api.configuration.item.AbstractEffectsConfiguration; +import fr.robie.craftengineconverter.api.enums.item.component.ConsumableAnimation; +import fr.robie.craftengineconverter.api.utils.item.component.ConsumeEffect; import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.file.YamlConfiguration; import org.jetbrains.annotations.NotNull; import java.util.List; -public class ConsumableConfiguration extends AbstractEffectsConfiguration { +public class ConsumableConfiguration extends AbstractEffectsConfiguration implements BedrockComponent { private final String sound; private final boolean hasConsumeParticles; private final double consumeSeconds; - private final Animation animation; + private final ConsumableAnimation animation; private final List onConsumeEffects; - public ConsumableConfiguration(String sound, boolean hasConsumeParticles, double consumeSeconds, Animation animation, List onConsumeEffects) { + public ConsumableConfiguration(String sound, boolean hasConsumeParticles, double consumeSeconds, ConsumableAnimation animation, List onConsumeEffects) { this.sound = sound; this.hasConsumeParticles = hasConsumeParticles; this.consumeSeconds = consumeSeconds; @@ -23,12 +27,8 @@ public ConsumableConfiguration(String sound, boolean hasConsumeParticles, double this.onConsumeEffects = onConsumeEffects; } - public enum Animation { - NONE, EAT, DRINK, BLOCK, BOW, SPEAR, CROSSBOW, SPYGLASS, TOOT_HORN, BRUSH, BUNDLE, TRIDENT; - - public String toKey() { - return this.name().toLowerCase(); - } + public ConsumableConfiguration(double consumeSeconds, ConsumableAnimation animation, List onConsumeEffects) { + this(null, true, consumeSeconds, animation, onConsumeEffects); } @Override @@ -45,7 +45,7 @@ public void serialize(@NotNull YamlConfiguration yamlConfiguration, @NotNull Str if (this.consumeSeconds != 1.6) { consumableSection.set("consume_seconds", this.consumeSeconds); } - if (this.animation != Animation.EAT) { + if (this.animation != ConsumableAnimation.EAT) { consumableSection.set("animation", this.animation.toKey()); } @@ -53,4 +53,16 @@ public void serialize(@NotNull YamlConfiguration yamlConfiguration, @NotNull Str consumableSection.set("on_consume_effects", this.serializeEffects(this.onConsumeEffects)); } } + + @Override + public void applyTo(@NotNull JsonObject componentObject) { + JsonObject consumableObject = new JsonObject(); + if (this.animation != ConsumableAnimation.EAT) { + consumableObject.addProperty("animation", this.animation.toKey()); + } + if (this.onConsumeEffects != null && !this.onConsumeEffects.isEmpty()) { + consumableObject.add("on_consume_effects", this.serializeEffectsToJsonArray(this.onConsumeEffects)); + } + componentObject.add("minecraft:consumable", consumableObject); + } } \ No newline at end of file diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/DeathProtectionConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/DeathProtectionConfiguration.java index f143b3a7..4ef74753 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/DeathProtectionConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/DeathProtectionConfiguration.java @@ -1,6 +1,7 @@ package fr.robie.craftengineconverter.api.configuration.item.components; import fr.robie.craftengineconverter.api.configuration.item.AbstractEffectsConfiguration; +import fr.robie.craftengineconverter.api.utils.item.component.ConsumeEffect; import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.file.YamlConfiguration; import org.jetbrains.annotations.NotNull; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/FoodConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/FoodConfiguration.java index 42b0b96f..68801649 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/FoodConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/FoodConfiguration.java @@ -1,11 +1,13 @@ package fr.robie.craftengineconverter.api.configuration.item.components; +import com.google.gson.JsonObject; +import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.component.BedrockComponent; import fr.robie.craftengineconverter.api.configuration.item.ItemConfigurationSerializable; import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.file.YamlConfiguration; import org.jetbrains.annotations.NotNull; -public class FoodConfiguration implements ItemConfigurationSerializable { +public class FoodConfiguration implements ItemConfigurationSerializable, BedrockComponent { private final int nutrition; private final float saturation; private final boolean canAlwaysEat; @@ -31,4 +33,16 @@ public void serialize(@NotNull YamlConfiguration yamlConfiguration, @NotNull Str foodComponent.set("can_always_eat", true); } } + + @Override + public void applyTo(@NotNull JsonObject componentObject) { + JsonObject foodComponent = new JsonObject(); + foodComponent.addProperty("nutrition", this.nutrition); + foodComponent.addProperty("saturation", this.saturation); + if (this.canAlwaysEat) { + foodComponent.addProperty("can_always_eat", true); + } + componentObject.add("minecraft:food", foodComponent); + } + } diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/MaxDamageComponent.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/MaxDamageComponent.java new file mode 100644 index 00000000..1a221718 --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/MaxDamageComponent.java @@ -0,0 +1,28 @@ +package fr.robie.craftengineconverter.api.configuration.item.components; + +import com.google.gson.JsonObject; +import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.component.BedrockComponent; +import fr.robie.craftengineconverter.api.configuration.item.ItemConfigurationSerializable; +import org.bukkit.configuration.ConfigurationSection; +import org.bukkit.configuration.file.YamlConfiguration; +import org.jetbrains.annotations.NotNull; + +public class MaxDamageComponent implements ItemConfigurationSerializable, BedrockComponent { + private final int maxDamage; + + public MaxDamageComponent(int maxDamage) { + assert maxDamage >= 0 : "Max damage must be non-negative"; + this.maxDamage = maxDamage; + } + + @Override + public void applyTo(@NotNull JsonObject componentObject) { + componentObject.addProperty("minecraft:max_damage", this.maxDamage); + } + + @Override + public void serialize(@NotNull YamlConfiguration yamlConfiguration, @NotNull String path, @NotNull ConfigurationSection itemSection, @NotNull String itemId) { + ConfigurationSection components = this.getOrCreateSection(itemSection, "components"); + components.set("minecraft:max_damage", this.maxDamage); + } +} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/MaxStackSizeConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/MaxStackSizeConfiguration.java index 15c1571f..e9a59ed2 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/MaxStackSizeConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/MaxStackSizeConfiguration.java @@ -1,11 +1,13 @@ package fr.robie.craftengineconverter.api.configuration.item.components; +import com.google.gson.JsonObject; +import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.component.BedrockComponent; import fr.robie.craftengineconverter.api.configuration.item.ItemConfigurationSerializable; import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.file.YamlConfiguration; import org.jetbrains.annotations.NotNull; -public class MaxStackSizeConfiguration implements ItemConfigurationSerializable { +public class MaxStackSizeConfiguration implements ItemConfigurationSerializable, BedrockComponent { private final int maxStackSize; public MaxStackSizeConfiguration(int maxStackSize) { @@ -16,4 +18,9 @@ public MaxStackSizeConfiguration(int maxStackSize) { public void serialize(@NotNull YamlConfiguration yamlConfiguration, @NotNull String path, @NotNull ConfigurationSection itemSection, @NotNull String itemId) { this.getOrCreateSection(itemSection, "components").set("minecraft:max_stack_size", this.maxStackSize); } + + @Override + public void applyTo(@NotNull JsonObject componentObject) { + componentObject.addProperty("minecraft:max_stack_size", this.maxStackSize); + } } diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/UseCooldownConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/UseCooldownConfiguration.java index 985e6bf4..81cd5c64 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/UseCooldownConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/UseCooldownConfiguration.java @@ -1,11 +1,13 @@ package fr.robie.craftengineconverter.api.configuration.item.components; +import com.google.gson.JsonObject; +import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.component.BedrockComponent; import fr.robie.craftengineconverter.api.configuration.item.ItemConfigurationSerializable; import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.file.YamlConfiguration; import org.jetbrains.annotations.NotNull; -public class UseCooldownConfiguration implements ItemConfigurationSerializable { +public class UseCooldownConfiguration implements ItemConfigurationSerializable, BedrockComponent { private final float seconds; private final String cooldownGroup; @@ -23,4 +25,14 @@ public void serialize(@NotNull YamlConfiguration yamlConfiguration, @NotNull Str useCooldownComponent.set("cooldown_group", this.cooldownGroup); } } + + @Override + public void applyTo(@NotNull JsonObject componentObject) { + JsonObject useCooldownComponent = new JsonObject(); + useCooldownComponent.addProperty("seconds", this.seconds); + if (this.cooldownGroup != null) { + useCooldownComponent.addProperty("cooldown_group", this.cooldownGroup); + } + componentObject.add("minecraft:use_cooldown", useCooldownComponent); + } } diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/settings/EquippableConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/settings/EquippableConfiguration.java index d79fb845..0116ce83 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/settings/EquippableConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/settings/EquippableConfiguration.java @@ -7,18 +7,18 @@ import org.jetbrains.annotations.NotNull; public class EquippableConfiguration implements ItemConfigurationSerializable { - private final EquipmentSlot equipmentSlot; - private final String equipSound; - private final String assetId; - private final Object allowedEntities; - private final boolean dispensable; - private final boolean swappable; - private final boolean damageOnHurt; - private final boolean equipOnInteract; - private final String cameraOverlay; - private final boolean canBeSheared; - private final String shearingSound; - private final String wings; + protected final EquipmentSlot equipmentSlot; + protected final String equipSound; + protected final String assetId; + protected final Object allowedEntities; + protected final boolean dispensable; + protected final boolean swappable; + protected final boolean damageOnHurt; + protected final boolean equipOnInteract; + protected final String cameraOverlay; + protected final boolean canBeSheared; + protected final String shearingSound; + protected final String wings; public EquippableConfiguration(EquipmentSlot equipmentSlot, String equipSound, String assetId, Object allowedEntities, boolean dispensable, boolean swappable, boolean damageOnHurt, boolean equipOnInteract, String cameraOverlay, boolean canBeSheared, String shearingSound, String wings) { this.equipmentSlot = equipmentSlot; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/enums/item/component/ConsumableAnimation.java b/API/src/main/java/fr/robie/craftengineconverter/api/enums/item/component/ConsumableAnimation.java new file mode 100644 index 00000000..61860ee1 --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/enums/item/component/ConsumableAnimation.java @@ -0,0 +1,9 @@ +package fr.robie.craftengineconverter.api.enums.item.component; + +public enum ConsumableAnimation { + NONE, EAT, DRINK, BLOCK, BOW, SPEAR, CROSSBOW, SPYGLASS, TOOT_HORN, BRUSH, BUNDLE, TRIDENT; + + public String toKey() { + return this.name().toLowerCase(); + } +} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/utils/item/component/ConsumeEffect.java b/API/src/main/java/fr/robie/craftengineconverter/api/utils/item/component/ConsumeEffect.java new file mode 100644 index 00000000..c0329228 --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/utils/item/component/ConsumeEffect.java @@ -0,0 +1,11 @@ +package fr.robie.craftengineconverter.api.utils.item.component; + +import com.google.gson.JsonObject; + +import java.util.Map; + +public interface ConsumeEffect { + Map serialize(); + + JsonObject serializeToJson(); +} diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoItemConverter.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoItemConverter.java index 6150a2b0..0fa8ed2e 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoItemConverter.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoItemConverter.java @@ -43,10 +43,12 @@ import fr.robie.craftengineconverter.api.configuration.item.settings.InvulnerableSettingConfiguration; import fr.robie.craftengineconverter.api.configuration.item.settings.ProjectileSettingConfiguration; import fr.robie.craftengineconverter.api.enums.*; +import fr.robie.craftengineconverter.api.enums.item.component.ConsumableAnimation; import fr.robie.craftengineconverter.api.format.Message; import fr.robie.craftengineconverter.api.logger.LogType; import fr.robie.craftengineconverter.api.logger.Logger; import fr.robie.craftengineconverter.api.utils.FloatsUtils; +import fr.robie.craftengineconverter.api.utils.item.component.ConsumeEffect; import fr.robie.craftengineconverter.common.BlockStatesMapper; import fr.robie.craftengineconverter.common.enums.BukkitFlagToComponentFlag; import fr.robie.craftengineconverter.common.utils.enums.nexo.NexoBestTool; @@ -482,16 +484,16 @@ public void convertConsumable() { boolean hasConsumeParticles = consumableSection.getBoolean("consume_particles", true); double consumeSeconds = consumableSection.getDouble("consume_seconds", 1.6); - ConsumableConfiguration.Animation animation; + ConsumableAnimation animation; try { - animation = ConsumableConfiguration.Animation.valueOf( + animation = ConsumableAnimation.valueOf( consumableSection.getString("animation", "eat").toUpperCase() ); } catch (IllegalArgumentException e) { - animation = ConsumableConfiguration.Animation.EAT; + animation = ConsumableAnimation.EAT; } - List consumeEffects = new ArrayList<>(); + List consumeEffects = new ArrayList<>(); ConfigurationSection effectsSection = consumableSection.getConfigurationSection("effects"); if (effectsSection != null) { @@ -699,7 +701,7 @@ public void convertDeathProtection() { return; } - List deathEffects = new ArrayList<>(); + List deathEffects = new ArrayList<>(); ConfigurationSection applyEffectsSection = deathEffectsSection.getConfigurationSection("APPLY_EFFECTS"); if (this.isNotNull(applyEffectsSection)) { From 7b336b6837aadd025ac8bd81f21dac417edf6d68 Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Mon, 6 Apr 2026 14:11:57 +0200 Subject: [PATCH 003/116] feat: implement BedrockComponent interface and JSON serialization for enchantable and tool configurations --- .../components/EnchantableConfiguration.java | 11 +++- ...EnchantmentGlintOverrideConfiguration.java | 9 +++- .../item/components/ToolConfiguration.java | 53 ++++++++++++++++++- 3 files changed, 70 insertions(+), 3 deletions(-) diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/EnchantableConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/EnchantableConfiguration.java index 1b7bb0ef..0def9d02 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/EnchantableConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/EnchantableConfiguration.java @@ -1,11 +1,13 @@ package fr.robie.craftengineconverter.api.configuration.item.components; +import com.google.gson.JsonObject; +import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.component.BedrockComponent; import fr.robie.craftengineconverter.api.configuration.item.ItemConfigurationSerializable; import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.file.YamlConfiguration; import org.jetbrains.annotations.NotNull; -public class EnchantableConfiguration implements ItemConfigurationSerializable { +public class EnchantableConfiguration implements ItemConfigurationSerializable, BedrockComponent { private final int enchantability; public EnchantableConfiguration(int enchantability) { @@ -18,4 +20,11 @@ public void serialize(@NotNull YamlConfiguration yamlConfiguration, @NotNull Str ConfigurationSection enchantableComponent = this.getOrCreateSection(components, "minecraft:enchantable"); enchantableComponent.set("value", this.enchantability); } + + @Override + public void applyTo(@NotNull JsonObject componentObject) { + JsonObject enchantableComponent = new JsonObject(); + enchantableComponent.addProperty("value", this.enchantability); + componentObject.add("minecraft:enchantable", enchantableComponent); + } } diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/EnchantmentGlintOverrideConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/EnchantmentGlintOverrideConfiguration.java index b87d7c14..f8e0c589 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/EnchantmentGlintOverrideConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/EnchantmentGlintOverrideConfiguration.java @@ -1,11 +1,13 @@ package fr.robie.craftengineconverter.api.configuration.item.components; +import com.google.gson.JsonObject; +import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.component.BedrockComponent; import fr.robie.craftengineconverter.api.configuration.item.ItemConfigurationSerializable; import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.file.YamlConfiguration; import org.jetbrains.annotations.NotNull; -public class EnchantmentGlintOverrideConfiguration implements ItemConfigurationSerializable { +public class EnchantmentGlintOverrideConfiguration implements ItemConfigurationSerializable, BedrockComponent { private final boolean enchantGlintOverride; public EnchantmentGlintOverrideConfiguration(boolean enchantGlintOverride) { @@ -16,4 +18,9 @@ public EnchantmentGlintOverrideConfiguration(boolean enchantGlintOverride) { public void serialize(@NotNull YamlConfiguration yamlConfiguration, @NotNull String path, @NotNull ConfigurationSection itemSection, @NotNull String itemId) { this.getOrCreateSection(itemSection, "components").set("minecraft:enchantment_glint_override", this.enchantGlintOverride); } + + @Override + public void applyTo(@NotNull JsonObject componentObject) { + componentObject.addProperty("minecraft:enchantment_glint_override", this.enchantGlintOverride); + } } diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/ToolConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/ToolConfiguration.java index 8d12363c..85b0e0ad 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/ToolConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/ToolConfiguration.java @@ -1,5 +1,7 @@ package fr.robie.craftengineconverter.api.configuration.item.components; +import com.google.gson.JsonObject; +import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.component.BedrockComponent; import fr.robie.craftengineconverter.api.configuration.item.ItemConfigurationSerializable; import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.file.YamlConfiguration; @@ -10,7 +12,7 @@ import java.util.List; import java.util.Map; -public class ToolConfiguration implements ItemConfigurationSerializable { +public class ToolConfiguration implements ItemConfigurationSerializable, BedrockComponent { private final float defaultMiningSpeed; private final int damagePerBlock; private final boolean canDestroyBlocksInCreative; @@ -67,6 +69,55 @@ public void serialize(@NotNull YamlConfiguration yamlConfiguration, @NotNull Str } } + @Override + public void applyTo(@NotNull JsonObject componentObject) { + JsonObject toolComponent = new JsonObject(); + + if (this.defaultMiningSpeed != 1.0f) { + toolComponent.addProperty("default_mining_speed", this.defaultMiningSpeed); + } + + if (this.damagePerBlock != 1) { + toolComponent.addProperty("damage_per_block", this.damagePerBlock); + } + + if (this.canDestroyBlocksInCreative) { + toolComponent.addProperty("can_destroy_blocks_in_creative", true); + } + + if (this.rules != null && !this.rules.isEmpty()) { + List ceRulesList = new ArrayList<>(); + + for (Rule rule : this.rules) { + JsonObject ceRule = new JsonObject(); + + if (rule.speed() != 0f) { + ceRule.addProperty("speed", rule.speed()); + } + if (rule.correctForDrops()) { + ceRule.addProperty("correct_for_drops", true); + } + if (rule.blocks() != null) { + if (rule.blocks() instanceof List blocksList) { + ceRule.add("blocks", componentObject.getAsJsonArray(blocksList.toString())); + } else if (rule.blocks() instanceof String blockString) { + ceRule.addProperty("blocks", blockString); + } + } + + if (!ceRule.entrySet().isEmpty()) { + ceRulesList.add(ceRule); + } + } + + if (!ceRulesList.isEmpty()) { + componentObject.add("rules", componentObject.getAsJsonArray(ceRulesList.toString())); + } + } + + componentObject.add("minecraft:tool", toolComponent); + } + public record Rule(float speed, boolean correctForDrops, Object blocks) { } } From 188659acff806eb2d6b953c8726e576e05e6c7d0 Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Mon, 6 Apr 2026 14:14:43 +0200 Subject: [PATCH 004/116] feat: implement AttackRangeConfiguration for BedrockComponent with JSON serialization Signed-off-by: 1robie <97293924+1robie@users.noreply.github.com> --- .../components/AttackRangeConfiguration.java | 35 ++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/AttackRangeConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/AttackRangeConfiguration.java index 413d627c..e5c26ebb 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/AttackRangeConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/AttackRangeConfiguration.java @@ -1,11 +1,13 @@ package fr.robie.craftengineconverter.api.configuration.item.components; +import com.google.gson.JsonObject; +import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.component.BedrockComponent; import fr.robie.craftengineconverter.api.configuration.item.ItemConfigurationSerializable; import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.file.YamlConfiguration; import org.jetbrains.annotations.NotNull; -public class AttackRangeConfiguration implements ItemConfigurationSerializable { +public class AttackRangeConfiguration implements ItemConfigurationSerializable, BedrockComponent { private final double minReach; private final double maxReach; @@ -56,4 +58,35 @@ public void serialize(@NotNull YamlConfiguration yamlConfiguration, @NotNull Str private double clamp(double value, double min, double max) { return Math.max(min, Math.min(max, value)); } + + @Override + public void applyTo(@NotNull JsonObject componentObject) { + JsonObject attackRangeComponent = new JsonObject(); + + if (this.minReach != 0.0) { + attackRangeComponent.addProperty("min_reach", this.clamp(this.minReach, 0.0, 64.0)); + } + + if (this.maxReach != 3.0) { + attackRangeComponent.addProperty("max_reach", this.clamp(this.maxReach, 0.0, 64.0)); + } + + if (this.minCreativeReach != 0.0) { + attackRangeComponent.addProperty("min_creative_reach", this.clamp(this.minCreativeReach, 0.0, 64.0)); + } + + if (this.maxCreativeReach != 5.0) { + attackRangeComponent.addProperty("max_creative_reach", this.clamp(this.maxCreativeReach, 0.0, 64.0)); + } + + if (this.hitboxMargin != 0.3) { + attackRangeComponent.addProperty("hitbox_margin", this.clamp(this.hitboxMargin, 0.0, 1.0)); + } + + if (this.mobFactor != 1.0) { + attackRangeComponent.addProperty("mob_factor", this.clamp(this.mobFactor, 0.0, 2.0)); + } + + componentObject.add("minecraft:attack_range", attackRangeComponent); + } } \ No newline at end of file From 4fedd4c96eb9347aa3f5e20517858db546d8a120 Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Mon, 6 Apr 2026 14:27:12 +0200 Subject: [PATCH 005/116] feat: implement KineticWeaponConfiguration with BedrockComponent interface and JSON serialization Signed-off-by: 1robie <97293924+1robie@users.noreply.github.com> --- .../KineticWeaponConfiguration.java | 60 ++++++++++++++++++- 1 file changed, 59 insertions(+), 1 deletion(-) diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/KineticWeaponConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/KineticWeaponConfiguration.java index 4b61d261..d4362ade 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/KineticWeaponConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/KineticWeaponConfiguration.java @@ -1,11 +1,13 @@ package fr.robie.craftengineconverter.api.configuration.item.components; +import com.google.gson.JsonObject; +import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.component.BedrockComponent; import fr.robie.craftengineconverter.api.configuration.item.ItemConfigurationSerializable; import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.file.YamlConfiguration; import org.jetbrains.annotations.NotNull; -public class KineticWeaponConfiguration implements ItemConfigurationSerializable { +public class KineticWeaponConfiguration implements ItemConfigurationSerializable, BedrockComponent { private final long delayTicks; private final double damageMultiplier; private final double forwardMovement; @@ -26,6 +28,50 @@ public KineticWeaponConfiguration(long delayTicks, double damageMultiplier, doub this.damageConditions = damageConditions; } + @Override + public void applyTo(@NotNull JsonObject componentObject) { + JsonObject kineticWeaponComponent = new JsonObject(); + if (this.delayTicks > 0) { + kineticWeaponComponent.addProperty("delay_ticks", this.delayTicks); + } + if (this.damageMultiplier != 1.0) { + kineticWeaponComponent.addProperty("damage_multiplier", this.damageMultiplier); + } + if (this.forwardMovement != 0.0) { + kineticWeaponComponent.addProperty("forward_movement", this.forwardMovement); + } + if (this.sound != null && !this.sound.isBlank()) { + kineticWeaponComponent.addProperty("sound", this.sound); + } + if (this.hitSound != null && !this.hitSound.isBlank()) { + kineticWeaponComponent.addProperty("hit_sound", this.hitSound); + } + + if (this.dismountConditions != null) { + JsonObject dismountObj = new JsonObject(); + this.dismountConditions.serializeBedrock(dismountObj); + if (!dismountObj.isEmpty()) { + kineticWeaponComponent.add("dismount_conditions", dismountObj); + } + } + if (this.knockbackConditions != null) { + JsonObject knockbackObj = new JsonObject(); + this.knockbackConditions.serializeBedrock(knockbackObj); + if (!knockbackObj.isEmpty()) { + kineticWeaponComponent.add("knockback_conditions", knockbackObj); + } + } + if (this.damageConditions != null) { + JsonObject damageObj = new JsonObject(); + this.damageConditions.serializeBedrock(damageObj); + if (!damageObj.isEmpty()) { + kineticWeaponComponent.add("damage_conditions", damageObj); + } + } + + componentObject.add("minecraft:kinetic_weapon", kineticWeaponComponent); + } + public record KineticConditions(long maxDurationTicks, double minSpeed, double minRelativeSpeed) { public void serialize(@NotNull ConfigurationSection section) { @@ -39,6 +85,18 @@ public void serialize(@NotNull ConfigurationSection section) { section.set("min_relative_speed", this.minRelativeSpeed); } } + + public void serializeBedrock(@NotNull JsonObject target) { + if (this.maxDurationTicks > 0) { + target.addProperty("max_duration_ticks", this.maxDurationTicks); + } + if (this.minSpeed > 0.0) { + target.addProperty("min_speed", this.minSpeed); + } + if (this.minRelativeSpeed > 0.0) { + target.addProperty("min_relative_speed", this.minRelativeSpeed); + } + } } @Override From 0f7ff4f15a0ae926a26f347ce06424aafb484695 Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Mon, 6 Apr 2026 14:30:11 +0200 Subject: [PATCH 006/116] feat: implement PiercingWeaponConfiguration and SwingAnimationConfiguration with BedrockComponent interface and JSON serialization Signed-off-by: 1robie <97293924+1robie@users.noreply.github.com> --- .../PiercingWeaponConfiguration.java | 25 ++++++++++++++++++- .../SwingAnimationConfiguration.java | 24 +++++++++++++++++- 2 files changed, 47 insertions(+), 2 deletions(-) diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/PiercingWeaponConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/PiercingWeaponConfiguration.java index 3ffdec08..0aa99007 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/PiercingWeaponConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/PiercingWeaponConfiguration.java @@ -1,11 +1,13 @@ package fr.robie.craftengineconverter.api.configuration.item.components; +import com.google.gson.JsonObject; +import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.component.BedrockComponent; import fr.robie.craftengineconverter.api.configuration.item.ItemConfigurationSerializable; import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.file.YamlConfiguration; import org.jetbrains.annotations.NotNull; -public class PiercingWeaponConfiguration implements ItemConfigurationSerializable { +public class PiercingWeaponConfiguration implements ItemConfigurationSerializable, BedrockComponent { private final boolean dealsKnockback; private final boolean dismounts; @@ -40,4 +42,25 @@ public void serialize(@NotNull YamlConfiguration yamlConfiguration, @NotNull Str piercingSection.set("hit_sound", this.hitSound); } } + + @Override + public void applyTo(@NotNull JsonObject componentObject) { + JsonObject piercingComponent = new JsonObject(); + if (!this.dealsKnockback) { + piercingComponent.addProperty("deals_knockback", false); + } + + if (this.dismounts) { + piercingComponent.addProperty("dismounts", true); + } + + if (this.sound != null && !this.sound.isBlank()) { + piercingComponent.addProperty("sound", this.sound); + } + + if (this.hitSound != null && !this.hitSound.isBlank()) { + piercingComponent.addProperty("hit_sound", this.hitSound); + } + componentObject.add("minecraft:piercing_weapon", piercingComponent); + } } \ No newline at end of file diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/SwingAnimationConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/SwingAnimationConfiguration.java index 34f5421f..d8d2069f 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/SwingAnimationConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/SwingAnimationConfiguration.java @@ -1,11 +1,13 @@ package fr.robie.craftengineconverter.api.configuration.item.components; +import com.google.gson.JsonObject; +import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.component.BedrockComponent; import fr.robie.craftengineconverter.api.configuration.item.ItemConfigurationSerializable; import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.file.YamlConfiguration; import org.jetbrains.annotations.NotNull; -public class SwingAnimationConfiguration implements ItemConfigurationSerializable { +public class SwingAnimationConfiguration implements ItemConfigurationSerializable, BedrockComponent { private final AnimationType type; private final int duration; @@ -15,6 +17,26 @@ public SwingAnimationConfiguration(AnimationType type, int duration) { this.duration = duration; } + /** + * Animation is hardcoded for bedrock, so only duration is configurable + * + * @param duration Duration of the swing animation in ticks + */ + public SwingAnimationConfiguration(int duration) { + this(null, duration); + } + + @Override + public void applyTo(@NotNull JsonObject componentObject) { + JsonObject swingAnimationComponent = new JsonObject(); + + if (this.duration != 6) { + swingAnimationComponent.addProperty("duration", this.duration); + } + + componentObject.add("minecraft:swing_animation", swingAnimationComponent); + } + public enum AnimationType { NONE, WHACK, STAB; From dfa1d5901acbfa3407d246a9ecdc36d5ed6408a4 Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Mon, 6 Apr 2026 14:36:28 +0200 Subject: [PATCH 007/116] feat: implement UseEffectsConfiguration with BedrockComponent interface and JSON serialization Signed-off-by: 1robie <97293924+1robie@users.noreply.github.com> --- .../components/UseEffectsConfiguration.java | 29 ++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/UseEffectsConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/UseEffectsConfiguration.java index bd4ee45e..db219f16 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/UseEffectsConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/UseEffectsConfiguration.java @@ -1,11 +1,13 @@ package fr.robie.craftengineconverter.api.configuration.item.components; +import com.google.gson.JsonObject; +import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.component.BedrockComponent; import fr.robie.craftengineconverter.api.configuration.item.ItemConfigurationSerializable; import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.file.YamlConfiguration; import org.jetbrains.annotations.NotNull; -public class UseEffectsConfiguration implements ItemConfigurationSerializable { +public class UseEffectsConfiguration implements ItemConfigurationSerializable, BedrockComponent { private final boolean canSprint; private final double speedMultiplier; @@ -17,6 +19,16 @@ public UseEffectsConfiguration(boolean canSprint, double speedMultiplier, boolea this.interactVibrations = interactVibrations; } + /** + * To use for bedrock items, as they don't have the can_sprint property is not present in bedrock. + * + * @param speedMultiplier + * @param interactVibrations + */ + public UseEffectsConfiguration(double speedMultiplier, boolean interactVibrations) { + this(false, speedMultiplier, interactVibrations); + } + @Override public void serialize(@NotNull YamlConfiguration yamlConfiguration, @NotNull String path, @NotNull ConfigurationSection itemSection, @NotNull String itemId) { ConfigurationSection components = this.getOrCreateSection(itemSection, "components"); @@ -34,4 +46,19 @@ public void serialize(@NotNull YamlConfiguration yamlConfiguration, @NotNull Str useEffectsSection.set("interact_vibrations", false); } } + + @Override + public void applyTo(@NotNull JsonObject componentObject) { + JsonObject useEffectsComponent = new JsonObject(); + + if (this.speedMultiplier != 0.2) { + useEffectsComponent.addProperty("speed_multiplier", Math.max(0.0, Math.min(1.0, this.speedMultiplier))); + } + + if (!this.interactVibrations) { + useEffectsComponent.addProperty("interact_vibrations", false); + } + + componentObject.add("minecraft:use_effects", useEffectsComponent); + } } \ No newline at end of file From ec7e7720308dbf0ba4e16c997f24dc3230c8b317 Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Mon, 6 Apr 2026 19:36:53 +0200 Subject: [PATCH 008/116] feat: add BedrockPredicate and its subclasses for item condition mapping --- .../item/predicate/BedrockPredicate.java | 32 +++++++++++++++++++ .../item/predicate/BrokenPredicate.java | 13 ++++++++ .../predicate/CustomModelDataPredicate.java | 26 +++++++++++++++ .../item/predicate/DamagedPredicate.java | 16 ++++++++++ .../predicate/FishingRodCastPredicate.java | 17 ++++++++++ .../converter/bedrock/BedrockConverter.java | 6 ++++ 6 files changed, 110 insertions(+) create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/BedrockPredicate.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/BrokenPredicate.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/CustomModelDataPredicate.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/DamagedPredicate.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/FishingRodCastPredicate.java create mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockConverter.java diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/BedrockPredicate.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/BedrockPredicate.java new file mode 100644 index 00000000..9bc176a1 --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/BedrockPredicate.java @@ -0,0 +1,32 @@ +package fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate; + +import com.google.gson.JsonObject; +import org.jetbrains.annotations.NotNull; + +public abstract class BedrockPredicate { + protected final boolean expected; + + protected BedrockPredicate() { + this(true); + } + + protected BedrockPredicate(boolean expected) { + this.expected = expected; + } + + protected abstract String propertyName(); + + protected void addExtraFields(JsonObject jsonObject) { + } + + public @NotNull JsonObject serialize() { + JsonObject jsonObject = new JsonObject(); + jsonObject.addProperty("type", "condition"); + jsonObject.addProperty("property", this.propertyName()); + if (!this.expected) { + jsonObject.addProperty("expected", false); + } + this.addExtraFields(jsonObject); + return jsonObject; + } +} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/BrokenPredicate.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/BrokenPredicate.java new file mode 100644 index 00000000..1bd987fd --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/BrokenPredicate.java @@ -0,0 +1,13 @@ +package fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate; + +public class BrokenPredicate extends BedrockPredicate { + + public BrokenPredicate(boolean expected) { + super(expected); + } + + @Override + protected String propertyName() { + return "broken"; + } +} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/CustomModelDataPredicate.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/CustomModelDataPredicate.java new file mode 100644 index 00000000..98e3fd6a --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/CustomModelDataPredicate.java @@ -0,0 +1,26 @@ +package fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate; + +import com.google.gson.JsonObject; + +public class CustomModelDataPredicate extends BedrockPredicate { + private final int index; + + public CustomModelDataPredicate(int index) { + this(index, true); + } + + public CustomModelDataPredicate(int index, boolean expected) { + super(expected); + this.index = index; + } + + @Override + protected String propertyName() { + return "custom_model_data"; + } + + @Override + protected void addExtraFields(JsonObject jsonObject) { + jsonObject.addProperty("index", this.index); + } +} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/DamagedPredicate.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/DamagedPredicate.java new file mode 100644 index 00000000..cfd27654 --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/DamagedPredicate.java @@ -0,0 +1,16 @@ +package fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate; + +public class DamagedPredicate extends BedrockPredicate { + public DamagedPredicate() { + super(true); + } + + public DamagedPredicate(boolean expected) { + super(expected); + } + + @Override + protected String propertyName() { + return "damaged"; + } +} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/FishingRodCastPredicate.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/FishingRodCastPredicate.java new file mode 100644 index 00000000..7a4145aa --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/FishingRodCastPredicate.java @@ -0,0 +1,17 @@ +package fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate; + +public class FishingRodCastPredicate extends BedrockPredicate { + + public FishingRodCastPredicate() { + super(true); + } + + public FishingRodCastPredicate(boolean expected) { + super(expected); + } + + @Override + protected String propertyName() { + return "fishing_rod_cast"; + } +} diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockConverter.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockConverter.java new file mode 100644 index 00000000..448290d2 --- /dev/null +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockConverter.java @@ -0,0 +1,6 @@ +package fr.robie.craftengineconverter.converter.bedrock; + +public class BedrockConverter { + + +} From 642fac29e9323d7db454df1f868776f49344c814 Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Mon, 6 Apr 2026 21:11:28 +0200 Subject: [PATCH 009/116] feat: implement BedrockConverter with directory management and file utilities --- .../api/utils/FileUtils.java | 98 +++++++++++++++ .../converter/Converter.java | 16 --- .../converter/bedrock/BedrockConverter.java | 115 ++++++++++++++++++ .../converter/itemsadder/IAConverter.java | 11 +- .../converter/nexo/NexoConverter.java | 15 +-- 5 files changed, 227 insertions(+), 28 deletions(-) create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/utils/FileUtils.java diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/utils/FileUtils.java b/API/src/main/java/fr/robie/craftengineconverter/api/utils/FileUtils.java new file mode 100644 index 00000000..df39a39f --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/utils/FileUtils.java @@ -0,0 +1,98 @@ +package fr.robie.craftengineconverter.api.utils; + +import fr.robie.craftengineconverter.api.format.Message; +import fr.robie.craftengineconverter.api.logger.LogType; +import fr.robie.craftengineconverter.api.logger.Logger; +import org.jetbrains.annotations.NotNull; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.StandardCopyOption; + +public class FileUtils { + + public static void deleteDirectory(@NotNull File directory) { + File[] files = directory.listFiles(); + if (files != null) { + for (File file : files) { + if (file.isDirectory()) { + deleteDirectory(file); + } else if (!file.delete()) { + Logger.debug(Message.WARNING__FILE__DELETE_FAILURE, LogType.ERROR, "file", file.getName(), "path", file.getAbsolutePath()); + } + } + } + if (!directory.delete()) { + Logger.debug(Message.WARNING__FOLDER__DELETE_FAILURE, LogType.ERROR, "folder", directory.getName(), "path", directory.getAbsolutePath()); + } + } + + public static boolean mkdirs(@NotNull File directory) { + if (directory.exists()) { + return true; + } + if (directory.mkdirs()) { + return true; + } + Logger.info(Message.ERROR__MKDIR_FAILURE, LogType.ERROR, "directory", directory.getName(), "path", directory.getAbsolutePath()); + return false; + } + + public static String getFileNameWithoutExtension(@NotNull File file) { + String name = file.getName(); + int lastDotIndex = name.lastIndexOf('.'); + if (lastDotIndex > 0) { + return name.substring(0, lastDotIndex); + } + return name; + } + + public static String getFileExtension(@NotNull File file) { + String name = file.getName(); + int lastDotIndex = name.lastIndexOf('.'); + if (lastDotIndex > 0 && lastDotIndex < name.length() - 1) { + return name.substring(lastDotIndex + 1); + } + return ""; + } + + public static void copyDirectory(@NotNull File source, @NotNull File destination) { + if (!mkdirs(destination)) { + return; + } + + File[] files = source.listFiles(); + if (files == null) { + return; + } + + for (File file : files) { + File dest = new File(destination, file.getName()); + if (file.isDirectory()) { + copyDirectory(file, dest); + } else { + copyFile(file, dest); + } + } + } + + public static boolean isYmlFile(@NotNull File file) { + String extension = getFileExtension(file); + return extension.equalsIgnoreCase("yml") || extension.equalsIgnoreCase("yaml"); + } + + public static void copyFile(@NotNull File source, @NotNull File destination) { + try { + mkdirs(destination.getParentFile()); + Files.copy( + source.toPath(), + destination.toPath(), + StandardCopyOption.REPLACE_EXISTING + ); + } catch (IOException e) { + Logger.debug(Message.ERROR__FILE__COPY_EXCEPTION, "file", destination.getName(), "message", e.getMessage()); + } + } + +} diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/Converter.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/Converter.java index 26edc4e5..db646b86 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/Converter.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/Converter.java @@ -403,22 +403,6 @@ protected void saveConvertedConfig(YamlConfiguration convertedConfig, ConfigFile } } - protected void deleteDirectory(File directory) { - File[] files = directory.listFiles(); - if (files != null) { - for (File file : files) { - if (file.isDirectory()) { - this.deleteDirectory(file); - } else if (!file.delete()) { - Logger.debug(Message.WARNING__FILE__DELETE_FAILURE, LogType.ERROR, "file", file.getName(), "path", file.getAbsolutePath()); - } - } - } - if (!directory.delete()) { - Logger.debug(Message.WARNING__FOLDER__DELETE_FAILURE, LogType.ERROR, "folder", directory.getName(), "path", directory.getAbsolutePath()); - } - } - public record PackMapping(String namespaceSource, String originalPath, String namespaceTarget, String targetPath, String newName) { public boolean matches(String path) { diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockConverter.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockConverter.java index 448290d2..b02fc627 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockConverter.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockConverter.java @@ -1,6 +1,121 @@ package fr.robie.craftengineconverter.converter.bedrock; +import fr.robie.craftengineconverter.api.configuration.bedrock.ManifestConfiguration; +import fr.robie.craftengineconverter.api.manager.FileCacheManager; +import fr.robie.craftengineconverter.api.utils.FileUtils; +import fr.robie.craftengineconverter.common.CraftEngineConverterPlugin; +import fr.robie.craftengineconverter.common.utils.SnakeUtils; +import org.jetbrains.annotations.NotNull; + +import java.io.File; + public class BedrockConverter { + private final CraftEngineConverterPlugin plugin; + + public BedrockConverter(CraftEngineConverterPlugin plugin) { + this.plugin = plugin; + } + + + public void convert() { + File outputFolder = new File(this.plugin.getDataFolder(), "bedrock-converted/Geyser-Spigot"); + + if (outputFolder.exists()) { + FileUtils.deleteDirectory(outputFolder); + } + + if (!FileUtils.mkdirs(outputFolder)) { + return; + } + + File customMappings = new File(outputFolder, "custom_mappings"); + if (!FileUtils.mkdirs(customMappings)) { + return; + } + + File packs = new File(outputFolder, "packs"); + if (!FileUtils.mkdirs(packs)) { + } + + + } + + private void convertItemMappingsFolder(@NotNull File inputFolder, @NotNull File outputFolder) { + if (!inputFolder.exists() || !inputFolder.isDirectory()) { + return; + } + + File[] listed = inputFolder.listFiles(); + if (listed == null) { + return; + } + + if (!FileUtils.mkdirs(outputFolder)) { + return; + } + + for (File file : listed) { + if (file.isFile() && FileUtils.isYmlFile(file)) { + SnakeUtils snakeUtils = SnakeUtils.loadSmart(file); + SnakeUtils items = snakeUtils.getSection("items"); + if (items != null) { + for (String itemId : items.getKeys()) { + SnakeUtils itemSection = items.getSection(itemId); + if (itemSection != null) { + //TODO: continue + } + } + } + } + } + } + + + private void convertPack(File inputFolder, File outputPackFolder) { + // if zip xxx + File[] listed = inputFolder.listFiles(); + if (listed == null) { + return; + } + for (var file : listed) { + String fileName = file.getName(); + if (file.isDirectory()) { + if (fileName.equalsIgnoreCase("assets")) { + File[] subFiles = file.listFiles(); + if (subFiles != null) { + for (var namespacedFile : subFiles) { + if (namespacedFile.isDirectory()) { + File[] folderType = namespacedFile.listFiles(); + if (folderType != null) { + for (var typeFile : folderType) { + if (typeFile.isDirectory()) { + String typeName = typeFile.getName(); + switch (typeName) { + case "textures", "models" -> + FileUtils.copyDirectory(typeFile, new File(outputPackFolder, "textures")); + } + } + } + } + } + } + } + } + } else { + String fileNameWithoutExtension = FileUtils.getFileNameWithoutExtension(file); + String extension = FileUtils.getFileExtension(file); + if (fileNameWithoutExtension.equalsIgnoreCase("pack")) { + File dest = new File(outputPackFolder, "pack_icon" + extension); + FileUtils.copyFile(file, dest); + } else if (fileName.equalsIgnoreCase("pack.mcmeta")) { + FileCacheManager.getJsonCache().getEntryFile(file.toPath()).ifPresent(jsonObjectFileCacheEntry -> { + ManifestConfiguration configuration = ManifestConfiguration.fromJavaPackFormat(jsonObjectFileCacheEntry.getData()); + configuration.saveManifest(outputPackFolder.toPath()); + }); + } + } + } + } } diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/itemsadder/IAConverter.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/itemsadder/IAConverter.java index a2658068..e2ecb9c6 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/itemsadder/IAConverter.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/itemsadder/IAConverter.java @@ -24,6 +24,7 @@ import fr.robie.craftengineconverter.api.logger.Logger; import fr.robie.craftengineconverter.api.manager.FileCacheManager; import fr.robie.craftengineconverter.api.progress.BukkitProgressBar; +import fr.robie.craftengineconverter.api.utils.FileUtils; import fr.robie.craftengineconverter.common.BlockStatesMapper; import fr.robie.craftengineconverter.common.PluginNameMapper; import fr.robie.craftengineconverter.common.enums.NmsVersion; @@ -75,7 +76,7 @@ private void convertItemsSync(Optional player) { } if (outputFolder.exists()) { - this.deleteDirectory(outputFolder); + FileUtils.deleteDirectory(outputFolder); } if (!outputFolder.mkdirs()) { @@ -251,7 +252,7 @@ private void convertImagesSync(Optional optionalPlayer) { } if (outputBase.exists()) { - this.deleteDirectory(outputBase); + FileUtils.deleteDirectory(outputBase); } if (!outputBase.mkdirs()) { this.logDebug(Message.ERROR__CONVERTER__IA__OUTPUT_FOLDER_CREATION_FAILED, LogType.ERROR, "path", outputBase.getAbsolutePath()); @@ -478,7 +479,7 @@ private void convertSoundsSync(Optional optionalPlayer) { } if (outputFolder.exists()) { - this.deleteDirectory(outputFolder); + FileUtils.deleteDirectory(outputFolder); } if (!outputFolder.mkdirs()) { @@ -588,7 +589,7 @@ private void convertRecipesSync(Optional optionalPlayer) { return; } if (outputFolder.exists()) { - this.deleteDirectory(outputFolder); + FileUtils.deleteDirectory(outputFolder); } if (!outputFolder.mkdirs()) { this.logDebug(Message.ERROR__CONVERTER__IA__OUTPUT_FOLDER_CREATION_FAILED, LogType.ERROR, "path", outputFolder.getAbsolutePath()); @@ -938,7 +939,7 @@ private void convertPackSync(Optional optionalPlayer) { } if (outputPackFile.exists()) { - this.deleteDirectory(outputPackFile); + FileUtils.deleteDirectory(outputPackFile); } if (!outputPackFile.mkdirs()) { diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoConverter.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoConverter.java index 3f8fe300..7504682b 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoConverter.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoConverter.java @@ -22,6 +22,7 @@ import fr.robie.craftengineconverter.api.logger.Logger; import fr.robie.craftengineconverter.api.manager.FileCacheManager; import fr.robie.craftengineconverter.api.progress.BukkitProgressBar; +import fr.robie.craftengineconverter.api.utils.FileUtils; import fr.robie.craftengineconverter.common.BlockStatesMapper; import fr.robie.craftengineconverter.common.PluginNameMapper; import fr.robie.craftengineconverter.common.records.ImageConversion; @@ -69,7 +70,7 @@ private void convertItemsSync(Optional player) { } if (outputBase.exists()) { - this.deleteDirectory(outputBase); + FileUtils.deleteDirectory(outputBase); } if (!outputBase.mkdirs()) { @@ -138,7 +139,7 @@ private void convertEmojisSync(Optional player) { } if (outputEmojisFolder.exists()) { - this.deleteDirectory(outputEmojisFolder); + FileUtils.deleteDirectory(outputEmojisFolder); } if (!outputEmojisFolder.mkdirs()) { @@ -269,7 +270,7 @@ private void convertRecipesSync(Optional player) { return; } if (outputFolder.exists()) { - this.deleteDirectory(outputFolder); + FileUtils.deleteDirectory(outputFolder); } if (!outputFolder.mkdirs()) { this.logDebug(Message.ERROR__MKDIR_FAILURE, LogType.ERROR, "directory", outputFolder.getName(), "path", outputFolder.getAbsolutePath()); @@ -967,7 +968,7 @@ private void convertImagesSync(Optional player) { } if (outputFolder.exists()) { - this.deleteDirectory(outputFolder); + FileUtils.deleteDirectory(outputFolder); } if (!outputFolder.mkdirs()) { @@ -1133,7 +1134,7 @@ private void convertPackSync(Optional optionalPlayer) { } if (outputPackFile.exists()) { - this.deleteDirectory(outputPackFile); + FileUtils.deleteDirectory(outputPackFile); } if (!outputPackFile.mkdirs()) { this.logDebug(Message.ERROR__MKDIR_FAILURE, LogType.ERROR, "directory", outputPackFile.getName(), "path", outputPackFile.getAbsolutePath()); @@ -1247,14 +1248,14 @@ private void extractAndCopyZipAssets(File zipFile, File outputAssetsFolder, Stri } if (!this.settings.dryRunEnabled()) { - this.deleteDirectory(tempDir); + FileUtils.deleteDirectory(tempDir); } } catch (IOException e) { Logger.showException(Message.ERROR__CONVERTER__NEXO__PACK__ZIP_EXTRACT_FAILURE, e, "file", zipFile.getName()); errorRef.compareAndSet(null, e); } finally { if (!this.settings.dryRunEnabled() && tempDir.exists()) { - this.deleteDirectory(tempDir); + FileUtils.deleteDirectory(tempDir); } } } From 1f0cab594edb032dad597e71f188ccdd6fe07c4c Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Tue, 7 Apr 2026 11:15:10 +0200 Subject: [PATCH 010/116] feat: refactor YAML utilities use Bukkit bas --- .../api/yaml/Configuration.java | 21 + .../api/yaml/ConfigurationOptions.java | 38 + .../api/yaml/ConfigurationSection.java | 184 ++++ .../common/utils/SnakeUtils.java | 2 +- .../utils/yaml/MemoryConfiguration.java | 82 ++ .../yaml/MemoryConfigurationOptions.java | 29 + .../common/utils/yaml/MemorySection.java | 896 ++++++++++++++++++ .../common/utils/yaml/SectionPathData.java | 51 + .../constructor}/SmartConstructor.java | 106 ++- .../{ => yaml}/directive/KeyDirective.java | 3 +- .../directive/KeyDirectiveRegistry.java | 4 +- .../yaml/directive/MergeKeyDirective.java | 42 + .../yaml/directive/PluginKeyDirective.java | 60 ++ .../directive/VersionKeyDirective.java | 63 +- .../utils/yaml/file/FileConfiguration.java | 89 ++ .../yaml/file/FileConfigurationOptions.java | 71 ++ .../utils/yaml/file/YamlConfiguration.java | 276 ++++++ .../yaml/file/YamlConfigurationOptions.java | 91 ++ .../utils/yaml/file/YamlRepresenter.java | 44 + .../ConfigurationSerialization.java | 220 +++++ 20 files changed, 2329 insertions(+), 43 deletions(-) create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/yaml/Configuration.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/yaml/ConfigurationOptions.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/yaml/ConfigurationSection.java create mode 100644 Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/MemoryConfiguration.java create mode 100644 Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/MemoryConfigurationOptions.java create mode 100644 Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/MemorySection.java create mode 100644 Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/SectionPathData.java rename Common/src/main/java/fr/robie/craftengineconverter/common/utils/{directive => yaml/constructor}/SmartConstructor.java (55%) rename Common/src/main/java/fr/robie/craftengineconverter/common/utils/{ => yaml}/directive/KeyDirective.java (76%) rename Common/src/main/java/fr/robie/craftengineconverter/common/utils/{ => yaml}/directive/KeyDirectiveRegistry.java (84%) create mode 100644 Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/directive/MergeKeyDirective.java create mode 100644 Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/directive/PluginKeyDirective.java rename Common/src/main/java/fr/robie/craftengineconverter/common/utils/{ => yaml}/directive/VersionKeyDirective.java (65%) create mode 100644 Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/file/FileConfiguration.java create mode 100644 Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/file/FileConfigurationOptions.java create mode 100644 Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/file/YamlConfiguration.java create mode 100644 Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/file/YamlConfigurationOptions.java create mode 100644 Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/file/YamlRepresenter.java create mode 100644 Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/serialization/ConfigurationSerialization.java diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/yaml/Configuration.java b/API/src/main/java/fr/robie/craftengineconverter/api/yaml/Configuration.java new file mode 100644 index 00000000..d64567a1 --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/yaml/Configuration.java @@ -0,0 +1,21 @@ +package fr.robie.craftengineconverter.api.yaml; + +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.Map; + +public interface Configuration extends ConfigurationSection { + @Override + void addDefault(@NotNull String path, @Nullable Object value); + + void addDefaults(@NotNull Map defaults); + + void addDefaults(@NotNull Configuration defaults); + + void setDefaults(@NotNull Configuration defaults); + + @Nullable Configuration getDefaults(); + + @NotNull ConfigurationOptions options(); +} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/yaml/ConfigurationOptions.java b/API/src/main/java/fr/robie/craftengineconverter/api/yaml/ConfigurationOptions.java new file mode 100644 index 00000000..6487098f --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/yaml/ConfigurationOptions.java @@ -0,0 +1,38 @@ +package fr.robie.craftengineconverter.api.yaml; + +import org.jetbrains.annotations.NotNull; + +public class ConfigurationOptions { + private char pathSeparator = '.'; + private boolean copyDefaults = false; + private final Configuration configuration; + + protected ConfigurationOptions(@NotNull Configuration configuration) { + this.configuration = configuration; + } + + @NotNull + public Configuration configuration() { + return this.configuration; + } + + public char pathSeparator() { + return this.pathSeparator; + } + + @NotNull + public ConfigurationOptions pathSeparator(char value) { + this.pathSeparator = value; + return this; + } + + public boolean copyDefaults() { + return this.copyDefaults; + } + + @NotNull + public ConfigurationOptions copyDefaults(boolean value) { + this.copyDefaults = value; + return this; + } +} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/yaml/ConfigurationSection.java b/API/src/main/java/fr/robie/craftengineconverter/api/yaml/ConfigurationSection.java new file mode 100644 index 00000000..34afe12f --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/yaml/ConfigurationSection.java @@ -0,0 +1,184 @@ +package fr.robie.craftengineconverter.api.yaml; + +import org.bukkit.configuration.serialization.ConfigurationSerializable; +import org.jetbrains.annotations.Contract; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.List; +import java.util.Map; +import java.util.Set; + +public interface ConfigurationSection { + @NotNull + Set getKeys(boolean deep); + + @NotNull + Map getValues(boolean deep); + + boolean contains(@NotNull String path); + + boolean contains(@NotNull String path, boolean ignoreDefault); + + boolean isSet(@NotNull String path); + + @Nullable + String getCurrentPath(); + + @NotNull + String getName(); + + @Nullable + Configuration getRoot(); + + @Nullable + ConfigurationSection getParent(); + + @Nullable + Object get(@NotNull String path); + + @Contract("_, !null -> !null") + @Nullable + Object get(@NotNull String path, @Nullable Object def); + + void set(@NotNull String path, @Nullable Object value); + + @NotNull + ConfigurationSection createSection(@NotNull String path); + + @NotNull + ConfigurationSection createSection(@NotNull String path, @NotNull Map map); + + @Nullable + String getString(@NotNull String path); + + @Contract("_, !null -> !null") + @Nullable + String getString(@NotNull String path, @Nullable String def); + + boolean isString(@NotNull String path); + + int getInt(@NotNull String path); + + int getInt(@NotNull String path, int def); + + boolean isInt(@NotNull String path); + + boolean getBoolean(@NotNull String path); + + boolean getBoolean(@NotNull String path, boolean def); + + boolean isBoolean(@NotNull String path); + + double getDouble(@NotNull String path); + + double getDouble(@NotNull String path, double def); + + boolean isDouble(@NotNull String path); + + long getLong(@NotNull String path); + + + long getLong(@NotNull String path, long def); + + + boolean isLong(@NotNull String path); + + + @Nullable + List getList(@NotNull String path); + + + @Contract("_, !null -> !null") + @Nullable + List getList(@NotNull String path, @Nullable List def); + + + boolean isList(@NotNull String path); + + + @NotNull + List getStringList(@NotNull String path); + + + @NotNull + List getIntegerList(@NotNull String path); + + + @NotNull + List getBooleanList(@NotNull String path); + + + @NotNull + List getDoubleList(@NotNull String path); + + + @NotNull + List getFloatList(@NotNull String path); + + + @NotNull + List getLongList(@NotNull String path); + + + @NotNull + List getByteList(@NotNull String path); + + + @NotNull + List getCharacterList(@NotNull String path); + + + @NotNull + List getShortList(@NotNull String path); + + + @NotNull + List> getMapList(@NotNull String path); + + + @Nullable + T getObject(@NotNull String path, @NotNull Class clazz); + + + @Contract("_, _, !null -> !null") + @Nullable + T getObject(@NotNull String path, @NotNull Class clazz, @Nullable T def); + + + @Nullable + T getSerializable(@NotNull String path, @NotNull Class clazz); + + + @Contract("_, _, !null -> !null") + @Nullable + T getSerializable(@NotNull String path, @NotNull Class clazz, @Nullable T def); + + + @Nullable + ConfigurationSection getConfigurationSection(@NotNull String path); + + + boolean isConfigurationSection(@NotNull String path); + + + @Nullable + ConfigurationSection getDefaultSection(); + + + void addDefault(@NotNull String path, @Nullable Object value); + + + @NotNull + List getComments(@NotNull String path); + + + @NotNull + List getInlineComments(@NotNull String path); + + + void setComments(@NotNull String path, @Nullable List comments); + + + void setInlineComments(@NotNull String path, @Nullable List comments); +} diff --git a/Common/src/main/java/fr/robie/craftengineconverter/common/utils/SnakeUtils.java b/Common/src/main/java/fr/robie/craftengineconverter/common/utils/SnakeUtils.java index e5e56aa5..26c998f0 100644 --- a/Common/src/main/java/fr/robie/craftengineconverter/common/utils/SnakeUtils.java +++ b/Common/src/main/java/fr/robie/craftengineconverter/common/utils/SnakeUtils.java @@ -2,7 +2,7 @@ import fr.robie.craftengineconverter.api.logger.LogType; import fr.robie.craftengineconverter.api.logger.Logger; -import fr.robie.craftengineconverter.common.utils.directive.SmartConstructor; +import fr.robie.craftengineconverter.common.utils.yaml.constructor.SmartConstructor; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.yaml.snakeyaml.DumperOptions; diff --git a/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/MemoryConfiguration.java b/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/MemoryConfiguration.java new file mode 100644 index 00000000..cbcc95c1 --- /dev/null +++ b/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/MemoryConfiguration.java @@ -0,0 +1,82 @@ +package fr.robie.craftengineconverter.common.utils.yaml; + +import com.google.common.base.Preconditions; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.Map; + + +public class MemoryConfiguration extends MemorySection implements fr.robie.craftengineconverter.api.yaml.Configuration { + protected fr.robie.craftengineconverter.api.yaml.Configuration defaults; + protected MemoryConfigurationOptions options; + + + public MemoryConfiguration() { + } + + + public MemoryConfiguration(@Nullable fr.robie.craftengineconverter.api.yaml.Configuration defaults) { + this.defaults = defaults; + } + + @Override + public void addDefault(@NotNull String path, @Nullable Object value) { + Preconditions.checkArgument(path != null, "Path may not be null"); + + if (this.defaults == null) { + this.defaults = new MemoryConfiguration(); + } + + this.defaults.set(path, value); + } + + @Override + public void addDefaults(@NotNull Map defaults) { + Preconditions.checkArgument(defaults != null, "Defaults may not be null"); + + for (Map.Entry entry : defaults.entrySet()) { + this.addDefault(entry.getKey(), entry.getValue()); + } + } + + @Override + public void addDefaults(@NotNull fr.robie.craftengineconverter.api.yaml.Configuration defaults) { + Preconditions.checkArgument(defaults != null, "Defaults may not be null"); + + for (String key : defaults.getKeys(true)) { + if (!defaults.isConfigurationSection(key)) { + this.addDefault(key, defaults.get(key)); + } + } + } + + @Override + public void setDefaults(@NotNull fr.robie.craftengineconverter.api.yaml.Configuration defaults) { + Preconditions.checkNotNull(defaults, "Defaults may not be null"); + + this.defaults = defaults; + } + + @Override + @Nullable + public fr.robie.craftengineconverter.api.yaml.Configuration getDefaults() { + return this.defaults; + } + + @Nullable + @Override + public fr.robie.craftengineconverter.api.yaml.ConfigurationSection getParent() { + return null; + } + + @Override + @NotNull + public MemoryConfigurationOptions options() { + if (this.options == null) { + this.options = new MemoryConfigurationOptions(this); + } + + return this.options; + } +} diff --git a/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/MemoryConfigurationOptions.java b/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/MemoryConfigurationOptions.java new file mode 100644 index 00000000..bec62865 --- /dev/null +++ b/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/MemoryConfigurationOptions.java @@ -0,0 +1,29 @@ +package fr.robie.craftengineconverter.common.utils.yaml; + +import org.jetbrains.annotations.NotNull; + +public class MemoryConfigurationOptions extends fr.robie.craftengineconverter.api.yaml.ConfigurationOptions { + protected MemoryConfigurationOptions(@NotNull MemoryConfiguration configuration) { + super(configuration); + } + + @NotNull + @Override + public MemoryConfiguration configuration() { + return (MemoryConfiguration) super.configuration(); + } + + @NotNull + @Override + public MemoryConfigurationOptions copyDefaults(boolean value) { + super.copyDefaults(value); + return this; + } + + @NotNull + @Override + public MemoryConfigurationOptions pathSeparator(char value) { + super.pathSeparator(value); + return this; + } +} diff --git a/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/MemorySection.java b/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/MemorySection.java new file mode 100644 index 00000000..88f511b4 --- /dev/null +++ b/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/MemorySection.java @@ -0,0 +1,896 @@ +package fr.robie.craftengineconverter.common.utils.yaml; + +import com.google.common.base.Preconditions; +import com.google.common.base.Strings; +import org.bukkit.configuration.serialization.ConfigurationSerializable; +import org.jetbrains.annotations.Contract; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.*; + +import static org.bukkit.util.NumberConversions.*; + + +public class MemorySection implements fr.robie.craftengineconverter.api.yaml.ConfigurationSection { + protected final Map map = new LinkedHashMap(); + private final fr.robie.craftengineconverter.api.yaml.Configuration root; + private final fr.robie.craftengineconverter.api.yaml.ConfigurationSection parent; + private final String path; + private final String fullPath; + + + protected MemorySection() { + if (!(this instanceof fr.robie.craftengineconverter.api.yaml.Configuration)) { + throw new IllegalStateException("Cannot construct a root MemorySection when not a Configuration"); + } + + this.path = ""; + this.fullPath = ""; + this.parent = null; + this.root = (fr.robie.craftengineconverter.api.yaml.Configuration) this; + } + + + protected MemorySection(@NotNull fr.robie.craftengineconverter.api.yaml.ConfigurationSection parent, @NotNull String path) { + Preconditions.checkArgument(parent != null, "Parent cannot be null"); + Preconditions.checkArgument(path != null, "Path cannot be null"); + + this.path = path; + this.parent = parent; + this.root = parent.getRoot(); + + Preconditions.checkArgument(this.root != null, "Path cannot be orphaned"); + + this.fullPath = createPath(parent, path); + } + + @Override + @NotNull + public Set getKeys(boolean deep) { + Set result = new LinkedHashSet(); + + fr.robie.craftengineconverter.api.yaml.Configuration root = this.getRoot(); + if (root != null && root.options().copyDefaults()) { + fr.robie.craftengineconverter.api.yaml.ConfigurationSection defaults = this.getDefaultSection(); + + if (defaults != null) { + result.addAll(defaults.getKeys(deep)); + } + } + + this.mapChildrenKeys(result, this, deep); + + return result; + } + + @Override + @NotNull + public Map getValues(boolean deep) { + Map result = new LinkedHashMap(); + + fr.robie.craftengineconverter.api.yaml.Configuration root = this.getRoot(); + if (root != null && root.options().copyDefaults()) { + fr.robie.craftengineconverter.api.yaml.ConfigurationSection defaults = this.getDefaultSection(); + + if (defaults != null) { + result.putAll(defaults.getValues(deep)); + } + } + + this.mapChildrenValues(result, this, deep); + + return result; + } + + @Override + public boolean contains(@NotNull String path) { + return this.contains(path, false); + } + + @Override + public boolean contains(@NotNull String path, boolean ignoreDefault) { + return ((ignoreDefault) ? this.get(path, null) : this.get(path)) != null; + } + + @Override + public boolean isSet(@NotNull String path) { + fr.robie.craftengineconverter.api.yaml.Configuration root = this.getRoot(); + if (root == null) { + return false; + } + if (root.options().copyDefaults()) { + return this.contains(path); + } + return this.get(path, null) != null; + } + + @Override + @NotNull + public String getCurrentPath() { + return this.fullPath; + } + + @Override + @NotNull + public String getName() { + return this.path; + } + + @Override + @Nullable + public fr.robie.craftengineconverter.api.yaml.Configuration getRoot() { + return this.root; + } + + @Override + @Nullable + public fr.robie.craftengineconverter.api.yaml.ConfigurationSection getParent() { + return this.parent; + } + + @Override + public void addDefault(@NotNull String path, @Nullable Object value) { + Preconditions.checkArgument(path != null, "Path cannot be null"); + + fr.robie.craftengineconverter.api.yaml.Configuration root = this.getRoot(); + if (root == null) { + throw new IllegalStateException("Cannot add default without root"); + } + if (root == this) { + throw new UnsupportedOperationException("Unsupported addDefault(String, Object) implementation"); + } + root.addDefault(createPath(this, path), value); + } + + @Override + @Nullable + public fr.robie.craftengineconverter.api.yaml.ConfigurationSection getDefaultSection() { + fr.robie.craftengineconverter.api.yaml.Configuration root = this.getRoot(); + fr.robie.craftengineconverter.api.yaml.Configuration defaults = root == null ? null : root.getDefaults(); + + if (defaults != null) { + if (defaults.isConfigurationSection(this.getCurrentPath())) { + return defaults.getConfigurationSection(this.getCurrentPath()); + } + } + + return null; + } + + @Override + public void set(@NotNull String path, @Nullable Object value) { + Preconditions.checkArgument(!Strings.isNullOrEmpty(path), "Cannot set to an empty path"); + + fr.robie.craftengineconverter.api.yaml.Configuration root = this.getRoot(); + if (root == null) { + throw new IllegalStateException("Cannot use section without a root"); + } + + final char separator = root.options().pathSeparator(); + + + int i1 = -1, i2; + fr.robie.craftengineconverter.api.yaml.ConfigurationSection section = this; + while ((i1 = path.indexOf(separator, i2 = i1 + 1)) != -1) { + String node = path.substring(i2, i1); + fr.robie.craftengineconverter.api.yaml.ConfigurationSection subSection = section.getConfigurationSection(node); + if (subSection == null) { + if (value == null) { + + return; + } + section = section.createSection(node); + } else { + section = subSection; + } + } + + String key = path.substring(i2); + if (section == this) { + if (value == null) { + this.map.remove(key); + } else { + SectionPathData entry = this.map.get(key); + if (entry == null) { + this.map.put(key, new SectionPathData(value)); + } else { + entry.setData(value); + } + } + } else { + section.set(key, value); + } + } + + @Override + @Nullable + public Object get(@NotNull String path) { + return this.get(path, this.getDefault(path)); + } + + @Override + @Contract("_, !null -> !null") + @Nullable + public Object get(@NotNull String path, @Nullable Object def) { + Preconditions.checkArgument(path != null, "Path cannot be null"); + + if (path.length() == 0) { + return this; + } + + fr.robie.craftengineconverter.api.yaml.Configuration root = this.getRoot(); + if (root == null) { + throw new IllegalStateException("Cannot access section without a root"); + } + + final char separator = root.options().pathSeparator(); + + + int i1 = -1, i2; + fr.robie.craftengineconverter.api.yaml.ConfigurationSection section = this; + while ((i1 = path.indexOf(separator, i2 = i1 + 1)) != -1) { + final String currentPath = path.substring(i2, i1); + if (!section.contains(currentPath, true)) { + return def; + } + section = section.getConfigurationSection(currentPath); + if (section == null) { + return def; + } + } + + String key = path.substring(i2); + if (section == this) { + SectionPathData result = this.map.get(key); + return (result == null) ? def : result.getData(); + } + return section.get(key, def); + } + + @Override + @NotNull + public fr.robie.craftengineconverter.api.yaml.ConfigurationSection createSection(@NotNull String path) { + Preconditions.checkArgument(!Strings.isNullOrEmpty(path), "Cannot create section at empty path"); + fr.robie.craftengineconverter.api.yaml.Configuration root = this.getRoot(); + if (root == null) { + throw new IllegalStateException("Cannot create section without a root"); + } + + final char separator = root.options().pathSeparator(); + + + int i1 = -1, i2; + fr.robie.craftengineconverter.api.yaml.ConfigurationSection section = this; + while ((i1 = path.indexOf(separator, i2 = i1 + 1)) != -1) { + String node = path.substring(i2, i1); + fr.robie.craftengineconverter.api.yaml.ConfigurationSection subSection = section.getConfigurationSection(node); + if (subSection == null) { + section = section.createSection(node); + } else { + section = subSection; + } + } + + String key = path.substring(i2); + if (section == this) { + fr.robie.craftengineconverter.api.yaml.ConfigurationSection result = new MemorySection(this, key); + this.map.put(key, new SectionPathData(result)); + return result; + } + return section.createSection(key); + } + + @Override + @NotNull + public fr.robie.craftengineconverter.api.yaml.ConfigurationSection createSection(@NotNull String path, @NotNull Map map) { + fr.robie.craftengineconverter.api.yaml.ConfigurationSection section = this.createSection(path); + + for (Map.Entry entry : map.entrySet()) { + if (entry.getValue() instanceof Map) { + section.createSection(entry.getKey().toString(), (Map) entry.getValue()); + } else { + section.set(entry.getKey().toString(), entry.getValue()); + } + } + + return section; + } + + + @Override + @Nullable + public String getString(@NotNull String path) { + Object def = this.getDefault(path); + return this.getString(path, def != null ? def.toString() : null); + } + + @Override + @Contract("_, !null -> !null") + @Nullable + public String getString(@NotNull String path, @Nullable String def) { + Object val = this.get(path, def); + return (val != null) ? val.toString() : def; + } + + @Override + public boolean isString(@NotNull String path) { + Object val = this.get(path); + return val instanceof String; + } + + @Override + public int getInt(@NotNull String path) { + Object def = this.getDefault(path); + return this.getInt(path, (def instanceof Number) ? toInt(def) : 0); + } + + @Override + public int getInt(@NotNull String path, int def) { + Object val = this.get(path, def); + return (val instanceof Number) ? toInt(val) : def; + } + + @Override + public boolean isInt(@NotNull String path) { + Object val = this.get(path); + return val instanceof Integer; + } + + @Override + public boolean getBoolean(@NotNull String path) { + Object def = this.getDefault(path); + return this.getBoolean(path, (def instanceof Boolean) ? (Boolean) def : false); + } + + @Override + public boolean getBoolean(@NotNull String path, boolean def) { + Object val = this.get(path, def); + return (val instanceof Boolean) ? (Boolean) val : def; + } + + @Override + public boolean isBoolean(@NotNull String path) { + Object val = this.get(path); + return val instanceof Boolean; + } + + @Override + public double getDouble(@NotNull String path) { + Object def = this.getDefault(path); + return this.getDouble(path, (def instanceof Number) ? toDouble(def) : 0); + } + + @Override + public double getDouble(@NotNull String path, double def) { + Object val = this.get(path, def); + return (val instanceof Number) ? toDouble(val) : def; + } + + @Override + public boolean isDouble(@NotNull String path) { + Object val = this.get(path); + return val instanceof Double; + } + + @Override + public long getLong(@NotNull String path) { + Object def = this.getDefault(path); + return this.getLong(path, (def instanceof Number) ? toLong(def) : 0); + } + + @Override + public long getLong(@NotNull String path, long def) { + Object val = this.get(path, def); + return (val instanceof Number) ? toLong(val) : def; + } + + @Override + public boolean isLong(@NotNull String path) { + Object val = this.get(path); + return val instanceof Long; + } + + + @Override + @Nullable + public List getList(@NotNull String path) { + Object def = this.getDefault(path); + return this.getList(path, (def instanceof List) ? (List) def : null); + } + + @Override + @Contract("_, !null -> !null") + @Nullable + public List getList(@NotNull String path, @Nullable List def) { + Object val = this.get(path, def); + return (List) ((val instanceof List) ? val : def); + } + + @Override + public boolean isList(@NotNull String path) { + Object val = this.get(path); + return val instanceof List; + } + + @Override + @NotNull + public List getStringList(@NotNull String path) { + List list = this.getList(path); + + if (list == null) { + return new ArrayList(0); + } + + List result = new ArrayList(); + + for (Object object : list) { + if ((object instanceof String) || (this.isPrimitiveWrapper(object))) { + result.add(String.valueOf(object)); + } + } + + return result; + } + + @Override + @NotNull + public List getIntegerList(@NotNull String path) { + List list = this.getList(path); + + if (list == null) { + return new ArrayList(0); + } + + List result = new ArrayList(); + + for (Object object : list) { + if (object instanceof Integer) { + result.add((Integer) object); + } else if (object instanceof String) { + try { + result.add(Integer.valueOf((String) object)); + } catch (Exception ex) { + } + } else if (object instanceof Character) { + result.add((int) ((Character) object).charValue()); + } else if (object instanceof Number) { + result.add(((Number) object).intValue()); + } + } + + return result; + } + + @Override + @NotNull + public List getBooleanList(@NotNull String path) { + List list = this.getList(path); + + if (list == null) { + return new ArrayList(0); + } + + List result = new ArrayList(); + + for (Object object : list) { + if (object instanceof Boolean) { + result.add((Boolean) object); + } else if (object instanceof String) { + if (Boolean.TRUE.toString().equals(object)) { + result.add(true); + } else if (Boolean.FALSE.toString().equals(object)) { + result.add(false); + } + } + } + + return result; + } + + @Override + @NotNull + public List getDoubleList(@NotNull String path) { + List list = this.getList(path); + + if (list == null) { + return new ArrayList(0); + } + + List result = new ArrayList(); + + for (Object object : list) { + if (object instanceof Double) { + result.add((Double) object); + } else if (object instanceof String) { + try { + result.add(Double.valueOf((String) object)); + } catch (Exception ex) { + } + } else if (object instanceof Character) { + result.add((double) ((Character) object).charValue()); + } else if (object instanceof Number) { + result.add(((Number) object).doubleValue()); + } + } + + return result; + } + + @Override + @NotNull + public List getFloatList(@NotNull String path) { + List list = this.getList(path); + + if (list == null) { + return new ArrayList(0); + } + + List result = new ArrayList(); + + for (Object object : list) { + if (object instanceof Float) { + result.add((Float) object); + } else if (object instanceof String) { + try { + result.add(Float.valueOf((String) object)); + } catch (Exception ex) { + } + } else if (object instanceof Character) { + result.add((float) ((Character) object).charValue()); + } else if (object instanceof Number) { + result.add(((Number) object).floatValue()); + } + } + + return result; + } + + @Override + @NotNull + public List getLongList(@NotNull String path) { + List list = this.getList(path); + + if (list == null) { + return new ArrayList(0); + } + + List result = new ArrayList(); + + for (Object object : list) { + if (object instanceof Long) { + result.add((Long) object); + } else if (object instanceof String) { + try { + result.add(Long.valueOf((String) object)); + } catch (Exception ex) { + } + } else if (object instanceof Character) { + result.add((long) ((Character) object).charValue()); + } else if (object instanceof Number) { + result.add(((Number) object).longValue()); + } + } + + return result; + } + + @Override + @NotNull + public List getByteList(@NotNull String path) { + List list = this.getList(path); + + if (list == null) { + return new ArrayList(0); + } + + List result = new ArrayList(); + + for (Object object : list) { + if (object instanceof Byte) { + result.add((Byte) object); + } else if (object instanceof String) { + try { + result.add(Byte.valueOf((String) object)); + } catch (Exception ex) { + } + } else if (object instanceof Character) { + result.add((byte) ((Character) object).charValue()); + } else if (object instanceof Number) { + result.add(((Number) object).byteValue()); + } + } + + return result; + } + + @Override + @NotNull + public List getCharacterList(@NotNull String path) { + List list = this.getList(path); + + if (list == null) { + return new ArrayList(0); + } + + List result = new ArrayList(); + + for (Object object : list) { + if (object instanceof Character) { + result.add((Character) object); + } else if (object instanceof String str) { + + if (str.length() == 1) { + result.add(str.charAt(0)); + } + } else if (object instanceof Number) { + result.add((char) ((Number) object).intValue()); + } + } + + return result; + } + + @Override + @NotNull + public List getShortList(@NotNull String path) { + List list = this.getList(path); + + if (list == null) { + return new ArrayList(0); + } + + List result = new ArrayList(); + + for (Object object : list) { + if (object instanceof Short) { + result.add((Short) object); + } else if (object instanceof String) { + try { + result.add(Short.valueOf((String) object)); + } catch (Exception ex) { + } + } else if (object instanceof Character) { + result.add((short) ((Character) object).charValue()); + } else if (object instanceof Number) { + result.add(((Number) object).shortValue()); + } + } + + return result; + } + + @Override + @NotNull + public List> getMapList(@NotNull String path) { + List list = this.getList(path); + List> result = new ArrayList>(); + + if (list == null) { + return result; + } + + for (Object object : list) { + if (object instanceof Map) { + result.add((Map) object); + } + } + + return result; + } + + + @Nullable + @Override + public T getObject(@NotNull String path, @NotNull Class clazz) { + Preconditions.checkArgument(clazz != null, "Class cannot be null"); + Object def = this.getDefault(path); + return this.getObject(path, clazz, (clazz.isInstance(def)) ? clazz.cast(def) : null); + } + + @Contract("_, _, !null -> !null") + @Nullable + @Override + public T getObject(@NotNull String path, @NotNull Class clazz, @Nullable T def) { + Preconditions.checkArgument(clazz != null, "Class cannot be null"); + Object val = this.get(path, def); + return (clazz.isInstance(val)) ? clazz.cast(val) : def; + } + + @Nullable + @Override + public T getSerializable(@NotNull String path, @NotNull Class clazz) { + return this.getObject(path, clazz); + } + + @Contract("_, _, !null -> !null") + @Nullable + @Override + public T getSerializable(@NotNull String path, @NotNull Class clazz, @Nullable T def) { + return this.getObject(path, clazz, def); + } + + @Override + @Nullable + public fr.robie.craftengineconverter.api.yaml.ConfigurationSection getConfigurationSection(@NotNull String path) { + Object val = this.get(path, null); + if (val != null) { + return (val instanceof fr.robie.craftengineconverter.api.yaml.ConfigurationSection) ? (fr.robie.craftengineconverter.api.yaml.ConfigurationSection) val : null; + } + + val = this.get(path, this.getDefault(path)); + return (val instanceof fr.robie.craftengineconverter.api.yaml.ConfigurationSection) ? this.createSection(path) : null; + } + + @Override + public boolean isConfigurationSection(@NotNull String path) { + Object val = this.get(path); + return val instanceof fr.robie.craftengineconverter.api.yaml.ConfigurationSection; + } + + protected boolean isPrimitiveWrapper(@Nullable Object input) { + return input instanceof Integer || input instanceof Boolean + || input instanceof Character || input instanceof Byte + || input instanceof Short || input instanceof Double + || input instanceof Long || input instanceof Float; + } + + @Nullable + protected Object getDefault(@NotNull String path) { + Preconditions.checkArgument(path != null, "Path cannot be null"); + + fr.robie.craftengineconverter.api.yaml.Configuration root = this.getRoot(); + fr.robie.craftengineconverter.api.yaml.Configuration defaults = root == null ? null : root.getDefaults(); + return (defaults == null) ? null : defaults.get(createPath(this, path)); + } + + protected void mapChildrenKeys(@NotNull Set output, @NotNull fr.robie.craftengineconverter.api.yaml.ConfigurationSection section, boolean deep) { + if (section instanceof MemorySection sec) { + + for (Map.Entry entry : sec.map.entrySet()) { + output.add(createPath(section, entry.getKey(), this)); + + if ((deep) && (entry.getValue().getData() instanceof fr.robie.craftengineconverter.api.yaml.ConfigurationSection subsection)) { + this.mapChildrenKeys(output, subsection, deep); + } + } + } else { + Set keys = section.getKeys(deep); + + for (String key : keys) { + output.add(createPath(section, key, this)); + } + } + } + + protected void mapChildrenValues(@NotNull Map output, @NotNull fr.robie.craftengineconverter.api.yaml.ConfigurationSection section, boolean deep) { + if (section instanceof MemorySection sec) { + + for (Map.Entry entry : sec.map.entrySet()) { + + + String childPath = createPath(section, entry.getKey(), this); + output.remove(childPath); + output.put(childPath, entry.getValue().getData()); + + if (entry.getValue().getData() instanceof fr.robie.craftengineconverter.api.yaml.ConfigurationSection) { + if (deep) { + this.mapChildrenValues(output, (fr.robie.craftengineconverter.api.yaml.ConfigurationSection) entry.getValue().getData(), deep); + } + } + } + } else { + Map values = section.getValues(deep); + + for (Map.Entry entry : values.entrySet()) { + output.put(createPath(section, entry.getKey(), this), entry.getValue()); + } + } + } + + + @NotNull + public static String createPath(@NotNull fr.robie.craftengineconverter.api.yaml.ConfigurationSection section, @Nullable String key) { + return createPath(section, key, (section == null) ? null : section.getRoot()); + } + + + @NotNull + public static String createPath(@NotNull fr.robie.craftengineconverter.api.yaml.ConfigurationSection section, @Nullable String key, @Nullable fr.robie.craftengineconverter.api.yaml.ConfigurationSection relativeTo) { + Preconditions.checkArgument(section != null, "Cannot create path without a section"); + fr.robie.craftengineconverter.api.yaml.Configuration root = section.getRoot(); + if (root == null) { + throw new IllegalStateException("Cannot create path without a root"); + } + char separator = root.options().pathSeparator(); + + StringBuilder builder = new StringBuilder(); + for (fr.robie.craftengineconverter.api.yaml.ConfigurationSection parent = section; (parent != null) && (parent != relativeTo); parent = parent.getParent()) { + if (!builder.isEmpty()) { + builder.insert(0, separator); + } + builder.insert(0, parent.getName()); + } + + if ((key != null) && (!key.isEmpty())) { + if (!builder.isEmpty()) { + builder.append(separator); + } + + builder.append(key); + } + + return builder.toString(); + } + + @Override + @NotNull + public List getComments(@NotNull final String path) { + final SectionPathData pathData = this.getSectionPathData(path); + return pathData == null ? Collections.emptyList() : pathData.getComments(); + } + + @Override + @NotNull + public List getInlineComments(@NotNull final String path) { + final SectionPathData pathData = this.getSectionPathData(path); + return pathData == null ? Collections.emptyList() : pathData.getInlineComments(); + } + + @Override + public void setComments(@NotNull final String path, @Nullable final List comments) { + final SectionPathData pathData = this.getSectionPathData(path); + if (pathData != null) { + pathData.setComments(comments); + } + } + + @Override + public void setInlineComments(@NotNull final String path, @Nullable final List comments) { + final SectionPathData pathData = this.getSectionPathData(path); + if (pathData != null) { + pathData.setInlineComments(comments); + } + } + + @Nullable + private SectionPathData getSectionPathData(@NotNull String path) { + Preconditions.checkArgument(path != null, "Path cannot be null"); + + fr.robie.craftengineconverter.api.yaml.Configuration root = this.getRoot(); + if (root == null) { + throw new IllegalStateException("Cannot access section without a root"); + } + + final char separator = root.options().pathSeparator(); + + + int i1 = -1, i2; + fr.robie.craftengineconverter.api.yaml.ConfigurationSection section = this; + while ((i1 = path.indexOf(separator, i2 = i1 + 1)) != -1) { + section = section.getConfigurationSection(path.substring(i2, i1)); + if (section == null) { + return null; + } + } + + String key = path.substring(i2); + if (section == this) { + return this.map.get(key); + } else if (section instanceof MemorySection) { + return ((MemorySection) section).getSectionPathData(key); + } + return null; + } + + @Override + public String toString() { + fr.robie.craftengineconverter.api.yaml.Configuration root = this.getRoot(); + return this.getClass().getSimpleName() + + "[path='" + + this.getCurrentPath() + + "', root='" + + (root == null ? null : root.getClass().getSimpleName()) + + "']"; + } +} diff --git a/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/SectionPathData.java b/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/SectionPathData.java new file mode 100644 index 00000000..1c7372bf --- /dev/null +++ b/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/SectionPathData.java @@ -0,0 +1,51 @@ +package fr.robie.craftengineconverter.common.utils.yaml; + +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.Collections; +import java.util.List; + +final class SectionPathData { + + private Object data; + private List comments; + private List inlineComments; + + public SectionPathData(@Nullable Object data) { + this.data = data; + this.comments = Collections.emptyList(); + this.inlineComments = Collections.emptyList(); + } + + @Nullable + public Object getData() { + return this.data; + } + + public void setData(@Nullable final Object data) { + this.data = data; + } + + + @NotNull + public List getComments() { + return this.comments; + } + + + public void setComments(@Nullable final List comments) { + this.comments = (comments == null) ? Collections.emptyList() : Collections.unmodifiableList(comments); + } + + + @NotNull + public List getInlineComments() { + return this.inlineComments; + } + + + public void setInlineComments(@Nullable final List inlineComments) { + this.inlineComments = (inlineComments == null) ? Collections.emptyList() : Collections.unmodifiableList(inlineComments); + } +} diff --git a/Common/src/main/java/fr/robie/craftengineconverter/common/utils/directive/SmartConstructor.java b/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/constructor/SmartConstructor.java similarity index 55% rename from Common/src/main/java/fr/robie/craftengineconverter/common/utils/directive/SmartConstructor.java rename to Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/constructor/SmartConstructor.java index a2078ed8..d2f686c5 100644 --- a/Common/src/main/java/fr/robie/craftengineconverter/common/utils/directive/SmartConstructor.java +++ b/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/constructor/SmartConstructor.java @@ -1,6 +1,9 @@ -package fr.robie.craftengineconverter.common.utils.directive; +package fr.robie.craftengineconverter.common.utils.yaml.constructor; +import fr.robie.craftengineconverter.common.utils.yaml.directive.KeyDirective; +import fr.robie.craftengineconverter.common.utils.yaml.directive.KeyDirectiveRegistry; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; import org.yaml.snakeyaml.LoaderOptions; import org.yaml.snakeyaml.constructor.SafeConstructor; import org.yaml.snakeyaml.nodes.MappingNode; @@ -14,12 +17,21 @@ public class SmartConstructor extends SafeConstructor { private static final String PREFIX = "$$"; - private static final String FALLBACK = "$$fallback"; + private static final String FALLBACK_STRIPPED = "fallback"; public SmartConstructor(@NotNull LoaderOptions options) { super(options); } + @Override + public void flattenMapping(@NotNull final MappingNode node) { + super.flattenMapping(node); + } + + @Nullable + public Object construct(@NotNull Node node) { + return this.constructObject(node); + } @Override public Object constructObject(Node node) { @@ -42,9 +54,10 @@ protected Map constructMapping(MappingNode node) { Node valueNode = tuple.getValueNode(); if (key.startsWith(PREFIX)) { - KeyDirective directive = KeyDirectiveRegistry.findMatch(key); + String strippedKey = key.substring(PREFIX.length()); + KeyDirective directive = KeyDirectiveRegistry.findMatch(strippedKey); if (directive != null) { - directive.handleBlockMerge(map, key, valueNode, this); + directive.handleBlockMerge(map, strippedKey, valueNode, this); } } else if (key.contains("::")) { this.processDeepKey(map, key, valueNode); @@ -73,24 +86,80 @@ private boolean isValueSelectorNode(MappingNode node) { } @SuppressWarnings("unchecked") - private void processDeepKey(Map map, String fullKey, Node valueNode) { + private void processDeepKey(Map rootMap, String fullKey, Node valueNode) { String[] parts = fullKey.split("::"); - Map current = map; + Object current = rootMap; for (int i = 0; i < parts.length - 1; i++) { - Object existing = current.get(parts[i]); - if (existing instanceof Map) { - current = (Map) existing; - } else { - Map nested = new LinkedHashMap<>(); - current.put(parts[i], nested); - current = nested; + String part = parts[i]; + String nextPart = parts[i + 1]; + boolean isNextIndex = this.isInteger(nextPart); + + if (current instanceof Map) { + Map map = (Map) current; + Object existing = map.get(part); + + if (existing != null) { + current = existing; + } else { + Object next; + if (isNextIndex) { + next = new java.util.ArrayList<>(); + } else { + next = new LinkedHashMap<>(); + } + map.put(part, next); + current = next; + } + } else if (current instanceof java.util.List) { + java.util.List list = (java.util.List) current; + int index = Integer.parseInt(part); + + while (list.size() <= index) { + list.add(null); + } + + Object existing = list.get(index); + if (existing != null) { + current = existing; + } else { + Object next; + if (isNextIndex) { + next = new java.util.ArrayList<>(); + } else { + next = new LinkedHashMap<>(); + } + list.set(index, next); + current = next; + } } } - String finalKey = parts[parts.length - 1]; + String finalPart = parts[parts.length - 1]; Object value = this.constructObjectPublic(valueNode); - this.setWithMerge(current, finalKey, value, fullKey); + + if (current instanceof Map) { + this.setWithMerge((Map) current, finalPart, value, fullKey); + } else if (current instanceof java.util.List) { + java.util.List list = (java.util.List) current; + int index = Integer.parseInt(finalPart); + while (list.size() <= index) { + list.add(null); + } + list.set(index, value); + } + } + + private boolean isInteger(String s) { + if (s == null || s.isEmpty()) { + return false; + } + for (int i = 0; i < s.length(); i++) { + if (!Character.isDigit(s.charAt(i))) { + return false; + } + } + return true; } private Object constructValueSelector(MappingNode node) { @@ -99,15 +168,16 @@ private Object constructValueSelector(MappingNode node) { for (NodeTuple tuple : node.getValue()) { String key = this.constructScalar((ScalarNode) tuple.getKeyNode()); + String strippedKey = key.startsWith(PREFIX) ? key.substring(PREFIX.length()) : key; - if (FALLBACK.equals(key)) { + if (FALLBACK_STRIPPED.equals(strippedKey)) { fallback = this.constructObjectPublic(tuple.getValueNode()); continue; } - KeyDirective directive = KeyDirectiveRegistry.findMatch(key); + KeyDirective directive = KeyDirectiveRegistry.findMatch(strippedKey); if (directive != null) { - Object candidate = directive.handleValueSelect(key, tuple.getValueNode(), this); + Object candidate = directive.handleValueSelect(strippedKey, tuple.getValueNode(), this); if (candidate != null) { matched = candidate; } diff --git a/Common/src/main/java/fr/robie/craftengineconverter/common/utils/directive/KeyDirective.java b/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/directive/KeyDirective.java similarity index 76% rename from Common/src/main/java/fr/robie/craftengineconverter/common/utils/directive/KeyDirective.java rename to Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/directive/KeyDirective.java index 99e1e72f..d7086ed3 100644 --- a/Common/src/main/java/fr/robie/craftengineconverter/common/utils/directive/KeyDirective.java +++ b/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/directive/KeyDirective.java @@ -1,5 +1,6 @@ -package fr.robie.craftengineconverter.common.utils.directive; +package fr.robie.craftengineconverter.common.utils.yaml.directive; +import fr.robie.craftengineconverter.common.utils.yaml.constructor.SmartConstructor; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.yaml.snakeyaml.nodes.Node; diff --git a/Common/src/main/java/fr/robie/craftengineconverter/common/utils/directive/KeyDirectiveRegistry.java b/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/directive/KeyDirectiveRegistry.java similarity index 84% rename from Common/src/main/java/fr/robie/craftengineconverter/common/utils/directive/KeyDirectiveRegistry.java rename to Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/directive/KeyDirectiveRegistry.java index a6d685f6..11532ab5 100644 --- a/Common/src/main/java/fr/robie/craftengineconverter/common/utils/directive/KeyDirectiveRegistry.java +++ b/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/directive/KeyDirectiveRegistry.java @@ -1,4 +1,4 @@ -package fr.robie.craftengineconverter.common.utils.directive; +package fr.robie.craftengineconverter.common.utils.yaml.directive; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -12,6 +12,8 @@ public final class KeyDirectiveRegistry { static { register(new VersionKeyDirective()); + register(new PluginKeyDirective()); + register(new MergeKeyDirective()); } private KeyDirectiveRegistry() {} diff --git a/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/directive/MergeKeyDirective.java b/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/directive/MergeKeyDirective.java new file mode 100644 index 00000000..0c6030b8 --- /dev/null +++ b/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/directive/MergeKeyDirective.java @@ -0,0 +1,42 @@ +package fr.robie.craftengineconverter.common.utils.yaml.directive; + +import fr.robie.craftengineconverter.common.utils.yaml.constructor.SmartConstructor; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import org.yaml.snakeyaml.nodes.Node; + +import java.util.List; +import java.util.Map; + +public class MergeKeyDirective implements KeyDirective { + + @Override + public boolean matches(@NotNull String key) { + return key.startsWith("merge"); + } + + @Override + public void handleBlockMerge(@NotNull Map targetMap, @NotNull String key, @NotNull Node valueNode, @NotNull SmartConstructor constructor) { + Object val = constructor.constructObjectPublic(valueNode); + + if (val instanceof Map) { + @SuppressWarnings("unchecked") + Map map = (Map) val; + constructor.mergeInto(targetMap, map, key); + } else if (val instanceof List) { + for (Object item : (List) val) { + if (item instanceof Map) { + @SuppressWarnings("unchecked") + Map map = (Map) item; + constructor.mergeInto(targetMap, map, key); + } + } + } + } + + @Override + @Nullable + public Object handleValueSelect(@NotNull String key, @NotNull Node valueNode, @NotNull SmartConstructor constructor) { + return constructor.constructObjectPublic(valueNode); + } +} diff --git a/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/directive/PluginKeyDirective.java b/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/directive/PluginKeyDirective.java new file mode 100644 index 00000000..de4a8bb3 --- /dev/null +++ b/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/directive/PluginKeyDirective.java @@ -0,0 +1,60 @@ +package fr.robie.craftengineconverter.common.utils.yaml.directive; + +import fr.robie.craftengineconverter.common.utils.yaml.constructor.SmartConstructor; +import org.bukkit.Bukkit; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import org.yaml.snakeyaml.nodes.MappingNode; +import org.yaml.snakeyaml.nodes.Node; + +import java.util.Map; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +public class PluginKeyDirective implements KeyDirective { + + private static final Pattern PLUGIN_PATTERN = Pattern.compile("^plugin:(!)?([A-Za-z0-9_]+)(?:#.*)?$"); + + @Override + public boolean matches(@NotNull String key) { + return PLUGIN_PATTERN.matcher(key).matches(); + } + + @Override + public void handleBlockMerge(@NotNull Map targetMap, @NotNull String key, @NotNull Node valueNode, @NotNull SmartConstructor constructor) { + if (!this.evaluate(key)) { + return; + } + + if (!(valueNode instanceof MappingNode mappingNode)) { + return; + } + + @SuppressWarnings("unchecked") + Map child = (Map) constructor.constructObjectPublic(mappingNode); + constructor.mergeInto(targetMap, child, key); + } + + @Override + @Nullable + public Object handleValueSelect(@NotNull String key, @NotNull Node valueNode, @NotNull SmartConstructor constructor) { + if (!this.evaluate(key)) { + return null; + } + return constructor.constructObjectPublic(valueNode); + } + + private boolean evaluate(@NotNull String key) { + Matcher m = PLUGIN_PATTERN.matcher(key); + if (!m.matches()) { + return false; + } + + boolean negate = m.group(1) != null; + String pluginName = m.group(2); + + boolean isEnabled = Bukkit.getPluginManager().isPluginEnabled(pluginName); + + return negate != isEnabled; + } +} diff --git a/Common/src/main/java/fr/robie/craftengineconverter/common/utils/directive/VersionKeyDirective.java b/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/directive/VersionKeyDirective.java similarity index 65% rename from Common/src/main/java/fr/robie/craftengineconverter/common/utils/directive/VersionKeyDirective.java rename to Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/directive/VersionKeyDirective.java index 6c054f7b..ad86d631 100644 --- a/Common/src/main/java/fr/robie/craftengineconverter/common/utils/directive/VersionKeyDirective.java +++ b/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/directive/VersionKeyDirective.java @@ -1,6 +1,7 @@ -package fr.robie.craftengineconverter.common.utils.directive; +package fr.robie.craftengineconverter.common.utils.yaml.directive; import fr.robie.craftengineconverter.common.enums.NmsVersion; +import fr.robie.craftengineconverter.common.utils.yaml.constructor.SmartConstructor; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.yaml.snakeyaml.nodes.MappingNode; @@ -11,7 +12,7 @@ import java.util.regex.Pattern; public class VersionKeyDirective implements KeyDirective { - private static final Pattern VERSION_PATTERN = Pattern.compile("^\\$\\$(>=|<=|>|<|!=|==)?([\\d][\\d.]*)(?:~([\\d][\\d.]*))?(?:#.*)?$"); + private static final Pattern VERSION_PATTERN = Pattern.compile("^(>=|<=|>|<|!=|==)?([\\d][\\d.]*)(?:~([\\d][\\d.]*))?(?:#.*)?$"); @Override public boolean matches(@NotNull String key) { @@ -20,7 +21,9 @@ public boolean matches(@NotNull String key) { @Override public void handleBlockMerge(@NotNull Map targetMap, @NotNull String key, @NotNull Node valueNode, @NotNull SmartConstructor constructor) { - if (!evaluate(key)) return; + if (!evaluate(key)) { + return; + } if (!(valueNode instanceof MappingNode mappingNode)) { return; @@ -34,13 +37,17 @@ public void handleBlockMerge(@NotNull Map targetMap, @NotNull St @Override @Nullable public Object handleValueSelect(@NotNull String key, @NotNull Node valueNode, @NotNull SmartConstructor constructor) { - if (!evaluate(key)) return null; + if (!evaluate(key)) { + return null; + } return constructor.constructObjectPublic(valueNode); } private static boolean evaluate(@NotNull String key) { Matcher m = VERSION_PATTERN.matcher(key); - if (!m.matches()) return false; + if (!m.matches()) { + return false; + } String operator = m.group(1); String verA = m.group(2); @@ -56,23 +63,27 @@ private static boolean evaluate(@NotNull String key) { NmsVersion target = resolve(verA); - if (operator == null || operator.isEmpty()) return current == target; + if (operator == null || operator.isEmpty()) { + return current == target; + } return switch (operator) { - case ">=" -> current.isAtLeast(target); - case ">" -> current.isNewerThan(target); - case "<=" -> current.isAtMost(target); - case "<" -> current.isOlderThan(target); - case "==" -> current == target; - case "!=" -> current != target; - default -> false; + case ">=" -> current.isAtLeast(target); + case ">" -> current.isNewerThan(target); + case "<=" -> current.isAtMost(target); + case "<" -> current.isOlderThan(target); + case "==" -> current == target; + case "!=" -> current != target; + default -> false; }; } private static NmsVersion resolve(@NotNull String versionStr) { Matcher m = Pattern.compile("(\\d+\\.\\d+)(\\.\\d+)?").matcher(versionStr); - if (!m.find()) return NmsVersion.UNKNOWN; + if (!m.find()) { + return NmsVersion.UNKNOWN; + } - String base = m.group(1).replace(".", ""); + String base = m.group(1).replace(".", ""); String patch = m.group(2) != null ? m.group(2).replace(".", "") : "0"; int target; try { @@ -84,12 +95,16 @@ private static NmsVersion resolve(@NotNull String versionStr) { NmsVersion best = NmsVersion.UNKNOWN; int bestDiff = Integer.MAX_VALUE; for (NmsVersion v : NmsVersion.values()) { - if (v == NmsVersion.UNKNOWN) continue; + if (v == NmsVersion.UNKNOWN) { + continue; + } int diff = Math.abs(versionInt(v) - target); if (diff < bestDiff) { - bestDiff = diff; best = v; - if (diff == 0) + bestDiff = diff; + best = v; + if (diff == 0) { break; + } } } return best; @@ -97,14 +112,18 @@ private static NmsVersion resolve(@NotNull String versionStr) { private static int versionInt(@NotNull NmsVersion v) { String name = v.name(); - if (!name.startsWith("V_")) return Integer.MAX_VALUE; + if (!name.startsWith("V_")) { + return Integer.MAX_VALUE; + } String[] p = name.substring(2).split("_"); try { return switch (p.length) { - case 2 -> Integer.parseInt(p[0] + p[1] + "0"); - case 3 -> Integer.parseInt(p[0] + p[1] + p[2]); + case 2 -> Integer.parseInt(p[0] + p[1] + "0"); + case 3 -> Integer.parseInt(p[0] + p[1] + p[2]); default -> Integer.MAX_VALUE; }; - } catch (NumberFormatException e) { return Integer.MAX_VALUE; } + } catch (NumberFormatException e) { + return Integer.MAX_VALUE; + } } } \ No newline at end of file diff --git a/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/file/FileConfiguration.java b/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/file/FileConfiguration.java new file mode 100644 index 00000000..e8d1bacb --- /dev/null +++ b/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/file/FileConfiguration.java @@ -0,0 +1,89 @@ +package fr.robie.craftengineconverter.common.utils.yaml.file; + +import com.google.common.base.Preconditions; +import com.google.common.io.Files; +import fr.robie.craftengineconverter.api.yaml.Configuration; +import fr.robie.craftengineconverter.common.utils.yaml.MemoryConfiguration; +import org.bukkit.configuration.InvalidConfigurationException; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.io.*; +import java.nio.charset.StandardCharsets; + +public abstract class FileConfiguration extends MemoryConfiguration { + + public FileConfiguration() { + super(); + } + + public FileConfiguration(@Nullable Configuration defaults) { + super(defaults); + } + + public void save(@NotNull File file) throws IOException { + Preconditions.checkNotNull(file, "File cannot be null"); + + Files.createParentDirs(file); + + String data = this.saveToString(); + + try (Writer writer = new OutputStreamWriter(new FileOutputStream(file), StandardCharsets.UTF_8)) { + writer.write(data); + } + } + + public void save(@NotNull String file) throws IOException { + Preconditions.checkNotNull(file, "File cannot be null"); + + this.save(new File(file)); + } + + @NotNull + public abstract String saveToString(); + + public void load(@NotNull File file) throws IOException, InvalidConfigurationException { + Preconditions.checkNotNull(file, "File cannot be null"); + + final FileInputStream stream = new FileInputStream(file); + + this.load(new InputStreamReader(stream, StandardCharsets.UTF_8)); + } + + public void load(@NotNull Reader reader) throws IOException, InvalidConfigurationException { + BufferedReader input = reader instanceof BufferedReader ? (BufferedReader) reader : new BufferedReader(reader); + + StringBuilder builder = new StringBuilder(); + + try { + String line; + + while ((line = input.readLine()) != null) { + builder.append(line); + builder.append('\n'); + } + } finally { + input.close(); + } + + this.loadFromString(builder.toString()); + } + + public void load(@NotNull String file) throws IOException, InvalidConfigurationException { + Preconditions.checkNotNull(file, "File cannot be null"); + + this.load(new File(file)); + } + + public abstract void loadFromString(@NotNull String contents) throws InvalidConfigurationException; + + @NotNull + @Override + public FileConfigurationOptions options() { + if (this.options == null) { + this.options = new FileConfigurationOptions(this); + } + + return (FileConfigurationOptions) this.options; + } +} diff --git a/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/file/FileConfigurationOptions.java b/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/file/FileConfigurationOptions.java new file mode 100644 index 00000000..4499b659 --- /dev/null +++ b/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/file/FileConfigurationOptions.java @@ -0,0 +1,71 @@ +package fr.robie.craftengineconverter.common.utils.yaml.file; + +import fr.robie.craftengineconverter.common.utils.yaml.MemoryConfiguration; +import fr.robie.craftengineconverter.common.utils.yaml.MemoryConfigurationOptions; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.Collections; +import java.util.List; + +public class FileConfigurationOptions extends MemoryConfigurationOptions { + private List header = Collections.emptyList(); + private List footer = Collections.emptyList(); + private boolean parseComments = true; + + protected FileConfigurationOptions(@NotNull MemoryConfiguration configuration) { + super(configuration); + } + + @NotNull + @Override + public FileConfiguration configuration() { + return (FileConfiguration) super.configuration(); + } + + @NotNull + @Override + public FileConfigurationOptions copyDefaults(boolean value) { + super.copyDefaults(value); + return this; + } + + @NotNull + @Override + public FileConfigurationOptions pathSeparator(char value) { + super.pathSeparator(value); + return this; + } + + @NotNull + public List getHeader() { + return this.header; + } + + @NotNull + public FileConfigurationOptions setHeader(@Nullable List value) { + this.header = (value == null) ? Collections.emptyList() : Collections.unmodifiableList(value); + return this; + } + + @NotNull + public List getFooter() { + return this.footer; + } + + @NotNull + public FileConfigurationOptions setFooter(@Nullable List value) { + this.footer = (value == null) ? Collections.emptyList() : Collections.unmodifiableList(value); + return this; + } + + public boolean parseComments() { + return this.parseComments; + } + + @NotNull + public MemoryConfigurationOptions parseComments(boolean value) { + this.parseComments = value; + return this; + } +} diff --git a/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/file/YamlConfiguration.java b/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/file/YamlConfiguration.java new file mode 100644 index 00000000..4775b775 --- /dev/null +++ b/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/file/YamlConfiguration.java @@ -0,0 +1,276 @@ +package fr.robie.craftengineconverter.common.utils.yaml.file; + +import com.google.common.base.Preconditions; +import fr.robie.craftengineconverter.api.logger.Logger; +import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; +import fr.robie.craftengineconverter.common.utils.yaml.constructor.SmartConstructor; +import fr.robie.craftengineconverter.common.utils.yaml.serialization.ConfigurationSerialization; +import org.bukkit.configuration.InvalidConfigurationException; +import org.jetbrains.annotations.NotNull; +import org.yaml.snakeyaml.DumperOptions; +import org.yaml.snakeyaml.LoaderOptions; +import org.yaml.snakeyaml.Yaml; +import org.yaml.snakeyaml.comments.CommentLine; +import org.yaml.snakeyaml.comments.CommentType; +import org.yaml.snakeyaml.error.YAMLException; +import org.yaml.snakeyaml.nodes.*; +import org.yaml.snakeyaml.reader.UnicodeReader; + +import java.io.*; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; + +public class YamlConfiguration extends FileConfiguration { + private final DumperOptions yamlDumperOptions; + private final LoaderOptions yamlLoaderOptions; + private final SmartConstructor constructor; + private final YamlRepresenter representer; + private final Yaml yaml; + + public YamlConfiguration() { + this.yamlDumperOptions = new DumperOptions(); + this.yamlDumperOptions.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK); + this.yamlLoaderOptions = new LoaderOptions(); + this.yamlLoaderOptions.setMaxAliasesForCollections(Integer.MAX_VALUE); + this.yamlLoaderOptions.setCodePointLimit(Integer.MAX_VALUE); + this.yamlLoaderOptions.setNestingDepthLimit(100); + + this.constructor = new SmartConstructor(this.yamlLoaderOptions); + this.representer = new YamlRepresenter(this.yamlDumperOptions); + this.representer.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK); + + this.yaml = new Yaml(this.constructor, this.representer, this.yamlDumperOptions, this.yamlLoaderOptions); + } + + @NotNull + @Override + public String saveToString() { + this.yamlDumperOptions.setIndent(this.options().indent()); + this.yamlDumperOptions.setWidth(this.options().width()); + this.yamlDumperOptions.setProcessComments(this.options().parseComments()); + + MappingNode node = this.toNodeTree(this); + + node.setBlockComments(this.getCommentLines(this.saveHeader(this.options().getHeader()), CommentType.BLOCK)); + node.setEndComments(this.getCommentLines(this.options().getFooter(), CommentType.BLOCK)); + + StringWriter writer = new StringWriter(); + if (node.getBlockComments().isEmpty() && node.getEndComments().isEmpty() && node.getValue().isEmpty()) { + writer.write(""); + } else { + if (node.getValue().isEmpty()) { + node.setFlowStyle(DumperOptions.FlowStyle.FLOW); + } + this.yaml.serialize(node, writer); + } + return writer.toString(); + } + + @Override + public void loadFromString(@NotNull String contents) throws InvalidConfigurationException { + Preconditions.checkNotNull(contents, "Contents cannot be null"); + this.yamlLoaderOptions.setProcessComments(this.options().parseComments()); + this.yamlLoaderOptions.setCodePointLimit(this.options().codePointLimit()); + + MappingNode node; + try (Reader reader = new UnicodeReader(new ByteArrayInputStream(contents.getBytes(StandardCharsets.UTF_8)))) { + Node rawNode = this.yaml.compose(reader); + try { + node = (MappingNode) rawNode; + } catch (ClassCastException e) { + throw new InvalidConfigurationException("Top level is not a Map."); + } + } catch (YAMLException | IOException | ClassCastException e) { + throw new InvalidConfigurationException(e); + } + + this.map.clear(); + + if (node != null) { + this.adjustNodeComments(node); + this.options().setHeader(this.loadHeader(this.getCommentLines(node.getBlockComments()))); + this.options().setFooter(this.getCommentLines(node.getEndComments())); + this.fromNodeTree(node, this); + } + } + + private void adjustNodeComments(final MappingNode node) { + if (node.getBlockComments() == null && !node.getValue().isEmpty()) { + Node firstNode = node.getValue().getFirst().getKeyNode(); + List lines = firstNode.getBlockComments(); + if (lines != null) { + int index = -1; + for (int i = 0; i < lines.size(); i++) { + if (lines.get(i).getCommentType() == CommentType.BLANK_LINE) { + index = i; + } + } + if (index != -1) { + node.setBlockComments(lines.subList(0, index + 1)); + firstNode.setBlockComments(lines.subList(index + 1, lines.size())); + } + } + } + } + + private void fromNodeTree(@NotNull MappingNode input, @NotNull ConfigurationSection section) { + this.constructor.flattenMapping(input); + for (NodeTuple nodeTuple : input.getValue()) { + Node key = nodeTuple.getKeyNode(); + String keyString = String.valueOf(this.constructor.construct(key)); + Node value = nodeTuple.getValueNode(); + + while (value instanceof AnchorNode) { + value = ((AnchorNode) value).getRealNode(); + } + + if (value instanceof MappingNode && !this.hasSerializedTypeKey((MappingNode) value)) { + this.fromNodeTree((MappingNode) value, section.createSection(keyString)); + } else { + section.set(keyString, this.constructor.construct(value)); + } + + section.setComments(keyString, this.getCommentLines(key.getBlockComments())); + if (value instanceof MappingNode || value instanceof SequenceNode) { + section.setInlineComments(keyString, this.getCommentLines(key.getInLineComments())); + } else { + section.setInlineComments(keyString, this.getCommentLines(value.getInLineComments())); + } + } + } + + private boolean hasSerializedTypeKey(MappingNode node) { + for (NodeTuple nodeTuple : node.getValue()) { + Node keyNode = nodeTuple.getKeyNode(); + if (!(keyNode instanceof ScalarNode)) { + continue; + } + String key = ((ScalarNode) keyNode).getValue(); + if (key.equals(ConfigurationSerialization.SERIALIZED_TYPE_KEY)) { + return true; + } + } + return false; + } + + private MappingNode toNodeTree(@NotNull ConfigurationSection section) { + List nodeTuples = new ArrayList<>(); + for (Map.Entry entry : section.getValues(false).entrySet()) { + Node key = this.representer.represent(entry.getKey()); + Node value; + if (entry.getValue() instanceof ConfigurationSection) { + value = this.toNodeTree((ConfigurationSection) entry.getValue()); + } else { + value = this.representer.represent(entry.getValue()); + } + key.setBlockComments(this.getCommentLines(section.getComments(entry.getKey()), CommentType.BLOCK)); + if (value instanceof MappingNode || value instanceof SequenceNode) { + key.setInLineComments(this.getCommentLines(section.getInlineComments(entry.getKey()), CommentType.IN_LINE)); + } else { + value.setInLineComments(this.getCommentLines(section.getInlineComments(entry.getKey()), CommentType.IN_LINE)); + } + + nodeTuples.add(new NodeTuple(key, value)); + } + + return new MappingNode(Tag.MAP, nodeTuples, DumperOptions.FlowStyle.BLOCK); + } + + private List getCommentLines(List comments) { + List lines = new ArrayList<>(); + if (comments != null) { + for (CommentLine comment : comments) { + if (comment.getCommentType() == CommentType.BLANK_LINE) { + lines.add(null); + } else { + String line = comment.getValue(); + line = line.startsWith(" ") ? line.substring(1) : line; + lines.add(line); + } + } + } + return lines; + } + + private List getCommentLines(List comments, CommentType commentType) { + List lines = new ArrayList(); + for (String comment : comments) { + if (comment == null) { + lines.add(new CommentLine(null, null, "", CommentType.BLANK_LINE)); + } else { + String line = comment; + line = line.isEmpty() ? line : " " + line; + lines.add(new CommentLine(null, null, line, commentType)); + } + } + return lines; + } + + private List loadHeader(List header) { + LinkedList list = new LinkedList<>(header); + + if (!list.isEmpty()) { + list.removeLast(); + } + + while (!list.isEmpty() && list.peek() == null) { + list.remove(); + } + + return list; + } + + private List saveHeader(List header) { + LinkedList list = new LinkedList<>(header); + + if (!list.isEmpty()) { + list.add(null); + } + + return list; + } + + @NotNull + @Override + public YamlConfigurationOptions options() { + if (this.options == null) { + this.options = new YamlConfigurationOptions(this); + } + + return (YamlConfigurationOptions) this.options; + } + + @NotNull + public static YamlConfiguration loadConfiguration(@NotNull File file) { + Preconditions.checkNotNull(file, "File cannot be null"); + + YamlConfiguration config = new YamlConfiguration(); + + try { + config.load(file); + } catch (FileNotFoundException ignored) { + } catch (IOException | InvalidConfigurationException ex) { + Logger.showException("Cannot load configuration from file: " + file, ex); + } + + return config; + } + + @NotNull + public static YamlConfiguration loadConfiguration(@NotNull Reader reader) { + Preconditions.checkNotNull(reader, "Reader cannot be null"); + + YamlConfiguration config = new YamlConfiguration(); + + try { + config.load(reader); + } catch (IOException | InvalidConfigurationException ex) { + Logger.showException("Cannot load configuration from stream.", ex); + } + + return config; + } +} diff --git a/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/file/YamlConfigurationOptions.java b/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/file/YamlConfigurationOptions.java new file mode 100644 index 00000000..d3b49e5b --- /dev/null +++ b/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/file/YamlConfigurationOptions.java @@ -0,0 +1,91 @@ +package fr.robie.craftengineconverter.common.utils.yaml.file; + +import com.google.common.base.Preconditions; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.List; + +public class YamlConfigurationOptions extends FileConfigurationOptions { + private int indent = 2; + private int width = 80; + private int codePointLimit = Integer.MAX_VALUE; + + protected YamlConfigurationOptions(@NotNull YamlConfiguration configuration) { + super(configuration); + } + + @NotNull + @Override + public YamlConfiguration configuration() { + return (YamlConfiguration) super.configuration(); + } + + @NotNull + @Override + public YamlConfigurationOptions copyDefaults(boolean value) { + super.copyDefaults(value); + return this; + } + + @NotNull + @Override + public YamlConfigurationOptions pathSeparator(char value) { + super.pathSeparator(value); + return this; + } + + @NotNull + @Override + public YamlConfigurationOptions setHeader(@Nullable List value) { + super.setHeader(value); + return this; + } + + @NotNull + @Override + public YamlConfigurationOptions setFooter(@Nullable List value) { + super.setFooter(value); + return this; + } + + @NotNull + @Override + public YamlConfigurationOptions parseComments(boolean value) { + super.parseComments(value); + return this; + } + + public int indent() { + return this.indent; + } + + @NotNull + public YamlConfigurationOptions indent(int value) { + Preconditions.checkArgument(value >= 2, "Indent must be at least 2 characters"); + Preconditions.checkArgument(value <= 9, "Indent cannot be greater than 9 characters"); + + this.indent = value; + return this; + } + + public int width() { + return this.width; + } + + @NotNull + public YamlConfigurationOptions width(int value) { + this.width = value; + return this; + } + + public int codePointLimit() { + return this.codePointLimit; + } + + @NotNull + public YamlConfigurationOptions codePointLimit(int codePointLimit) { + this.codePointLimit = codePointLimit; + return this; + } +} diff --git a/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/file/YamlRepresenter.java b/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/file/YamlRepresenter.java new file mode 100644 index 00000000..83abed29 --- /dev/null +++ b/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/file/YamlRepresenter.java @@ -0,0 +1,44 @@ +package fr.robie.craftengineconverter.common.utils.yaml.file; + +import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; +import fr.robie.craftengineconverter.common.utils.yaml.serialization.ConfigurationSerialization; +import org.bukkit.configuration.serialization.ConfigurationSerializable; +import org.jetbrains.annotations.NotNull; +import org.yaml.snakeyaml.DumperOptions; +import org.yaml.snakeyaml.nodes.Node; +import org.yaml.snakeyaml.representer.Representer; + +import java.util.LinkedHashMap; +import java.util.Map; + +public class YamlRepresenter extends Representer { + + public YamlRepresenter(@NotNull DumperOptions options) { + super(options); + this.multiRepresenters.put(ConfigurationSection.class, new RepresentConfigurationSection()); + this.multiRepresenters.put(ConfigurationSerializable.class, new RepresentConfigurationSerializable()); + this.multiRepresenters.remove(Enum.class); + } + + private class RepresentConfigurationSection extends RepresentMap { + @NotNull + @Override + public Node representData(@NotNull Object data) { + return super.representData(((ConfigurationSection) data).getValues(false)); + } + } + + private class RepresentConfigurationSerializable extends RepresentMap { + + @NotNull + @Override + public Node representData(@NotNull Object data) { + ConfigurationSerializable serializable = (ConfigurationSerializable) data; + Map values = new LinkedHashMap<>(); + values.put(ConfigurationSerialization.SERIALIZED_TYPE_KEY, ConfigurationSerialization.getAlias(serializable.getClass())); + values.putAll(serializable.serialize()); + + return super.representData(values); + } + } +} diff --git a/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/serialization/ConfigurationSerialization.java b/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/serialization/ConfigurationSerialization.java new file mode 100644 index 00000000..df070650 --- /dev/null +++ b/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/serialization/ConfigurationSerialization.java @@ -0,0 +1,220 @@ +package fr.robie.craftengineconverter.common.utils.yaml.serialization; + +import com.google.common.base.Preconditions; +import org.bukkit.Color; +import org.bukkit.FireworkEffect; +import org.bukkit.Location; +import org.bukkit.attribute.AttributeModifier; +import org.bukkit.block.banner.Pattern; +import org.bukkit.block.spawner.SpawnRule; +import org.bukkit.configuration.serialization.ConfigurationSerializable; +import org.bukkit.configuration.serialization.DelegateDeserialization; +import org.bukkit.configuration.serialization.SerializableAs; +import org.bukkit.inventory.ItemStack; +import org.bukkit.potion.PotionEffect; +import org.bukkit.util.BlockVector; +import org.bukkit.util.BoundingBox; +import org.bukkit.util.Vector; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.lang.reflect.Constructor; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.lang.reflect.Modifier; +import java.util.HashMap; +import java.util.Map; +import java.util.logging.Level; +import java.util.logging.Logger; + +public class ConfigurationSerialization { + public static final String SERIALIZED_TYPE_KEY = "=="; + private final Class clazz; + private static final Map> aliases = new HashMap<>(); + + static { + registerClass(Vector.class); + registerClass(BlockVector.class); + registerClass(ItemStack.class); + registerClass(Color.class); + registerClass(PotionEffect.class); + registerClass(FireworkEffect.class); + registerClass(Pattern.class); + registerClass(Location.class); + registerClass(AttributeModifier.class); + registerClass(BoundingBox.class); + registerClass(SpawnRule.class); + } + + protected ConfigurationSerialization(@NotNull Class clazz) { + this.clazz = clazz; + } + + @Nullable + protected Method getMethod(@NotNull String name) { + try { + Method method = this.clazz.getDeclaredMethod(name, Map.class); + + if (!ConfigurationSerializable.class.isAssignableFrom(method.getReturnType())) { + return null; + } + if (!Modifier.isStatic(method.getModifiers())) { + return null; + } + + return method; + } catch (NoSuchMethodException | SecurityException ex) { + return null; + } + } + + @Nullable + protected Constructor getConstructor() { + try { + return this.clazz.getConstructor(Map.class); + } catch (NoSuchMethodException | SecurityException ex) { + return null; + } + } + + @Nullable + protected ConfigurationSerializable deserializeViaMethod(@NotNull Method method, @NotNull Map args) { + try { + ConfigurationSerializable result = (ConfigurationSerializable) method.invoke(null, args); + + if (result == null) { + Logger.getLogger(ConfigurationSerialization.class.getName()).log(Level.SEVERE, "Could not call method '" + method + "' of " + this.clazz + " for deserialization: method returned null"); + } else { + return result; + } + } catch (Throwable ex) { + Logger.getLogger(ConfigurationSerialization.class.getName()).log( + Level.SEVERE, + "Could not call method '" + method + "' of " + this.clazz + " for deserialization", + ex instanceof InvocationTargetException ? ex.getCause() : ex); + } + + return null; + } + + @Nullable + protected ConfigurationSerializable deserializeViaCtor(@NotNull Constructor ctor, @NotNull Map args) { + try { + return ctor.newInstance(args); + } catch (Throwable ex) { + Logger.getLogger(ConfigurationSerialization.class.getName()).log( + Level.SEVERE, + "Could not call constructor '" + ctor + "' of " + this.clazz + " for deserialization", + ex instanceof InvocationTargetException ? ex.getCause() : ex); + } + + return null; + } + + @Nullable + public ConfigurationSerializable deserialize(@NotNull Map args) { + Preconditions.checkArgument(args != null, "Args must not be null"); + + ConfigurationSerializable result = null; + Method method = this.getMethod("deserialize"); + + if (method != null) { + result = this.deserializeViaMethod(method, args); + } + + if (result == null) { + method = this.getMethod("valueOf"); + + if (method != null) { + result = this.deserializeViaMethod(method, args); + } + } + + if (result == null) { + Constructor constructor = this.getConstructor(); + + if (constructor != null) { + result = this.deserializeViaCtor(constructor, args); + } + } + + return result; + } + + @Nullable + public static ConfigurationSerializable deserializeObject(@NotNull Map args, @NotNull Class clazz) { + return new ConfigurationSerialization(clazz).deserialize(args); + } + + @Nullable + public static ConfigurationSerializable deserializeObject(@NotNull Map args) { + Class clazz; + + if (args.containsKey(SERIALIZED_TYPE_KEY)) { + try { + String alias = (String) args.get(SERIALIZED_TYPE_KEY); + + if (alias == null) { + throw new IllegalArgumentException("Cannot have null alias"); + } + clazz = getClassByAlias(alias); + if (clazz == null) { + throw new IllegalArgumentException("Specified class does not exist ('" + alias + "')"); + } + } catch (ClassCastException ex) { + ex.fillInStackTrace(); + throw ex; + } + } else { + throw new IllegalArgumentException("Args doesn't contain type key ('" + SERIALIZED_TYPE_KEY + "')"); + } + + return new ConfigurationSerialization(clazz).deserialize(args); + } + + public static void registerClass(@NotNull Class clazz) { + DelegateDeserialization delegate = clazz.getAnnotation(DelegateDeserialization.class); + + if (delegate == null) { + registerClass(clazz, getAlias(clazz)); + registerClass(clazz, clazz.getName()); + } + } + + public static void registerClass(@NotNull Class clazz, @NotNull String alias) { + aliases.put(alias, clazz); + } + + public static void unregisterClass(@NotNull String alias) { + aliases.remove(alias); + } + + public static void unregisterClass(@NotNull Class clazz) { + while (aliases.values().remove(clazz)) { + } + } + + @Nullable + public static Class getClassByAlias(@NotNull String alias) { + return aliases.get(alias); + } + + @NotNull + public static String getAlias(@NotNull Class clazz) { + DelegateDeserialization delegate = clazz.getAnnotation(DelegateDeserialization.class); + + if (delegate != null) { + if (delegate.value() != clazz) { + return getAlias(delegate.value()); + } + } + + SerializableAs alias = clazz.getAnnotation(SerializableAs.class); + + if (alias != null) { + return alias.value(); + } + + return clazz.getName(); + } +} From 77b6bf7c80b5f5c512d739476885a17090439b4f Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Tue, 7 Apr 2026 11:28:42 +0200 Subject: [PATCH 011/116] feat: simplify annotations in configuration classes --- .../craftengineconverter/api/yaml/ConfigurationSection.java | 6 ++---- .../common/utils/yaml/MemoryConfigurationOptions.java | 4 +++- .../common/utils/yaml/MemorySection.java | 3 +-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/yaml/ConfigurationSection.java b/API/src/main/java/fr/robie/craftengineconverter/api/yaml/ConfigurationSection.java index 34afe12f..f56b7300 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/yaml/ConfigurationSection.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/yaml/ConfigurationSection.java @@ -10,11 +10,9 @@ import java.util.Set; public interface ConfigurationSection { - @NotNull - Set getKeys(boolean deep); + @NotNull Set getKeys(boolean deep); - @NotNull - Map getValues(boolean deep); + @NotNull Map getValues(boolean deep); boolean contains(@NotNull String path); diff --git a/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/MemoryConfigurationOptions.java b/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/MemoryConfigurationOptions.java index bec62865..e32eab47 100644 --- a/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/MemoryConfigurationOptions.java +++ b/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/MemoryConfigurationOptions.java @@ -1,8 +1,10 @@ package fr.robie.craftengineconverter.common.utils.yaml; +import fr.robie.craftengineconverter.api.yaml.ConfigurationOptions; import org.jetbrains.annotations.NotNull; -public class MemoryConfigurationOptions extends fr.robie.craftengineconverter.api.yaml.ConfigurationOptions { +public class MemoryConfigurationOptions extends ConfigurationOptions { + protected MemoryConfigurationOptions(@NotNull MemoryConfiguration configuration) { super(configuration); } diff --git a/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/MemorySection.java b/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/MemorySection.java index 88f511b4..ddef47b1 100644 --- a/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/MemorySection.java +++ b/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/MemorySection.java @@ -46,8 +46,7 @@ protected MemorySection(@NotNull fr.robie.craftengineconverter.api.yaml.Configur } @Override - @NotNull - public Set getKeys(boolean deep) { + public @NotNull Set getKeys(boolean deep) { Set result = new LinkedHashSet(); fr.robie.craftengineconverter.api.yaml.Configuration root = this.getRoot(); From 9f4aa528fc63c6a1a8b5f5f62a3217783471d479 Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Wed, 29 Apr 2026 17:19:45 +0200 Subject: [PATCH 012/116] feat: enhance Bedrock item loading with texture and mapping configurations --- .../bedrock/ItemTextureConfiguration.java | 55 +++++++++ .../bedrock/mapping/item/ItemMapping.java | 28 +++++ .../bedrock/texture/TextureData.java | 40 ++++++ .../models/AbstractConditionLoader.java | 12 ++ .../models/ModelConfigurationLoader.java | 11 ++ .../models/ModelConfigurationRegistry.java | 53 ++++++++ .../CompositeModelConfigurationLoader.java | 28 +++++ .../condition/ComponentConditionLoader.java | 28 +++++ .../ConditionModelConfigurationLoader.java | 23 ++++ .../CustomModelDataConditionLoader.java | 20 +++ .../HasComponentConditionLoader.java | 25 ++++ .../condition/KeybindDownConditionLoader.java | 23 ++++ .../model/SimpleModelConfigurationLoader.java | 49 ++++++++ .../models/tints/TintConfigurationLoader.java | 13 ++ .../tints/TintConfigurationRegistry.java | 114 ++++++++++++++++++ .../api/yaml/ConfigurationSection.java | 3 + .../converter/bedrock/BedrockConverter.java | 35 ++++-- .../converter/bedrock/BedrockItemLoader.java | 82 +++++++++++++ .../loader/MessageLoader.java | 1 - 19 files changed, 635 insertions(+), 8 deletions(-) create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/ItemTextureConfiguration.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/texture/TextureData.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/AbstractConditionLoader.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/ModelConfigurationLoader.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/ModelConfigurationRegistry.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/composite/CompositeModelConfigurationLoader.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/condition/ComponentConditionLoader.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/condition/ConditionModelConfigurationLoader.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/condition/CustomModelDataConditionLoader.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/condition/HasComponentConditionLoader.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/condition/KeybindDownConditionLoader.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/model/SimpleModelConfigurationLoader.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/tints/TintConfigurationLoader.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/tints/TintConfigurationRegistry.java create mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockItemLoader.java diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/ItemTextureConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/ItemTextureConfiguration.java new file mode 100644 index 00000000..de6d6dd4 --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/ItemTextureConfiguration.java @@ -0,0 +1,55 @@ +package fr.robie.craftengineconverter.api.configuration.bedrock; + +import com.google.gson.JsonObject; +import fr.robie.craftengineconverter.api.configuration.bedrock.texture.TextureData; +import fr.robie.craftengineconverter.api.manager.FileCacheManager; +import org.jetbrains.annotations.NotNull; + +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.List; + +public class ItemTextureConfiguration { + private String resourcePackName; + private String textureName; + + private final List textures = new ArrayList<>(); + + public ItemTextureConfiguration setResourcePackName(String resourcePackName) { + this.resourcePackName = resourcePackName; + return this; + } + + public ItemTextureConfiguration setTextureName(String textureName) { + this.textureName = textureName; + return this; + } + + public ItemTextureConfiguration addTextureData(@NotNull TextureData textureData) { + this.textures.add(textureData); + return this; + } + + public void save(@NotNull Path directory) { + JsonObject jsonObject = new JsonObject(); + + if (this.resourcePackName != null) { + jsonObject.addProperty("resource_pack_name", this.resourcePackName); + } + + if (this.textureName != null) { + jsonObject.addProperty("texture_name", this.textureName); + } + + if (!this.textures.isEmpty()) { + JsonObject texturesObject = new JsonObject(); + for (TextureData textureData : this.textures) { + texturesObject.add(textureData.getBedrockIdentifier(), textureData.serialize()); + } + jsonObject.add("texture_data", texturesObject); + } + + FileCacheManager.saveJsonToFile(directory.resolve("textures").resolve("item_texture.json"), jsonObject); + } + +} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/ItemMapping.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/ItemMapping.java index 4be41a34..93b2b17a 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/ItemMapping.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/ItemMapping.java @@ -3,8 +3,11 @@ import com.google.gson.JsonObject; import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.component.BedrockComponent; import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.option.BedrockOptions; +import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate.BedrockPredicate; +import fr.robie.craftengineconverter.api.configuration.bedrock.texture.TextureData; import org.bukkit.Material; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; import java.util.ArrayList; import java.util.List; @@ -16,9 +19,12 @@ public abstract class ItemMapping { private String displayName; private BedrockOptions bedrockOptions; + private BedrockPredicate bedrockPredicate; private final List bedrockComponents = new ArrayList<>(); + private TextureData textureData; + public ItemMapping(@NotNull Material javaMaterial, @NotNull String bedrockIdentifier) { this.javaMaterial = javaMaterial; this.bedrockIdentifier = bedrockIdentifier; @@ -39,6 +45,24 @@ public ItemMapping addBedrockComponent(@NotNull BedrockComponent component) { return this; } + public ItemMapping setBedrockPredicate(BedrockPredicate bedrockPredicate) { + this.bedrockPredicate = bedrockPredicate; + return this; + } + + @NotNull + public TextureData getOrCreateTextureData() { + if (this.textureData == null) { + this.textureData = new TextureData(this.bedrockIdentifier); + } + return this.textureData; + } + + @Nullable + public TextureData getTextureData() { + return this.textureData; + } + public Material getJavaMaterial() { return this.javaMaterial; } @@ -66,6 +90,10 @@ public JsonObject serialize() { jsonObject.add("components", componentsObject); } + if (this.bedrockPredicate != null) { + jsonObject.add("predicate", this.bedrockPredicate.serialize()); + } + return jsonObject; } } diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/texture/TextureData.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/texture/TextureData.java new file mode 100644 index 00000000..0d395632 --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/texture/TextureData.java @@ -0,0 +1,40 @@ +package fr.robie.craftengineconverter.api.configuration.bedrock.texture; + +import com.google.gson.JsonArray; +import com.google.gson.JsonObject; +import org.jetbrains.annotations.NotNull; + +import java.util.ArrayList; +import java.util.List; + +public class TextureData { + private final String bedrockIdentifier; + + private final List textures = new ArrayList<>(); + + public TextureData(@NotNull String bedrockIdentifier) { + this.bedrockIdentifier = bedrockIdentifier; + } + + public String getBedrockIdentifier() { + return this.bedrockIdentifier; + } + + public JsonObject serialize() { + JsonObject jsonObject = new JsonObject(); + + if (!this.textures.isEmpty()) { + if (this.textures.size() == 1) { + jsonObject.addProperty("textures", this.textures.getFirst()); + } else { + JsonArray texturesArray = new JsonArray(); + for (String texture : this.textures) { + texturesArray.add(texture); + } + jsonObject.add("textures", texturesArray); + } + } + + return jsonObject; + } +} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/AbstractConditionLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/AbstractConditionLoader.java new file mode 100644 index 00000000..c61a45f6 --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/AbstractConditionLoader.java @@ -0,0 +1,12 @@ +package fr.robie.craftengineconverter.api.configuration.loader.models; + +import fr.robie.craftengineconverter.api.configuration.item.models.condition.ConditionModelConfiguration; +import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; + +public abstract class AbstractConditionLoader implements ModelConfigurationLoader { + + protected void loadBranches(ConditionModelConfiguration config, ConfigurationSection section) { + config.setOnTrue(ModelConfigurationRegistry.load(section.getConfigurationSection("on-true"))); + config.setOnFalse(ModelConfigurationRegistry.load(section.getConfigurationSection("on-false"))); + } +} \ No newline at end of file diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/ModelConfigurationLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/ModelConfigurationLoader.java new file mode 100644 index 00000000..d2be8549 --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/ModelConfigurationLoader.java @@ -0,0 +1,11 @@ +package fr.robie.craftengineconverter.api.configuration.loader.models; + +import fr.robie.craftengineconverter.api.configuration.item.models.ModelConfiguration; +import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +@FunctionalInterface +public interface ModelConfigurationLoader { + @Nullable ModelConfiguration load(@NotNull ConfigurationSection section); +} \ No newline at end of file diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/ModelConfigurationRegistry.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/ModelConfigurationRegistry.java new file mode 100644 index 00000000..f4722082 --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/ModelConfigurationRegistry.java @@ -0,0 +1,53 @@ +package fr.robie.craftengineconverter.api.configuration.loader.models; + +import fr.robie.craftengineconverter.api.configuration.item.models.ModelConfiguration; +import fr.robie.craftengineconverter.api.configuration.loader.models.composite.CompositeModelConfigurationLoader; +import fr.robie.craftengineconverter.api.configuration.loader.models.condition.*; +import fr.robie.craftengineconverter.api.configuration.loader.models.model.SimpleModelConfigurationLoader; +import fr.robie.craftengineconverter.api.logger.LogType; +import fr.robie.craftengineconverter.api.logger.Logger; +import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.HashMap; +import java.util.Map; + +public class ModelConfigurationRegistry { + private static final Map LOADERS = new HashMap<>(); + + static { + register("model", new SimpleModelConfigurationLoader()); + register("composite", new CompositeModelConfigurationLoader()); + register("condition", new ConditionModelConfigurationLoader()); + register("has_component", new HasComponentConditionLoader()); + register("custom_model_data", new CustomModelDataConditionLoader()); + register("keybind_down", new KeybindDownConditionLoader()); + register("component", new ComponentConditionLoader()); + } + + private ModelConfigurationRegistry() { + throw new UnsupportedOperationException("ModelConfigurationRegistry is a utility class and cannot be instantiated."); + } + + public static void register(@NotNull String type, @NotNull ModelConfigurationLoader loader) { + LOADERS.put(type, loader); + } + + @Nullable + public static ModelConfiguration load(@Nullable ConfigurationSection section) { + if (section == null) { + return null; + } + String type = section.getString("type", "model"); + if (type.startsWith("minecraft:")) { + type = type.substring("minecraft:".length()); + } + ModelConfigurationLoader loader = LOADERS.get(type); + if (loader == null) { + Logger.info("Unknown model type '" + type + "', skipping.", LogType.WARNING); + return null; + } + return loader.load(section); + } +} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/composite/CompositeModelConfigurationLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/composite/CompositeModelConfigurationLoader.java new file mode 100644 index 00000000..7699d55a --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/composite/CompositeModelConfigurationLoader.java @@ -0,0 +1,28 @@ +package fr.robie.craftengineconverter.api.configuration.loader.models.composite; + +import fr.robie.craftengineconverter.api.configuration.item.models.ModelConfiguration; +import fr.robie.craftengineconverter.api.configuration.item.models.composite.CompositeModelConfiguration; +import fr.robie.craftengineconverter.api.configuration.loader.models.ModelConfigurationLoader; +import fr.robie.craftengineconverter.api.configuration.loader.models.ModelConfigurationRegistry; +import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.List; + +public class CompositeModelConfigurationLoader implements ModelConfigurationLoader { + @Override + public @Nullable ModelConfiguration load(@NotNull ConfigurationSection section) { + CompositeModelConfiguration config = new CompositeModelConfiguration(); + + List models = section.getSectionList("models"); + for (ConfigurationSection modelSection : models) { + ModelConfiguration child = ModelConfigurationRegistry.load(modelSection); + if (child != null) { + config.addModel(child); + } + } + + return config; + } +} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/condition/ComponentConditionLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/condition/ComponentConditionLoader.java new file mode 100644 index 00000000..2fc55543 --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/condition/ComponentConditionLoader.java @@ -0,0 +1,28 @@ +package fr.robie.craftengineconverter.api.configuration.loader.models.condition; + +import fr.robie.craftengineconverter.api.configuration.item.models.ModelConfiguration; +import fr.robie.craftengineconverter.api.configuration.item.models.condition.ComponentConditionConfiguration; +import fr.robie.craftengineconverter.api.configuration.loader.models.AbstractConditionLoader; +import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +public class ComponentConditionLoader extends AbstractConditionLoader { + + @Override + public @Nullable ModelConfiguration load(@NotNull ConfigurationSection section) { + String predicate = section.getString("predicate"); + if (predicate == null) { + return null; + } + + Object value = section.get("value"); + if (value == null) { + return null; + } + + ComponentConditionConfiguration config = new ComponentConditionConfiguration(predicate, value); + this.loadBranches(config, section); + return config; + } +} \ No newline at end of file diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/condition/ConditionModelConfigurationLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/condition/ConditionModelConfigurationLoader.java new file mode 100644 index 00000000..a87d408c --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/condition/ConditionModelConfigurationLoader.java @@ -0,0 +1,23 @@ +package fr.robie.craftengineconverter.api.configuration.loader.models.condition; + +import fr.robie.craftengineconverter.api.configuration.item.models.ModelConfiguration; +import fr.robie.craftengineconverter.api.configuration.item.models.condition.ConditionModelConfiguration; +import fr.robie.craftengineconverter.api.configuration.loader.models.AbstractConditionLoader; +import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +public class ConditionModelConfigurationLoader extends AbstractConditionLoader { + + @Override + public @Nullable ModelConfiguration load(@NotNull ConfigurationSection section) { + String property = section.getString("property"); + if (property == null) { + return null; + } + + ConditionModelConfiguration config = new ConditionModelConfiguration(property); + this.loadBranches(config, section); + return config; + } +} \ No newline at end of file diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/condition/CustomModelDataConditionLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/condition/CustomModelDataConditionLoader.java new file mode 100644 index 00000000..c0e8e683 --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/condition/CustomModelDataConditionLoader.java @@ -0,0 +1,20 @@ +package fr.robie.craftengineconverter.api.configuration.loader.models.condition; + +import fr.robie.craftengineconverter.api.configuration.item.models.ModelConfiguration; +import fr.robie.craftengineconverter.api.configuration.item.models.condition.CustomModelDataConditionConfiguration; +import fr.robie.craftengineconverter.api.configuration.loader.models.AbstractConditionLoader; +import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +public class CustomModelDataConditionLoader extends AbstractConditionLoader { + + @Override + public @Nullable ModelConfiguration load(@NotNull ConfigurationSection section) { + int index = section.getInt("index", 0); + + CustomModelDataConditionConfiguration config = new CustomModelDataConditionConfiguration(index); + this.loadBranches(config, section); + return config; + } +} \ No newline at end of file diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/condition/HasComponentConditionLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/condition/HasComponentConditionLoader.java new file mode 100644 index 00000000..862f5084 --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/condition/HasComponentConditionLoader.java @@ -0,0 +1,25 @@ +package fr.robie.craftengineconverter.api.configuration.loader.models.condition; + +import fr.robie.craftengineconverter.api.configuration.item.models.ModelConfiguration; +import fr.robie.craftengineconverter.api.configuration.item.models.condition.HasComponentConditionConfiguration; +import fr.robie.craftengineconverter.api.configuration.loader.models.AbstractConditionLoader; +import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +public class HasComponentConditionLoader extends AbstractConditionLoader { + + @Override + public @Nullable ModelConfiguration load(@NotNull ConfigurationSection section) { + String component = section.getString("component"); + if (component == null) { + return null; + } + + boolean ignoreDefault = section.getBoolean("ignore-default", false); + + HasComponentConditionConfiguration config = new HasComponentConditionConfiguration(component, ignoreDefault); + this.loadBranches(config, section); + return config; + } +} \ No newline at end of file diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/condition/KeybindDownConditionLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/condition/KeybindDownConditionLoader.java new file mode 100644 index 00000000..864eab87 --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/condition/KeybindDownConditionLoader.java @@ -0,0 +1,23 @@ +package fr.robie.craftengineconverter.api.configuration.loader.models.condition; + +import fr.robie.craftengineconverter.api.configuration.item.models.ModelConfiguration; +import fr.robie.craftengineconverter.api.configuration.item.models.condition.KeybindDownConditionConfiguration; +import fr.robie.craftengineconverter.api.configuration.loader.models.AbstractConditionLoader; +import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +public class KeybindDownConditionLoader extends AbstractConditionLoader { + + @Override + public @Nullable ModelConfiguration load(@NotNull ConfigurationSection section) { + String keybind = section.getString("keybind"); + if (keybind == null) { + return null; + } + + KeybindDownConditionConfiguration config = new KeybindDownConditionConfiguration(keybind); + this.loadBranches(config, section); + return config; + } +} \ No newline at end of file diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/model/SimpleModelConfigurationLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/model/SimpleModelConfigurationLoader.java new file mode 100644 index 00000000..01ec9130 --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/model/SimpleModelConfigurationLoader.java @@ -0,0 +1,49 @@ +package fr.robie.craftengineconverter.api.configuration.loader.models.model; + +import fr.robie.craftengineconverter.api.configuration.item.models.ModelConfiguration; +import fr.robie.craftengineconverter.api.configuration.item.models.model.GenerationConfiguration; +import fr.robie.craftengineconverter.api.configuration.item.models.model.SimpleModelConfiguration; +import fr.robie.craftengineconverter.api.configuration.item.models.tints.TintConfiguration; +import fr.robie.craftengineconverter.api.configuration.loader.models.ModelConfigurationLoader; +import fr.robie.craftengineconverter.api.configuration.loader.models.tints.TintConfigurationRegistry; +import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.List; + +public class SimpleModelConfigurationLoader implements ModelConfigurationLoader { + + @Override + public @Nullable ModelConfiguration load(@NotNull ConfigurationSection section) { + String path = section.getString("path"); + if (path == null) { + return null; + } + + SimpleModelConfiguration config = new SimpleModelConfiguration(path); + + // generation block (optional) + ConfigurationSection generationSection = section.getConfigurationSection("generation"); + if (generationSection != null) { + String parent = generationSection.getString("parent"); + GenerationConfiguration generation = new GenerationConfiguration(parent); + + ConfigurationSection texturesSection = generationSection.getConfigurationSection("textures"); + if (texturesSection != null) { + for (String key : texturesSection.getKeys(false)) { + String value = texturesSection.getString(key); + if (value != null) { + generation.addTexture(key, value); + } + } + } + config.setGeneration(generation); + } + + List tints = TintConfigurationRegistry.loadList(section, "tints"); + tints.forEach(config::addTint); + + return config; + } +} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/tints/TintConfigurationLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/tints/TintConfigurationLoader.java new file mode 100644 index 00000000..60979d00 --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/tints/TintConfigurationLoader.java @@ -0,0 +1,13 @@ +package fr.robie.craftengineconverter.api.configuration.loader.models.tints; + +import fr.robie.craftengineconverter.api.configuration.item.models.tints.TintConfiguration; +import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +@FunctionalInterface +public interface TintConfigurationLoader { + @Nullable + TintConfiguration load(@NotNull ConfigurationSection section); +} + \ No newline at end of file diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/tints/TintConfigurationRegistry.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/tints/TintConfigurationRegistry.java new file mode 100644 index 00000000..5b548884 --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/tints/TintConfigurationRegistry.java @@ -0,0 +1,114 @@ +package fr.robie.craftengineconverter.api.configuration.loader.models.tints; + +import fr.robie.craftengineconverter.api.configuration.item.models.tints.*; +import fr.robie.craftengineconverter.api.logger.LogType; +import fr.robie.craftengineconverter.api.logger.Logger; +import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class TintConfigurationRegistry { + private static final Map LOADERS = new HashMap<>(); + + static { + register("constant", TintConfigurationRegistry::loadConstant); + register("dye", TintConfigurationRegistry::loadDye); + register("firework", TintConfigurationRegistry::loadFirework); + register("grass", TintConfigurationRegistry::loadGrass); + register("map_color", TintConfigurationRegistry::loadMapColor); + register("potion", TintConfigurationRegistry::loadPotion); + register("team", TintConfigurationRegistry::loadTeam); + register("custom_model_data", TintConfigurationRegistry::loadCustomModelData); + } + + private TintConfigurationRegistry() { + } + + public static void register(@NotNull String type, @NotNull TintConfigurationLoader loader) { + LOADERS.put(type, loader); + } + + @Nullable + public static TintConfiguration load(@Nullable ConfigurationSection section) { + if (section == null) { + return null; + } + String type = section.getString("type"); + if (type == null) { + Logger.info("Tint section is missing 'type' field, skipping.", LogType.WARNING); + return null; + } + if (type.startsWith("minecraft:")) { + type = type.substring("minecraft:".length()); + } + TintConfigurationLoader loader = LOADERS.get(type); + if (loader == null) { + Logger.info("Unknown tint type '" + type + "', skipping.", LogType.WARNING); + return null; + } + return loader.load(section); + } + + @NotNull + public static List loadList(@NotNull ConfigurationSection parent, @NotNull String key) { + List result = new ArrayList<>(); + List sections = parent.getSectionList(key); + for (ConfigurationSection section : sections) { + TintConfiguration tint = load(section); + if (tint != null) { + result.add(tint); + } + } + return result; + } + + private static TintConfiguration loadConstant(ConfigurationSection section) { + Object value = section.get("value"); + if (value == null) { + return null; + } + return new ConstantTintConfiguration(value); + } + + private static TintConfiguration loadCustomModelData(ConfigurationSection section) { + int index = section.getInt("index", 0); + Object defaultValue = section.get("default"); + return new CustomModelDataTintConfiguration(index, defaultValue); + } + + private static TintConfiguration loadDye(ConfigurationSection section) { + Object o = section.get("default"); + return o == null ? null : new DyeTintConfiguration(o); + } + + private static TintConfiguration loadFirework(ConfigurationSection section) { + Object o = section.get("default"); + return o == null ? null : new FireworkTintConfiguration(o); + } + + private static TintConfiguration loadGrass(ConfigurationSection section) { + float temperature = (float) section.getDouble("temperature", 0.0); + float downfall = (float) section.getDouble("downfall", 0.0); + return new GrassTintConfiguration(temperature, downfall); + } + + private static TintConfiguration loadMapColor(ConfigurationSection section) { + Object o = section.get("default"); + return o == null ? null : new MapColorTintConfiguration(o); + } + + private static TintConfiguration loadPotion(ConfigurationSection section) { + Object o = section.get("default"); + return o == null ? null : new PotionTintConfiguration(o); + } + + private static TintConfiguration loadTeam(ConfigurationSection section) { + Object o = section.get("default"); + return o == null ? null : new TeamTintConfiguration(o); + } +} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/yaml/ConfigurationSection.java b/API/src/main/java/fr/robie/craftengineconverter/api/yaml/ConfigurationSection.java index f56b7300..3136f690 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/yaml/ConfigurationSection.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/yaml/ConfigurationSection.java @@ -134,6 +134,9 @@ public interface ConfigurationSection { @NotNull List> getMapList(@NotNull String path); + @NotNull + List getSectionList(@NotNull String path); + @Nullable T getObject(@NotNull String path, @NotNull Class clazz); diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockConverter.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockConverter.java index b02fc627..5b9ad056 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockConverter.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockConverter.java @@ -1,10 +1,15 @@ package fr.robie.craftengineconverter.converter.bedrock; +import fr.robie.craftengineconverter.api.configuration.bedrock.ItemTextureConfiguration; import fr.robie.craftengineconverter.api.configuration.bedrock.ManifestConfiguration; +import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.MappingsConfiguration; +import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.ItemMapping; +import fr.robie.craftengineconverter.api.configuration.bedrock.texture.TextureData; import fr.robie.craftengineconverter.api.manager.FileCacheManager; import fr.robie.craftengineconverter.api.utils.FileUtils; +import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; import fr.robie.craftengineconverter.common.CraftEngineConverterPlugin; -import fr.robie.craftengineconverter.common.utils.SnakeUtils; +import fr.robie.craftengineconverter.common.utils.yaml.file.YamlConfiguration; import org.jetbrains.annotations.NotNull; import java.io.File; @@ -54,20 +59,36 @@ private void convertItemMappingsFolder(@NotNull File inputFolder, @NotNull File return; } + MappingsConfiguration mappingsConfiguration = new MappingsConfiguration(); + ItemTextureConfiguration itemTextureConfiguration = new ItemTextureConfiguration(); + for (File file : listed) { if (file.isFile() && FileUtils.isYmlFile(file)) { - SnakeUtils snakeUtils = SnakeUtils.loadSmart(file); - SnakeUtils items = snakeUtils.getSection("items"); + YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(file); + ConfigurationSection items = yamlConfiguration.getConfigurationSection("items"); if (items != null) { - for (String itemId : items.getKeys()) { - SnakeUtils itemSection = items.getSection(itemId); + for (String itemId : items.getKeys(false)) { + ConfigurationSection itemSection = items.getConfigurationSection(itemId); if (itemSection != null) { - //TODO: continue + BedrockItemLoader itemLoader = new BedrockItemLoader(itemId, itemSection); + + ItemMapping load = itemLoader.load(); + if (load != null) { + mappingsConfiguration.addItemMapping(load); + + TextureData textureData = load.getTextureData(); + if (textureData != null) { + itemTextureConfiguration.addTextureData(textureData); + } + } } } } } } + + mappingsConfiguration.saveMappings(outputFolder.toPath()); + itemTextureConfiguration.save(outputFolder.toPath()); } @@ -94,7 +115,7 @@ private void convertPack(File inputFolder, File outputPackFolder) { String typeName = typeFile.getName(); switch (typeName) { case "textures", "models" -> - FileUtils.copyDirectory(typeFile, new File(outputPackFolder, "textures")); + FileUtils.copyDirectory(typeFile, new File(outputPackFolder, typeName)); } } } diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockItemLoader.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockItemLoader.java new file mode 100644 index 00000000..6d20a823 --- /dev/null +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockItemLoader.java @@ -0,0 +1,82 @@ +package fr.robie.craftengineconverter.converter.bedrock; + +import fr.robie.craftengineconverter.api.configuration.Configuration; +import fr.robie.craftengineconverter.api.configuration.ConfigurationKey; +import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.ItemMapping; +import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.ItemModelItemMapping; +import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.LegacyItemMapping; +import fr.robie.craftengineconverter.api.configuration.item.models.ModelConfiguration; +import fr.robie.craftengineconverter.api.configuration.loader.models.ModelConfigurationRegistry; +import fr.robie.craftengineconverter.api.logger.Logger; +import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; +import org.bukkit.Material; +import org.jetbrains.annotations.NotNull; + +import java.util.List; + +public class BedrockItemLoader { + private final String itemId; + private final ConfigurationSection itemSection; + + public BedrockItemLoader(@NotNull String itemId, @NotNull ConfigurationSection itemSection) { + this.itemId = itemId; + this.itemSection = itemSection; + } + + + public ItemMapping load() { + ItemMapping itemMapping; + if (this.itemSection.isString("item-model")) { + itemMapping = new ItemModelItemMapping( + this.getMaterial(), + this.itemId, + this.itemSection.getString("item-model") + ); + } else if (this.itemSection.isInt("custom-model-data")) { + Logger.info("Item %itemId% uses custom model data integer, which is not supported for Bedrock Edition. Skipping."); + return null; + } else { + List floats = this.itemSection.getFloatList("data.components.custom_model_data"); + if (floats.isEmpty()) { + floats = this.itemSection.getFloatList("data.components.minecraft:custom_model_data"); + } + if (!floats.isEmpty()) { + itemMapping = new LegacyItemMapping( + this.getMaterial(), + this.itemId, + floats.getFirst() + ); + } else { + return null; + } + } + + String itemName = this.itemSection.getString("data.item-name", this.itemSection.getString("data.custom-name")); + if (itemName != null) { + itemMapping.setDisplayName(itemName); + } + + ConfigurationSection modelSection = this.itemSection.getConfigurationSection("model"); + if (modelSection != null) { + ModelConfiguration modelConfiguration = ModelConfigurationRegistry.load(modelSection); + if (modelConfiguration != null) { + + } + } + + return itemMapping; + } + + + private Material getMaterial() { + String material = this.itemSection.getString("material"); + if (material != null) { + try { + return Material.valueOf(material.toUpperCase()); + } catch (IllegalArgumentException ignored) { + } + } + return Configuration.get(ConfigurationKey.DEFAULT_MATERIAL); + } + +} diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/loader/MessageLoader.java b/Plugin/src/main/java/fr/robie/craftengineconverter/loader/MessageLoader.java index 0afd8159..06e6ffe7 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/loader/MessageLoader.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/loader/MessageLoader.java @@ -318,7 +318,6 @@ private CraftEngineConverterMessage parseCraftMessage(@NotNull ConfigurationSect }; } - private void validateLoadedMessages(List loadedMessages, Languages language) { if (loadedMessages.size() == Message.values().length) { return; From 158ae4553607b30249f1a4dea64a12e915096711 Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Wed, 29 Apr 2026 17:30:23 +0200 Subject: [PATCH 013/116] feat: update MemorySection and YamlConfiguration for improved ConfigurationSection handling --- .../common/utils/yaml/MemorySection.java | 154 +++++++++++------- .../utils/yaml/file/YamlConfiguration.java | 25 +++ .../utils/yaml/YamlListSectionTest.java | 104 ++++++++++++ 3 files changed, 225 insertions(+), 58 deletions(-) create mode 100644 Common/src/test/java/fr/robie/craftengineconverter/common/utils/yaml/YamlListSectionTest.java diff --git a/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/MemorySection.java b/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/MemorySection.java index ddef47b1..65fc23ee 100644 --- a/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/MemorySection.java +++ b/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/MemorySection.java @@ -2,6 +2,8 @@ import com.google.common.base.Preconditions; import com.google.common.base.Strings; +import fr.robie.craftengineconverter.api.yaml.Configuration; +import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; import org.bukkit.configuration.serialization.ConfigurationSerializable; import org.jetbrains.annotations.Contract; import org.jetbrains.annotations.NotNull; @@ -12,27 +14,27 @@ import static org.bukkit.util.NumberConversions.*; -public class MemorySection implements fr.robie.craftengineconverter.api.yaml.ConfigurationSection { +public class MemorySection implements ConfigurationSection { protected final Map map = new LinkedHashMap(); - private final fr.robie.craftengineconverter.api.yaml.Configuration root; - private final fr.robie.craftengineconverter.api.yaml.ConfigurationSection parent; + private final Configuration root; + private final ConfigurationSection parent; private final String path; private final String fullPath; protected MemorySection() { - if (!(this instanceof fr.robie.craftengineconverter.api.yaml.Configuration)) { + if (!(this instanceof Configuration)) { throw new IllegalStateException("Cannot construct a root MemorySection when not a Configuration"); } this.path = ""; this.fullPath = ""; this.parent = null; - this.root = (fr.robie.craftengineconverter.api.yaml.Configuration) this; + this.root = (Configuration) this; } - protected MemorySection(@NotNull fr.robie.craftengineconverter.api.yaml.ConfigurationSection parent, @NotNull String path) { + protected MemorySection(@NotNull ConfigurationSection parent, @NotNull String path) { Preconditions.checkArgument(parent != null, "Parent cannot be null"); Preconditions.checkArgument(path != null, "Path cannot be null"); @@ -49,9 +51,9 @@ protected MemorySection(@NotNull fr.robie.craftengineconverter.api.yaml.Configur public @NotNull Set getKeys(boolean deep) { Set result = new LinkedHashSet(); - fr.robie.craftengineconverter.api.yaml.Configuration root = this.getRoot(); + Configuration root = this.getRoot(); if (root != null && root.options().copyDefaults()) { - fr.robie.craftengineconverter.api.yaml.ConfigurationSection defaults = this.getDefaultSection(); + ConfigurationSection defaults = this.getDefaultSection(); if (defaults != null) { result.addAll(defaults.getKeys(deep)); @@ -68,9 +70,9 @@ protected MemorySection(@NotNull fr.robie.craftengineconverter.api.yaml.Configur public Map getValues(boolean deep) { Map result = new LinkedHashMap(); - fr.robie.craftengineconverter.api.yaml.Configuration root = this.getRoot(); + Configuration root = this.getRoot(); if (root != null && root.options().copyDefaults()) { - fr.robie.craftengineconverter.api.yaml.ConfigurationSection defaults = this.getDefaultSection(); + ConfigurationSection defaults = this.getDefaultSection(); if (defaults != null) { result.putAll(defaults.getValues(deep)); @@ -94,7 +96,7 @@ public boolean contains(@NotNull String path, boolean ignoreDefault) { @Override public boolean isSet(@NotNull String path) { - fr.robie.craftengineconverter.api.yaml.Configuration root = this.getRoot(); + Configuration root = this.getRoot(); if (root == null) { return false; } @@ -118,13 +120,13 @@ public String getName() { @Override @Nullable - public fr.robie.craftengineconverter.api.yaml.Configuration getRoot() { + public Configuration getRoot() { return this.root; } @Override @Nullable - public fr.robie.craftengineconverter.api.yaml.ConfigurationSection getParent() { + public ConfigurationSection getParent() { return this.parent; } @@ -132,7 +134,7 @@ public fr.robie.craftengineconverter.api.yaml.ConfigurationSection getParent() { public void addDefault(@NotNull String path, @Nullable Object value) { Preconditions.checkArgument(path != null, "Path cannot be null"); - fr.robie.craftengineconverter.api.yaml.Configuration root = this.getRoot(); + Configuration root = this.getRoot(); if (root == null) { throw new IllegalStateException("Cannot add default without root"); } @@ -144,9 +146,9 @@ public void addDefault(@NotNull String path, @Nullable Object value) { @Override @Nullable - public fr.robie.craftengineconverter.api.yaml.ConfigurationSection getDefaultSection() { - fr.robie.craftengineconverter.api.yaml.Configuration root = this.getRoot(); - fr.robie.craftengineconverter.api.yaml.Configuration defaults = root == null ? null : root.getDefaults(); + public ConfigurationSection getDefaultSection() { + Configuration root = this.getRoot(); + Configuration defaults = root == null ? null : root.getDefaults(); if (defaults != null) { if (defaults.isConfigurationSection(this.getCurrentPath())) { @@ -161,7 +163,7 @@ public fr.robie.craftengineconverter.api.yaml.ConfigurationSection getDefaultSec public void set(@NotNull String path, @Nullable Object value) { Preconditions.checkArgument(!Strings.isNullOrEmpty(path), "Cannot set to an empty path"); - fr.robie.craftengineconverter.api.yaml.Configuration root = this.getRoot(); + Configuration root = this.getRoot(); if (root == null) { throw new IllegalStateException("Cannot use section without a root"); } @@ -170,10 +172,10 @@ public void set(@NotNull String path, @Nullable Object value) { int i1 = -1, i2; - fr.robie.craftengineconverter.api.yaml.ConfigurationSection section = this; + ConfigurationSection section = this; while ((i1 = path.indexOf(separator, i2 = i1 + 1)) != -1) { String node = path.substring(i2, i1); - fr.robie.craftengineconverter.api.yaml.ConfigurationSection subSection = section.getConfigurationSection(node); + ConfigurationSection subSection = section.getConfigurationSection(node); if (subSection == null) { if (value == null) { @@ -218,40 +220,51 @@ public Object get(@NotNull String path, @Nullable Object def) { return this; } - fr.robie.craftengineconverter.api.yaml.Configuration root = this.getRoot(); + Configuration root = this.getRoot(); if (root == null) { throw new IllegalStateException("Cannot access section without a root"); } final char separator = root.options().pathSeparator(); - int i1 = -1, i2; - fr.robie.craftengineconverter.api.yaml.ConfigurationSection section = this; + Object current = this; while ((i1 = path.indexOf(separator, i2 = i1 + 1)) != -1) { - final String currentPath = path.substring(i2, i1); - if (!section.contains(currentPath, true)) { - return def; - } - section = section.getConfigurationSection(currentPath); - if (section == null) { + current = this.getPart(current, path.substring(i2, i1)); + if (current == null) { return def; } } String key = path.substring(i2); - if (section == this) { - SectionPathData result = this.map.get(key); - return (result == null) ? def : result.getData(); + Object result = this.getPart(current, key); + return (result == null) ? def : result; + } + + @Nullable + private Object getPart(@Nullable Object current, @NotNull String node) { + if (current instanceof MemorySection sec) { + SectionPathData result = sec.map.get(node); + return (result == null) ? sec.getDefault(node) : result.getData(); + } else if (current instanceof ConfigurationSection sec) { + return sec.get(node, null); + } else if (current instanceof List list) { + try { + int index = Integer.parseInt(node); + if (index >= 0 && index < list.size()) { + return list.get(index); + } + } catch (NumberFormatException ignored) { + } } - return section.get(key, def); + return null; } @Override @NotNull - public fr.robie.craftengineconverter.api.yaml.ConfigurationSection createSection(@NotNull String path) { + public ConfigurationSection createSection(@NotNull String path) { Preconditions.checkArgument(!Strings.isNullOrEmpty(path), "Cannot create section at empty path"); - fr.robie.craftengineconverter.api.yaml.Configuration root = this.getRoot(); + Configuration root = this.getRoot(); if (root == null) { throw new IllegalStateException("Cannot create section without a root"); } @@ -260,10 +273,10 @@ public fr.robie.craftengineconverter.api.yaml.ConfigurationSection createSection int i1 = -1, i2; - fr.robie.craftengineconverter.api.yaml.ConfigurationSection section = this; + ConfigurationSection section = this; while ((i1 = path.indexOf(separator, i2 = i1 + 1)) != -1) { String node = path.substring(i2, i1); - fr.robie.craftengineconverter.api.yaml.ConfigurationSection subSection = section.getConfigurationSection(node); + ConfigurationSection subSection = section.getConfigurationSection(node); if (subSection == null) { section = section.createSection(node); } else { @@ -273,7 +286,7 @@ public fr.robie.craftengineconverter.api.yaml.ConfigurationSection createSection String key = path.substring(i2); if (section == this) { - fr.robie.craftengineconverter.api.yaml.ConfigurationSection result = new MemorySection(this, key); + ConfigurationSection result = new MemorySection(this, key); this.map.put(key, new SectionPathData(result)); return result; } @@ -282,8 +295,8 @@ public fr.robie.craftengineconverter.api.yaml.ConfigurationSection createSection @Override @NotNull - public fr.robie.craftengineconverter.api.yaml.ConfigurationSection createSection(@NotNull String path, @NotNull Map map) { - fr.robie.craftengineconverter.api.yaml.ConfigurationSection section = this.createSection(path); + public ConfigurationSection createSection(@NotNull String path, @NotNull Map map) { + ConfigurationSection section = this.createSection(path); for (Map.Entry entry : map.entrySet()) { if (entry.getValue() instanceof Map) { @@ -672,7 +685,32 @@ public List getShortList(@NotNull String path) { for (Object object : list) { if (object instanceof Map) { result.add((Map) object); + } else if (object instanceof ConfigurationSection section) { + result.add(section.getValues(false)); + } + } + + return result; + } + + @Override + @NotNull + public List getSectionList(@NotNull String path) { + List list = this.getList(path); + List result = new ArrayList<>(); + + if (list == null) { + return result; + } + + int index = 0; + for (Object object : list) { + if (object instanceof ConfigurationSection) { + result.add((ConfigurationSection) object); + } else if (object instanceof Map map) { + result.add(this.createSection(path + "." + index, map)); } + index++; } return result; @@ -711,20 +749,20 @@ public T getSerializable(@NotNull String p @Override @Nullable - public fr.robie.craftengineconverter.api.yaml.ConfigurationSection getConfigurationSection(@NotNull String path) { + public ConfigurationSection getConfigurationSection(@NotNull String path) { Object val = this.get(path, null); if (val != null) { - return (val instanceof fr.robie.craftengineconverter.api.yaml.ConfigurationSection) ? (fr.robie.craftengineconverter.api.yaml.ConfigurationSection) val : null; + return (val instanceof ConfigurationSection) ? (ConfigurationSection) val : null; } val = this.get(path, this.getDefault(path)); - return (val instanceof fr.robie.craftengineconverter.api.yaml.ConfigurationSection) ? this.createSection(path) : null; + return (val instanceof ConfigurationSection) ? this.createSection(path) : null; } @Override public boolean isConfigurationSection(@NotNull String path) { Object val = this.get(path); - return val instanceof fr.robie.craftengineconverter.api.yaml.ConfigurationSection; + return val instanceof ConfigurationSection; } protected boolean isPrimitiveWrapper(@Nullable Object input) { @@ -738,18 +776,18 @@ protected boolean isPrimitiveWrapper(@Nullable Object input) { protected Object getDefault(@NotNull String path) { Preconditions.checkArgument(path != null, "Path cannot be null"); - fr.robie.craftengineconverter.api.yaml.Configuration root = this.getRoot(); - fr.robie.craftengineconverter.api.yaml.Configuration defaults = root == null ? null : root.getDefaults(); + Configuration root = this.getRoot(); + Configuration defaults = root == null ? null : root.getDefaults(); return (defaults == null) ? null : defaults.get(createPath(this, path)); } - protected void mapChildrenKeys(@NotNull Set output, @NotNull fr.robie.craftengineconverter.api.yaml.ConfigurationSection section, boolean deep) { + protected void mapChildrenKeys(@NotNull Set output, @NotNull ConfigurationSection section, boolean deep) { if (section instanceof MemorySection sec) { for (Map.Entry entry : sec.map.entrySet()) { output.add(createPath(section, entry.getKey(), this)); - if ((deep) && (entry.getValue().getData() instanceof fr.robie.craftengineconverter.api.yaml.ConfigurationSection subsection)) { + if ((deep) && (entry.getValue().getData() instanceof ConfigurationSection subsection)) { this.mapChildrenKeys(output, subsection, deep); } } @@ -762,7 +800,7 @@ protected void mapChildrenKeys(@NotNull Set output, @NotNull fr.robie.cr } } - protected void mapChildrenValues(@NotNull Map output, @NotNull fr.robie.craftengineconverter.api.yaml.ConfigurationSection section, boolean deep) { + protected void mapChildrenValues(@NotNull Map output, @NotNull ConfigurationSection section, boolean deep) { if (section instanceof MemorySection sec) { for (Map.Entry entry : sec.map.entrySet()) { @@ -772,9 +810,9 @@ protected void mapChildrenValues(@NotNull Map output, @NotNull f output.remove(childPath); output.put(childPath, entry.getValue().getData()); - if (entry.getValue().getData() instanceof fr.robie.craftengineconverter.api.yaml.ConfigurationSection) { + if (entry.getValue().getData() instanceof ConfigurationSection) { if (deep) { - this.mapChildrenValues(output, (fr.robie.craftengineconverter.api.yaml.ConfigurationSection) entry.getValue().getData(), deep); + this.mapChildrenValues(output, (ConfigurationSection) entry.getValue().getData(), deep); } } } @@ -789,22 +827,22 @@ protected void mapChildrenValues(@NotNull Map output, @NotNull f @NotNull - public static String createPath(@NotNull fr.robie.craftengineconverter.api.yaml.ConfigurationSection section, @Nullable String key) { + public static String createPath(@NotNull ConfigurationSection section, @Nullable String key) { return createPath(section, key, (section == null) ? null : section.getRoot()); } @NotNull - public static String createPath(@NotNull fr.robie.craftengineconverter.api.yaml.ConfigurationSection section, @Nullable String key, @Nullable fr.robie.craftengineconverter.api.yaml.ConfigurationSection relativeTo) { + public static String createPath(@NotNull ConfigurationSection section, @Nullable String key, @Nullable ConfigurationSection relativeTo) { Preconditions.checkArgument(section != null, "Cannot create path without a section"); - fr.robie.craftengineconverter.api.yaml.Configuration root = section.getRoot(); + Configuration root = section.getRoot(); if (root == null) { throw new IllegalStateException("Cannot create path without a root"); } char separator = root.options().pathSeparator(); StringBuilder builder = new StringBuilder(); - for (fr.robie.craftengineconverter.api.yaml.ConfigurationSection parent = section; (parent != null) && (parent != relativeTo); parent = parent.getParent()) { + for (ConfigurationSection parent = section; (parent != null) && (parent != relativeTo); parent = parent.getParent()) { if (!builder.isEmpty()) { builder.insert(0, separator); } @@ -856,7 +894,7 @@ public void setInlineComments(@NotNull final String path, @Nullable final List()); + + config.createSection("list.0").set("name", "first"); + config.set("list.2.name", "third"); // Should pad with null at index 1 + + List list = config.getList("list"); + assertEquals(3, list.size()); + assertInstanceOf(ConfigurationSection.class, list.get(0)); + assertNull(list.get(1)); + assertInstanceOf(ConfigurationSection.class, list.get(2)); + + assertEquals("first", config.getString("list.0.name")); + assertEquals("third", config.getString("list.2.name")); + } + + @Test + @DisplayName("Should remove elements or values via index path") + void testRemoval() { + YamlConfiguration config = new YamlConfiguration(); + config.set("list", new ArrayList<>(List.of("a", "b", "c"))); + + config.set("list.1", null); // Should set element at index 1 to null + List list = config.getList("list"); + assertNull(list.get(1)); + } + } + + @Nested + @DisplayName("Serialization and Round-trip Tests") + class SerializationTests { + + @Test + @DisplayName("Should preserve list-section structure during save and load") + void testRoundTrip() throws Exception { + YamlConfiguration config = new YamlConfiguration(); + config.set("items", new ArrayList<>()); + ConfigurationSection item0 = config.createSection("items.0"); + item0.set("id", "stone"); + item0.set("amount", 64); + + String saved = config.saveToString(); + + YamlConfiguration reloaded = new YamlConfiguration(); + reloaded.loadFromString(saved); + + assertTrue(reloaded.isConfigurationSection("items.0")); + assertEquals("stone", reloaded.getString("items.0.id")); + assertEquals(64, reloaded.getInt("items.0.amount")); + } + + @Test + @DisplayName("Should handle ConfigurationSerializable within lists") + void testSerializableInList() throws Exception { + ConfigurationSerialization.registerClass(TestSerializable.class); + + String yaml = """ + items: + - ==: TestSerializable + val: "foo" + """; + + YamlConfiguration config = new YamlConfiguration(); + config.loadFromString(yaml); + + List list = config.getList("items"); + assertInstanceOf(TestSerializable.class, list.getFirst()); + assertEquals("foo", ((TestSerializable) list.getFirst()).val); + + ConfigurationSerialization.unregisterClass(TestSerializable.class); + } + } + + @SerializableAs("TestSerializable") + public static class TestSerializable implements ConfigurationSerializable { + public String val; + + public TestSerializable(Map map) { + this.val = (String) map.get("val"); + } + + @Override + public @NotNull Map serialize() { + Map map = new LinkedHashMap<>(); + map.put("val", this.val); + return map; + } + + } +} diff --git a/Common/src/test/java/fr/robie/craftengineconverter/common/utils/yaml/YamlListSectionTest.java b/Common/src/test/java/fr/robie/craftengineconverter/common/utils/yaml/YamlListSectionTest.java deleted file mode 100644 index 0a69543f..00000000 --- a/Common/src/test/java/fr/robie/craftengineconverter/common/utils/yaml/YamlListSectionTest.java +++ /dev/null @@ -1,104 +0,0 @@ -package fr.robie.craftengineconverter.common.utils.yaml; - -import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; -import fr.robie.craftengineconverter.common.utils.yaml.file.YamlConfiguration; -import org.junit.jupiter.api.Test; - -import java.util.List; -import java.util.Map; - -import static org.junit.jupiter.api.Assertions.*; - -public class YamlListSectionTest { - - @Test - public void testListSections() { - String yaml = """ - list: - - key: value1 - nested: - foo: bar - - key: value2 - """; - - YamlConfiguration config = new YamlConfiguration(); - try { - config.loadFromString(yaml); - } catch (Exception e) { - fail("Failed to load YAML: " + e.getMessage()); - } - - List list = config.getList("list"); - assertNotNull(list); - assertEquals(2, list.size()); - - // Verify elements are ConfigurationSections - assertInstanceOf(ConfigurationSection.class, list.get(0), "First element should be a ConfigurationSection"); - assertInstanceOf(ConfigurationSection.class, list.get(1), "Second element should be a ConfigurationSection"); - - ConfigurationSection sec0 = (ConfigurationSection) list.get(0); - assertEquals("value1", sec0.getString("key")); - assertEquals("bar", sec0.getString("nested.foo")); - - // Verify index-based path access - assertEquals("value1", config.getString("list.0.key")); - assertEquals("bar", config.getString("list.0.nested.foo")); - assertEquals("value2", config.getString("list.1.key")); - - // Verify getConfigurationSection with index - ConfigurationSection secIndex0 = config.getConfigurationSection("list.0"); - assertNotNull(secIndex0); - assertEquals("value1", secIndex0.getString("key")); - - config.getSectionList("list").forEach(section -> { - assertInstanceOf(ConfigurationSection.class, section, "Each list element should be a ConfigurationSection"); - }); - - // Verify contains - assertTrue(config.contains("list.0.key")); - assertTrue(config.contains("list.1")); - assertFalse(config.contains("list.2")); - } - - @Test - public void testGetMapList() { - String yaml = """ - list: - - key: value1 - """; - - YamlConfiguration config = new YamlConfiguration(); - try { - config.loadFromString(yaml); - } catch (Exception e) { - fail("Failed to load YAML: " + e.getMessage()); - } - - List> mapList = config.getMapList("list"); - assertNotNull(mapList); - // If my hypothesis is correct, this might fail because elements are ConfigurationSections, not Maps. - assertEquals(1, mapList.size(), "getMapList should return elements even if they are stored as ConfigurationSections"); - assertEquals("value1", mapList.get(0).get("key")); - } - - @Test - public void testNestedLists() { - String yaml = """ - nested_list: - - - item: 0-0 - - item: 0-1 - - - item: 1-0 - """; - - YamlConfiguration config = new YamlConfiguration(); - try { - config.loadFromString(yaml); - } catch (Exception e) { - fail("Failed to load YAML: " + e.getMessage()); - } - - assertEquals("0-0", config.getString("nested_list.0.0.item")); - assertEquals("0-1", config.getString("nested_list.0.1.item")); - assertEquals("1-0", config.getString("nested_list.1.0.item")); - } -} From 416ab8cd63023a4e192c03ccdc7e8f1e920977e6 Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Thu, 30 Apr 2026 10:15:44 +0200 Subject: [PATCH 015/116] feat: add configuration loaders and models for item selection and tinting --- API/pom.xml | 6 + .../api/ReflectionsCache.java | 22 ++++ .../AutoModelConfigurationLoader.java | 14 +++ .../AutoTintConfigurationLoader.java | 12 ++ .../api/annotations/PaperOnly.java | 16 +++ .../api/annotations/SinceVersion.java | 25 ++++ .../api/annotations/SpigotOnly.java | 16 +++ .../api/annotations/UntilVersion.java | 25 ++++ .../models/range_dispatch/ChargeType.java | 7 ++ .../select/ChargeTypeSelectConfiguration.java | 10 +- .../CustomModelDataSelectConfiguration.java | 2 +- .../item/models/select/DisplayContent.java | 14 +++ .../DisplayContentSelectConfiguration.java | 14 +-- .../item/models/select/MainHand.java | 6 + .../select/MainHandSelectConfiguration.java | 6 +- .../models/ModelConfigurationRegistry.java | 16 --- .../CompositeModelConfigurationLoader.java | 2 + .../condition/ComponentConditionLoader.java | 2 + .../ConditionModelConfigurationLoader.java | 2 + .../CustomModelDataConditionLoader.java | 2 + .../HasComponentConditionLoader.java | 2 + .../condition/KeybindDownConditionLoader.java | 2 + .../model/SimpleModelConfigurationLoader.java | 3 + .../AbstractSelectModelConfiguration.java | 49 ++++++++ .../BlockStateSelectConfigurationLoader.java | 26 +++++ .../ChargeTypeSelectConfigurationLoader.java | 22 ++++ .../ComponentSelectConfigurationLoader.java | 26 +++++ ...tomModelDataSelectConfigurationLoader.java | 22 ++++ ...splayContentSelectConfigurationLoader.java | 22 ++++ .../LocalTimeSelectConfigurationLoader.java | 27 +++++ .../MainHandSelectConfigurationLoader.java | 22 ++++ .../SelectModelConfigurationLoader.java | 19 +++ .../SelectModelConfigurationRegistry.java | 51 +++++++++ .../tints/TintConfigurationRegistry.java | 58 +--------- .../loader/tints/ConstantTintLoader.java | 16 +++ .../tints/CustomModelDataTintLoader.java | 17 +++ .../loader/tints/DyeTintLoader.java | 16 +++ .../loader/tints/FireworkTintLoader.java | 16 +++ .../loader/tints/GrassTintLoader.java | 17 +++ .../loader/tints/MapColorTintLoader.java | 16 +++ .../loader/tints/PotionTintLoader.java | 16 +++ .../loader/tints/TeamTintLoader.java | 16 +++ .../manager/FoliaCompatibilityManager.java | 24 ++-- .../api/reflections/ReflectionsCache.java | 51 +++++++++ .../api/utils/MinecraftVersion.java | 108 ++++++++++++++++++ .../api/utils/VersionFilter.java | 47 ++++++++ .../services/org.reflections.scanners.Scanner | 1 + .../yaml/directive/VersionKeyDirective.java | 70 ++---------- Plugin/pom.xml | 5 + .../CraftEngineConverter.java | 70 ++++++++++++ .../itemsadder/IAItemsConverter.java | 16 +-- .../converter/nexo/NexoItemConverter.java | 12 +- Plugin/src/main/resources/plugin.yml | 6 +- pom.xml | 7 ++ 54 files changed, 937 insertions(+), 180 deletions(-) create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/ReflectionsCache.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/annotations/AutoModelConfigurationLoader.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/annotations/AutoTintConfigurationLoader.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/annotations/PaperOnly.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/annotations/SinceVersion.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/annotations/SpigotOnly.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/annotations/UntilVersion.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/range_dispatch/ChargeType.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/select/DisplayContent.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/select/MainHand.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/AbstractSelectModelConfiguration.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/BlockStateSelectConfigurationLoader.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/ChargeTypeSelectConfigurationLoader.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/ComponentSelectConfigurationLoader.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/CustomModelDataSelectConfigurationLoader.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/DisplayContentSelectConfigurationLoader.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/LocalTimeSelectConfigurationLoader.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/MainHandSelectConfigurationLoader.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/SelectModelConfigurationLoader.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/SelectModelConfigurationRegistry.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/ConstantTintLoader.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/CustomModelDataTintLoader.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/DyeTintLoader.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/FireworkTintLoader.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/GrassTintLoader.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/MapColorTintLoader.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/PotionTintLoader.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/TeamTintLoader.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/reflections/ReflectionsCache.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/utils/MinecraftVersion.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/utils/VersionFilter.java create mode 100644 API/src/main/resources/META-INF/services/org.reflections.scanners.Scanner diff --git a/API/pom.xml b/API/pom.xml index 90439ef3..7b3c6d3a 100644 --- a/API/pom.xml +++ b/API/pom.xml @@ -40,5 +40,11 @@ com.tcoded FoliaLib + + + org.reflections + reflections + 0.10.2 + \ No newline at end of file diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/ReflectionsCache.java b/API/src/main/java/fr/robie/craftengineconverter/api/ReflectionsCache.java new file mode 100644 index 00000000..13d88ef7 --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/ReflectionsCache.java @@ -0,0 +1,22 @@ +package fr.robie.craftengineconverter.api; + +import org.reflections.Reflections; + +import java.util.HashMap; +import java.util.Map; + +public class ReflectionsCache { + private static final ReflectionsCache INSTANCE = new ReflectionsCache(); + private final Map cache = new HashMap<>(); + + private ReflectionsCache() { + } + + public static ReflectionsCache getInstance() { + return INSTANCE; + } + + public Reflections getOrCreate(Object caller, String namespace) { + return this.cache.computeIfAbsent(namespace, key -> new Reflections(namespace)); + } +} \ No newline at end of file diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/annotations/AutoModelConfigurationLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/annotations/AutoModelConfigurationLoader.java new file mode 100644 index 00000000..d4b876bd --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/annotations/AutoModelConfigurationLoader.java @@ -0,0 +1,14 @@ +package fr.robie.craftengineconverter.api.annotations; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.TYPE) +public @interface AutoModelConfigurationLoader { + + + String[] value(); +} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/annotations/AutoTintConfigurationLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/annotations/AutoTintConfigurationLoader.java new file mode 100644 index 00000000..5c353a9e --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/annotations/AutoTintConfigurationLoader.java @@ -0,0 +1,12 @@ +package fr.robie.craftengineconverter.api.annotations; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Target(ElementType.TYPE) +@Retention(RetentionPolicy.RUNTIME) +public @interface AutoTintConfigurationLoader { + String[] value(); +} \ No newline at end of file diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/annotations/PaperOnly.java b/API/src/main/java/fr/robie/craftengineconverter/api/annotations/PaperOnly.java new file mode 100644 index 00000000..f3c32c90 --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/annotations/PaperOnly.java @@ -0,0 +1,16 @@ +package fr.robie.craftengineconverter.api.annotations; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Marks a class as Paper-only. + * Classes annotated with this will only be registered when running on Paper or Paper-based servers. + * Can be combined with {@link SinceVersion} and {@link UntilVersion} for finer-grained control. + */ +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.TYPE) +public @interface PaperOnly { +} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/annotations/SinceVersion.java b/API/src/main/java/fr/robie/craftengineconverter/api/annotations/SinceVersion.java new file mode 100644 index 00000000..5d1775b3 --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/annotations/SinceVersion.java @@ -0,0 +1,25 @@ +package fr.robie.craftengineconverter.api.annotations; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Declares the minimum Minecraft version (inclusive) for which a class should be registered. + * Classes annotated with this will be skipped on servers running versions older than the declared minimum. + * + *

Example: {@code @SinceVersion("1.21.4")} registers the class only on 1.21.4 and above. + * + *

Can be combined with {@link UntilVersion} to define a closed version range, + * and with {@link PaperOnly} / {@link SpigotOnly} for platform filtering. + */ +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.TYPE) +public @interface SinceVersion { + + /** + * The minimum Minecraft version string, e.g. {@code "1.21.4"}. + */ + String value(); +} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/annotations/SpigotOnly.java b/API/src/main/java/fr/robie/craftengineconverter/api/annotations/SpigotOnly.java new file mode 100644 index 00000000..897ace90 --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/annotations/SpigotOnly.java @@ -0,0 +1,16 @@ +package fr.robie.craftengineconverter.api.annotations; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Marks a class as Spigot-only (non-Paper servers). + * Classes annotated with this will only be registered when running on Spigot (not Paper). + * Can be combined with {@link SinceVersion} and {@link UntilVersion} for finer-grained control. + */ +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.TYPE) +public @interface SpigotOnly { +} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/annotations/UntilVersion.java b/API/src/main/java/fr/robie/craftengineconverter/api/annotations/UntilVersion.java new file mode 100644 index 00000000..57719de0 --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/annotations/UntilVersion.java @@ -0,0 +1,25 @@ +package fr.robie.craftengineconverter.api.annotations; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Declares the maximum Minecraft version (inclusive) for which a class should be registered. + * Classes annotated with this will be skipped on servers running versions newer than the declared maximum. + * + *

Example: {@code @UntilVersion("1.21.3")} registers the class only on 1.21.3 and below. + * + *

Can be combined with {@link SinceVersion} to define a closed version range, + * and with {@link PaperOnly} / {@link SpigotOnly} for platform filtering. + */ +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.TYPE) +public @interface UntilVersion { + + /** + * The maximum Minecraft version string, e.g. {@code "1.21.3"}. + */ + String value(); +} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/range_dispatch/ChargeType.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/range_dispatch/ChargeType.java new file mode 100644 index 00000000..0274c5bd --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/range_dispatch/ChargeType.java @@ -0,0 +1,7 @@ +package fr.robie.craftengineconverter.api.configuration.item.models.range_dispatch; + +public enum ChargeType { + NONE, + ROCKET, + ARROW +} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/select/ChargeTypeSelectConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/select/ChargeTypeSelectConfiguration.java index b0f1b00d..345b3900 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/select/ChargeTypeSelectConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/select/ChargeTypeSelectConfiguration.java @@ -1,14 +1,10 @@ package fr.robie.craftengineconverter.api.configuration.item.models.select; -public class ChargeTypeSelectConfiguration extends SelectModelConfiguration { +import fr.robie.craftengineconverter.api.configuration.item.models.range_dispatch.ChargeType; + +public class ChargeTypeSelectConfiguration extends SelectModelConfiguration { public ChargeTypeSelectConfiguration() { super("minecraft:charge_type"); } - - public enum ChargeType { - NONE, - ROCKET, - ARROW - } } \ No newline at end of file diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/select/CustomModelDataSelectConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/select/CustomModelDataSelectConfiguration.java index 42d2f281..81a00136 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/select/CustomModelDataSelectConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/select/CustomModelDataSelectConfiguration.java @@ -3,7 +3,7 @@ import org.bukkit.configuration.ConfigurationSection; import org.jetbrains.annotations.NotNull; -public class CustomModelDataSelectConfiguration extends SelectModelConfiguration { +public class CustomModelDataSelectConfiguration extends SelectModelConfiguration { private final int index; public CustomModelDataSelectConfiguration(int index) { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/select/DisplayContent.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/select/DisplayContent.java new file mode 100644 index 00000000..62a69c4e --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/select/DisplayContent.java @@ -0,0 +1,14 @@ +package fr.robie.craftengineconverter.api.configuration.item.models.select; + +public enum DisplayContent { + NONE, + THIRDPERSON_LEFTHAND, + THIRDPERSON_RIGHTHAND, + FIRSTPERSON_LEFTHAND, + FIRSTPERSON_RIGHTHAND, + HEAD, + GUI, + GROUND, + FIXED, + ON_SHELF +} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/select/DisplayContentSelectConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/select/DisplayContentSelectConfiguration.java index 7a905ac3..44af9fcc 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/select/DisplayContentSelectConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/select/DisplayContentSelectConfiguration.java @@ -1,21 +1,9 @@ package fr.robie.craftengineconverter.api.configuration.item.models.select; -public class DisplayContentSelectConfiguration extends SelectModelConfiguration{ +public class DisplayContentSelectConfiguration extends SelectModelConfiguration { public DisplayContentSelectConfiguration() { super("minecraft:display_context"); } - public enum DisplayContent { - NONE, - THIRDPERSON_LEFTHAND, - THIRDPERSON_RIGHTHAND, - FIRSTPERSON_LEFTHAND, - FIRSTPERSON_RIGHTHAND, - HEAD, - GUI, - GROUND, - FIXED, - ON_SHELF - } } diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/select/MainHand.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/select/MainHand.java new file mode 100644 index 00000000..603862ce --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/select/MainHand.java @@ -0,0 +1,6 @@ +package fr.robie.craftengineconverter.api.configuration.item.models.select; + +public enum MainHand { + LEFT, + RIGHT +} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/select/MainHandSelectConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/select/MainHandSelectConfiguration.java index 07149636..c78f4ccb 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/select/MainHandSelectConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/select/MainHandSelectConfiguration.java @@ -1,13 +1,9 @@ package fr.robie.craftengineconverter.api.configuration.item.models.select; -public class MainHandSelectConfiguration extends SelectModelConfiguration { +public class MainHandSelectConfiguration extends SelectModelConfiguration { public MainHandSelectConfiguration() { super("minecraft:main_hand"); } - public enum MainHand { - LEFT, - RIGHT - } } diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/ModelConfigurationRegistry.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/ModelConfigurationRegistry.java index f4722082..72bff115 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/ModelConfigurationRegistry.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/ModelConfigurationRegistry.java @@ -1,9 +1,6 @@ package fr.robie.craftengineconverter.api.configuration.loader.models; import fr.robie.craftengineconverter.api.configuration.item.models.ModelConfiguration; -import fr.robie.craftengineconverter.api.configuration.loader.models.composite.CompositeModelConfigurationLoader; -import fr.robie.craftengineconverter.api.configuration.loader.models.condition.*; -import fr.robie.craftengineconverter.api.configuration.loader.models.model.SimpleModelConfigurationLoader; import fr.robie.craftengineconverter.api.logger.LogType; import fr.robie.craftengineconverter.api.logger.Logger; import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; @@ -16,16 +13,6 @@ public class ModelConfigurationRegistry { private static final Map LOADERS = new HashMap<>(); - static { - register("model", new SimpleModelConfigurationLoader()); - register("composite", new CompositeModelConfigurationLoader()); - register("condition", new ConditionModelConfigurationLoader()); - register("has_component", new HasComponentConditionLoader()); - register("custom_model_data", new CustomModelDataConditionLoader()); - register("keybind_down", new KeybindDownConditionLoader()); - register("component", new ComponentConditionLoader()); - } - private ModelConfigurationRegistry() { throw new UnsupportedOperationException("ModelConfigurationRegistry is a utility class and cannot be instantiated."); } @@ -40,9 +27,6 @@ public static ModelConfiguration load(@Nullable ConfigurationSection section) { return null; } String type = section.getString("type", "model"); - if (type.startsWith("minecraft:")) { - type = type.substring("minecraft:".length()); - } ModelConfigurationLoader loader = LOADERS.get(type); if (loader == null) { Logger.info("Unknown model type '" + type + "', skipping.", LogType.WARNING); diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/composite/CompositeModelConfigurationLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/composite/CompositeModelConfigurationLoader.java index 7699d55a..25090855 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/composite/CompositeModelConfigurationLoader.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/composite/CompositeModelConfigurationLoader.java @@ -1,5 +1,6 @@ package fr.robie.craftengineconverter.api.configuration.loader.models.composite; +import fr.robie.craftengineconverter.api.annotations.AutoModelConfigurationLoader; import fr.robie.craftengineconverter.api.configuration.item.models.ModelConfiguration; import fr.robie.craftengineconverter.api.configuration.item.models.composite.CompositeModelConfiguration; import fr.robie.craftengineconverter.api.configuration.loader.models.ModelConfigurationLoader; @@ -10,6 +11,7 @@ import java.util.List; +@AutoModelConfigurationLoader({"composite", "minecraft:composite"}) public class CompositeModelConfigurationLoader implements ModelConfigurationLoader { @Override public @Nullable ModelConfiguration load(@NotNull ConfigurationSection section) { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/condition/ComponentConditionLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/condition/ComponentConditionLoader.java index 2fc55543..4d497a05 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/condition/ComponentConditionLoader.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/condition/ComponentConditionLoader.java @@ -1,5 +1,6 @@ package fr.robie.craftengineconverter.api.configuration.loader.models.condition; +import fr.robie.craftengineconverter.api.annotations.AutoModelConfigurationLoader; import fr.robie.craftengineconverter.api.configuration.item.models.ModelConfiguration; import fr.robie.craftengineconverter.api.configuration.item.models.condition.ComponentConditionConfiguration; import fr.robie.craftengineconverter.api.configuration.loader.models.AbstractConditionLoader; @@ -7,6 +8,7 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; +@AutoModelConfigurationLoader({"component", "minecraft:component"}) public class ComponentConditionLoader extends AbstractConditionLoader { @Override diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/condition/ConditionModelConfigurationLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/condition/ConditionModelConfigurationLoader.java index a87d408c..0c66b49d 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/condition/ConditionModelConfigurationLoader.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/condition/ConditionModelConfigurationLoader.java @@ -1,5 +1,6 @@ package fr.robie.craftengineconverter.api.configuration.loader.models.condition; +import fr.robie.craftengineconverter.api.annotations.AutoModelConfigurationLoader; import fr.robie.craftengineconverter.api.configuration.item.models.ModelConfiguration; import fr.robie.craftengineconverter.api.configuration.item.models.condition.ConditionModelConfiguration; import fr.robie.craftengineconverter.api.configuration.loader.models.AbstractConditionLoader; @@ -7,6 +8,7 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; +@AutoModelConfigurationLoader({"condition", "minecraft:condition"}) public class ConditionModelConfigurationLoader extends AbstractConditionLoader { @Override diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/condition/CustomModelDataConditionLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/condition/CustomModelDataConditionLoader.java index c0e8e683..f9026e46 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/condition/CustomModelDataConditionLoader.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/condition/CustomModelDataConditionLoader.java @@ -1,5 +1,6 @@ package fr.robie.craftengineconverter.api.configuration.loader.models.condition; +import fr.robie.craftengineconverter.api.annotations.AutoModelConfigurationLoader; import fr.robie.craftengineconverter.api.configuration.item.models.ModelConfiguration; import fr.robie.craftengineconverter.api.configuration.item.models.condition.CustomModelDataConditionConfiguration; import fr.robie.craftengineconverter.api.configuration.loader.models.AbstractConditionLoader; @@ -7,6 +8,7 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; +@AutoModelConfigurationLoader({"custom_model_data", "minecraft:custom_model_data"}) public class CustomModelDataConditionLoader extends AbstractConditionLoader { @Override diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/condition/HasComponentConditionLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/condition/HasComponentConditionLoader.java index 862f5084..7e743e78 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/condition/HasComponentConditionLoader.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/condition/HasComponentConditionLoader.java @@ -1,5 +1,6 @@ package fr.robie.craftengineconverter.api.configuration.loader.models.condition; +import fr.robie.craftengineconverter.api.annotations.AutoModelConfigurationLoader; import fr.robie.craftengineconverter.api.configuration.item.models.ModelConfiguration; import fr.robie.craftengineconverter.api.configuration.item.models.condition.HasComponentConditionConfiguration; import fr.robie.craftengineconverter.api.configuration.loader.models.AbstractConditionLoader; @@ -7,6 +8,7 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; +@AutoModelConfigurationLoader({"has_component", "minecraft:has_component"}) public class HasComponentConditionLoader extends AbstractConditionLoader { @Override diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/condition/KeybindDownConditionLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/condition/KeybindDownConditionLoader.java index 864eab87..1f5cb90c 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/condition/KeybindDownConditionLoader.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/condition/KeybindDownConditionLoader.java @@ -1,5 +1,6 @@ package fr.robie.craftengineconverter.api.configuration.loader.models.condition; +import fr.robie.craftengineconverter.api.annotations.AutoModelConfigurationLoader; import fr.robie.craftengineconverter.api.configuration.item.models.ModelConfiguration; import fr.robie.craftengineconverter.api.configuration.item.models.condition.KeybindDownConditionConfiguration; import fr.robie.craftengineconverter.api.configuration.loader.models.AbstractConditionLoader; @@ -7,6 +8,7 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; +@AutoModelConfigurationLoader({"keybind_down", "minecraft:keybind_down"}) public class KeybindDownConditionLoader extends AbstractConditionLoader { @Override diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/model/SimpleModelConfigurationLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/model/SimpleModelConfigurationLoader.java index 01ec9130..cbe68c92 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/model/SimpleModelConfigurationLoader.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/model/SimpleModelConfigurationLoader.java @@ -1,5 +1,6 @@ package fr.robie.craftengineconverter.api.configuration.loader.models.model; +import fr.robie.craftengineconverter.api.annotations.AutoModelConfigurationLoader; import fr.robie.craftengineconverter.api.configuration.item.models.ModelConfiguration; import fr.robie.craftengineconverter.api.configuration.item.models.model.GenerationConfiguration; import fr.robie.craftengineconverter.api.configuration.item.models.model.SimpleModelConfiguration; @@ -12,6 +13,8 @@ import java.util.List; + +@AutoModelConfigurationLoader({"model", "minecraft:model"}) public class SimpleModelConfigurationLoader implements ModelConfigurationLoader { @Override diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/AbstractSelectModelConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/AbstractSelectModelConfiguration.java new file mode 100644 index 00000000..e6b46508 --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/AbstractSelectModelConfiguration.java @@ -0,0 +1,49 @@ +package fr.robie.craftengineconverter.api.configuration.loader.models.select; + +import fr.robie.craftengineconverter.api.configuration.item.models.ModelConfiguration; +import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.function.BiConsumer; +import java.util.function.Function; + +public abstract class AbstractSelectModelConfiguration implements SelectModelConfigurationLoader { + private final String property; + + public AbstractSelectModelConfiguration(@NotNull String property) { + this.property = property; + } + + @Override + @NotNull + public String getPropertyName() { + return this.property; + } + + @Nullable + protected ModelConfiguration loadFallback(@NotNull ConfigurationSection section) { + ConfigurationSection fallbackSection = section.getConfigurationSection("fallback"); + return fallbackSection != null ? this.loadModel(fallbackSection) : null; + } + + protected void loadCases( + @NotNull ConfigurationSection section, + BiConsumer caseConsumer, + Function valueParser) { + for (ConfigurationSection caseSection : section.getSectionList("cases")) { + Object when = caseSection.get("when"); + if (when == null) { + continue; + } + try { + T parsedValue = valueParser.apply(when); + ModelConfiguration model = this.loadModel(caseSection.getConfigurationSection("model")); + if (model != null) { + caseConsumer.accept(parsedValue, model); + } + } catch (IllegalArgumentException ignored) { + } + } + } +} \ No newline at end of file diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/BlockStateSelectConfigurationLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/BlockStateSelectConfigurationLoader.java new file mode 100644 index 00000000..a2338039 --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/BlockStateSelectConfigurationLoader.java @@ -0,0 +1,26 @@ +package fr.robie.craftengineconverter.api.configuration.loader.models.select; + +import fr.robie.craftengineconverter.api.configuration.item.models.select.BlockStateSelectConfiguration; +import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; +import org.jetbrains.annotations.NotNull; + +public class BlockStateSelectConfigurationLoader extends AbstractSelectModelConfiguration { + + public BlockStateSelectConfigurationLoader() { + super("block_state"); + } + + @Override + public BlockStateSelectConfiguration load(@NotNull ConfigurationSection section) { + String blockStateProperty = section.getString("block_state_property"); + if (blockStateProperty == null || blockStateProperty.isEmpty()) { + throw new IllegalArgumentException("Missing required field 'block_state_property'"); + } + + BlockStateSelectConfiguration config = new BlockStateSelectConfiguration(blockStateProperty); + config.setFallback(this.loadFallback(section)); + this.loadCases(section, config::addCase, when -> when); + return config; + } + +} \ No newline at end of file diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/ChargeTypeSelectConfigurationLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/ChargeTypeSelectConfigurationLoader.java new file mode 100644 index 00000000..e1b7414f --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/ChargeTypeSelectConfigurationLoader.java @@ -0,0 +1,22 @@ +package fr.robie.craftengineconverter.api.configuration.loader.models.select; + +import fr.robie.craftengineconverter.api.configuration.item.models.range_dispatch.ChargeType; +import fr.robie.craftengineconverter.api.configuration.item.models.select.ChargeTypeSelectConfiguration; +import fr.robie.craftengineconverter.api.configuration.item.models.select.SelectModelConfiguration; +import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; +import org.jetbrains.annotations.NotNull; + +public class ChargeTypeSelectConfigurationLoader extends AbstractSelectModelConfiguration { + + public ChargeTypeSelectConfigurationLoader() { + super("minecraft:charge_type"); + } + + @Override + public SelectModelConfiguration load(@NotNull ConfigurationSection section) { + ChargeTypeSelectConfiguration chargeTypeSelectConfiguration = new ChargeTypeSelectConfiguration(); + chargeTypeSelectConfiguration.setFallback(this.loadFallback(section)); + this.loadCases(section, chargeTypeSelectConfiguration::addCase, when -> ChargeType.valueOf(when.toString().toUpperCase())); + return chargeTypeSelectConfiguration; + } +} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/ComponentSelectConfigurationLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/ComponentSelectConfigurationLoader.java new file mode 100644 index 00000000..60200431 --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/ComponentSelectConfigurationLoader.java @@ -0,0 +1,26 @@ +package fr.robie.craftengineconverter.api.configuration.loader.models.select; + +import fr.robie.craftengineconverter.api.configuration.item.models.select.ComponentSelectConfiguration; +import fr.robie.craftengineconverter.api.configuration.item.models.select.SelectModelConfiguration; +import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; +import org.jetbrains.annotations.NotNull; + +public class ComponentSelectConfigurationLoader extends AbstractSelectModelConfiguration { + + public ComponentSelectConfigurationLoader() { + super("component"); + } + + @Override + public SelectModelConfiguration load(@NotNull ConfigurationSection section) { + String component = section.getString("component"); + if (component == null || component.isEmpty()) { + throw new IllegalArgumentException("Missing required field 'component'"); + } + + SelectModelConfiguration config = new ComponentSelectConfiguration(component); + config.setFallback(this.loadFallback(section)); + this.loadCases(section, config::addCase, when -> when); + return config; + } +} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/CustomModelDataSelectConfigurationLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/CustomModelDataSelectConfigurationLoader.java new file mode 100644 index 00000000..ae21ebfb --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/CustomModelDataSelectConfigurationLoader.java @@ -0,0 +1,22 @@ +package fr.robie.craftengineconverter.api.configuration.loader.models.select; + +import fr.robie.craftengineconverter.api.configuration.item.models.select.CustomModelDataSelectConfiguration; +import fr.robie.craftengineconverter.api.configuration.item.models.select.SelectModelConfiguration; +import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; +import org.jetbrains.annotations.NotNull; + +public class CustomModelDataSelectConfigurationLoader extends AbstractSelectModelConfiguration { + + public CustomModelDataSelectConfigurationLoader() { + super("custom_model_data"); + } + + @Override + public SelectModelConfiguration load(@NotNull ConfigurationSection section) { + int index = section.getInt("index", 0); + SelectModelConfiguration config = new CustomModelDataSelectConfiguration(index); + config.setFallback(this.loadFallback(section)); + this.loadCases(section, config::addCase, Object::toString); + return config; + } +} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/DisplayContentSelectConfigurationLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/DisplayContentSelectConfigurationLoader.java new file mode 100644 index 00000000..6c6c3ea7 --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/DisplayContentSelectConfigurationLoader.java @@ -0,0 +1,22 @@ +package fr.robie.craftengineconverter.api.configuration.loader.models.select; + +import fr.robie.craftengineconverter.api.configuration.item.models.select.DisplayContent; +import fr.robie.craftengineconverter.api.configuration.item.models.select.DisplayContentSelectConfiguration; +import fr.robie.craftengineconverter.api.configuration.item.models.select.SelectModelConfiguration; +import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; +import org.jetbrains.annotations.NotNull; + +public class DisplayContentSelectConfigurationLoader extends AbstractSelectModelConfiguration { + + public DisplayContentSelectConfigurationLoader() { + super("display_context"); + } + + @Override + public SelectModelConfiguration load(@NotNull ConfigurationSection section) { + SelectModelConfiguration config = new DisplayContentSelectConfiguration(); + config.setFallback(this.loadFallback(section)); + this.loadCases(section, config::addCase, when -> DisplayContent.valueOf(when.toString().toUpperCase())); + return config; + } +} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/LocalTimeSelectConfigurationLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/LocalTimeSelectConfigurationLoader.java new file mode 100644 index 00000000..96a9add5 --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/LocalTimeSelectConfigurationLoader.java @@ -0,0 +1,27 @@ +package fr.robie.craftengineconverter.api.configuration.loader.models.select; + +import fr.robie.craftengineconverter.api.configuration.item.models.select.LocalTimeSelectConfiguration; +import fr.robie.craftengineconverter.api.configuration.item.models.select.SelectModelConfiguration; +import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; +import org.jetbrains.annotations.NotNull; + +public class LocalTimeSelectConfigurationLoader extends AbstractSelectModelConfiguration { + + public LocalTimeSelectConfigurationLoader() { + super("local_time"); + } + + @Override + public SelectModelConfiguration load(@NotNull ConfigurationSection section) { + String locale = section.getString("locale"); + String timeZone = section.getString("time_zone"); + String pattern = section.getString("pattern"); + if (pattern == null || pattern.isEmpty()) { + throw new IllegalArgumentException("Missing required field 'pattern'"); + } + LocalTimeSelectConfiguration config = new LocalTimeSelectConfiguration(locale, timeZone, pattern); + config.setFallback(this.loadFallback(section)); + this.loadCases(section, config::addCase, when -> when); + return config; + } +} \ No newline at end of file diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/MainHandSelectConfigurationLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/MainHandSelectConfigurationLoader.java new file mode 100644 index 00000000..035051d9 --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/MainHandSelectConfigurationLoader.java @@ -0,0 +1,22 @@ +package fr.robie.craftengineconverter.api.configuration.loader.models.select; + +import fr.robie.craftengineconverter.api.configuration.item.models.select.MainHand; +import fr.robie.craftengineconverter.api.configuration.item.models.select.MainHandSelectConfiguration; +import fr.robie.craftengineconverter.api.configuration.item.models.select.SelectModelConfiguration; +import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; +import org.jetbrains.annotations.NotNull; + +public class MainHandSelectConfigurationLoader extends AbstractSelectModelConfiguration { + + public MainHandSelectConfigurationLoader() { + super("main_hand"); + } + + @Override + public SelectModelConfiguration load(@NotNull ConfigurationSection section) { + SelectModelConfiguration config = new MainHandSelectConfiguration(); + config.setFallback(this.loadFallback(section)); + this.loadCases(section, config::addCase, when -> MainHand.valueOf(when.toString().toUpperCase())); + return config; + } +} \ No newline at end of file diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/SelectModelConfigurationLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/SelectModelConfigurationLoader.java new file mode 100644 index 00000000..2ecfb852 --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/SelectModelConfigurationLoader.java @@ -0,0 +1,19 @@ +package fr.robie.craftengineconverter.api.configuration.loader.models.select; + +import fr.robie.craftengineconverter.api.configuration.item.models.ModelConfiguration; +import fr.robie.craftengineconverter.api.configuration.item.models.select.SelectModelConfiguration; +import fr.robie.craftengineconverter.api.configuration.loader.models.ModelConfigurationRegistry; +import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; +import org.jetbrains.annotations.NotNull; + +public interface SelectModelConfigurationLoader { + + @NotNull + String getPropertyName(); + + SelectModelConfiguration load(@NotNull ConfigurationSection section); + + default ModelConfiguration loadModel(ConfigurationSection modelSection) { + return ModelConfigurationRegistry.load(modelSection); + } +} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/SelectModelConfigurationRegistry.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/SelectModelConfigurationRegistry.java new file mode 100644 index 00000000..060b5e85 --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/SelectModelConfigurationRegistry.java @@ -0,0 +1,51 @@ +package fr.robie.craftengineconverter.api.configuration.loader.models.select; + +import fr.robie.craftengineconverter.api.configuration.item.models.select.SelectModelConfiguration; +import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; +import org.jetbrains.annotations.Nullable; + +import java.util.HashMap; +import java.util.Map; + +public class SelectModelConfigurationRegistry { + private static final Map> LOADERS = new HashMap<>(); + + static { + registerLoader(new ChargeTypeSelectConfigurationLoader()); + registerLoader(new BlockStateSelectConfigurationLoader()); + registerLoader(new ComponentSelectConfigurationLoader()); + registerLoader(new CustomModelDataSelectConfigurationLoader()); + registerLoader(new DisplayContentSelectConfigurationLoader()); + registerLoader(new LocalTimeSelectConfigurationLoader()); + registerLoader(new MainHandSelectConfigurationLoader()); + } + + public static void registerLoader(SelectModelConfigurationLoader loader) { + LOADERS.put(loader.getPropertyName(), loader); + } + + @Nullable + public static SelectModelConfiguration load(@Nullable ConfigurationSection section) { + if (section == null) { + return null; + } + String property = section.getString("property"); + if (property == null) { + return null; + } + + SelectModelConfigurationLoader loader = LOADERS.get(property); + if (loader == null) { + if (property.startsWith("minecraft:")) { + loader = LOADERS.get(property.substring("minecraft:".length())); + } else { + loader = LOADERS.get("minecraft:" + property); + } + } + + if (loader == null) { + return null; + } + return loader.load(section); + } +} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/tints/TintConfigurationRegistry.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/tints/TintConfigurationRegistry.java index 5b548884..fb806ea0 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/tints/TintConfigurationRegistry.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/tints/TintConfigurationRegistry.java @@ -1,6 +1,6 @@ package fr.robie.craftengineconverter.api.configuration.loader.models.tints; -import fr.robie.craftengineconverter.api.configuration.item.models.tints.*; +import fr.robie.craftengineconverter.api.configuration.item.models.tints.TintConfiguration; import fr.robie.craftengineconverter.api.logger.LogType; import fr.robie.craftengineconverter.api.logger.Logger; import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; @@ -15,17 +15,6 @@ public class TintConfigurationRegistry { private static final Map LOADERS = new HashMap<>(); - static { - register("constant", TintConfigurationRegistry::loadConstant); - register("dye", TintConfigurationRegistry::loadDye); - register("firework", TintConfigurationRegistry::loadFirework); - register("grass", TintConfigurationRegistry::loadGrass); - register("map_color", TintConfigurationRegistry::loadMapColor); - register("potion", TintConfigurationRegistry::loadPotion); - register("team", TintConfigurationRegistry::loadTeam); - register("custom_model_data", TintConfigurationRegistry::loadCustomModelData); - } - private TintConfigurationRegistry() { } @@ -66,49 +55,4 @@ public static List loadList(@NotNull ConfigurationSection par } return result; } - - private static TintConfiguration loadConstant(ConfigurationSection section) { - Object value = section.get("value"); - if (value == null) { - return null; - } - return new ConstantTintConfiguration(value); - } - - private static TintConfiguration loadCustomModelData(ConfigurationSection section) { - int index = section.getInt("index", 0); - Object defaultValue = section.get("default"); - return new CustomModelDataTintConfiguration(index, defaultValue); - } - - private static TintConfiguration loadDye(ConfigurationSection section) { - Object o = section.get("default"); - return o == null ? null : new DyeTintConfiguration(o); - } - - private static TintConfiguration loadFirework(ConfigurationSection section) { - Object o = section.get("default"); - return o == null ? null : new FireworkTintConfiguration(o); - } - - private static TintConfiguration loadGrass(ConfigurationSection section) { - float temperature = (float) section.getDouble("temperature", 0.0); - float downfall = (float) section.getDouble("downfall", 0.0); - return new GrassTintConfiguration(temperature, downfall); - } - - private static TintConfiguration loadMapColor(ConfigurationSection section) { - Object o = section.get("default"); - return o == null ? null : new MapColorTintConfiguration(o); - } - - private static TintConfiguration loadPotion(ConfigurationSection section) { - Object o = section.get("default"); - return o == null ? null : new PotionTintConfiguration(o); - } - - private static TintConfiguration loadTeam(ConfigurationSection section) { - Object o = section.get("default"); - return o == null ? null : new TeamTintConfiguration(o); - } } diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/ConstantTintLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/ConstantTintLoader.java new file mode 100644 index 00000000..a962e383 --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/ConstantTintLoader.java @@ -0,0 +1,16 @@ +package fr.robie.craftengineconverter.api.configuration.loader.tints; + +import fr.robie.craftengineconverter.api.annotations.AutoTintConfigurationLoader; +import fr.robie.craftengineconverter.api.configuration.item.models.tints.ConstantTintConfiguration; +import fr.robie.craftengineconverter.api.configuration.loader.models.tints.TintConfigurationLoader; +import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; + +@AutoTintConfigurationLoader({"constant", "minecraft:constant"}) +public class ConstantTintLoader implements TintConfigurationLoader { + + @Override + public ConstantTintConfiguration load(ConfigurationSection section) { + Object value = section.get("value"); + return value == null ? null : new ConstantTintConfiguration(value); + } +} \ No newline at end of file diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/CustomModelDataTintLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/CustomModelDataTintLoader.java new file mode 100644 index 00000000..e7206b58 --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/CustomModelDataTintLoader.java @@ -0,0 +1,17 @@ +package fr.robie.craftengineconverter.api.configuration.loader.tints; + +import fr.robie.craftengineconverter.api.annotations.AutoTintConfigurationLoader; +import fr.robie.craftengineconverter.api.configuration.item.models.tints.CustomModelDataTintConfiguration; +import fr.robie.craftengineconverter.api.configuration.loader.models.tints.TintConfigurationLoader; +import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; + +@AutoTintConfigurationLoader({"custom_model_data", "minecraft:custom_model_data"}) +public class CustomModelDataTintLoader implements TintConfigurationLoader { + + @Override + public CustomModelDataTintConfiguration load(ConfigurationSection section) { + int index = section.getInt("index", 0); + Object defaultValue = section.get("default"); + return new CustomModelDataTintConfiguration(index, defaultValue); + } +} \ No newline at end of file diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/DyeTintLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/DyeTintLoader.java new file mode 100644 index 00000000..0ada568d --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/DyeTintLoader.java @@ -0,0 +1,16 @@ +package fr.robie.craftengineconverter.api.configuration.loader.tints; + +import fr.robie.craftengineconverter.api.annotations.AutoTintConfigurationLoader; +import fr.robie.craftengineconverter.api.configuration.item.models.tints.DyeTintConfiguration; +import fr.robie.craftengineconverter.api.configuration.loader.models.tints.TintConfigurationLoader; +import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; + +@AutoTintConfigurationLoader({"dye", "minecraft:dye"}) +public class DyeTintLoader implements TintConfigurationLoader { + + @Override + public DyeTintConfiguration load(ConfigurationSection section) { + Object o = section.get("default"); + return o == null ? null : new DyeTintConfiguration(o); + } +} \ No newline at end of file diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/FireworkTintLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/FireworkTintLoader.java new file mode 100644 index 00000000..b0bbdacd --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/FireworkTintLoader.java @@ -0,0 +1,16 @@ +package fr.robie.craftengineconverter.api.configuration.loader.tints; + +import fr.robie.craftengineconverter.api.annotations.AutoTintConfigurationLoader; +import fr.robie.craftengineconverter.api.configuration.item.models.tints.FireworkTintConfiguration; +import fr.robie.craftengineconverter.api.configuration.loader.models.tints.TintConfigurationLoader; +import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; + +@AutoTintConfigurationLoader({"firework", "minecraft:firework"}) +public class FireworkTintLoader implements TintConfigurationLoader { + + @Override + public FireworkTintConfiguration load(ConfigurationSection section) { + Object o = section.get("default"); + return o == null ? null : new FireworkTintConfiguration(o); + } +} \ No newline at end of file diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/GrassTintLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/GrassTintLoader.java new file mode 100644 index 00000000..65f2fbaa --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/GrassTintLoader.java @@ -0,0 +1,17 @@ +package fr.robie.craftengineconverter.api.configuration.loader.tints; + +import fr.robie.craftengineconverter.api.annotations.AutoTintConfigurationLoader; +import fr.robie.craftengineconverter.api.configuration.item.models.tints.GrassTintConfiguration; +import fr.robie.craftengineconverter.api.configuration.loader.models.tints.TintConfigurationLoader; +import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; + +@AutoTintConfigurationLoader({"grass", "minecraft:grass"}) +public class GrassTintLoader implements TintConfigurationLoader { + + @Override + public GrassTintConfiguration load(ConfigurationSection section) { + float temperature = (float) section.getDouble("temperature", 0.0); + float downfall = (float) section.getDouble("downfall", 0.0); + return new GrassTintConfiguration(temperature, downfall); + } +} \ No newline at end of file diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/MapColorTintLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/MapColorTintLoader.java new file mode 100644 index 00000000..65f798b9 --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/MapColorTintLoader.java @@ -0,0 +1,16 @@ +package fr.robie.craftengineconverter.api.configuration.loader.tints; + +import fr.robie.craftengineconverter.api.annotations.AutoTintConfigurationLoader; +import fr.robie.craftengineconverter.api.configuration.item.models.tints.MapColorTintConfiguration; +import fr.robie.craftengineconverter.api.configuration.loader.models.tints.TintConfigurationLoader; +import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; + +@AutoTintConfigurationLoader({"map_color", "minecraft:map_color"}) +public class MapColorTintLoader implements TintConfigurationLoader { + + @Override + public MapColorTintConfiguration load(ConfigurationSection section) { + Object defaultValue = section.get("default"); + return defaultValue == null ? null : new MapColorTintConfiguration(defaultValue); + } +} \ No newline at end of file diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/PotionTintLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/PotionTintLoader.java new file mode 100644 index 00000000..89136f60 --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/PotionTintLoader.java @@ -0,0 +1,16 @@ +package fr.robie.craftengineconverter.api.configuration.loader.tints; + +import fr.robie.craftengineconverter.api.annotations.AutoTintConfigurationLoader; +import fr.robie.craftengineconverter.api.configuration.item.models.tints.PotionTintConfiguration; +import fr.robie.craftengineconverter.api.configuration.loader.models.tints.TintConfigurationLoader; +import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; + +@AutoTintConfigurationLoader({"potion", "minecraft:potion"}) +public class PotionTintLoader implements TintConfigurationLoader { + + @Override + public PotionTintConfiguration load(ConfigurationSection section) { + Object o = section.get("default"); + return o == null ? null : new PotionTintConfiguration(o); + } +} \ No newline at end of file diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/TeamTintLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/TeamTintLoader.java new file mode 100644 index 00000000..1a49cd0e --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/TeamTintLoader.java @@ -0,0 +1,16 @@ +package fr.robie.craftengineconverter.api.configuration.loader.tints; + +import fr.robie.craftengineconverter.api.annotations.AutoTintConfigurationLoader; +import fr.robie.craftengineconverter.api.configuration.item.models.tints.TeamTintConfiguration; +import fr.robie.craftengineconverter.api.configuration.loader.models.tints.TintConfigurationLoader; +import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; + +@AutoTintConfigurationLoader({"team", "minecraft:team"}) +public class TeamTintLoader implements TintConfigurationLoader { + + @Override + public TeamTintConfiguration load(ConfigurationSection section) { + Object o = section.get("default"); + return o == null ? null : new TeamTintConfiguration(o); + } +} \ No newline at end of file diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/manager/FoliaCompatibilityManager.java b/API/src/main/java/fr/robie/craftengineconverter/api/manager/FoliaCompatibilityManager.java index 48d8f9a1..9a10f984 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/manager/FoliaCompatibilityManager.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/manager/FoliaCompatibilityManager.java @@ -2,6 +2,7 @@ import com.tcoded.folialib.FoliaLib; import com.tcoded.folialib.wrapper.task.WrappedTask; +import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.entity.Entity; import org.bukkit.entity.Player; @@ -12,17 +13,26 @@ import java.util.concurrent.TimeUnit; import java.util.function.Consumer; -public class FoliaCompatibilityManager { - private final FoliaLib foliaLib; +public record FoliaCompatibilityManager(FoliaLib foliaLib) { + private static FoliaCompatibilityManager instance; - public FoliaCompatibilityManager(Plugin plugin) { - this.foliaLib = new FoliaLib(plugin); + public FoliaCompatibilityManager(Plugin foliaLib) { + this.foliaLib = new FoliaLib(foliaLib); + instance = this; + } + + public static FoliaCompatibilityManager getInstance() { + if (instance == null) { + throw new IllegalStateException("FoliaCompatibilityManager has not been initialized yet."); + } + return instance; } /** * Get the FoliaLib instance for direct access if needed. */ - public FoliaLib getFoliaLib() { + @Override + public FoliaLib foliaLib() { return this.foliaLib; } @@ -260,7 +270,7 @@ public boolean isOwnedByCurrentRegion(Location location) { if (this.foliaLib.isFolia()) { // Use Bukkit.isOwnedByCurrentRegion() on Folia try { - return org.bukkit.Bukkit.isOwnedByCurrentRegion(location); + return Bukkit.isOwnedByCurrentRegion(location); } catch (Exception e) { // Fallback if method doesn't exist in current version return true; @@ -280,7 +290,7 @@ public boolean isOwnedByCurrentRegion(Entity entity) { if (this.foliaLib.isFolia()) { // Use Bukkit.isOwnedByCurrentRegion() on Folia try { - return org.bukkit.Bukkit.isOwnedByCurrentRegion(entity); + return Bukkit.isOwnedByCurrentRegion(entity); } catch (Exception e) { // Fallback if method doesn't exist in current version return true; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/reflections/ReflectionsCache.java b/API/src/main/java/fr/robie/craftengineconverter/api/reflections/ReflectionsCache.java new file mode 100644 index 00000000..6f326c43 --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/reflections/ReflectionsCache.java @@ -0,0 +1,51 @@ +package fr.robie.craftengineconverter.api.reflections; + +import org.bukkit.plugin.java.JavaPlugin; +import org.jetbrains.annotations.NotNull; +import org.reflections.Reflections; +import org.reflections.scanners.Scanners; +import org.reflections.util.ConfigurationBuilder; + +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +public class ReflectionsCache { + private static ReflectionsCache instance; + + private final Map cache; + + private ReflectionsCache() { + this.cache = new ConcurrentHashMap<>(); + } + + public static synchronized ReflectionsCache getInstance() { + if (instance == null) { + instance = new ReflectionsCache(); + } + return instance; + } + + public Reflections getOrCreate(@NotNull JavaPlugin plugin, @NotNull String packageName) { + if (packageName.trim().isEmpty()) { + throw new IllegalArgumentException("Package name cannot be empty"); + } + + ClassLoader classLoader = plugin.getClass().getClassLoader(); + CacheKey key = new CacheKey(packageName, classLoader); + + return this.cache.computeIfAbsent(key, k -> this.createReflections(classLoader, packageName)); + } + + private Reflections createReflections(ClassLoader classLoader, String packageName) { + return new Reflections(new ConfigurationBuilder() + .forPackage(packageName, classLoader) + .addClassLoaders(classLoader) + .setScanners(Scanners.TypesAnnotated, Scanners.SubTypes)); + } + + private record CacheKey(String packageName, int classLoaderHash) { + CacheKey(String packageName, ClassLoader classLoader) { + this(packageName, System.identityHashCode(classLoader)); + } + } +} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/utils/MinecraftVersion.java b/API/src/main/java/fr/robie/craftengineconverter/api/utils/MinecraftVersion.java new file mode 100644 index 00000000..6140f161 --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/utils/MinecraftVersion.java @@ -0,0 +1,108 @@ +package fr.robie.craftengineconverter.api.utils; + +import org.bukkit.Bukkit; + +public final class MinecraftVersion implements Comparable { + + private static MinecraftVersion current; + + private final int major; + private final int minor; + private final int patch; + + private MinecraftVersion(int major, int minor, int patch) { + this.major = major; + this.minor = minor; + this.patch = patch; + } + + /** + * Returns the current server's Minecraft version, parsed once and cached. + */ + public static MinecraftVersion current() { + if (current == null) { + current = parse(Bukkit.getBukkitVersion()); + } + return current; + } + + /** + * Parses a version string such as {@code "1.21.4"} or {@code "1.21.4-R0.1-SNAPSHOT"}. + * If parsing fails, returns {@code (0, 0, 0)} and logs a warning — this causes all + * {@code @SinceVersion} checks to fail conservatively rather than crashing. + */ + public static MinecraftVersion parse(String raw) { + if (raw == null || raw.isBlank()) { + return new MinecraftVersion(0, 0, 0); + } + // Strip everything after the first '-' → "1.21.4-R0.1-SNAPSHOT" becomes "1.21.4" + String clean = raw.contains("-") ? raw.substring(0, raw.indexOf('-')) : raw; + String[] parts = clean.split("\\."); + try { + int major = parts.length > 0 ? Integer.parseInt(parts[0]) : 0; + int minor = parts.length > 1 ? Integer.parseInt(parts[1]) : 0; + int patch = parts.length > 2 ? Integer.parseInt(parts[2]) : 0; + return new MinecraftVersion(major, minor, patch); + } catch (NumberFormatException e) { + return new MinecraftVersion(0, 0, 0); + } + } + + /** + * Returns {@code true} if this version is greater than or equal to {@code other}. + */ + public boolean isAtLeast(MinecraftVersion other) { + return this.compareTo(other) >= 0; + } + + /** + * Returns {@code true} if this version is less than or equal to {@code other}. + */ + public boolean isAtMost(MinecraftVersion other) { + return this.compareTo(other) <= 0; + } + + public int getMajor() { + return this.major; + } + + public int getMinor() { + return this.minor; + } + + public int getPatch() { + return this.patch; + } + + @Override + public int compareTo(MinecraftVersion other) { + if (this.major != other.major) { + return Integer.compare(this.major, other.major); + } + if (this.minor != other.minor) { + return Integer.compare(this.minor, other.minor); + } + return Integer.compare(this.patch, other.patch); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof MinecraftVersion other)) { + return false; + } + return this.major == other.major && this.minor == other.minor && this.patch == other.patch; + } + + @Override + public int hashCode() { + return 31 * (31 * this.major + this.minor) + this.patch; + } + + @Override + public String toString() { + return this.major + "." + this.minor + (this.patch != 0 ? "." + this.patch : ""); + } +} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/utils/VersionFilter.java b/API/src/main/java/fr/robie/craftengineconverter/api/utils/VersionFilter.java new file mode 100644 index 00000000..1634f15d --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/utils/VersionFilter.java @@ -0,0 +1,47 @@ +package fr.robie.craftengineconverter.api.utils; + +import fr.robie.craftengineconverter.api.annotations.PaperOnly; +import fr.robie.craftengineconverter.api.annotations.SinceVersion; +import fr.robie.craftengineconverter.api.annotations.SpigotOnly; +import fr.robie.craftengineconverter.api.annotations.UntilVersion; +import fr.robie.craftengineconverter.api.logger.Logger; +import fr.robie.craftengineconverter.api.manager.FoliaCompatibilityManager; + +public final class VersionFilter { + + private VersionFilter() { + } + + public static boolean passes(Class clazz, String label) { + if (clazz.isAnnotationPresent(PaperOnly.class) && !FoliaCompatibilityManager.getInstance().isPaperOrFolia()) { + Logger.debug("Skipping %label% — @PaperOnly, running Spigot.", "label", label); + return false; + } + if (clazz.isAnnotationPresent(SpigotOnly.class) && FoliaCompatibilityManager.getInstance().isPaperOrFolia()) { + Logger.debug("Skipping %label% — @SpigotOnly, running Paper.", "label", label); + return false; + } + + MinecraftVersion server = MinecraftVersion.current(); + + SinceVersion since = clazz.getAnnotation(SinceVersion.class); + if (since != null) { + MinecraftVersion minimum = MinecraftVersion.parse(since.value()); + if (!server.isAtLeast(minimum)) { + Logger.debug("Skipping %label% — requires >= %version%, server is %server%.", "label", label, "version", since.value(), "server", server); + return false; + } + } + + UntilVersion until = clazz.getAnnotation(UntilVersion.class); + if (until != null) { + MinecraftVersion maximum = MinecraftVersion.parse(until.value()); + if (!server.isAtMost(maximum)) { + Logger.debug("Skipping %label% — requires <= %version%, server is %server%.", "label", label, "version", until.value(), "server", server); + return false; + } + } + + return true; + } +} \ No newline at end of file diff --git a/API/src/main/resources/META-INF/services/org.reflections.scanners.Scanner b/API/src/main/resources/META-INF/services/org.reflections.scanners.Scanner new file mode 100644 index 00000000..2f49d15b --- /dev/null +++ b/API/src/main/resources/META-INF/services/org.reflections.scanners.Scanner @@ -0,0 +1 @@ +AutoTintConfigurationLoaderScanner \ No newline at end of file diff --git a/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/directive/VersionKeyDirective.java b/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/directive/VersionKeyDirective.java index ad86d631..fb93e0a6 100644 --- a/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/directive/VersionKeyDirective.java +++ b/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/directive/VersionKeyDirective.java @@ -1,6 +1,6 @@ package fr.robie.craftengineconverter.common.utils.yaml.directive; -import fr.robie.craftengineconverter.common.enums.NmsVersion; +import fr.robie.craftengineconverter.api.utils.MinecraftVersion; import fr.robie.craftengineconverter.common.utils.yaml.constructor.SmartConstructor; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -53,77 +53,27 @@ private static boolean evaluate(@NotNull String key) { String verA = m.group(2); String verB = m.group(3); - NmsVersion current = NmsVersion.nmsVersion; + MinecraftVersion current = MinecraftVersion.current(); if (verB != null) { - NmsVersion min = resolve(verA); - NmsVersion max = resolve(verB); + MinecraftVersion min = MinecraftVersion.parse(verA); + MinecraftVersion max = MinecraftVersion.parse(verB); return current.isAtLeast(min) && current.isAtMost(max); } - NmsVersion target = resolve(verA); + MinecraftVersion target = MinecraftVersion.parse(verA); if (operator == null || operator.isEmpty()) { - return current == target; + return current.equals(target); } return switch (operator) { case ">=" -> current.isAtLeast(target); - case ">" -> current.isNewerThan(target); + case ">" -> current.compareTo(target) > 0; case "<=" -> current.isAtMost(target); - case "<" -> current.isOlderThan(target); - case "==" -> current == target; - case "!=" -> current != target; + case "<" -> current.compareTo(target) < 0; + case "==" -> current.equals(target); + case "!=" -> !current.equals(target); default -> false; }; } - - private static NmsVersion resolve(@NotNull String versionStr) { - Matcher m = Pattern.compile("(\\d+\\.\\d+)(\\.\\d+)?").matcher(versionStr); - if (!m.find()) { - return NmsVersion.UNKNOWN; - } - - String base = m.group(1).replace(".", ""); - String patch = m.group(2) != null ? m.group(2).replace(".", "") : "0"; - int target; - try { - target = Integer.parseInt(base + patch); - } catch (NumberFormatException e) { - return NmsVersion.UNKNOWN; - } - - NmsVersion best = NmsVersion.UNKNOWN; - int bestDiff = Integer.MAX_VALUE; - for (NmsVersion v : NmsVersion.values()) { - if (v == NmsVersion.UNKNOWN) { - continue; - } - int diff = Math.abs(versionInt(v) - target); - if (diff < bestDiff) { - bestDiff = diff; - best = v; - if (diff == 0) { - break; - } - } - } - return best; - } - - private static int versionInt(@NotNull NmsVersion v) { - String name = v.name(); - if (!name.startsWith("V_")) { - return Integer.MAX_VALUE; - } - String[] p = name.substring(2).split("_"); - try { - return switch (p.length) { - case 2 -> Integer.parseInt(p[0] + p[1] + "0"); - case 3 -> Integer.parseInt(p[0] + p[1] + p[2]); - default -> Integer.MAX_VALUE; - }; - } catch (NumberFormatException e) { - return Integer.MAX_VALUE; - } - } } \ No newline at end of file diff --git a/Plugin/pom.xml b/Plugin/pom.xml index 5e7a9733..d38c26b3 100644 --- a/Plugin/pom.xml +++ b/Plugin/pom.xml @@ -96,6 +96,11 @@ compile + + org.reflections + reflections + + org.junit.jupiter diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/CraftEngineConverter.java b/Plugin/src/main/java/fr/robie/craftengineconverter/CraftEngineConverter.java index 982d9f4a..b1b22cc6 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/CraftEngineConverter.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/CraftEngineConverter.java @@ -1,8 +1,15 @@ package fr.robie.craftengineconverter; +import fr.robie.craftengineconverter.api.annotations.AutoModelConfigurationLoader; +import fr.robie.craftengineconverter.api.annotations.AutoTintConfigurationLoader; import fr.robie.craftengineconverter.api.builder.TimerBuilder; import fr.robie.craftengineconverter.api.configuration.Configuration; import fr.robie.craftengineconverter.api.configuration.ConfigurationKey; +import fr.robie.craftengineconverter.api.configuration.loader.models.ModelConfigurationLoader; +import fr.robie.craftengineconverter.api.configuration.loader.models.ModelConfigurationRegistry; +import fr.robie.craftengineconverter.api.configuration.loader.models.select.SelectModelConfigurationRegistry; +import fr.robie.craftengineconverter.api.configuration.loader.models.tints.TintConfigurationLoader; +import fr.robie.craftengineconverter.api.configuration.loader.models.tints.TintConfigurationRegistry; import fr.robie.craftengineconverter.api.database.StorageManager; import fr.robie.craftengineconverter.api.enums.ConverterOption; import fr.robie.craftengineconverter.api.enums.Plugins; @@ -17,7 +24,9 @@ import fr.robie.craftengineconverter.api.manager.FoliaCompatibilityManager; import fr.robie.craftengineconverter.api.packet.PacketLoader; import fr.robie.craftengineconverter.api.profile.ServerProfile; +import fr.robie.craftengineconverter.api.reflections.ReflectionsCache; import fr.robie.craftengineconverter.api.tag.ITagResolver; +import fr.robie.craftengineconverter.api.utils.VersionFilter; import fr.robie.craftengineconverter.behavior.BehaviorRegister; import fr.robie.craftengineconverter.command.CraftEngineConverterCommand; import fr.robie.craftengineconverter.common.CraftEngineConverterPlugin; @@ -45,6 +54,7 @@ import org.bukkit.event.Listener; import org.bukkit.plugin.ServicePriority; import org.jetbrains.annotations.NotNull; +import org.reflections.Reflections; import java.io.File; import java.util.*; @@ -121,6 +131,7 @@ public void onEnable() { this.storageManager.loadDatabase(); this.serverProfile.load(); + this.loadRegistries(); this.commandManager.registerCommand("craftengineconverter", new CraftEngineConverterCommand(this), "cengineconverter", "cec"); @@ -239,6 +250,65 @@ public void onDisable() { Logger.info(Message.MESSAGE__PLUGIN__SHUTDOWN__COMPLETE, "time", TimerBuilder.formatTimeAuto(System.currentTimeMillis() - startTime)); } + private void loadRegistries() { + this.loadModelConfigurationRegistry(); + this.loadTintConfigurationRegistry(); + } + + private void loadModelConfigurationRegistry() { + Reflections reflections = ReflectionsCache.getInstance().getOrCreate(this, "fr.robie.craftengineconverter"); + Set> candidates = reflections.getTypesAnnotatedWith(AutoModelConfigurationLoader.class); + int count = 0; + for (Class clazz : candidates) { + if (!ModelConfigurationLoader.class.isAssignableFrom(clazz)) { + continue; + } + if (!VersionFilter.passes(clazz, clazz.getSimpleName())) { + continue; + } + AutoModelConfigurationLoader annotation = clazz.getAnnotation(AutoModelConfigurationLoader.class); + try { + ModelConfigurationLoader loader = (ModelConfigurationLoader) clazz.getDeclaredConstructor().newInstance(); + for (String name : annotation.value()) { + ModelConfigurationRegistry.register(name, loader); + } + count++; + } catch (Exception e) { + Logger.showException("Failed to load ModelConfigurationLoader " + clazz.getName() + " for names " + Arrays.toString(annotation.value()), e); + } + } + + ModelConfigurationRegistry.register("select", SelectModelConfigurationRegistry::load); + count++; + + Logger.info("Loaded " + count + " ModelConfigurationLoaders"); + } + + private void loadTintConfigurationRegistry() { + Reflections reflections = ReflectionsCache.getInstance().getOrCreate(this, "fr.robie.craftengineconverter"); + Set> candidates = reflections.getTypesAnnotatedWith(AutoTintConfigurationLoader.class); + int count = 0; + for (Class clazz : candidates) { + if (!TintConfigurationLoader.class.isAssignableFrom(clazz)) { + continue; + } + if (!fr.robie.craftengineconverter.api.utils.VersionFilter.passes(clazz, clazz.getSimpleName())) { + continue; + } + AutoTintConfigurationLoader annotation = clazz.getAnnotation(AutoTintConfigurationLoader.class); + try { + TintConfigurationLoader loader = (TintConfigurationLoader) clazz.getDeclaredConstructor().newInstance(); + for (String name : annotation.value()) { + TintConfigurationRegistry.register(name, loader); + } + count++; + } catch (Exception e) { + fr.robie.craftengineconverter.api.logger.Logger.showException("Failed to load TintConfigurationLoader " + clazz.getName() + " for names " + java.util.Arrays.toString(annotation.value()), e); + } + } + Logger.info("Loaded " + count + " TintConfigurationLoaders"); + } + public void reloadMessages() { this.messageLoader.reload(); } diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/itemsadder/IAItemsConverter.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/itemsadder/IAItemsConverter.java index 7b4095ba..9b75bc86 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/itemsadder/IAItemsConverter.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/itemsadder/IAItemsConverter.java @@ -27,8 +27,10 @@ import fr.robie.craftengineconverter.api.configuration.item.models.condition.ConditionModelConfiguration; import fr.robie.craftengineconverter.api.configuration.item.models.model.GenerationConfiguration; import fr.robie.craftengineconverter.api.configuration.item.models.model.SimpleModelConfiguration; +import fr.robie.craftengineconverter.api.configuration.item.models.range_dispatch.ChargeType; import fr.robie.craftengineconverter.api.configuration.item.models.range_dispatch.UseDurationRangeDispatchConfiguration; import fr.robie.craftengineconverter.api.configuration.item.models.select.ChargeTypeSelectConfiguration; +import fr.robie.craftengineconverter.api.configuration.item.models.select.DisplayContent; import fr.robie.craftengineconverter.api.configuration.item.models.select.DisplayContentSelectConfiguration; import fr.robie.craftengineconverter.api.configuration.item.settings.DropDisplayConfiguration; import fr.robie.craftengineconverter.api.configuration.item.settings.EquippableConfiguration; @@ -1066,8 +1068,8 @@ private void handleCrossbow2D(ConfigurationSection texturesSection) { String arrowTexture = this.namespaced(texturesSection.getString("arrow"), this.namespace); ChargeTypeSelectConfiguration chargeTypeSelect = new ChargeTypeSelectConfiguration(); - chargeTypeSelect.addCase(ChargeTypeSelectConfiguration.ChargeType.ARROW, this.buildSimpleModel("minecraft:item/crossbow_arrow", arrowTexture)); - chargeTypeSelect.addCase(ChargeTypeSelectConfiguration.ChargeType.ROCKET, this.buildSimpleModel("minecraft:item/crossbow_firework", rocketTexture)); + chargeTypeSelect.addCase(ChargeType.ARROW, this.buildSimpleModel("minecraft:item/crossbow_arrow", arrowTexture)); + chargeTypeSelect.addCase(ChargeType.ROCKET, this.buildSimpleModel("minecraft:item/crossbow_firework", rocketTexture)); chargeTypeSelect.setFallback(this.buildSimpleModel("minecraft:item/crossbow", normalTexture)); UseDurationRangeDispatchConfiguration pullingDispatch = new UseDurationRangeDispatchConfiguration(); @@ -1113,8 +1115,8 @@ private void handleCrossbow3D(ConfigurationSection modelsSection) { String arrowModel = this.namespaced(modelsSection.getString("arrow"), this.namespace); ChargeTypeSelectConfiguration chargeTypeSelect = new ChargeTypeSelectConfiguration(); - chargeTypeSelect.addCase(ChargeTypeSelectConfiguration.ChargeType.ARROW, new SimpleModelConfiguration(arrowModel)); - chargeTypeSelect.addCase(ChargeTypeSelectConfiguration.ChargeType.ROCKET, new SimpleModelConfiguration(rocketModel)); + chargeTypeSelect.addCase(ChargeType.ARROW, new SimpleModelConfiguration(arrowModel)); + chargeTypeSelect.addCase(ChargeType.ROCKET, new SimpleModelConfiguration(rocketModel)); chargeTypeSelect.setFallback(new SimpleModelConfiguration(normalModel)); UseDurationRangeDispatchConfiguration pullingDispatch = new UseDurationRangeDispatchConfiguration(); @@ -1139,9 +1141,9 @@ private void handleTrident3D(ConfigurationSection modelsSection) { DisplayContentSelectConfiguration displayContentSelect = new DisplayContentSelectConfiguration(); displayContentSelect.addCase(new SimpleModelConfiguration(normalModel), - DisplayContentSelectConfiguration.DisplayContent.GUI, - DisplayContentSelectConfiguration.DisplayContent.GROUND, - DisplayContentSelectConfiguration.DisplayContent.FIXED + DisplayContent.GUI, + DisplayContent.GROUND, + DisplayContent.FIXED ); displayContentSelect.setFallback(usingItemCondition); diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoItemConverter.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoItemConverter.java index 0fa8ed2e..e2883f71 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoItemConverter.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoItemConverter.java @@ -37,8 +37,10 @@ import fr.robie.craftengineconverter.api.configuration.item.models.condition.ConditionModelConfiguration; import fr.robie.craftengineconverter.api.configuration.item.models.model.GenerationConfiguration; import fr.robie.craftengineconverter.api.configuration.item.models.model.SimpleModelConfiguration; +import fr.robie.craftengineconverter.api.configuration.item.models.range_dispatch.ChargeType; import fr.robie.craftengineconverter.api.configuration.item.models.range_dispatch.UseDurationRangeDispatchConfiguration; import fr.robie.craftengineconverter.api.configuration.item.models.select.ChargeTypeSelectConfiguration; +import fr.robie.craftengineconverter.api.configuration.item.models.select.DisplayContent; import fr.robie.craftengineconverter.api.configuration.item.models.select.DisplayContentSelectConfiguration; import fr.robie.craftengineconverter.api.configuration.item.settings.InvulnerableSettingConfiguration; import fr.robie.craftengineconverter.api.configuration.item.settings.ProjectileSettingConfiguration; @@ -1392,9 +1394,9 @@ private boolean tryBuildTridentModel(ConfigurationSection packSection, String mo DisplayContentSelectConfiguration displayContentSelect = new DisplayContentSelectConfiguration(); displayContentSelect.addCase(new SimpleModelConfiguration(namespacedModel), - DisplayContentSelectConfiguration.DisplayContent.GUI, - DisplayContentSelectConfiguration.DisplayContent.GROUND, - DisplayContentSelectConfiguration.DisplayContent.FIXED + DisplayContent.GUI, + DisplayContent.GROUND, + DisplayContent.FIXED ); displayContentSelect.setFallback(usingItemCondition); @@ -1922,8 +1924,8 @@ private void buildCrossbowModel(ConfigurationSection packSection) { if (this.isNotNull(baseModel) && this.isNotNull(pulling0) && this.isNotNull(pulling1) && this.isNotNull(pulling2)) { ChargeTypeSelectConfiguration chargeTypeSelect = new ChargeTypeSelectConfiguration(); - chargeTypeSelect.addCase(ChargeTypeSelectConfiguration.ChargeType.ARROW, new SimpleModelConfiguration(arrowModel != null ? arrowModel : pulling2)); - chargeTypeSelect.addCase(ChargeTypeSelectConfiguration.ChargeType.ROCKET, new SimpleModelConfiguration(fireworkModel != null ? fireworkModel : pulling2)); + chargeTypeSelect.addCase(ChargeType.ARROW, new SimpleModelConfiguration(arrowModel != null ? arrowModel : pulling2)); + chargeTypeSelect.addCase(ChargeType.ROCKET, new SimpleModelConfiguration(fireworkModel != null ? fireworkModel : pulling2)); chargeTypeSelect.setFallback(new SimpleModelConfiguration(baseModel)); UseDurationRangeDispatchConfiguration pullingDispatch = new UseDurationRangeDispatchConfiguration(); diff --git a/Plugin/src/main/resources/plugin.yml b/Plugin/src/main/resources/plugin.yml index 547e8ca7..324dd6a3 100644 --- a/Plugin/src/main/resources/plugin.yml +++ b/Plugin/src/main/resources/plugin.yml @@ -1,6 +1,6 @@ name: ${project.parent.artifactId} version: ${plugin.finalVersion} -authors: [ ${plugin.author} ] +authors: [ ${ plugin.author } ] description: ${plugin.description} main: ${plugin.mainClass} api-version: ${plugin.apiVersion} @@ -8,4 +8,6 @@ softdepend: - CraftEngine - packetevents - PlaceholderAPI -folia-supported: true \ No newline at end of file +folia-supported: true +libraries: + - org.reflections:reflections:0.10.2 \ No newline at end of file diff --git a/pom.xml b/pom.xml index 10536475..d0eadc62 100644 --- a/pom.xml +++ b/pom.xml @@ -175,6 +175,13 @@ 2.6 provided + + + org.reflections + reflections + 0.10.2 + provided + From 0accb03d9c5875d76219e81d10423b39aeb22390 Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Thu, 30 Apr 2026 10:18:16 +0200 Subject: [PATCH 016/116] fix: canonical constructor error --- .../api/manager/FoliaCompatibilityManager.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/manager/FoliaCompatibilityManager.java b/API/src/main/java/fr/robie/craftengineconverter/api/manager/FoliaCompatibilityManager.java index 9a10f984..e6f05104 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/manager/FoliaCompatibilityManager.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/manager/FoliaCompatibilityManager.java @@ -16,8 +16,8 @@ public record FoliaCompatibilityManager(FoliaLib foliaLib) { private static FoliaCompatibilityManager instance; - public FoliaCompatibilityManager(Plugin foliaLib) { - this.foliaLib = new FoliaLib(foliaLib); + public FoliaCompatibilityManager(Plugin plugin) { + this(new FoliaLib(plugin)); instance = this; } From f7be5aa2417c806e33381871cd0811d7cd97339d Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Thu, 30 Apr 2026 10:42:34 +0200 Subject: [PATCH 017/116] feat: refactor model configuration loaders to support generics and improve type safety --- .../AutoSelectModelConfigurationLoader.java | 15 ++++++ .../models/AbstractConditionLoader.java | 3 +- .../models/ModelConfigurationLoader.java | 4 +- .../CompositeModelConfigurationLoader.java | 2 +- .../model/SimpleModelConfigurationLoader.java | 3 +- ...mpassRangeDispatchConfigurationLoader.java | 16 +++++++ .../AbstractSelectModelConfiguration.java | 19 ++++---- .../BlockStateSelectConfigurationLoader.java | 4 +- .../ChargeTypeSelectConfigurationLoader.java | 4 +- .../ComponentSelectConfigurationLoader.java | 4 +- ...tomModelDataSelectConfigurationLoader.java | 4 +- ...playContextSelectConfigurationLoader.java} | 8 ++-- .../LocalTimeSelectConfigurationLoader.java | 4 +- .../MainHandSelectConfigurationLoader.java | 4 +- .../SelectModelConfigurationLoader.java | 19 -------- .../SelectModelConfigurationRegistry.java | 28 +++-------- .../loader/tints/ConstantTintLoader.java | 3 +- .../tints/CustomModelDataTintLoader.java | 3 +- .../loader/tints/DyeTintLoader.java | 3 +- .../loader/tints/FireworkTintLoader.java | 3 +- .../loader/tints/GrassTintLoader.java | 3 +- .../loader/tints/MapColorTintLoader.java | 3 +- .../loader/tints/PotionTintLoader.java | 3 +- .../loader/tints/TeamTintLoader.java | 3 +- .../CraftEngineConverter.java | 47 ++++++++++++++++++- 25 files changed, 137 insertions(+), 75 deletions(-) create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/annotations/AutoSelectModelConfigurationLoader.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/range_dispatch/CompassRangeDispatchConfigurationLoader.java rename API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/{DisplayContentSelectConfigurationLoader.java => DisplayContextSelectConfigurationLoader.java} (75%) delete mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/SelectModelConfigurationLoader.java diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/annotations/AutoSelectModelConfigurationLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/annotations/AutoSelectModelConfigurationLoader.java new file mode 100644 index 00000000..22a96f72 --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/annotations/AutoSelectModelConfigurationLoader.java @@ -0,0 +1,15 @@ +package fr.robie.craftengineconverter.api.annotations; + +import org.jetbrains.annotations.NotNull; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.TYPE) +public @interface AutoSelectModelConfigurationLoader { + @NotNull + String[] value(); +} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/AbstractConditionLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/AbstractConditionLoader.java index c61a45f6..7608bf32 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/AbstractConditionLoader.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/AbstractConditionLoader.java @@ -1,9 +1,10 @@ package fr.robie.craftengineconverter.api.configuration.loader.models; +import fr.robie.craftengineconverter.api.configuration.item.models.ModelConfiguration; import fr.robie.craftengineconverter.api.configuration.item.models.condition.ConditionModelConfiguration; import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; -public abstract class AbstractConditionLoader implements ModelConfigurationLoader { +public abstract class AbstractConditionLoader implements ModelConfigurationLoader { protected void loadBranches(ConditionModelConfiguration config, ConfigurationSection section) { config.setOnTrue(ModelConfigurationRegistry.load(section.getConfigurationSection("on-true"))); diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/ModelConfigurationLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/ModelConfigurationLoader.java index d2be8549..9dd10916 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/ModelConfigurationLoader.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/ModelConfigurationLoader.java @@ -6,6 +6,6 @@ import org.jetbrains.annotations.Nullable; @FunctionalInterface -public interface ModelConfigurationLoader { - @Nullable ModelConfiguration load(@NotNull ConfigurationSection section); +public interface ModelConfigurationLoader { + @Nullable T load(@NotNull ConfigurationSection section); } \ No newline at end of file diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/composite/CompositeModelConfigurationLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/composite/CompositeModelConfigurationLoader.java index 25090855..29814fe2 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/composite/CompositeModelConfigurationLoader.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/composite/CompositeModelConfigurationLoader.java @@ -12,7 +12,7 @@ import java.util.List; @AutoModelConfigurationLoader({"composite", "minecraft:composite"}) -public class CompositeModelConfigurationLoader implements ModelConfigurationLoader { +public class CompositeModelConfigurationLoader implements ModelConfigurationLoader { @Override public @Nullable ModelConfiguration load(@NotNull ConfigurationSection section) { CompositeModelConfiguration config = new CompositeModelConfiguration(); diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/model/SimpleModelConfigurationLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/model/SimpleModelConfigurationLoader.java index cbe68c92..3d7cb4bd 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/model/SimpleModelConfigurationLoader.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/model/SimpleModelConfigurationLoader.java @@ -15,7 +15,7 @@ @AutoModelConfigurationLoader({"model", "minecraft:model"}) -public class SimpleModelConfigurationLoader implements ModelConfigurationLoader { +public class SimpleModelConfigurationLoader implements ModelConfigurationLoader { @Override public @Nullable ModelConfiguration load(@NotNull ConfigurationSection section) { @@ -26,7 +26,6 @@ public class SimpleModelConfigurationLoader implements ModelConfigurationLoader SimpleModelConfiguration config = new SimpleModelConfiguration(path); - // generation block (optional) ConfigurationSection generationSection = section.getConfigurationSection("generation"); if (generationSection != null) { String parent = generationSection.getString("parent"); diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/range_dispatch/CompassRangeDispatchConfigurationLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/range_dispatch/CompassRangeDispatchConfigurationLoader.java new file mode 100644 index 00000000..ea917a34 --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/range_dispatch/CompassRangeDispatchConfigurationLoader.java @@ -0,0 +1,16 @@ +package fr.robie.craftengineconverter.api.configuration.loader.models.range_dispatch; + +import fr.robie.craftengineconverter.api.configuration.item.models.range_dispatch.RangeDispatchModelConfiguration; +import fr.robie.craftengineconverter.api.configuration.loader.models.ModelConfigurationLoader; +import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; +import org.jetbrains.annotations.NotNull; +import org.jspecify.annotations.Nullable; + +public class CompassRangeDispatchConfigurationLoader implements ModelConfigurationLoader { + + + @Override + public @Nullable RangeDispatchModelConfiguration load(@NotNull ConfigurationSection section) { + int scale = section.getInt("scale", 1); + } +} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/AbstractSelectModelConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/AbstractSelectModelConfiguration.java index e6b46508..e1bad355 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/AbstractSelectModelConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/AbstractSelectModelConfiguration.java @@ -1,6 +1,9 @@ package fr.robie.craftengineconverter.api.configuration.loader.models.select; import fr.robie.craftengineconverter.api.configuration.item.models.ModelConfiguration; +import fr.robie.craftengineconverter.api.configuration.item.models.select.SelectModelConfiguration; +import fr.robie.craftengineconverter.api.configuration.loader.models.ModelConfigurationLoader; +import fr.robie.craftengineconverter.api.configuration.loader.models.ModelConfigurationRegistry; import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -8,17 +11,9 @@ import java.util.function.BiConsumer; import java.util.function.Function; -public abstract class AbstractSelectModelConfiguration implements SelectModelConfigurationLoader { - private final String property; +public abstract class AbstractSelectModelConfiguration implements ModelConfigurationLoader> { - public AbstractSelectModelConfiguration(@NotNull String property) { - this.property = property; - } - - @Override - @NotNull - public String getPropertyName() { - return this.property; + public AbstractSelectModelConfiguration() { } @Nullable @@ -46,4 +41,8 @@ protected void loadCases( } } } + + protected ModelConfiguration loadModel(ConfigurationSection modelSection) { + return ModelConfigurationRegistry.load(modelSection); + } } \ No newline at end of file diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/BlockStateSelectConfigurationLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/BlockStateSelectConfigurationLoader.java index a2338039..fa09c94c 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/BlockStateSelectConfigurationLoader.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/BlockStateSelectConfigurationLoader.java @@ -1,13 +1,15 @@ package fr.robie.craftengineconverter.api.configuration.loader.models.select; +import fr.robie.craftengineconverter.api.annotations.AutoSelectModelConfigurationLoader; import fr.robie.craftengineconverter.api.configuration.item.models.select.BlockStateSelectConfiguration; import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; import org.jetbrains.annotations.NotNull; +@AutoSelectModelConfigurationLoader({"block_state", "minecraft:block_state"}) public class BlockStateSelectConfigurationLoader extends AbstractSelectModelConfiguration { public BlockStateSelectConfigurationLoader() { - super("block_state"); + super(); } @Override diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/ChargeTypeSelectConfigurationLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/ChargeTypeSelectConfigurationLoader.java index e1b7414f..a4eb558f 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/ChargeTypeSelectConfigurationLoader.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/ChargeTypeSelectConfigurationLoader.java @@ -1,15 +1,17 @@ package fr.robie.craftengineconverter.api.configuration.loader.models.select; +import fr.robie.craftengineconverter.api.annotations.AutoSelectModelConfigurationLoader; import fr.robie.craftengineconverter.api.configuration.item.models.range_dispatch.ChargeType; import fr.robie.craftengineconverter.api.configuration.item.models.select.ChargeTypeSelectConfiguration; import fr.robie.craftengineconverter.api.configuration.item.models.select.SelectModelConfiguration; import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; import org.jetbrains.annotations.NotNull; +@AutoSelectModelConfigurationLoader({"charge_type", "minecraft:charge_type"}) public class ChargeTypeSelectConfigurationLoader extends AbstractSelectModelConfiguration { public ChargeTypeSelectConfigurationLoader() { - super("minecraft:charge_type"); + super(); } @Override diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/ComponentSelectConfigurationLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/ComponentSelectConfigurationLoader.java index 60200431..1a041600 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/ComponentSelectConfigurationLoader.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/ComponentSelectConfigurationLoader.java @@ -1,14 +1,16 @@ package fr.robie.craftengineconverter.api.configuration.loader.models.select; +import fr.robie.craftengineconverter.api.annotations.AutoSelectModelConfigurationLoader; import fr.robie.craftengineconverter.api.configuration.item.models.select.ComponentSelectConfiguration; import fr.robie.craftengineconverter.api.configuration.item.models.select.SelectModelConfiguration; import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; import org.jetbrains.annotations.NotNull; +@AutoSelectModelConfigurationLoader({"component", "minecraft:component"}) public class ComponentSelectConfigurationLoader extends AbstractSelectModelConfiguration { public ComponentSelectConfigurationLoader() { - super("component"); + super(); } @Override diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/CustomModelDataSelectConfigurationLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/CustomModelDataSelectConfigurationLoader.java index ae21ebfb..3ce82e63 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/CustomModelDataSelectConfigurationLoader.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/CustomModelDataSelectConfigurationLoader.java @@ -1,14 +1,16 @@ package fr.robie.craftengineconverter.api.configuration.loader.models.select; +import fr.robie.craftengineconverter.api.annotations.AutoSelectModelConfigurationLoader; import fr.robie.craftengineconverter.api.configuration.item.models.select.CustomModelDataSelectConfiguration; import fr.robie.craftengineconverter.api.configuration.item.models.select.SelectModelConfiguration; import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; import org.jetbrains.annotations.NotNull; +@AutoSelectModelConfigurationLoader({"custom_model_data", "minecraft:custom_model_data"}) public class CustomModelDataSelectConfigurationLoader extends AbstractSelectModelConfiguration { public CustomModelDataSelectConfigurationLoader() { - super("custom_model_data"); + super(); } @Override diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/DisplayContentSelectConfigurationLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/DisplayContextSelectConfigurationLoader.java similarity index 75% rename from API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/DisplayContentSelectConfigurationLoader.java rename to API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/DisplayContextSelectConfigurationLoader.java index 6c6c3ea7..4adb1381 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/DisplayContentSelectConfigurationLoader.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/DisplayContextSelectConfigurationLoader.java @@ -1,15 +1,17 @@ package fr.robie.craftengineconverter.api.configuration.loader.models.select; +import fr.robie.craftengineconverter.api.annotations.AutoSelectModelConfigurationLoader; import fr.robie.craftengineconverter.api.configuration.item.models.select.DisplayContent; import fr.robie.craftengineconverter.api.configuration.item.models.select.DisplayContentSelectConfiguration; import fr.robie.craftengineconverter.api.configuration.item.models.select.SelectModelConfiguration; import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; import org.jetbrains.annotations.NotNull; -public class DisplayContentSelectConfigurationLoader extends AbstractSelectModelConfiguration { +@AutoSelectModelConfigurationLoader({"display_context", "minecraft:display_context"}) +public class DisplayContextSelectConfigurationLoader extends AbstractSelectModelConfiguration { - public DisplayContentSelectConfigurationLoader() { - super("display_context"); + public DisplayContextSelectConfigurationLoader() { + super(); } @Override diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/LocalTimeSelectConfigurationLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/LocalTimeSelectConfigurationLoader.java index 96a9add5..9ff25d07 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/LocalTimeSelectConfigurationLoader.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/LocalTimeSelectConfigurationLoader.java @@ -1,14 +1,16 @@ package fr.robie.craftengineconverter.api.configuration.loader.models.select; +import fr.robie.craftengineconverter.api.annotations.AutoSelectModelConfigurationLoader; import fr.robie.craftengineconverter.api.configuration.item.models.select.LocalTimeSelectConfiguration; import fr.robie.craftengineconverter.api.configuration.item.models.select.SelectModelConfiguration; import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; import org.jetbrains.annotations.NotNull; +@AutoSelectModelConfigurationLoader({"local_time", "minecraft:local_time"}) public class LocalTimeSelectConfigurationLoader extends AbstractSelectModelConfiguration { public LocalTimeSelectConfigurationLoader() { - super("local_time"); + super(); } @Override diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/MainHandSelectConfigurationLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/MainHandSelectConfigurationLoader.java index 035051d9..b92c6cc3 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/MainHandSelectConfigurationLoader.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/MainHandSelectConfigurationLoader.java @@ -1,15 +1,17 @@ package fr.robie.craftengineconverter.api.configuration.loader.models.select; +import fr.robie.craftengineconverter.api.annotations.AutoSelectModelConfigurationLoader; import fr.robie.craftengineconverter.api.configuration.item.models.select.MainHand; import fr.robie.craftengineconverter.api.configuration.item.models.select.MainHandSelectConfiguration; import fr.robie.craftengineconverter.api.configuration.item.models.select.SelectModelConfiguration; import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; import org.jetbrains.annotations.NotNull; +@AutoSelectModelConfigurationLoader({"main_hand", "minecraft:main_hand"}) public class MainHandSelectConfigurationLoader extends AbstractSelectModelConfiguration { public MainHandSelectConfigurationLoader() { - super("main_hand"); + super(); } @Override diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/SelectModelConfigurationLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/SelectModelConfigurationLoader.java deleted file mode 100644 index 2ecfb852..00000000 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/SelectModelConfigurationLoader.java +++ /dev/null @@ -1,19 +0,0 @@ -package fr.robie.craftengineconverter.api.configuration.loader.models.select; - -import fr.robie.craftengineconverter.api.configuration.item.models.ModelConfiguration; -import fr.robie.craftengineconverter.api.configuration.item.models.select.SelectModelConfiguration; -import fr.robie.craftengineconverter.api.configuration.loader.models.ModelConfigurationRegistry; -import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; -import org.jetbrains.annotations.NotNull; - -public interface SelectModelConfigurationLoader { - - @NotNull - String getPropertyName(); - - SelectModelConfiguration load(@NotNull ConfigurationSection section); - - default ModelConfiguration loadModel(ConfigurationSection modelSection) { - return ModelConfigurationRegistry.load(modelSection); - } -} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/SelectModelConfigurationRegistry.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/SelectModelConfigurationRegistry.java index 060b5e85..a9fdaaf9 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/SelectModelConfigurationRegistry.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/SelectModelConfigurationRegistry.java @@ -1,27 +1,19 @@ package fr.robie.craftengineconverter.api.configuration.loader.models.select; import fr.robie.craftengineconverter.api.configuration.item.models.select.SelectModelConfiguration; +import fr.robie.craftengineconverter.api.configuration.loader.models.ModelConfigurationLoader; import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import java.util.HashMap; import java.util.Map; public class SelectModelConfigurationRegistry { - private static final Map> LOADERS = new HashMap<>(); + private static final Map>> LOADERS = new HashMap<>(); - static { - registerLoader(new ChargeTypeSelectConfigurationLoader()); - registerLoader(new BlockStateSelectConfigurationLoader()); - registerLoader(new ComponentSelectConfigurationLoader()); - registerLoader(new CustomModelDataSelectConfigurationLoader()); - registerLoader(new DisplayContentSelectConfigurationLoader()); - registerLoader(new LocalTimeSelectConfigurationLoader()); - registerLoader(new MainHandSelectConfigurationLoader()); - } - - public static void registerLoader(SelectModelConfigurationLoader loader) { - LOADERS.put(loader.getPropertyName(), loader); + public static void register(@NotNull String property, @NotNull ModelConfigurationLoader> loader) { + LOADERS.put(property, loader); } @Nullable @@ -34,15 +26,7 @@ public static SelectModelConfiguration load(@Nullable ConfigurationSection se return null; } - SelectModelConfigurationLoader loader = LOADERS.get(property); - if (loader == null) { - if (property.startsWith("minecraft:")) { - loader = LOADERS.get(property.substring("minecraft:".length())); - } else { - loader = LOADERS.get("minecraft:" + property); - } - } - + ModelConfigurationLoader> loader = LOADERS.get(property); if (loader == null) { return null; } diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/ConstantTintLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/ConstantTintLoader.java index a962e383..8add3dc2 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/ConstantTintLoader.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/ConstantTintLoader.java @@ -4,12 +4,13 @@ import fr.robie.craftengineconverter.api.configuration.item.models.tints.ConstantTintConfiguration; import fr.robie.craftengineconverter.api.configuration.loader.models.tints.TintConfigurationLoader; import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; +import org.jspecify.annotations.NonNull; @AutoTintConfigurationLoader({"constant", "minecraft:constant"}) public class ConstantTintLoader implements TintConfigurationLoader { @Override - public ConstantTintConfiguration load(ConfigurationSection section) { + public ConstantTintConfiguration load(@NonNull ConfigurationSection section) { Object value = section.get("value"); return value == null ? null : new ConstantTintConfiguration(value); } diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/CustomModelDataTintLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/CustomModelDataTintLoader.java index e7206b58..1452cb2d 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/CustomModelDataTintLoader.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/CustomModelDataTintLoader.java @@ -4,12 +4,13 @@ import fr.robie.craftengineconverter.api.configuration.item.models.tints.CustomModelDataTintConfiguration; import fr.robie.craftengineconverter.api.configuration.loader.models.tints.TintConfigurationLoader; import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; +import org.jspecify.annotations.NonNull; @AutoTintConfigurationLoader({"custom_model_data", "minecraft:custom_model_data"}) public class CustomModelDataTintLoader implements TintConfigurationLoader { @Override - public CustomModelDataTintConfiguration load(ConfigurationSection section) { + public CustomModelDataTintConfiguration load(@NonNull ConfigurationSection section) { int index = section.getInt("index", 0); Object defaultValue = section.get("default"); return new CustomModelDataTintConfiguration(index, defaultValue); diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/DyeTintLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/DyeTintLoader.java index 0ada568d..eac87397 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/DyeTintLoader.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/DyeTintLoader.java @@ -4,12 +4,13 @@ import fr.robie.craftengineconverter.api.configuration.item.models.tints.DyeTintConfiguration; import fr.robie.craftengineconverter.api.configuration.loader.models.tints.TintConfigurationLoader; import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; +import org.jspecify.annotations.NonNull; @AutoTintConfigurationLoader({"dye", "minecraft:dye"}) public class DyeTintLoader implements TintConfigurationLoader { @Override - public DyeTintConfiguration load(ConfigurationSection section) { + public DyeTintConfiguration load(@NonNull ConfigurationSection section) { Object o = section.get("default"); return o == null ? null : new DyeTintConfiguration(o); } diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/FireworkTintLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/FireworkTintLoader.java index b0bbdacd..8da7f662 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/FireworkTintLoader.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/FireworkTintLoader.java @@ -4,12 +4,13 @@ import fr.robie.craftengineconverter.api.configuration.item.models.tints.FireworkTintConfiguration; import fr.robie.craftengineconverter.api.configuration.loader.models.tints.TintConfigurationLoader; import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; +import org.jspecify.annotations.NonNull; @AutoTintConfigurationLoader({"firework", "minecraft:firework"}) public class FireworkTintLoader implements TintConfigurationLoader { @Override - public FireworkTintConfiguration load(ConfigurationSection section) { + public FireworkTintConfiguration load(@NonNull ConfigurationSection section) { Object o = section.get("default"); return o == null ? null : new FireworkTintConfiguration(o); } diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/GrassTintLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/GrassTintLoader.java index 65f2fbaa..86f4eacb 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/GrassTintLoader.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/GrassTintLoader.java @@ -4,12 +4,13 @@ import fr.robie.craftengineconverter.api.configuration.item.models.tints.GrassTintConfiguration; import fr.robie.craftengineconverter.api.configuration.loader.models.tints.TintConfigurationLoader; import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; +import org.jspecify.annotations.NonNull; @AutoTintConfigurationLoader({"grass", "minecraft:grass"}) public class GrassTintLoader implements TintConfigurationLoader { @Override - public GrassTintConfiguration load(ConfigurationSection section) { + public GrassTintConfiguration load(@NonNull ConfigurationSection section) { float temperature = (float) section.getDouble("temperature", 0.0); float downfall = (float) section.getDouble("downfall", 0.0); return new GrassTintConfiguration(temperature, downfall); diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/MapColorTintLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/MapColorTintLoader.java index 65f798b9..720004b3 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/MapColorTintLoader.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/MapColorTintLoader.java @@ -4,12 +4,13 @@ import fr.robie.craftengineconverter.api.configuration.item.models.tints.MapColorTintConfiguration; import fr.robie.craftengineconverter.api.configuration.loader.models.tints.TintConfigurationLoader; import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; +import org.jspecify.annotations.NonNull; @AutoTintConfigurationLoader({"map_color", "minecraft:map_color"}) public class MapColorTintLoader implements TintConfigurationLoader { @Override - public MapColorTintConfiguration load(ConfigurationSection section) { + public MapColorTintConfiguration load(@NonNull ConfigurationSection section) { Object defaultValue = section.get("default"); return defaultValue == null ? null : new MapColorTintConfiguration(defaultValue); } diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/PotionTintLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/PotionTintLoader.java index 89136f60..130ca0b6 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/PotionTintLoader.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/PotionTintLoader.java @@ -4,12 +4,13 @@ import fr.robie.craftengineconverter.api.configuration.item.models.tints.PotionTintConfiguration; import fr.robie.craftengineconverter.api.configuration.loader.models.tints.TintConfigurationLoader; import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; +import org.jspecify.annotations.NonNull; @AutoTintConfigurationLoader({"potion", "minecraft:potion"}) public class PotionTintLoader implements TintConfigurationLoader { @Override - public PotionTintConfiguration load(ConfigurationSection section) { + public PotionTintConfiguration load(@NonNull ConfigurationSection section) { Object o = section.get("default"); return o == null ? null : new PotionTintConfiguration(o); } diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/TeamTintLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/TeamTintLoader.java index 1a49cd0e..3685a644 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/TeamTintLoader.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/TeamTintLoader.java @@ -4,12 +4,13 @@ import fr.robie.craftengineconverter.api.configuration.item.models.tints.TeamTintConfiguration; import fr.robie.craftengineconverter.api.configuration.loader.models.tints.TintConfigurationLoader; import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; +import org.jspecify.annotations.NonNull; @AutoTintConfigurationLoader({"team", "minecraft:team"}) public class TeamTintLoader implements TintConfigurationLoader { @Override - public TeamTintConfiguration load(ConfigurationSection section) { + public TeamTintConfiguration load(@NonNull ConfigurationSection section) { Object o = section.get("default"); return o == null ? null : new TeamTintConfiguration(o); } diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/CraftEngineConverter.java b/Plugin/src/main/java/fr/robie/craftengineconverter/CraftEngineConverter.java index b1b22cc6..ead3d389 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/CraftEngineConverter.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/CraftEngineConverter.java @@ -1,10 +1,13 @@ package fr.robie.craftengineconverter; import fr.robie.craftengineconverter.api.annotations.AutoModelConfigurationLoader; +import fr.robie.craftengineconverter.api.annotations.AutoSelectModelConfigurationLoader; import fr.robie.craftengineconverter.api.annotations.AutoTintConfigurationLoader; import fr.robie.craftengineconverter.api.builder.TimerBuilder; import fr.robie.craftengineconverter.api.configuration.Configuration; import fr.robie.craftengineconverter.api.configuration.ConfigurationKey; +import fr.robie.craftengineconverter.api.configuration.item.models.ModelConfiguration; +import fr.robie.craftengineconverter.api.configuration.item.models.select.SelectModelConfiguration; import fr.robie.craftengineconverter.api.configuration.loader.models.ModelConfigurationLoader; import fr.robie.craftengineconverter.api.configuration.loader.models.ModelConfigurationRegistry; import fr.robie.craftengineconverter.api.configuration.loader.models.select.SelectModelConfigurationRegistry; @@ -253,6 +256,7 @@ public void onDisable() { private void loadRegistries() { this.loadModelConfigurationRegistry(); this.loadTintConfigurationRegistry(); + this.loadSelectModelConfigurationRegistry(); } private void loadModelConfigurationRegistry() { @@ -267,12 +271,20 @@ private void loadModelConfigurationRegistry() { continue; } AutoModelConfigurationLoader annotation = clazz.getAnnotation(AutoModelConfigurationLoader.class); + if (annotation.value().length == 0) { + continue; + } try { - ModelConfigurationLoader loader = (ModelConfigurationLoader) clazz.getDeclaredConstructor().newInstance(); + @SuppressWarnings("rawtypes") + Class typedClass = clazz.asSubclass(ModelConfigurationLoader.class); + @SuppressWarnings("unchecked") + ModelConfigurationLoader loader = (ModelConfigurationLoader) typedClass.getDeclaredConstructor().newInstance(); for (String name : annotation.value()) { ModelConfigurationRegistry.register(name, loader); } count++; + } catch (ClassCastException e) { + Logger.showException("Class " + clazz.getName() + " cannot be cast to ModelConfigurationLoader", e); } catch (Exception e) { Logger.showException("Failed to load ModelConfigurationLoader " + clazz.getName() + " for names " + Arrays.toString(annotation.value()), e); } @@ -309,6 +321,39 @@ private void loadTintConfigurationRegistry() { Logger.info("Loaded " + count + " TintConfigurationLoaders"); } + @SuppressWarnings({"rawtypes", "unchecked"}) + private void loadSelectModelConfigurationRegistry() { + Reflections reflections = ReflectionsCache.getInstance().getOrCreate(this, "fr.robie.craftengineconverter"); + Set> candidates = reflections.getTypesAnnotatedWith(AutoSelectModelConfigurationLoader.class); + int count = 0; + for (Class clazz : candidates) { + if (!ModelConfigurationLoader.class.isAssignableFrom(clazz)) { + continue; + } + if (!VersionFilter.passes(clazz, clazz.getSimpleName())) { + continue; + } + AutoSelectModelConfigurationLoader annotation = clazz.getAnnotation(AutoSelectModelConfigurationLoader.class); + if (annotation.value().length == 0) { + Logger.debug("Skipping " + clazz.getName() + " — no names specified in @AutoSelectModelConfigurationLoader"); + continue; + } + try { + Class typedClass = clazz.asSubclass(ModelConfigurationLoader.class); + ModelConfigurationLoader> loader = (ModelConfigurationLoader>) typedClass.getDeclaredConstructor().newInstance(); + for (String name : annotation.value()) { + SelectModelConfigurationRegistry.register(name, loader); + } + count++; + } catch (ClassCastException e) { + Logger.showException("Class " + clazz.getName() + " cannot be cast to ModelConfigurationLoader", e); + } catch (Exception e) { + Logger.showException("Failed to load SelectModelConfigurationLoader " + clazz.getName() + " for names " + Arrays.toString(annotation.value()), e); + } + } + Logger.info("Loaded " + count + " SelectModelConfigurationLoaders"); + } + public void reloadMessages() { this.messageLoader.reload(); } From 1294e174efa7a27bd41df345f66466e284453a04 Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Thu, 30 Apr 2026 11:11:27 +0200 Subject: [PATCH 018/116] feat: introduce range dispatch configuration loaders and refactor select model configuration classes --- .../AutoRangeDispatchConfigurationLoader.java | 15 +++++++ .../RangeDispatchModelConfiguration.java | 21 +++------- ...tractRangeDispatchConfigurationLoader.java | 30 ++++++++++++++ ...mpassRangeDispatchConfigurationLoader.java | 21 +++++++--- ...CountRangeDispatchConfigurationLoader.java | 20 +++++++++ ...lDataRangeDispatchConfigurationLoader.java | 21 ++++++++++ ...amageRangeDispatchConfigurationLoader.java | 20 +++++++++ .../RangeDispatchConfigurationRegistry.java | 34 +++++++++++++++ .../TimeRangeDispatchConfigurationLoader.java | 24 +++++++++++ ...CycleRangeDispatchConfigurationLoader.java | 21 ++++++++++ ...ationRangeDispatchConfigurationLoader.java | 18 ++++++++ ...stractSelectModelConfigurationLoader.java} | 4 +- .../BlockStateSelectConfigurationLoader.java | 2 +- .../ChargeTypeSelectConfigurationLoader.java | 2 +- .../ComponentSelectConfigurationLoader.java | 2 +- ...tomModelDataSelectConfigurationLoader.java | 2 +- ...splayContextSelectConfigurationLoader.java | 2 +- .../LocalTimeSelectConfigurationLoader.java | 2 +- .../MainHandSelectConfigurationLoader.java | 2 +- .../CraftEngineConverter.java | 41 +++++++++++++++++++ 20 files changed, 273 insertions(+), 31 deletions(-) create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/annotations/AutoRangeDispatchConfigurationLoader.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/range_dispatch/AbstractRangeDispatchConfigurationLoader.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/range_dispatch/CountRangeDispatchConfigurationLoader.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/range_dispatch/CustomModelDataRangeDispatchConfigurationLoader.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/range_dispatch/DamageRangeDispatchConfigurationLoader.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/range_dispatch/RangeDispatchConfigurationRegistry.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/range_dispatch/TimeRangeDispatchConfigurationLoader.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/range_dispatch/UseCycleRangeDispatchConfigurationLoader.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/range_dispatch/UseDurationRangeDispatchConfigurationLoader.java rename API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/{AbstractSelectModelConfiguration.java => AbstractSelectModelConfigurationLoader.java} (91%) diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/annotations/AutoRangeDispatchConfigurationLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/annotations/AutoRangeDispatchConfigurationLoader.java new file mode 100644 index 00000000..b31f8927 --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/annotations/AutoRangeDispatchConfigurationLoader.java @@ -0,0 +1,15 @@ +package fr.robie.craftengineconverter.api.annotations; + +import org.jetbrains.annotations.NotNull; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.TYPE) +public @interface AutoRangeDispatchConfigurationLoader { + @NotNull + String[] value(); +} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/range_dispatch/RangeDispatchModelConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/range_dispatch/RangeDispatchModelConfiguration.java index 70c0ac8e..4c3ae38f 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/range_dispatch/RangeDispatchModelConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/range_dispatch/RangeDispatchModelConfiguration.java @@ -10,7 +10,7 @@ public class RangeDispatchModelConfiguration implements ModelConfiguration { private final String property; - private Double scale; + private Float scale; private final List entries = new ArrayList<>(); private ModelConfiguration fallback; @@ -18,7 +18,7 @@ public RangeDispatchModelConfiguration(@NotNull String property) { this.property = this.namespaced(property); } - public void setScale(@Nullable Double scale) { + public void setScale(@Nullable Float scale) { this.scale = scale; } @@ -44,29 +44,18 @@ public void serialize(@NotNull ConfigurationSection section) { List> serializedEntries = new ArrayList<>(); for (Entry entry : this.entries) { Map map = new LinkedHashMap<>(); - map.put("threshold", entry.getThreshold()); - map.put("model", ConfigurationSerializationUtils.toMap(entry.getModel())); + map.put("threshold", entry.threshold()); + map.put("model", ConfigurationSerializationUtils.toMap(entry.model())); serializedEntries.add(map); } section.set("entries", serializedEntries); } } - public static class Entry { - private final double threshold; - private final ModelConfiguration model; - + public record Entry(double threshold, ModelConfiguration model) { public Entry(double threshold, @NotNull ModelConfiguration model) { this.threshold = threshold; this.model = Objects.requireNonNull(model, "model cannot be null"); } - - public double getThreshold() { - return this.threshold; - } - - public ModelConfiguration getModel() { - return this.model; - } } } diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/range_dispatch/AbstractRangeDispatchConfigurationLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/range_dispatch/AbstractRangeDispatchConfigurationLoader.java new file mode 100644 index 00000000..222baa1e --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/range_dispatch/AbstractRangeDispatchConfigurationLoader.java @@ -0,0 +1,30 @@ +package fr.robie.craftengineconverter.api.configuration.loader.models.range_dispatch; + +import fr.robie.craftengineconverter.api.configuration.item.models.ModelConfiguration; +import fr.robie.craftengineconverter.api.configuration.item.models.range_dispatch.RangeDispatchModelConfiguration; +import fr.robie.craftengineconverter.api.configuration.loader.models.ModelConfigurationLoader; +import fr.robie.craftengineconverter.api.configuration.loader.models.ModelConfigurationRegistry; +import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; +import org.jetbrains.annotations.NotNull; + +import java.util.List; + +public abstract class AbstractRangeDispatchConfigurationLoader implements ModelConfigurationLoader { + + protected void loadCommonProperties(@NotNull T configuration, @NotNull ConfigurationSection section) { + Float scale = (float) section.getDouble("scale", 1.0); + configuration.setScale(scale); + + configuration.setFallback(ModelConfigurationRegistry.load(section.getConfigurationSection("fallback"))); + + List entries = section.getSectionList("entries"); + for (ConfigurationSection entry : entries) { + float threshold = (float) entry.getDouble("threshold"); + ModelConfiguration model = ModelConfigurationRegistry.load(entry.getConfigurationSection("model")); + if (model != null) { + configuration.addEntry(threshold, model); + } + } + } + +} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/range_dispatch/CompassRangeDispatchConfigurationLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/range_dispatch/CompassRangeDispatchConfigurationLoader.java index ea917a34..12d3fbf1 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/range_dispatch/CompassRangeDispatchConfigurationLoader.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/range_dispatch/CompassRangeDispatchConfigurationLoader.java @@ -1,16 +1,25 @@ package fr.robie.craftengineconverter.api.configuration.loader.models.range_dispatch; -import fr.robie.craftengineconverter.api.configuration.item.models.range_dispatch.RangeDispatchModelConfiguration; -import fr.robie.craftengineconverter.api.configuration.loader.models.ModelConfigurationLoader; +import fr.robie.craftengineconverter.api.annotations.AutoRangeDispatchConfigurationLoader; +import fr.robie.craftengineconverter.api.configuration.item.models.range_dispatch.CompassRangeDispatchConfiguration; import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; import org.jetbrains.annotations.NotNull; import org.jspecify.annotations.Nullable; -public class CompassRangeDispatchConfigurationLoader implements ModelConfigurationLoader { - +@AutoRangeDispatchConfigurationLoader({"compass", "minecraft:compass"}) +public class CompassRangeDispatchConfigurationLoader extends AbstractRangeDispatchConfigurationLoader { @Override - public @Nullable RangeDispatchModelConfiguration load(@NotNull ConfigurationSection section) { - int scale = section.getInt("scale", 1); + public @Nullable CompassRangeDispatchConfiguration load(@NotNull ConfigurationSection section) { + String target = section.getString("target"); + if (target == null) { + return null; + } + boolean wobble = section.getBoolean("wobble", true); + CompassRangeDispatchConfiguration compassRangeDispatchConfiguration = new CompassRangeDispatchConfiguration(target, wobble); + + this.loadCommonProperties(compassRangeDispatchConfiguration, section); + + return compassRangeDispatchConfiguration; } } diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/range_dispatch/CountRangeDispatchConfigurationLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/range_dispatch/CountRangeDispatchConfigurationLoader.java new file mode 100644 index 00000000..812fc776 --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/range_dispatch/CountRangeDispatchConfigurationLoader.java @@ -0,0 +1,20 @@ +package fr.robie.craftengineconverter.api.configuration.loader.models.range_dispatch; + +import fr.robie.craftengineconverter.api.annotations.AutoRangeDispatchConfigurationLoader; +import fr.robie.craftengineconverter.api.configuration.item.models.range_dispatch.CountRangeDispatchConfiguration; +import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; +import org.jetbrains.annotations.NotNull; +import org.jspecify.annotations.Nullable; + +@AutoRangeDispatchConfigurationLoader({"count", "minecraft:count"}) +public class CountRangeDispatchConfigurationLoader extends AbstractRangeDispatchConfigurationLoader { + @Override + public @Nullable CountRangeDispatchConfiguration load(@NotNull ConfigurationSection section) { + boolean normalize = section.getBoolean("normalize", true); + CountRangeDispatchConfiguration countRangeDispatchConfiguration = new CountRangeDispatchConfiguration(normalize); + + this.loadCommonProperties(countRangeDispatchConfiguration, section); + + return countRangeDispatchConfiguration; + } +} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/range_dispatch/CustomModelDataRangeDispatchConfigurationLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/range_dispatch/CustomModelDataRangeDispatchConfigurationLoader.java new file mode 100644 index 00000000..83f9948f --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/range_dispatch/CustomModelDataRangeDispatchConfigurationLoader.java @@ -0,0 +1,21 @@ +package fr.robie.craftengineconverter.api.configuration.loader.models.range_dispatch; + +import fr.robie.craftengineconverter.api.annotations.AutoRangeDispatchConfigurationLoader; +import fr.robie.craftengineconverter.api.configuration.item.models.range_dispatch.CustomModelDataRangeDispatchConfiguration; +import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; +import org.jetbrains.annotations.NotNull; +import org.jspecify.annotations.Nullable; + +@AutoRangeDispatchConfigurationLoader({"custom_model_data", "minecraft:custom_model_data"}) +public class CustomModelDataRangeDispatchConfigurationLoader extends AbstractRangeDispatchConfigurationLoader { + @Override + public @Nullable CustomModelDataRangeDispatchConfiguration load(@NotNull ConfigurationSection section) { + int index = section.getInt("index", 0); + + CustomModelDataRangeDispatchConfiguration customModelDataRangeDispatchConfiguration = new CustomModelDataRangeDispatchConfiguration(index); + + this.loadCommonProperties(customModelDataRangeDispatchConfiguration, section); + + return customModelDataRangeDispatchConfiguration; + } +} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/range_dispatch/DamageRangeDispatchConfigurationLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/range_dispatch/DamageRangeDispatchConfigurationLoader.java new file mode 100644 index 00000000..abf31b51 --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/range_dispatch/DamageRangeDispatchConfigurationLoader.java @@ -0,0 +1,20 @@ +package fr.robie.craftengineconverter.api.configuration.loader.models.range_dispatch; + +import fr.robie.craftengineconverter.api.annotations.AutoRangeDispatchConfigurationLoader; +import fr.robie.craftengineconverter.api.configuration.item.models.range_dispatch.DamageRangeDispatchConfiguration; +import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; +import org.jetbrains.annotations.NotNull; +import org.jspecify.annotations.Nullable; + +@AutoRangeDispatchConfigurationLoader({"damage", "minecraft:damage"}) +public class DamageRangeDispatchConfigurationLoader extends AbstractRangeDispatchConfigurationLoader { + @Override + public @Nullable DamageRangeDispatchConfiguration load(@NotNull ConfigurationSection section) { + boolean normalize = section.getBoolean("normalize", true); + DamageRangeDispatchConfiguration damageRangeDispatchConfiguration = new DamageRangeDispatchConfiguration(normalize); + + this.loadCommonProperties(damageRangeDispatchConfiguration, section); + + return damageRangeDispatchConfiguration; + } +} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/range_dispatch/RangeDispatchConfigurationRegistry.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/range_dispatch/RangeDispatchConfigurationRegistry.java new file mode 100644 index 00000000..bae2b8af --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/range_dispatch/RangeDispatchConfigurationRegistry.java @@ -0,0 +1,34 @@ +package fr.robie.craftengineconverter.api.configuration.loader.models.range_dispatch; + +import fr.robie.craftengineconverter.api.configuration.item.models.range_dispatch.RangeDispatchModelConfiguration; +import fr.robie.craftengineconverter.api.configuration.loader.models.ModelConfigurationLoader; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.HashMap; +import java.util.Map; + +public class RangeDispatchConfigurationRegistry { + private static final Map> LOADERS = new HashMap<>(); + + public static void register(@NotNull String property, @NotNull ModelConfigurationLoader loader) { + LOADERS.put(property, loader); + } + + @Nullable + public static RangeDispatchModelConfiguration load(@Nullable fr.robie.craftengineconverter.api.yaml.ConfigurationSection section) { + if (section == null) { + return null; + } + String property = section.getString("property"); + if (property == null) { + return null; + } + + ModelConfigurationLoader loader = LOADERS.get(property); + if (loader == null) { + return null; + } + return loader.load(section); + } +} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/range_dispatch/TimeRangeDispatchConfigurationLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/range_dispatch/TimeRangeDispatchConfigurationLoader.java new file mode 100644 index 00000000..a07a5075 --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/range_dispatch/TimeRangeDispatchConfigurationLoader.java @@ -0,0 +1,24 @@ +package fr.robie.craftengineconverter.api.configuration.loader.models.range_dispatch; + +import fr.robie.craftengineconverter.api.annotations.AutoRangeDispatchConfigurationLoader; +import fr.robie.craftengineconverter.api.configuration.item.models.range_dispatch.TimeRangeDispatchConfiguration; +import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; +import org.jetbrains.annotations.NotNull; +import org.jspecify.annotations.Nullable; + +@AutoRangeDispatchConfigurationLoader({"time", "minecraft:time"}) +public class TimeRangeDispatchConfigurationLoader extends AbstractRangeDispatchConfigurationLoader { + @Override + public @Nullable TimeRangeDispatchConfiguration load(@NotNull ConfigurationSection section) { + String source = section.getString("source"); + if (source == null) { + return null; + } + boolean wobble = section.getBoolean("wobble", true); + TimeRangeDispatchConfiguration timeRangeDispatchConfiguration = new TimeRangeDispatchConfiguration(source, wobble); + + this.loadCommonProperties(timeRangeDispatchConfiguration, section); + + return timeRangeDispatchConfiguration; + } +} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/range_dispatch/UseCycleRangeDispatchConfigurationLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/range_dispatch/UseCycleRangeDispatchConfigurationLoader.java new file mode 100644 index 00000000..a51625e6 --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/range_dispatch/UseCycleRangeDispatchConfigurationLoader.java @@ -0,0 +1,21 @@ +package fr.robie.craftengineconverter.api.configuration.loader.models.range_dispatch; + +import fr.robie.craftengineconverter.api.annotations.AutoRangeDispatchConfigurationLoader; +import fr.robie.craftengineconverter.api.configuration.item.models.range_dispatch.UseCycleRangeDispatchConfiguration; +import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; +import org.jetbrains.annotations.NotNull; +import org.jspecify.annotations.Nullable; + +@AutoRangeDispatchConfigurationLoader({"use_cycle", "minecraft:use_cycle"}) +public class UseCycleRangeDispatchConfigurationLoader extends AbstractRangeDispatchConfigurationLoader { + @Override + public @Nullable UseCycleRangeDispatchConfiguration load(@NotNull ConfigurationSection section) { + float period = (float) section.getDouble("period", 1.0); + if (period < 0) { + return null; + } + UseCycleRangeDispatchConfiguration configuration = new UseCycleRangeDispatchConfiguration(period); + this.loadCommonProperties(configuration, section); + return configuration; + } +} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/range_dispatch/UseDurationRangeDispatchConfigurationLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/range_dispatch/UseDurationRangeDispatchConfigurationLoader.java new file mode 100644 index 00000000..7a58cc3e --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/range_dispatch/UseDurationRangeDispatchConfigurationLoader.java @@ -0,0 +1,18 @@ +package fr.robie.craftengineconverter.api.configuration.loader.models.range_dispatch; + +import fr.robie.craftengineconverter.api.annotations.AutoRangeDispatchConfigurationLoader; +import fr.robie.craftengineconverter.api.configuration.item.models.range_dispatch.UseDurationRangeDispatchConfiguration; +import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; +import org.jetbrains.annotations.NotNull; +import org.jspecify.annotations.Nullable; + +@AutoRangeDispatchConfigurationLoader({"use_duration", "minecraft:use_duration"}) +public class UseDurationRangeDispatchConfigurationLoader extends AbstractRangeDispatchConfigurationLoader { + @Override + public @Nullable UseDurationRangeDispatchConfiguration load(@NotNull ConfigurationSection section) { + boolean remaining = section.getBoolean("remaining", false); + UseDurationRangeDispatchConfiguration configuration = new UseDurationRangeDispatchConfiguration(remaining); + this.loadCommonProperties(configuration, section); + return configuration; + } +} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/AbstractSelectModelConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/AbstractSelectModelConfigurationLoader.java similarity index 91% rename from API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/AbstractSelectModelConfiguration.java rename to API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/AbstractSelectModelConfigurationLoader.java index e1bad355..fcbb0bba 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/AbstractSelectModelConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/AbstractSelectModelConfigurationLoader.java @@ -11,9 +11,9 @@ import java.util.function.BiConsumer; import java.util.function.Function; -public abstract class AbstractSelectModelConfiguration implements ModelConfigurationLoader> { +public abstract class AbstractSelectModelConfigurationLoader implements ModelConfigurationLoader> { - public AbstractSelectModelConfiguration() { + public AbstractSelectModelConfigurationLoader() { } @Nullable diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/BlockStateSelectConfigurationLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/BlockStateSelectConfigurationLoader.java index fa09c94c..4912ff76 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/BlockStateSelectConfigurationLoader.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/BlockStateSelectConfigurationLoader.java @@ -6,7 +6,7 @@ import org.jetbrains.annotations.NotNull; @AutoSelectModelConfigurationLoader({"block_state", "minecraft:block_state"}) -public class BlockStateSelectConfigurationLoader extends AbstractSelectModelConfiguration { +public class BlockStateSelectConfigurationLoader extends AbstractSelectModelConfigurationLoader { public BlockStateSelectConfigurationLoader() { super(); diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/ChargeTypeSelectConfigurationLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/ChargeTypeSelectConfigurationLoader.java index a4eb558f..498621bc 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/ChargeTypeSelectConfigurationLoader.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/ChargeTypeSelectConfigurationLoader.java @@ -8,7 +8,7 @@ import org.jetbrains.annotations.NotNull; @AutoSelectModelConfigurationLoader({"charge_type", "minecraft:charge_type"}) -public class ChargeTypeSelectConfigurationLoader extends AbstractSelectModelConfiguration { +public class ChargeTypeSelectConfigurationLoader extends AbstractSelectModelConfigurationLoader { public ChargeTypeSelectConfigurationLoader() { super(); diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/ComponentSelectConfigurationLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/ComponentSelectConfigurationLoader.java index 1a041600..841273d3 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/ComponentSelectConfigurationLoader.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/ComponentSelectConfigurationLoader.java @@ -7,7 +7,7 @@ import org.jetbrains.annotations.NotNull; @AutoSelectModelConfigurationLoader({"component", "minecraft:component"}) -public class ComponentSelectConfigurationLoader extends AbstractSelectModelConfiguration { +public class ComponentSelectConfigurationLoader extends AbstractSelectModelConfigurationLoader { public ComponentSelectConfigurationLoader() { super(); diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/CustomModelDataSelectConfigurationLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/CustomModelDataSelectConfigurationLoader.java index 3ce82e63..1b921bd3 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/CustomModelDataSelectConfigurationLoader.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/CustomModelDataSelectConfigurationLoader.java @@ -7,7 +7,7 @@ import org.jetbrains.annotations.NotNull; @AutoSelectModelConfigurationLoader({"custom_model_data", "minecraft:custom_model_data"}) -public class CustomModelDataSelectConfigurationLoader extends AbstractSelectModelConfiguration { +public class CustomModelDataSelectConfigurationLoader extends AbstractSelectModelConfigurationLoader { public CustomModelDataSelectConfigurationLoader() { super(); diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/DisplayContextSelectConfigurationLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/DisplayContextSelectConfigurationLoader.java index 4adb1381..cd691f76 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/DisplayContextSelectConfigurationLoader.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/DisplayContextSelectConfigurationLoader.java @@ -8,7 +8,7 @@ import org.jetbrains.annotations.NotNull; @AutoSelectModelConfigurationLoader({"display_context", "minecraft:display_context"}) -public class DisplayContextSelectConfigurationLoader extends AbstractSelectModelConfiguration { +public class DisplayContextSelectConfigurationLoader extends AbstractSelectModelConfigurationLoader { public DisplayContextSelectConfigurationLoader() { super(); diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/LocalTimeSelectConfigurationLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/LocalTimeSelectConfigurationLoader.java index 9ff25d07..f8f90fb4 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/LocalTimeSelectConfigurationLoader.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/LocalTimeSelectConfigurationLoader.java @@ -7,7 +7,7 @@ import org.jetbrains.annotations.NotNull; @AutoSelectModelConfigurationLoader({"local_time", "minecraft:local_time"}) -public class LocalTimeSelectConfigurationLoader extends AbstractSelectModelConfiguration { +public class LocalTimeSelectConfigurationLoader extends AbstractSelectModelConfigurationLoader { public LocalTimeSelectConfigurationLoader() { super(); diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/MainHandSelectConfigurationLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/MainHandSelectConfigurationLoader.java index b92c6cc3..dec25760 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/MainHandSelectConfigurationLoader.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/MainHandSelectConfigurationLoader.java @@ -8,7 +8,7 @@ import org.jetbrains.annotations.NotNull; @AutoSelectModelConfigurationLoader({"main_hand", "minecraft:main_hand"}) -public class MainHandSelectConfigurationLoader extends AbstractSelectModelConfiguration { +public class MainHandSelectConfigurationLoader extends AbstractSelectModelConfigurationLoader { public MainHandSelectConfigurationLoader() { super(); diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/CraftEngineConverter.java b/Plugin/src/main/java/fr/robie/craftengineconverter/CraftEngineConverter.java index ead3d389..ff29c764 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/CraftEngineConverter.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/CraftEngineConverter.java @@ -1,15 +1,18 @@ package fr.robie.craftengineconverter; import fr.robie.craftengineconverter.api.annotations.AutoModelConfigurationLoader; +import fr.robie.craftengineconverter.api.annotations.AutoRangeDispatchConfigurationLoader; import fr.robie.craftengineconverter.api.annotations.AutoSelectModelConfigurationLoader; import fr.robie.craftengineconverter.api.annotations.AutoTintConfigurationLoader; import fr.robie.craftengineconverter.api.builder.TimerBuilder; import fr.robie.craftengineconverter.api.configuration.Configuration; import fr.robie.craftengineconverter.api.configuration.ConfigurationKey; import fr.robie.craftengineconverter.api.configuration.item.models.ModelConfiguration; +import fr.robie.craftengineconverter.api.configuration.item.models.range_dispatch.RangeDispatchModelConfiguration; import fr.robie.craftengineconverter.api.configuration.item.models.select.SelectModelConfiguration; import fr.robie.craftengineconverter.api.configuration.loader.models.ModelConfigurationLoader; import fr.robie.craftengineconverter.api.configuration.loader.models.ModelConfigurationRegistry; +import fr.robie.craftengineconverter.api.configuration.loader.models.range_dispatch.RangeDispatchConfigurationRegistry; import fr.robie.craftengineconverter.api.configuration.loader.models.select.SelectModelConfigurationRegistry; import fr.robie.craftengineconverter.api.configuration.loader.models.tints.TintConfigurationLoader; import fr.robie.craftengineconverter.api.configuration.loader.models.tints.TintConfigurationRegistry; @@ -257,6 +260,7 @@ private void loadRegistries() { this.loadModelConfigurationRegistry(); this.loadTintConfigurationRegistry(); this.loadSelectModelConfigurationRegistry(); + this.loadRangeDispatchModelConfigurationRegistry(); } private void loadModelConfigurationRegistry() { @@ -291,6 +295,10 @@ private void loadModelConfigurationRegistry() { } ModelConfigurationRegistry.register("select", SelectModelConfigurationRegistry::load); + ModelConfigurationRegistry.register("minecraft:select", SelectModelConfigurationRegistry::load); + count++; + ModelConfigurationRegistry.register("range_dispatch", RangeDispatchConfigurationRegistry::load); + ModelConfigurationRegistry.register("minecraft:range_dispatch", RangeDispatchConfigurationRegistry::load); count++; Logger.info("Loaded " + count + " ModelConfigurationLoaders"); @@ -354,6 +362,39 @@ private void loadSelectModelConfigurationRegistry() { Logger.info("Loaded " + count + " SelectModelConfigurationLoaders"); } + private void loadRangeDispatchModelConfigurationRegistry() { + Reflections reflections = ReflectionsCache.getInstance().getOrCreate(this, "fr.robie.craftengineconverter"); + Set> candidates = reflections.getTypesAnnotatedWith(AutoModelConfigurationLoader.class); + int count = 0; + for (Class clazz : candidates) { + if (!ModelConfigurationLoader.class.isAssignableFrom(clazz)) { + continue; + } + if (!VersionFilter.passes(clazz, clazz.getSimpleName())) { + continue; + } + AutoRangeDispatchConfigurationLoader annotation = clazz.getAnnotation(AutoRangeDispatchConfigurationLoader.class); + if (annotation.value().length == 0) { + Logger.debug("Skipping " + clazz.getName() + " — no names specified in @AutoRangeDispatchConfigurationLoader"); + continue; + } + try { + Class typedClass = clazz.asSubclass(ModelConfigurationLoader.class); + ModelConfigurationLoader loader = (ModelConfigurationLoader) typedClass.getDeclaredConstructor().newInstance(); + for (String name : annotation.value()) { + RangeDispatchConfigurationRegistry.register(name, loader); + } + count++; + } catch (ClassCastException e) { + Logger.showException("Class " + clazz.getName() + " cannot be cast to ModelConfigurationLoader", e); + } catch (Exception e) { + Logger.showException("Failed to load RangeDispatchModelConfigurationLoader " + clazz.getName() + " for names " + Arrays.toString(annotation.value()), e); + } + } + + Logger.info("Loaded " + count + " RangeDispatchModelConfigurationLoaders"); + } + public void reloadMessages() { this.messageLoader.reload(); } From 9a3cb079e3dab7b8745a8f36d34e7454ff658308 Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Thu, 30 Apr 2026 13:42:58 +0200 Subject: [PATCH 019/116] feat: implement group definition mapping and enhance item mapping with texture data handling --- .../mapping/item/GroupDefinitionMapping.java | 47 +++++++++++++++ .../bedrock/mapping/item/ItemMapping.java | 20 +++---- .../mapping/item/ItemModelItemMapping.java | 7 ++- .../bedrock/texture/TextureData.java | 5 ++ .../ConditionModelConfiguration.java | 43 +++++++++++++ ...CustomModelDataConditionConfiguration.java | 4 ++ .../models/model/GenerationConfiguration.java | 9 +++ .../converter/bedrock/BedrockConverter.java | 6 +- .../converter/bedrock/BedrockItemLoader.java | 60 ++++++++++++++++--- 9 files changed, 174 insertions(+), 27 deletions(-) create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/GroupDefinitionMapping.java diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/GroupDefinitionMapping.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/GroupDefinitionMapping.java new file mode 100644 index 00000000..301c338f --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/GroupDefinitionMapping.java @@ -0,0 +1,47 @@ +package fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item; + +import com.google.gson.JsonArray; +import com.google.gson.JsonObject; +import org.bukkit.Material; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.ArrayList; +import java.util.List; + +public class GroupDefinitionMapping extends ItemMapping { + private String model; + + private final List definitions = new ArrayList<>(); + + public GroupDefinitionMapping(@NotNull Material javaMaterial, @NotNull String bedrockIdentifier) { + super(javaMaterial, bedrockIdentifier); + } + + public GroupDefinitionMapping setModel(@Nullable String model) { + this.model = model; + return this; + } + + public GroupDefinitionMapping addDefinition(@NotNull ItemMapping definition) { + this.definitions.add(definition); + return this; + } + + @Override + public JsonObject serialize() { + JsonObject jsonObject = super.serialize(); + + if (this.model != null) { + jsonObject.addProperty("model", this.model); + } + + jsonObject.addProperty("type", "group"); + + if (!this.definitions.isEmpty()) { + jsonObject.add("definitions", this.definitions.stream().map(ItemMapping::serialize).collect(JsonArray::new, JsonArray::add, JsonArray::addAll)); + } + + return jsonObject; + } +} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/ItemMapping.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/ItemMapping.java index 93b2b17a..5fb6ae8a 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/ItemMapping.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/ItemMapping.java @@ -7,7 +7,6 @@ import fr.robie.craftengineconverter.api.configuration.bedrock.texture.TextureData; import org.bukkit.Material; import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; import java.util.ArrayList; import java.util.List; @@ -21,9 +20,9 @@ public abstract class ItemMapping { private BedrockOptions bedrockOptions; private BedrockPredicate bedrockPredicate; - private final List bedrockComponents = new ArrayList<>(); + private final List bedrockComponents = new ArrayList<>(0); - private TextureData textureData; + private final List texturesData = new ArrayList<>(); public ItemMapping(@NotNull Material javaMaterial, @NotNull String bedrockIdentifier) { this.javaMaterial = javaMaterial; @@ -50,17 +49,14 @@ public ItemMapping setBedrockPredicate(BedrockPredicate bedrockPredicate) { return this; } - @NotNull - public TextureData getOrCreateTextureData() { - if (this.textureData == null) { - this.textureData = new TextureData(this.bedrockIdentifier); - } - return this.textureData; + public ItemMapping addTextureData(TextureData textureData) { + this.texturesData.add(textureData); + return this; } - @Nullable - public TextureData getTextureData() { - return this.textureData; + @NotNull + public List getTexturesData() { + return this.texturesData; } public Material getJavaMaterial() { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/ItemModelItemMapping.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/ItemModelItemMapping.java index 7d5f4284..d342ccac 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/ItemModelItemMapping.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/ItemModelItemMapping.java @@ -3,11 +3,12 @@ import com.google.gson.JsonObject; import org.bukkit.Material; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; public class ItemModelItemMapping extends ItemMapping { private final String bedrockModelPath; - public ItemModelItemMapping(@NotNull Material javaMaterial, @NotNull String bedrockIdentifier, @NotNull String bedrockModelPath) { + public ItemModelItemMapping(@NotNull Material javaMaterial, @NotNull String bedrockIdentifier, @Nullable String bedrockModelPath) { super(javaMaterial, bedrockIdentifier); this.bedrockModelPath = bedrockModelPath; } @@ -17,7 +18,9 @@ public ItemModelItemMapping(@NotNull Material javaMaterial, @NotNull String bedr public JsonObject serialize() { JsonObject jsonObject = super.serialize(); jsonObject.addProperty("type", "definition"); - jsonObject.addProperty("model", this.bedrockModelPath); + if (this.bedrockModelPath != null) { + jsonObject.addProperty("model", this.bedrockModelPath); + } return jsonObject; } diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/texture/TextureData.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/texture/TextureData.java index 0d395632..0e32bf2c 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/texture/TextureData.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/texture/TextureData.java @@ -16,6 +16,11 @@ public TextureData(@NotNull String bedrockIdentifier) { this.bedrockIdentifier = bedrockIdentifier; } + public TextureData addTexture(@NotNull String texture) { + this.textures.add(texture); + return this; + } + public String getBedrockIdentifier() { return this.bedrockIdentifier; } diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/condition/ConditionModelConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/condition/ConditionModelConfiguration.java index a9e5cef4..49468c07 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/condition/ConditionModelConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/condition/ConditionModelConfiguration.java @@ -1,5 +1,6 @@ package fr.robie.craftengineconverter.api.configuration.item.models.condition; +import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate.*; import fr.robie.craftengineconverter.api.configuration.item.models.ModelConfiguration; import fr.robie.craftengineconverter.api.utils.ConfigurationSerializationUtils; import org.bukkit.configuration.ConfigurationSection; @@ -15,6 +16,20 @@ public ConditionModelConfiguration(@NotNull String property) { this.property = this.namespaced(property); } + public String getProperty() { + return this.property; + } + + @Nullable + public ModelConfiguration getOnTrue() { + return this.onTrue; + } + + @Nullable + public ModelConfiguration getOnFalse() { + return this.onFalse; + } + public void setOnTrue(@Nullable ModelConfiguration onTrue) { this.onTrue = onTrue; } @@ -36,4 +51,32 @@ public void serialize(@NotNull ConfigurationSection section) { section.set("on-false", ConfigurationSerializationUtils.toMap(this.onFalse)); } } + + public BedrockPredicate getOnTruePredicate() { + return this.getPredicate(this.onTrue, true); + } + + public BedrockPredicate getOnFalsePredicate() { + return this.getPredicate(this.onFalse, false); + } + + private BedrockPredicate getPredicate(ModelConfiguration condition, boolean value) { + if (condition == null) { + return null; + } + String propertyName = this.property.contains(":") ? this.property.split(":")[1] : this.property; + if (propertyName.equalsIgnoreCase("broken")) { + return new BrokenPredicate(value); + } + if (propertyName.equalsIgnoreCase("damaged")) { + return new DamagedPredicate(value); + } + if (propertyName.equalsIgnoreCase("fishing_rod/cast")) { + return new FishingRodCastPredicate(value); + } + if (propertyName.equalsIgnoreCase("custom_model_data") && this instanceof CustomModelDataConditionConfiguration customModelDataConditionConfiguration) { + return new CustomModelDataPredicate(customModelDataConditionConfiguration.getIndex(), value); + } + return null; + } } diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/condition/CustomModelDataConditionConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/condition/CustomModelDataConditionConfiguration.java index 0e93c9fc..c952ca48 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/condition/CustomModelDataConditionConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/condition/CustomModelDataConditionConfiguration.java @@ -16,4 +16,8 @@ public void serialize(@NotNull ConfigurationSection section) { super.serialize(section); section.set("index", this.index); } + + public int getIndex() { + return this.index; + } } diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/model/GenerationConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/model/GenerationConfiguration.java index 8437b3cd..f414eb6a 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/model/GenerationConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/model/GenerationConfiguration.java @@ -1,5 +1,6 @@ package fr.robie.craftengineconverter.api.configuration.item.models.model; +import fr.robie.craftengineconverter.api.configuration.bedrock.texture.TextureData; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -36,4 +37,12 @@ public Map serialize() { } return map; } + + public TextureData toTextureData(@NotNull String bedrockIdentifier) { + TextureData textureData = new TextureData(bedrockIdentifier); + for (String texture : this.textures.values()) { + textureData.addTexture(texture); + } + return textureData; + } } diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockConverter.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockConverter.java index 5b9ad056..726231a0 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockConverter.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockConverter.java @@ -4,7 +4,6 @@ import fr.robie.craftengineconverter.api.configuration.bedrock.ManifestConfiguration; import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.MappingsConfiguration; import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.ItemMapping; -import fr.robie.craftengineconverter.api.configuration.bedrock.texture.TextureData; import fr.robie.craftengineconverter.api.manager.FileCacheManager; import fr.robie.craftengineconverter.api.utils.FileUtils; import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; @@ -76,10 +75,7 @@ private void convertItemMappingsFolder(@NotNull File inputFolder, @NotNull File if (load != null) { mappingsConfiguration.addItemMapping(load); - TextureData textureData = load.getTextureData(); - if (textureData != null) { - itemTextureConfiguration.addTextureData(textureData); - } + load.getTexturesData().forEach(itemTextureConfiguration::addTextureData); } } } diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockItemLoader.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockItemLoader.java index 6d20a823..812e5c44 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockItemLoader.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockItemLoader.java @@ -2,10 +2,15 @@ import fr.robie.craftengineconverter.api.configuration.Configuration; import fr.robie.craftengineconverter.api.configuration.ConfigurationKey; +import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.GroupDefinitionMapping; import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.ItemMapping; import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.ItemModelItemMapping; import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.LegacyItemMapping; +import fr.robie.craftengineconverter.api.configuration.bedrock.texture.TextureData; import fr.robie.craftengineconverter.api.configuration.item.models.ModelConfiguration; +import fr.robie.craftengineconverter.api.configuration.item.models.condition.ConditionModelConfiguration; +import fr.robie.craftengineconverter.api.configuration.item.models.model.GenerationConfiguration; +import fr.robie.craftengineconverter.api.configuration.item.models.model.SimpleModelConfiguration; import fr.robie.craftengineconverter.api.configuration.loader.models.ModelConfigurationRegistry; import fr.robie.craftengineconverter.api.logger.Logger; import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; @@ -26,9 +31,33 @@ public BedrockItemLoader(@NotNull String itemId, @NotNull ConfigurationSection i public ItemMapping load() { ItemMapping itemMapping; + Material material = this.getMaterial(); + ModelConfiguration modelConfiguration = ModelConfigurationRegistry.load(this.itemSection.getConfigurationSection("model")); + + if (modelConfiguration instanceof ConditionModelConfiguration conditionModelConfiguration) { + GroupDefinitionMapping groupDefinitionMapping = new GroupDefinitionMapping(material, this.itemId); + + ItemModelItemMapping onFalse = new ItemModelItemMapping(material, this.itemId, null); + ItemModelItemMapping onTrue = new ItemModelItemMapping(material, this.itemId + "_" + conditionModelConfiguration.getProperty(), null); + + onTrue.setBedrockPredicate(conditionModelConfiguration.getOnTruePredicate()); + onFalse.setBedrockPredicate(conditionModelConfiguration.getOnFalsePredicate()); + + this.convertItem(onTrue); + this.convertItem(onFalse); + + groupDefinitionMapping.addDefinition(onTrue); + groupDefinitionMapping.addDefinition(onFalse); + + this.addTextureDataIfSimpleModel(conditionModelConfiguration.getOnFalse(), groupDefinitionMapping, this.itemId + "_false"); + this.addTextureDataIfSimpleModel(conditionModelConfiguration.getOnTrue(), groupDefinitionMapping, this.itemId + "_true"); + + return groupDefinitionMapping; + } + if (this.itemSection.isString("item-model")) { itemMapping = new ItemModelItemMapping( - this.getMaterial(), + material, this.itemId, this.itemSection.getString("item-model") ); @@ -42,7 +71,7 @@ public ItemMapping load() { } if (!floats.isEmpty()) { itemMapping = new LegacyItemMapping( - this.getMaterial(), + material, this.itemId, floats.getFirst() ); @@ -51,20 +80,35 @@ public ItemMapping load() { } } + + return itemMapping; + } + + private void convertItem(ItemMapping itemMapping) { String itemName = this.itemSection.getString("data.item-name", this.itemSection.getString("data.custom-name")); if (itemName != null) { itemMapping.setDisplayName(itemName); } - ConfigurationSection modelSection = this.itemSection.getConfigurationSection("model"); - if (modelSection != null) { - ModelConfiguration modelConfiguration = ModelConfigurationRegistry.load(modelSection); - if (modelConfiguration != null) { + } + /** + * Adds TextureData to the groupDefinitionMapping if the modelConfiguration is a SimpleModelConfiguration with a GenerationConfiguration. + * + * @param modelConfiguration the model configuration (can be null) + * @param groupDefinitionMapping the group definition mapping to add to + * @param textureId the texture id to use for toTextureData + */ + private void addTextureDataIfSimpleModel(ModelConfiguration modelConfiguration, GroupDefinitionMapping groupDefinitionMapping, String textureId) { + if (modelConfiguration instanceof SimpleModelConfiguration simpleModelConfiguration) { + GenerationConfiguration generation = simpleModelConfiguration.getGeneration(); + if (generation != null) { + TextureData textureData = generation.toTextureData(textureId); + if (textureData != null) { + groupDefinitionMapping.addTextureData(textureData); + } } } - - return itemMapping; } From c7cbbb2bb8c717801aa473260c30881d4c1edb23 Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Thu, 30 Apr 2026 13:56:19 +0200 Subject: [PATCH 020/116] fix: spaces --- Plugin/src/main/resources/plugin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugin/src/main/resources/plugin.yml b/Plugin/src/main/resources/plugin.yml index 324dd6a3..7c92348f 100644 --- a/Plugin/src/main/resources/plugin.yml +++ b/Plugin/src/main/resources/plugin.yml @@ -1,6 +1,6 @@ name: ${project.parent.artifactId} version: ${plugin.finalVersion} -authors: [ ${ plugin.author } ] +authors: [ ${plugin.author} ] description: ${plugin.description} main: ${plugin.mainClass} api-version: ${plugin.apiVersion} From 3cd84de7d0517d4b53b6a7a135917a71dc9b31bd Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Thu, 30 Apr 2026 17:04:21 +0200 Subject: [PATCH 021/116] feat: enhance BedrockConverter with improved logging and directory handling --- .../bedrock/ItemTextureConfiguration.java | 6 +- .../mapping/MappingsConfiguration.java | 2 + .../api/reflections/ReflectionsCache.java | 8 + .../api/utils/MinecraftVersion.java | 8 +- .../CraftEngineConverter.java | 158 +--------------- .../craftengineconverter/RegistryHelper.java | 175 ++++++++++++++++++ .../command/CraftEngineConverterCommand.java | 14 +- .../converter/bedrock/BedrockConverter.java | 21 ++- .../converter/bedrock/BedrockItemLoader.java | 6 + .../itemsadder/IAItemsConverter.java | 4 +- .../converter/nexo/NexoItemConverter.java | 2 +- .../BedrockConverterTest.java | 37 ++++ .../craftengineconverter/SystemLogger.java | 128 +++++++++++++ .../bedrock/items/test_item.yml | 44 +++++ 14 files changed, 439 insertions(+), 174 deletions(-) create mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/RegistryHelper.java create mode 100644 Plugin/src/test/java/fr/robie/craftengineconverter/BedrockConverterTest.java create mode 100644 Plugin/src/test/java/fr/robie/craftengineconverter/SystemLogger.java create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/test_item.yml diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/ItemTextureConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/ItemTextureConfiguration.java index de6d6dd4..9e9828ae 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/ItemTextureConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/ItemTextureConfiguration.java @@ -2,6 +2,7 @@ import com.google.gson.JsonObject; import fr.robie.craftengineconverter.api.configuration.bedrock.texture.TextureData; +import fr.robie.craftengineconverter.api.logger.Logger; import fr.robie.craftengineconverter.api.manager.FileCacheManager; import org.jetbrains.annotations.NotNull; @@ -47,9 +48,12 @@ public void save(@NotNull Path directory) { texturesObject.add(textureData.getBedrockIdentifier(), textureData.serialize()); } jsonObject.add("texture_data", texturesObject); + } else { + Logger.info("No textures added to the item texture configuration, skipping texture_data section."); } - FileCacheManager.saveJsonToFile(directory.resolve("textures").resolve("item_texture.json"), jsonObject); + FileCacheManager.saveJsonToFile(directory.resolve("packs").resolve("textures").resolve("item_texture.json"), jsonObject); + Logger.info("Item texture configuration saved successfully."); } } diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/MappingsConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/MappingsConfiguration.java index e36504cc..12bd62e1 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/MappingsConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/MappingsConfiguration.java @@ -41,6 +41,8 @@ public void saveMappings(@NotNull Path directory) { itemsObject.add("minecraft:" + material.name().toLowerCase(), mappingsArray); } + jsonObject.add("items", itemsObject); + Path mappingsFile = directory.resolve("items_mappings.json"); FileCacheManager.saveJsonToFile(mappingsFile, jsonObject); } diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/reflections/ReflectionsCache.java b/API/src/main/java/fr/robie/craftengineconverter/api/reflections/ReflectionsCache.java index 6f326c43..c82a13fb 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/reflections/ReflectionsCache.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/reflections/ReflectionsCache.java @@ -36,6 +36,14 @@ public Reflections getOrCreate(@NotNull JavaPlugin plugin, @NotNull String packa return this.cache.computeIfAbsent(key, k -> this.createReflections(classLoader, packageName)); } + public Reflections getOrCreate(@NotNull ClassLoader classLoader, @NotNull String packageName) { + if (packageName.trim().isEmpty()) { + throw new IllegalArgumentException("Package name cannot be empty"); + } + CacheKey key = new CacheKey(packageName, classLoader); + return this.cache.computeIfAbsent(key, k -> this.createReflections(classLoader, packageName)); + } + private Reflections createReflections(ClassLoader classLoader, String packageName) { return new Reflections(new ConfigurationBuilder() .forPackage(packageName, classLoader) diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/utils/MinecraftVersion.java b/API/src/main/java/fr/robie/craftengineconverter/api/utils/MinecraftVersion.java index 6140f161..b42c19a7 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/utils/MinecraftVersion.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/utils/MinecraftVersion.java @@ -21,7 +21,13 @@ private MinecraftVersion(int major, int minor, int patch) { */ public static MinecraftVersion current() { if (current == null) { - current = parse(Bukkit.getBukkitVersion()); + String bukkitVersion; + try { + bukkitVersion = Bukkit.getBukkitVersion(); + } catch (NoClassDefFoundError | Exception e) { // In case we're running in an environment without Bukkit (e.g., during testing), we can't get the version, so we default to (0, 0, 0). + bukkitVersion = null; + } + current = parse(bukkitVersion); } return current; } diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/CraftEngineConverter.java b/Plugin/src/main/java/fr/robie/craftengineconverter/CraftEngineConverter.java index ff29c764..76154cd8 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/CraftEngineConverter.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/CraftEngineConverter.java @@ -1,21 +1,8 @@ package fr.robie.craftengineconverter; -import fr.robie.craftengineconverter.api.annotations.AutoModelConfigurationLoader; -import fr.robie.craftengineconverter.api.annotations.AutoRangeDispatchConfigurationLoader; -import fr.robie.craftengineconverter.api.annotations.AutoSelectModelConfigurationLoader; -import fr.robie.craftengineconverter.api.annotations.AutoTintConfigurationLoader; import fr.robie.craftengineconverter.api.builder.TimerBuilder; import fr.robie.craftengineconverter.api.configuration.Configuration; import fr.robie.craftengineconverter.api.configuration.ConfigurationKey; -import fr.robie.craftengineconverter.api.configuration.item.models.ModelConfiguration; -import fr.robie.craftengineconverter.api.configuration.item.models.range_dispatch.RangeDispatchModelConfiguration; -import fr.robie.craftengineconverter.api.configuration.item.models.select.SelectModelConfiguration; -import fr.robie.craftengineconverter.api.configuration.loader.models.ModelConfigurationLoader; -import fr.robie.craftengineconverter.api.configuration.loader.models.ModelConfigurationRegistry; -import fr.robie.craftengineconverter.api.configuration.loader.models.range_dispatch.RangeDispatchConfigurationRegistry; -import fr.robie.craftengineconverter.api.configuration.loader.models.select.SelectModelConfigurationRegistry; -import fr.robie.craftengineconverter.api.configuration.loader.models.tints.TintConfigurationLoader; -import fr.robie.craftengineconverter.api.configuration.loader.models.tints.TintConfigurationRegistry; import fr.robie.craftengineconverter.api.database.StorageManager; import fr.robie.craftengineconverter.api.enums.ConverterOption; import fr.robie.craftengineconverter.api.enums.Plugins; @@ -30,9 +17,7 @@ import fr.robie.craftengineconverter.api.manager.FoliaCompatibilityManager; import fr.robie.craftengineconverter.api.packet.PacketLoader; import fr.robie.craftengineconverter.api.profile.ServerProfile; -import fr.robie.craftengineconverter.api.reflections.ReflectionsCache; import fr.robie.craftengineconverter.api.tag.ITagResolver; -import fr.robie.craftengineconverter.api.utils.VersionFilter; import fr.robie.craftengineconverter.behavior.BehaviorRegister; import fr.robie.craftengineconverter.command.CraftEngineConverterCommand; import fr.robie.craftengineconverter.common.CraftEngineConverterPlugin; @@ -60,7 +45,6 @@ import org.bukkit.event.Listener; import org.bukkit.plugin.ServicePriority; import org.jetbrains.annotations.NotNull; -import org.reflections.Reflections; import java.io.File; import java.util.*; @@ -137,7 +121,8 @@ public void onEnable() { this.storageManager.loadDatabase(); this.serverProfile.load(); - this.loadRegistries(); + + new RegistryHelper(this).loadRegistries(); this.commandManager.registerCommand("craftengineconverter", new CraftEngineConverterCommand(this), "cengineconverter", "cec"); @@ -256,145 +241,6 @@ public void onDisable() { Logger.info(Message.MESSAGE__PLUGIN__SHUTDOWN__COMPLETE, "time", TimerBuilder.formatTimeAuto(System.currentTimeMillis() - startTime)); } - private void loadRegistries() { - this.loadModelConfigurationRegistry(); - this.loadTintConfigurationRegistry(); - this.loadSelectModelConfigurationRegistry(); - this.loadRangeDispatchModelConfigurationRegistry(); - } - - private void loadModelConfigurationRegistry() { - Reflections reflections = ReflectionsCache.getInstance().getOrCreate(this, "fr.robie.craftengineconverter"); - Set> candidates = reflections.getTypesAnnotatedWith(AutoModelConfigurationLoader.class); - int count = 0; - for (Class clazz : candidates) { - if (!ModelConfigurationLoader.class.isAssignableFrom(clazz)) { - continue; - } - if (!VersionFilter.passes(clazz, clazz.getSimpleName())) { - continue; - } - AutoModelConfigurationLoader annotation = clazz.getAnnotation(AutoModelConfigurationLoader.class); - if (annotation.value().length == 0) { - continue; - } - try { - @SuppressWarnings("rawtypes") - Class typedClass = clazz.asSubclass(ModelConfigurationLoader.class); - @SuppressWarnings("unchecked") - ModelConfigurationLoader loader = (ModelConfigurationLoader) typedClass.getDeclaredConstructor().newInstance(); - for (String name : annotation.value()) { - ModelConfigurationRegistry.register(name, loader); - } - count++; - } catch (ClassCastException e) { - Logger.showException("Class " + clazz.getName() + " cannot be cast to ModelConfigurationLoader", e); - } catch (Exception e) { - Logger.showException("Failed to load ModelConfigurationLoader " + clazz.getName() + " for names " + Arrays.toString(annotation.value()), e); - } - } - - ModelConfigurationRegistry.register("select", SelectModelConfigurationRegistry::load); - ModelConfigurationRegistry.register("minecraft:select", SelectModelConfigurationRegistry::load); - count++; - ModelConfigurationRegistry.register("range_dispatch", RangeDispatchConfigurationRegistry::load); - ModelConfigurationRegistry.register("minecraft:range_dispatch", RangeDispatchConfigurationRegistry::load); - count++; - - Logger.info("Loaded " + count + " ModelConfigurationLoaders"); - } - - private void loadTintConfigurationRegistry() { - Reflections reflections = ReflectionsCache.getInstance().getOrCreate(this, "fr.robie.craftengineconverter"); - Set> candidates = reflections.getTypesAnnotatedWith(AutoTintConfigurationLoader.class); - int count = 0; - for (Class clazz : candidates) { - if (!TintConfigurationLoader.class.isAssignableFrom(clazz)) { - continue; - } - if (!fr.robie.craftengineconverter.api.utils.VersionFilter.passes(clazz, clazz.getSimpleName())) { - continue; - } - AutoTintConfigurationLoader annotation = clazz.getAnnotation(AutoTintConfigurationLoader.class); - try { - TintConfigurationLoader loader = (TintConfigurationLoader) clazz.getDeclaredConstructor().newInstance(); - for (String name : annotation.value()) { - TintConfigurationRegistry.register(name, loader); - } - count++; - } catch (Exception e) { - fr.robie.craftengineconverter.api.logger.Logger.showException("Failed to load TintConfigurationLoader " + clazz.getName() + " for names " + java.util.Arrays.toString(annotation.value()), e); - } - } - Logger.info("Loaded " + count + " TintConfigurationLoaders"); - } - - @SuppressWarnings({"rawtypes", "unchecked"}) - private void loadSelectModelConfigurationRegistry() { - Reflections reflections = ReflectionsCache.getInstance().getOrCreate(this, "fr.robie.craftengineconverter"); - Set> candidates = reflections.getTypesAnnotatedWith(AutoSelectModelConfigurationLoader.class); - int count = 0; - for (Class clazz : candidates) { - if (!ModelConfigurationLoader.class.isAssignableFrom(clazz)) { - continue; - } - if (!VersionFilter.passes(clazz, clazz.getSimpleName())) { - continue; - } - AutoSelectModelConfigurationLoader annotation = clazz.getAnnotation(AutoSelectModelConfigurationLoader.class); - if (annotation.value().length == 0) { - Logger.debug("Skipping " + clazz.getName() + " — no names specified in @AutoSelectModelConfigurationLoader"); - continue; - } - try { - Class typedClass = clazz.asSubclass(ModelConfigurationLoader.class); - ModelConfigurationLoader> loader = (ModelConfigurationLoader>) typedClass.getDeclaredConstructor().newInstance(); - for (String name : annotation.value()) { - SelectModelConfigurationRegistry.register(name, loader); - } - count++; - } catch (ClassCastException e) { - Logger.showException("Class " + clazz.getName() + " cannot be cast to ModelConfigurationLoader", e); - } catch (Exception e) { - Logger.showException("Failed to load SelectModelConfigurationLoader " + clazz.getName() + " for names " + Arrays.toString(annotation.value()), e); - } - } - Logger.info("Loaded " + count + " SelectModelConfigurationLoaders"); - } - - private void loadRangeDispatchModelConfigurationRegistry() { - Reflections reflections = ReflectionsCache.getInstance().getOrCreate(this, "fr.robie.craftengineconverter"); - Set> candidates = reflections.getTypesAnnotatedWith(AutoModelConfigurationLoader.class); - int count = 0; - for (Class clazz : candidates) { - if (!ModelConfigurationLoader.class.isAssignableFrom(clazz)) { - continue; - } - if (!VersionFilter.passes(clazz, clazz.getSimpleName())) { - continue; - } - AutoRangeDispatchConfigurationLoader annotation = clazz.getAnnotation(AutoRangeDispatchConfigurationLoader.class); - if (annotation.value().length == 0) { - Logger.debug("Skipping " + clazz.getName() + " — no names specified in @AutoRangeDispatchConfigurationLoader"); - continue; - } - try { - Class typedClass = clazz.asSubclass(ModelConfigurationLoader.class); - ModelConfigurationLoader loader = (ModelConfigurationLoader) typedClass.getDeclaredConstructor().newInstance(); - for (String name : annotation.value()) { - RangeDispatchConfigurationRegistry.register(name, loader); - } - count++; - } catch (ClassCastException e) { - Logger.showException("Class " + clazz.getName() + " cannot be cast to ModelConfigurationLoader", e); - } catch (Exception e) { - Logger.showException("Failed to load RangeDispatchModelConfigurationLoader " + clazz.getName() + " for names " + Arrays.toString(annotation.value()), e); - } - } - - Logger.info("Loaded " + count + " RangeDispatchModelConfigurationLoaders"); - } - public void reloadMessages() { this.messageLoader.reload(); } diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/RegistryHelper.java b/Plugin/src/main/java/fr/robie/craftengineconverter/RegistryHelper.java new file mode 100644 index 00000000..c6cfa188 --- /dev/null +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/RegistryHelper.java @@ -0,0 +1,175 @@ +package fr.robie.craftengineconverter; + +import fr.robie.craftengineconverter.api.annotations.AutoModelConfigurationLoader; +import fr.robie.craftengineconverter.api.annotations.AutoRangeDispatchConfigurationLoader; +import fr.robie.craftengineconverter.api.annotations.AutoSelectModelConfigurationLoader; +import fr.robie.craftengineconverter.api.annotations.AutoTintConfigurationLoader; +import fr.robie.craftengineconverter.api.configuration.item.models.ModelConfiguration; +import fr.robie.craftengineconverter.api.configuration.item.models.range_dispatch.RangeDispatchModelConfiguration; +import fr.robie.craftengineconverter.api.configuration.item.models.select.SelectModelConfiguration; +import fr.robie.craftengineconverter.api.configuration.loader.models.ModelConfigurationLoader; +import fr.robie.craftengineconverter.api.configuration.loader.models.ModelConfigurationRegistry; +import fr.robie.craftengineconverter.api.configuration.loader.models.range_dispatch.RangeDispatchConfigurationRegistry; +import fr.robie.craftengineconverter.api.configuration.loader.models.select.SelectModelConfigurationRegistry; +import fr.robie.craftengineconverter.api.configuration.loader.models.tints.TintConfigurationLoader; +import fr.robie.craftengineconverter.api.configuration.loader.models.tints.TintConfigurationRegistry; +import fr.robie.craftengineconverter.api.logger.Logger; +import fr.robie.craftengineconverter.api.reflections.ReflectionsCache; +import fr.robie.craftengineconverter.api.utils.VersionFilter; +import fr.robie.craftengineconverter.common.CraftEngineConverterPlugin; +import org.jetbrains.annotations.NotNull; +import org.reflections.Reflections; + +import java.util.Arrays; +import java.util.Set; + +public class RegistryHelper { + private final ClassLoader classLoader; + + public RegistryHelper(CraftEngineConverterPlugin plugin) { + this.classLoader = plugin.getClass().getClassLoader(); + } + + public RegistryHelper(@NotNull ClassLoader classLoader) { + this.classLoader = classLoader; + } + + public void loadRegistries() { + this.loadModelConfigurationRegistry(); + this.loadTintConfigurationRegistry(); + this.loadSelectModelConfigurationRegistry(); + this.loadRangeDispatchModelConfigurationRegistry(); + } + + private void loadModelConfigurationRegistry() { + Reflections reflections = ReflectionsCache.getInstance().getOrCreate(this.classLoader, "fr.robie.craftengineconverter"); + Set> candidates = reflections.getTypesAnnotatedWith(AutoModelConfigurationLoader.class); + int count = 0; + for (Class clazz : candidates) { + if (!ModelConfigurationLoader.class.isAssignableFrom(clazz)) { + continue; + } + if (!VersionFilter.passes(clazz, clazz.getSimpleName())) { + continue; + } + AutoModelConfigurationLoader annotation = clazz.getAnnotation(AutoModelConfigurationLoader.class); + if (annotation.value().length == 0) { + continue; + } + try { + @SuppressWarnings("rawtypes") + Class typedClass = clazz.asSubclass(ModelConfigurationLoader.class); + @SuppressWarnings("unchecked") + ModelConfigurationLoader loader = (ModelConfigurationLoader) typedClass.getDeclaredConstructor().newInstance(); + for (String name : annotation.value()) { + ModelConfigurationRegistry.register(name, loader); + } + count++; + } catch (ClassCastException e) { + Logger.showException("Class " + clazz.getName() + " cannot be cast to ModelConfigurationLoader", e); + } catch (Exception e) { + Logger.showException("Failed to load ModelConfigurationLoader " + clazz.getName() + " for names " + Arrays.toString(annotation.value()), e); + } + } + + ModelConfigurationRegistry.register("select", SelectModelConfigurationRegistry::load); + ModelConfigurationRegistry.register("minecraft:select", SelectModelConfigurationRegistry::load); + count++; + ModelConfigurationRegistry.register("range_dispatch", RangeDispatchConfigurationRegistry::load); + ModelConfigurationRegistry.register("minecraft:range_dispatch", RangeDispatchConfigurationRegistry::load); + count++; + + Logger.info("Loaded " + count + " ModelConfigurationLoaders"); + } + + private void loadTintConfigurationRegistry() { + Reflections reflections = ReflectionsCache.getInstance().getOrCreate(this.classLoader, "fr.robie.craftengineconverter"); + Set> candidates = reflections.getTypesAnnotatedWith(AutoTintConfigurationLoader.class); + int count = 0; + for (Class clazz : candidates) { + if (!TintConfigurationLoader.class.isAssignableFrom(clazz)) { + continue; + } + if (!fr.robie.craftengineconverter.api.utils.VersionFilter.passes(clazz, clazz.getSimpleName())) { + continue; + } + AutoTintConfigurationLoader annotation = clazz.getAnnotation(AutoTintConfigurationLoader.class); + try { + TintConfigurationLoader loader = (TintConfigurationLoader) clazz.getDeclaredConstructor().newInstance(); + for (String name : annotation.value()) { + TintConfigurationRegistry.register(name, loader); + } + count++; + } catch (Exception e) { + fr.robie.craftengineconverter.api.logger.Logger.showException("Failed to load TintConfigurationLoader " + clazz.getName() + " for names " + java.util.Arrays.toString(annotation.value()), e); + } + } + Logger.info("Loaded " + count + " TintConfigurationLoaders"); + } + + @SuppressWarnings({"rawtypes", "unchecked"}) + private void loadSelectModelConfigurationRegistry() { + Reflections reflections = ReflectionsCache.getInstance().getOrCreate(this.classLoader, "fr.robie.craftengineconverter"); + Set> candidates = reflections.getTypesAnnotatedWith(AutoSelectModelConfigurationLoader.class); + int count = 0; + for (Class clazz : candidates) { + if (!ModelConfigurationLoader.class.isAssignableFrom(clazz)) { + continue; + } + if (!VersionFilter.passes(clazz, clazz.getSimpleName())) { + continue; + } + AutoSelectModelConfigurationLoader annotation = clazz.getAnnotation(AutoSelectModelConfigurationLoader.class); + if (annotation.value().length == 0) { + Logger.debug("Skipping " + clazz.getName() + " — no names specified in @AutoSelectModelConfigurationLoader"); + continue; + } + try { + Class typedClass = clazz.asSubclass(ModelConfigurationLoader.class); + ModelConfigurationLoader> loader = (ModelConfigurationLoader>) typedClass.getDeclaredConstructor().newInstance(); + for (String name : annotation.value()) { + SelectModelConfigurationRegistry.register(name, loader); + } + count++; + } catch (ClassCastException e) { + Logger.showException("Class " + clazz.getName() + " cannot be cast to ModelConfigurationLoader", e); + } catch (Exception e) { + Logger.showException("Failed to load SelectModelConfigurationLoader " + clazz.getName() + " for names " + Arrays.toString(annotation.value()), e); + } + } + Logger.info("Loaded " + count + " SelectModelConfigurationLoaders"); + } + + private void loadRangeDispatchModelConfigurationRegistry() { + Reflections reflections = ReflectionsCache.getInstance().getOrCreate(this.classLoader, "fr.robie.craftengineconverter"); + Set> candidates = reflections.getTypesAnnotatedWith(AutoRangeDispatchConfigurationLoader.class); + int count = 0; + for (Class clazz : candidates) { + if (!ModelConfigurationLoader.class.isAssignableFrom(clazz)) { + continue; + } + if (!VersionFilter.passes(clazz, clazz.getSimpleName())) { + continue; + } + AutoRangeDispatchConfigurationLoader annotation = clazz.getAnnotation(AutoRangeDispatchConfigurationLoader.class); + if (annotation.value().length == 0) { + Logger.debug("Skipping " + clazz.getName() + " — no names specified in @AutoRangeDispatchConfigurationLoader"); + continue; + } + try { + Class typedClass = clazz.asSubclass(ModelConfigurationLoader.class); + ModelConfigurationLoader loader = (ModelConfigurationLoader) typedClass.getDeclaredConstructor().newInstance(); + for (String name : annotation.value()) { + RangeDispatchConfigurationRegistry.register(name, loader); + } + count++; + } catch (ClassCastException e) { + Logger.showException("Class " + clazz.getName() + " cannot be cast to ModelConfigurationLoader", e); + } catch (Exception e) { + Logger.showException("Failed to load RangeDispatchModelConfigurationLoader " + clazz.getName() + " for names " + Arrays.toString(annotation.value()), e); + } + } + + Logger.info("Loaded " + count + " RangeDispatchModelConfigurationLoaders"); + } +} diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/command/CraftEngineConverterCommand.java b/Plugin/src/main/java/fr/robie/craftengineconverter/command/CraftEngineConverterCommand.java index 0b34fbb4..eaf26d78 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/command/CraftEngineConverterCommand.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/command/CraftEngineConverterCommand.java @@ -2,13 +2,16 @@ import fr.robie.craftengineconverter.CraftEngineConverter; import fr.robie.craftengineconverter.common.permission.Permission; +import fr.robie.craftengineconverter.converter.bedrock.BedrockConverter; import fr.robie.craftengineconverter.utils.command.CommandType; import fr.robie.craftengineconverter.utils.command.VCommand; -import org.bukkit.block.Block; public class CraftEngineConverterCommand extends VCommand { + private final BedrockConverter bedrockConverter; + public CraftEngineConverterCommand(CraftEngineConverter craftEngineConverter) { super(craftEngineConverter); + this.bedrockConverter = new BedrockConverter(craftEngineConverter.getDataFolder()); this.setPermission(Permission.COMMAND_USE); this.addSubCommand(new CraftEngineConverterCommandReload(craftEngineConverter)); this.addSubCommand(new CraftEngineConverterCommandConvert(craftEngineConverter)); @@ -19,12 +22,9 @@ public CraftEngineConverterCommand(CraftEngineConverter craftEngineConverter) { @Override protected CommandType perform(CraftEngineConverter plugin) { this.syntaxMessage(); - Block targetBlockExact = this.player.getTargetBlockExact(100); - if (targetBlockExact != null) { - this.player.sendMessage("Target block: " + targetBlockExact.getBlockData().getAsString()); - } else { - this.player.sendMessage("No target block within range."); - } + + this.bedrockConverter.convert(); + return CommandType.SUCCESS; } } diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockConverter.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockConverter.java index 726231a0..68cf53f9 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockConverter.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockConverter.java @@ -4,25 +4,24 @@ import fr.robie.craftengineconverter.api.configuration.bedrock.ManifestConfiguration; import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.MappingsConfiguration; import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.ItemMapping; +import fr.robie.craftengineconverter.api.logger.Logger; import fr.robie.craftengineconverter.api.manager.FileCacheManager; import fr.robie.craftengineconverter.api.utils.FileUtils; import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; -import fr.robie.craftengineconverter.common.CraftEngineConverterPlugin; import fr.robie.craftengineconverter.common.utils.yaml.file.YamlConfiguration; import org.jetbrains.annotations.NotNull; import java.io.File; public class BedrockConverter { - private final CraftEngineConverterPlugin plugin; + private final File pluginFolder; - public BedrockConverter(CraftEngineConverterPlugin plugin) { - this.plugin = plugin; + public BedrockConverter(File pluginFolder) { + this.pluginFolder = pluginFolder; } - public void convert() { - File outputFolder = new File(this.plugin.getDataFolder(), "bedrock-converted/Geyser-Spigot"); + File outputFolder = new File(this.pluginFolder, "bedrock-converted/Geyser-Spigot"); if (outputFolder.exists()) { FileUtils.deleteDirectory(outputFolder); @@ -39,22 +38,31 @@ public void convert() { File packs = new File(outputFolder, "packs"); if (!FileUtils.mkdirs(packs)) { + return; } + File textures = new File(packs, "textures"); + if (!FileUtils.mkdirs(textures)) { + return; + } + this.convertItemMappingsFolder(new File(this.pluginFolder, "bedrock/items"), outputFolder); } private void convertItemMappingsFolder(@NotNull File inputFolder, @NotNull File outputFolder) { if (!inputFolder.exists() || !inputFolder.isDirectory()) { + Logger.info("Input folder does not exist or is not a directory: " + inputFolder.getAbsolutePath()); return; } File[] listed = inputFolder.listFiles(); if (listed == null) { + Logger.info("No files found in input folder: " + inputFolder.getAbsolutePath()); return; } if (!FileUtils.mkdirs(outputFolder)) { + Logger.info("Failed to create output folder: " + outputFolder.getAbsolutePath()); return; } @@ -83,6 +91,7 @@ private void convertItemMappingsFolder(@NotNull File inputFolder, @NotNull File } } + Logger.info("Saving mappings and textures to: " + outputFolder.getAbsolutePath()); mappingsConfiguration.saveMappings(outputFolder.toPath()); itemTextureConfiguration.save(outputFolder.toPath()); } diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockItemLoader.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockItemLoader.java index 812e5c44..5efcce9c 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockItemLoader.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockItemLoader.java @@ -12,6 +12,7 @@ import fr.robie.craftengineconverter.api.configuration.item.models.model.GenerationConfiguration; import fr.robie.craftengineconverter.api.configuration.item.models.model.SimpleModelConfiguration; import fr.robie.craftengineconverter.api.configuration.loader.models.ModelConfigurationRegistry; +import fr.robie.craftengineconverter.api.logger.LogType; import fr.robie.craftengineconverter.api.logger.Logger; import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; import org.bukkit.Material; @@ -105,9 +106,14 @@ private void addTextureDataIfSimpleModel(ModelConfiguration modelConfiguration, if (generation != null) { TextureData textureData = generation.toTextureData(textureId); if (textureData != null) { + Logger.info("", "Adding texture data for item %itemId% with texture id %textureId%", LogType.INFO, "itemId", this.itemId, "textureId", textureId); groupDefinitionMapping.addTextureData(textureData); } } + } else if (modelConfiguration != null) { + Logger.info("Model configuration for item %itemId% is not a SimpleModelConfiguration, skipping texture data extraction.", LogType.INFO, "itemId", this.itemId); + } else { + Logger.info("No model configuration for item %itemId%, skipping texture data extraction.", LogType.INFO, "itemId", this.itemId); } } diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/itemsadder/IAItemsConverter.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/itemsadder/IAItemsConverter.java index 9b75bc86..b60277ea 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/itemsadder/IAItemsConverter.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/itemsadder/IAItemsConverter.java @@ -1036,7 +1036,7 @@ private void handleBow2D(ConfigurationSection texturesSection) { String pulling2Texture = this.namespaced(texturesSection.getString("pulling_2"), this.namespace); UseDurationRangeDispatchConfiguration pullingDispatch = new UseDurationRangeDispatchConfiguration(); - pullingDispatch.setScale(0.05); + pullingDispatch.setScale(0.05f); pullingDispatch.addEntry(0.65, this.buildSimpleModel("minecraft:item/bow_pulling_1", pulling1Texture)); pullingDispatch.addEntry(0.90, this.buildSimpleModel("minecraft:item/bow_pulling_2", pulling2Texture)); pullingDispatch.setFallback(this.buildSimpleModel("minecraft:item/bow_pulling_0", pulling0Texture)); @@ -1086,7 +1086,7 @@ private void handleCrossbow2D(ConfigurationSection texturesSection) { private void handleBow3D(String defaultModelPath, String pulling0ModelPath, String pulling1ModelPath, String pulling2ModelPath) { UseDurationRangeDispatchConfiguration pullingDispatch = new UseDurationRangeDispatchConfiguration(); - pullingDispatch.setScale(0.05); + pullingDispatch.setScale(0.05f); pullingDispatch.addEntry(0.65, new SimpleModelConfiguration(pulling1ModelPath)); pullingDispatch.addEntry(0.90, new SimpleModelConfiguration(pulling2ModelPath)); pullingDispatch.setFallback(new SimpleModelConfiguration(pulling0ModelPath)); diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoItemConverter.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoItemConverter.java index e2883f71..183e9e17 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoItemConverter.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoItemConverter.java @@ -1897,7 +1897,7 @@ private void buildBowModel(ConfigurationSection packSection) { if (this.isNotNull(baseModel) && this.isNotNull(pulling0) && this.isNotNull(pulling1) && this.isNotNull(pulling2)) { UseDurationRangeDispatchConfiguration pullingDispatch = new UseDurationRangeDispatchConfiguration(); - pullingDispatch.setScale(0.05); + pullingDispatch.setScale(0.05f); pullingDispatch.addEntry(0.65, new SimpleModelConfiguration(pulling1)); pullingDispatch.addEntry(0.90, new SimpleModelConfiguration(pulling2)); pullingDispatch.setFallback(new SimpleModelConfiguration(pulling0)); diff --git a/Plugin/src/test/java/fr/robie/craftengineconverter/BedrockConverterTest.java b/Plugin/src/test/java/fr/robie/craftengineconverter/BedrockConverterTest.java new file mode 100644 index 00000000..9f938333 --- /dev/null +++ b/Plugin/src/test/java/fr/robie/craftengineconverter/BedrockConverterTest.java @@ -0,0 +1,37 @@ +package fr.robie.craftengineconverter; + + +import fr.robie.craftengineconverter.common.CraftEngineConverterPlugin; +import fr.robie.craftengineconverter.converter.bedrock.BedrockConverter; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +import java.io.File; + +public class BedrockConverterTest { + + @BeforeAll + static void setup() { + new SystemLogger(); + + ClassLoader classLoader = CraftEngineConverterPlugin.class.getClassLoader(); + RegistryHelper registryHelper = new RegistryHelper(classLoader); + registryHelper.loadRegistries(); + + } + + @Test + void testConvertCreatesMappings() throws Exception { + var resource = this.getClass() + .getClassLoader() + .getResource("bedrock-folder"); + + assert resource != null; + + File file = new File(resource.toURI()); + + BedrockConverter converter = new BedrockConverter(file); + + converter.convert(); + } +} diff --git a/Plugin/src/test/java/fr/robie/craftengineconverter/SystemLogger.java b/Plugin/src/test/java/fr/robie/craftengineconverter/SystemLogger.java new file mode 100644 index 00000000..78ecb4a4 --- /dev/null +++ b/Plugin/src/test/java/fr/robie/craftengineconverter/SystemLogger.java @@ -0,0 +1,128 @@ +package fr.robie.craftengineconverter; + +import fr.robie.craftengineconverter.api.logger.LogType; +import fr.robie.craftengineconverter.api.logger.Logger; +import org.jetbrains.annotations.Nullable; + +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +public class SystemLogger extends Logger { + + private static final String ANSI_RESET = "\u001B[0m"; + + public SystemLogger() { + super("CraftEngineConverter"); + } + + @Override + public void log(@Nullable String subPrefix, String message, LogType logType, Object... args) { + String prefix = subPrefix != null ? "[" + this.prefix + "] [" + subPrefix + "] " : "[" + this.prefix + "] "; + + String ansiColor = toAnsi(logType.getColor()); + String parsed = this.parseText(message, args); + + System.out.println(prefix + ansiColor + stripFormatting(parsed) + ANSI_RESET); + } + + private static String toAnsi(String color) { + if (color == null || color.isEmpty()) return ""; + if (color.startsWith("§") && color.length() == 2) { + String ansi = legacyCodeToAnsi(Character.toLowerCase(color.charAt(1))); + return ansi != null ? ansi : ""; + } + if (color.startsWith("<") && color.endsWith(">")) { + String tag = color.substring(1, color.length() - 1).toLowerCase(); + String ansi = miniMessageTagToAnsi(tag); + return ansi != null ? ansi : ""; + } + return ""; + } + + private static String stripFormatting(String text) { + StringBuilder sb = new StringBuilder(text.length()); + for (int i = 0; i < text.length(); i++) { + if (text.charAt(i) == '§' && i + 1 < text.length()) { + char code = Character.toLowerCase(text.charAt(i + 1)); + String ansi = legacyCodeToAnsi(code); + if (ansi != null) sb.append(ansi); + i++; + continue; + } + sb.append(text.charAt(i)); + } + text = sb.toString(); + + text = text.replace("", ANSI_RESET); + text = text.replaceAll("]+>", ANSI_RESET); + + text = text.replace("", "\u001B[1m"); + text = text.replace("", "\u001B[3m"); + text = text.replace("", "\u001B[4m"); + text = text.replace("", "\u001B[9m"); + + text = Pattern.compile("<[^>]+>").matcher(text).replaceAll(match -> { + String tag = match.group().substring(1, match.group().length() - 1).toLowerCase(); + String ansi = miniMessageTagToAnsi(tag); + return ansi != null ? Matcher.quoteReplacement(ansi) : ""; + }); + + return text; + } + + @Nullable + private static String legacyCodeToAnsi(char code) { + return switch (code) { + case '0' -> "\u001B[30m"; // black + case '1' -> "\u001B[34m"; // dark_blue + case '2' -> "\u001B[32m"; // dark_green + case '3' -> "\u001B[36m"; // dark_aqua + case '4' -> "\u001B[31m"; // dark_red + case '5' -> "\u001B[35m"; // dark_purple + case '6' -> "\u001B[33m"; // gold + case '7' -> "\u001B[37m"; // gray + case '8' -> "\u001B[90m"; // dark_gray + case '9' -> "\u001B[94m"; // blue + case 'a' -> "\u001B[92m"; // green + case 'b' -> "\u001B[96m"; // aqua + case 'c' -> "\u001B[91m"; // red + case 'd' -> "\u001B[95m"; // light_purple + case 'e' -> "\u001B[93m"; // yellow + case 'f' -> "\u001B[97m"; // white + case 'l' -> "\u001B[1m"; // bold + case 'o' -> "\u001B[3m"; // italic + case 'n' -> "\u001B[4m"; // underline + case 'm' -> "\u001B[9m"; // strikethrough + case 'r' -> ANSI_RESET; + default -> null; + }; + } + + @Nullable + private static String miniMessageTagToAnsi(String tag) { + return switch (tag) { + case "black" -> "\u001B[30m"; + case "dark_blue" -> "\u001B[34m"; + case "dark_green" -> "\u001B[32m"; + case "dark_aqua" -> "\u001B[36m"; + case "dark_red" -> "\u001B[31m"; + case "dark_purple" -> "\u001B[35m"; + case "gold" -> "\u001B[33m"; + case "gray" -> "\u001B[37m"; + case "dark_gray" -> "\u001B[90m"; + case "blue" -> "\u001B[94m"; + case "green" -> "\u001B[92m"; + case "aqua" -> "\u001B[96m"; + case "red" -> "\u001B[91m"; + case "light_purple" -> "\u001B[95m"; + case "yellow" -> "\u001B[93m"; + case "white" -> "\u001B[97m"; + case "bold" -> "\u001B[1m"; + case "italic" -> "\u001B[3m"; + case "underlined" -> "\u001B[4m"; + case "strikethrough"-> "\u001B[9m"; + case "reset" -> ANSI_RESET; + default -> null; + }; + } +} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/items/test_item.yml b/Plugin/src/test/resources/bedrock-folder/bedrock/items/test_item.yml new file mode 100644 index 00000000..b6faef82 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/items/test_item.yml @@ -0,0 +1,44 @@ +items: + default:cap: + material: leather_helmet + $$<=1.21.1: + client-bound-material: leather_horse_armor + data: + item-name: + unbreakable: true + remove-components: + - attribute_modifiers + $$>=1.21.2: + equippable: + slot: head + model: + type: minecraft:model + path: minecraft:item/custom/cap + tints: + - type: minecraft:dye + default: -6265536 + + + test:test: + material: PAPER + item-model: "test:test" + data: + item-name: <#FF8C00> + components: + custom_model_data: + - 3.0f + model: + type: minecraft:condition + property: minecraft:broken + on-false: + path: minecraft:item/custom/test + generation: + parent: minecraft:item/generated + textures: + layer0: minecraft:item/custom/test + on-true: + path: minecraft:item/custom/broken_test + generation: + parent: minecraft:item/generated + textures: + layer0: minecraft:item/custom/broken_test \ No newline at end of file From d3cccdc79c45a254717ad3d1e4988b408cd7e924 Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Thu, 30 Apr 2026 17:09:12 +0200 Subject: [PATCH 022/116] feat: refactor BedrockConverter to improve folder structure and item mapping handling --- .../bedrock/ItemTextureConfiguration.java | 2 +- .../command/CraftEngineConverterCommand.java | 5 ----- .../converter/bedrock/BedrockConverter.java | 20 +++++++++++-------- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/ItemTextureConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/ItemTextureConfiguration.java index 9e9828ae..5bc0ba56 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/ItemTextureConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/ItemTextureConfiguration.java @@ -52,7 +52,7 @@ public void save(@NotNull Path directory) { Logger.info("No textures added to the item texture configuration, skipping texture_data section."); } - FileCacheManager.saveJsonToFile(directory.resolve("packs").resolve("textures").resolve("item_texture.json"), jsonObject); + FileCacheManager.saveJsonToFile(directory.resolve("item_texture.json"), jsonObject); Logger.info("Item texture configuration saved successfully."); } diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/command/CraftEngineConverterCommand.java b/Plugin/src/main/java/fr/robie/craftengineconverter/command/CraftEngineConverterCommand.java index eaf26d78..48601bd7 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/command/CraftEngineConverterCommand.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/command/CraftEngineConverterCommand.java @@ -2,16 +2,13 @@ import fr.robie.craftengineconverter.CraftEngineConverter; import fr.robie.craftengineconverter.common.permission.Permission; -import fr.robie.craftengineconverter.converter.bedrock.BedrockConverter; import fr.robie.craftengineconverter.utils.command.CommandType; import fr.robie.craftengineconverter.utils.command.VCommand; public class CraftEngineConverterCommand extends VCommand { - private final BedrockConverter bedrockConverter; public CraftEngineConverterCommand(CraftEngineConverter craftEngineConverter) { super(craftEngineConverter); - this.bedrockConverter = new BedrockConverter(craftEngineConverter.getDataFolder()); this.setPermission(Permission.COMMAND_USE); this.addSubCommand(new CraftEngineConverterCommandReload(craftEngineConverter)); this.addSubCommand(new CraftEngineConverterCommandConvert(craftEngineConverter)); @@ -23,8 +20,6 @@ public CraftEngineConverterCommand(CraftEngineConverter craftEngineConverter) { protected CommandType perform(CraftEngineConverter plugin) { this.syntaxMessage(); - this.bedrockConverter.convert(); - return CommandType.SUCCESS; } } diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockConverter.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockConverter.java index 68cf53f9..fa37cc13 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockConverter.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockConverter.java @@ -41,15 +41,20 @@ public void convert() { return; } - File textures = new File(packs, "textures"); + File craftEngineConverterPack = new File(packs, "CraftEngineConverterPack"); + if (!FileUtils.mkdirs(craftEngineConverterPack)) { + return; + } + + File textures = new File(craftEngineConverterPack, "textures"); if (!FileUtils.mkdirs(textures)) { return; } - this.convertItemMappingsFolder(new File(this.pluginFolder, "bedrock/items"), outputFolder); + this.convertItemMappingsFolder(new File(this.pluginFolder, "bedrock/items"), textures, customMappings); } - private void convertItemMappingsFolder(@NotNull File inputFolder, @NotNull File outputFolder) { + private void convertItemMappingsFolder(@NotNull File inputFolder, @NotNull File texturesFolder, @NotNull File itemMappingsOutputFolder) { if (!inputFolder.exists() || !inputFolder.isDirectory()) { Logger.info("Input folder does not exist or is not a directory: " + inputFolder.getAbsolutePath()); return; @@ -61,8 +66,8 @@ private void convertItemMappingsFolder(@NotNull File inputFolder, @NotNull File return; } - if (!FileUtils.mkdirs(outputFolder)) { - Logger.info("Failed to create output folder: " + outputFolder.getAbsolutePath()); + if (!FileUtils.mkdirs(texturesFolder)) { + Logger.info("Failed to create output folder: " + texturesFolder.getAbsolutePath()); return; } @@ -91,9 +96,8 @@ private void convertItemMappingsFolder(@NotNull File inputFolder, @NotNull File } } - Logger.info("Saving mappings and textures to: " + outputFolder.getAbsolutePath()); - mappingsConfiguration.saveMappings(outputFolder.toPath()); - itemTextureConfiguration.save(outputFolder.toPath()); + mappingsConfiguration.saveMappings(itemMappingsOutputFolder.toPath()); + itemTextureConfiguration.save(texturesFolder.toPath()); } From e72fd37353baf1b6c8973ee3ff4ff9e962f88571 Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Thu, 30 Apr 2026 17:14:44 +0200 Subject: [PATCH 023/116] feat: streamline texture data handling and remove redundant logging in item loaders --- .../api/configuration/bedrock/ItemTextureConfiguration.java | 1 - .../item/models/model/GenerationConfiguration.java | 5 ++++- .../converter/bedrock/BedrockItemLoader.java | 6 ------ 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/ItemTextureConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/ItemTextureConfiguration.java index 5bc0ba56..d827debe 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/ItemTextureConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/ItemTextureConfiguration.java @@ -53,7 +53,6 @@ public void save(@NotNull Path directory) { } FileCacheManager.saveJsonToFile(directory.resolve("item_texture.json"), jsonObject); - Logger.info("Item texture configuration saved successfully."); } } diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/model/GenerationConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/model/GenerationConfiguration.java index f414eb6a..21b56365 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/model/GenerationConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/model/GenerationConfiguration.java @@ -41,7 +41,10 @@ public Map serialize() { public TextureData toTextureData(@NotNull String bedrockIdentifier) { TextureData textureData = new TextureData(bedrockIdentifier); for (String texture : this.textures.values()) { - textureData.addTexture(texture); + if (texture.contains(":")) { + texture = texture.substring(texture.indexOf(':') + 1); + } + textureData.addTexture("textures/"+texture); } return textureData; } diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockItemLoader.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockItemLoader.java index 5efcce9c..812e5c44 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockItemLoader.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockItemLoader.java @@ -12,7 +12,6 @@ import fr.robie.craftengineconverter.api.configuration.item.models.model.GenerationConfiguration; import fr.robie.craftengineconverter.api.configuration.item.models.model.SimpleModelConfiguration; import fr.robie.craftengineconverter.api.configuration.loader.models.ModelConfigurationRegistry; -import fr.robie.craftengineconverter.api.logger.LogType; import fr.robie.craftengineconverter.api.logger.Logger; import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; import org.bukkit.Material; @@ -106,14 +105,9 @@ private void addTextureDataIfSimpleModel(ModelConfiguration modelConfiguration, if (generation != null) { TextureData textureData = generation.toTextureData(textureId); if (textureData != null) { - Logger.info("", "Adding texture data for item %itemId% with texture id %textureId%", LogType.INFO, "itemId", this.itemId, "textureId", textureId); groupDefinitionMapping.addTextureData(textureData); } } - } else if (modelConfiguration != null) { - Logger.info("Model configuration for item %itemId% is not a SimpleModelConfiguration, skipping texture data extraction.", LogType.INFO, "itemId", this.itemId); - } else { - Logger.info("No model configuration for item %itemId%, skipping texture data extraction.", LogType.INFO, "itemId", this.itemId); } } From 937273233fb7b4e04ccd6e99cac551e7b7dc0f26 Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Thu, 30 Apr 2026 18:32:47 +0200 Subject: [PATCH 024/116] feat: reorganize predicate classes into condition package and implement HasComponentPredicate --- .../{ => condition}/BrokenPredicate.java | 4 ++- .../CustomModelDataPredicate.java | 3 +- .../{ => condition}/DamagedPredicate.java | 4 ++- .../FishingRodCastPredicate.java | 4 ++- .../condition/HasComponentPredicate.java | 28 +++++++++++++++++++ .../ConditionModelConfiguration.java | 12 +++++--- .../HasComponentConditionConfiguration.java | 5 ++++ .../bedrock/items/test_item.yml | 2 +- 8 files changed, 53 insertions(+), 9 deletions(-) rename API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/{ => condition}/BrokenPredicate.java (67%) rename API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/{ => condition}/CustomModelDataPredicate.java (82%) rename API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/{ => condition}/DamagedPredicate.java (71%) rename API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/{ => condition}/FishingRodCastPredicate.java (73%) create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/condition/HasComponentPredicate.java diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/BrokenPredicate.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/condition/BrokenPredicate.java similarity index 67% rename from API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/BrokenPredicate.java rename to API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/condition/BrokenPredicate.java index 1bd987fd..2a3e6d83 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/BrokenPredicate.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/condition/BrokenPredicate.java @@ -1,4 +1,6 @@ -package fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate; +package fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate.condition; + +import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate.BedrockPredicate; public class BrokenPredicate extends BedrockPredicate { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/CustomModelDataPredicate.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/condition/CustomModelDataPredicate.java similarity index 82% rename from API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/CustomModelDataPredicate.java rename to API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/condition/CustomModelDataPredicate.java index 98e3fd6a..03843759 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/CustomModelDataPredicate.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/condition/CustomModelDataPredicate.java @@ -1,6 +1,7 @@ -package fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate; +package fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate.condition; import com.google.gson.JsonObject; +import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate.BedrockPredicate; public class CustomModelDataPredicate extends BedrockPredicate { private final int index; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/DamagedPredicate.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/condition/DamagedPredicate.java similarity index 71% rename from API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/DamagedPredicate.java rename to API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/condition/DamagedPredicate.java index cfd27654..fcea1081 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/DamagedPredicate.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/condition/DamagedPredicate.java @@ -1,4 +1,6 @@ -package fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate; +package fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate.condition; + +import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate.BedrockPredicate; public class DamagedPredicate extends BedrockPredicate { public DamagedPredicate() { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/FishingRodCastPredicate.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/condition/FishingRodCastPredicate.java similarity index 73% rename from API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/FishingRodCastPredicate.java rename to API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/condition/FishingRodCastPredicate.java index 7a4145aa..a732d29f 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/FishingRodCastPredicate.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/condition/FishingRodCastPredicate.java @@ -1,4 +1,6 @@ -package fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate; +package fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate.condition; + +import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate.BedrockPredicate; public class FishingRodCastPredicate extends BedrockPredicate { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/condition/HasComponentPredicate.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/condition/HasComponentPredicate.java new file mode 100644 index 00000000..9d36b13f --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/condition/HasComponentPredicate.java @@ -0,0 +1,28 @@ +package fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate.condition; + +import com.google.gson.JsonObject; +import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate.BedrockPredicate; + +public class HasComponentPredicate extends BedrockPredicate { + private final String component; + + public HasComponentPredicate(String component) { + super(true); + this.component = component; + } + + public HasComponentPredicate(String component, boolean expected) { + super(expected); + this.component = component; + } + + @Override + protected void addExtraFields(JsonObject jsonObject) { + jsonObject.addProperty("component", this.component); + } + + @Override + protected String propertyName() { + return "has_component"; + } +} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/condition/ConditionModelConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/condition/ConditionModelConfiguration.java index 49468c07..db34baf6 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/condition/ConditionModelConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/condition/ConditionModelConfiguration.java @@ -1,6 +1,7 @@ package fr.robie.craftengineconverter.api.configuration.item.models.condition; -import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate.*; +import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate.BedrockPredicate; +import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate.condition.*; import fr.robie.craftengineconverter.api.configuration.item.models.ModelConfiguration; import fr.robie.craftengineconverter.api.utils.ConfigurationSerializationUtils; import org.bukkit.configuration.ConfigurationSection; @@ -53,14 +54,14 @@ public void serialize(@NotNull ConfigurationSection section) { } public BedrockPredicate getOnTruePredicate() { - return this.getPredicate(this.onTrue, true); + return this.toBedrockPredicate(this.onTrue, true); } public BedrockPredicate getOnFalsePredicate() { - return this.getPredicate(this.onFalse, false); + return this.toBedrockPredicate(this.onFalse, false); } - private BedrockPredicate getPredicate(ModelConfiguration condition, boolean value) { + private BedrockPredicate toBedrockPredicate(ModelConfiguration condition, boolean value) { if (condition == null) { return null; } @@ -77,6 +78,9 @@ private BedrockPredicate getPredicate(ModelConfiguration condition, boolean valu if (propertyName.equalsIgnoreCase("custom_model_data") && this instanceof CustomModelDataConditionConfiguration customModelDataConditionConfiguration) { return new CustomModelDataPredicate(customModelDataConditionConfiguration.getIndex(), value); } + if (propertyName.equalsIgnoreCase("has_component") && this instanceof HasComponentConditionConfiguration hasComponentConditionConfiguration) { + return new HasComponentPredicate(hasComponentConditionConfiguration.getComponent(), value); + } return null; } } diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/condition/HasComponentConditionConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/condition/HasComponentConditionConfiguration.java index c36be6b2..ce0abcd5 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/condition/HasComponentConditionConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/condition/HasComponentConditionConfiguration.java @@ -13,6 +13,11 @@ public HasComponentConditionConfiguration(@NotNull String component, boolean ign this.ignoreDefault = ignoreDefault; } + @NotNull + public String getComponent() { + return this.component; + } + @Override public void serialize(@NotNull ConfigurationSection section) { super.serialize(section); diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/items/test_item.yml b/Plugin/src/test/resources/bedrock-folder/bedrock/items/test_item.yml index b6faef82..f0764ec2 100644 --- a/Plugin/src/test/resources/bedrock-folder/bedrock/items/test_item.yml +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/items/test_item.yml @@ -20,7 +20,7 @@ items: test:test: - material: PAPER + material: elytra item-model: "test:test" data: item-name: <#FF8C00> From 75eca3adf1081e0cdc51abca04096c63ddd8832a Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Tue, 12 May 2026 20:44:39 +0200 Subject: [PATCH 025/116] feat: enhance Bedrock predicates with support for multiple predicates and new range dispatch types --- .../bedrock/mapping/item/ItemMapping.java | 31 ++++++++++++++++--- .../item/predicate/BedrockPredicate.java | 18 ++++++++++- .../predicate/match/ChargeTypePredicate.java | 26 ++++++++++++++++ .../match/ContextDimensionPredicate.java | 29 +++++++++++++++++ .../match/CustomModelDataPredicate.java | 31 +++++++++++++++++++ .../match/TrimMaterialPredicate.java | 29 +++++++++++++++++ .../BundleFullnessPredicate.java | 14 +++++++++ .../range_dispatch/CountPredicate.java | 13 ++++++++ .../CustomModelDataPredicate.java | 13 ++++++++ .../range_dispatch/DamagePredicate.java | 13 ++++++++ .../RangeDispatchPredicate.java | 30 ++++++++++++++++++ .../converter/bedrock/BedrockItemLoader.java | 4 +-- 12 files changed, 243 insertions(+), 8 deletions(-) create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/match/ChargeTypePredicate.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/match/ContextDimensionPredicate.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/match/CustomModelDataPredicate.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/match/TrimMaterialPredicate.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/range_dispatch/BundleFullnessPredicate.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/range_dispatch/CountPredicate.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/range_dispatch/CustomModelDataPredicate.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/range_dispatch/DamagePredicate.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/range_dispatch/RangeDispatchPredicate.java diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/ItemMapping.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/ItemMapping.java index 5fb6ae8a..3a87eb97 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/ItemMapping.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/ItemMapping.java @@ -1,5 +1,6 @@ package fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item; +import com.google.gson.JsonArray; import com.google.gson.JsonObject; import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.component.BedrockComponent; import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.option.BedrockOptions; @@ -18,7 +19,8 @@ public abstract class ItemMapping { private String displayName; private BedrockOptions bedrockOptions; - private BedrockPredicate bedrockPredicate; + private final List bedrockPredicates = new ArrayList<>(); + private PredicateStrategy predicateStrategy = PredicateStrategy.AND; private final List bedrockComponents = new ArrayList<>(0); @@ -44,8 +46,13 @@ public ItemMapping addBedrockComponent(@NotNull BedrockComponent component) { return this; } - public ItemMapping setBedrockPredicate(BedrockPredicate bedrockPredicate) { - this.bedrockPredicate = bedrockPredicate; + public ItemMapping addBedrockPredicate(BedrockPredicate bedrockPredicate) { + this.bedrockPredicates.add(bedrockPredicate); + return this; + } + + public ItemMapping setPredicateStrategy(@NotNull PredicateStrategy predicateStrategy) { + this.predicateStrategy = predicateStrategy; return this; } @@ -86,10 +93,24 @@ public JsonObject serialize() { jsonObject.add("components", componentsObject); } - if (this.bedrockPredicate != null) { - jsonObject.add("predicate", this.bedrockPredicate.serialize()); + if (!this.bedrockPredicates.isEmpty()) { + if (this.bedrockPredicates.size() == 1) { + jsonObject.add("predicate", this.bedrockPredicates.getFirst().serialize()); + } else { + jsonObject.addProperty("predicate_strategy", this.predicateStrategy.name().toLowerCase()); + JsonArray predicateArray = new JsonArray(); + for (BedrockPredicate predicate : this.bedrockPredicates) { + predicateArray.add(predicate.serialize()); + } + jsonObject.add("predicates", predicateArray); + } } return jsonObject; } + + public enum PredicateStrategy { + AND, + OR + } } diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/BedrockPredicate.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/BedrockPredicate.java index 9bc176a1..edf94ffa 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/BedrockPredicate.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/BedrockPredicate.java @@ -4,6 +4,7 @@ import org.jetbrains.annotations.NotNull; public abstract class BedrockPredicate { + private Type type; protected final boolean expected; protected BedrockPredicate() { @@ -14,6 +15,15 @@ protected BedrockPredicate(boolean expected) { this.expected = expected; } + public BedrockPredicate withType(Type type) { + this.type = type; + return this; + } + + public Type getType() { + return this.type; + } + protected abstract String propertyName(); protected void addExtraFields(JsonObject jsonObject) { @@ -21,7 +31,7 @@ protected void addExtraFields(JsonObject jsonObject) { public @NotNull JsonObject serialize() { JsonObject jsonObject = new JsonObject(); - jsonObject.addProperty("type", "condition"); + jsonObject.addProperty("type", this.type.name().toLowerCase()); jsonObject.addProperty("property", this.propertyName()); if (!this.expected) { jsonObject.addProperty("expected", false); @@ -29,4 +39,10 @@ protected void addExtraFields(JsonObject jsonObject) { this.addExtraFields(jsonObject); return jsonObject; } + + public enum Type { + CONDITION, + MATCH, + RANGE_DISPATCH + } } diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/match/ChargeTypePredicate.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/match/ChargeTypePredicate.java new file mode 100644 index 00000000..60f1c0b2 --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/match/ChargeTypePredicate.java @@ -0,0 +1,26 @@ +package fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate.match; + +import com.google.gson.JsonObject; +import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate.BedrockPredicate; +import fr.robie.craftengineconverter.api.configuration.item.models.range_dispatch.ChargeType; +import org.jetbrains.annotations.NotNull; + +public class ChargeTypePredicate extends BedrockPredicate { + private final ChargeType expected; + + public ChargeTypePredicate(@NotNull ChargeType expected) { + this.expected = expected; + this.withType(Type.MATCH); + } + + @Override + protected void addExtraFields(JsonObject jsonObject) { + if (this.expected == ChargeType.NONE) return; + jsonObject.addProperty("value", this.expected.name().toLowerCase()); + } + + @Override + protected String propertyName() { + return "charge_type"; + } +} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/match/ContextDimensionPredicate.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/match/ContextDimensionPredicate.java new file mode 100644 index 00000000..be364fb4 --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/match/ContextDimensionPredicate.java @@ -0,0 +1,29 @@ +package fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate.match; + +import com.google.gson.JsonObject; +import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate.BedrockPredicate; +import org.jetbrains.annotations.NotNull; + +public class ContextDimensionPredicate extends BedrockPredicate { + private final String dimension; + + public ContextDimensionPredicate(@NotNull String dimension) { + this(dimension, true); + } + + public ContextDimensionPredicate(@NotNull String dimension, boolean expected) { + super(expected); + this.dimension = dimension; + this.withType(Type.MATCH); + } + + @Override + protected void addExtraFields(JsonObject jsonObject) { + jsonObject.addProperty("value", this.dimension); + } + + @Override + protected String propertyName() { + return "context_dimension"; + } +} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/match/CustomModelDataPredicate.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/match/CustomModelDataPredicate.java new file mode 100644 index 00000000..81740820 --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/match/CustomModelDataPredicate.java @@ -0,0 +1,31 @@ +package fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate.match; + +import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate.BedrockPredicate; +import org.jetbrains.annotations.NotNull; + +public class CustomModelDataPredicate extends BedrockPredicate { + private final int index; + private final String value; + + public CustomModelDataPredicate(int index, @NotNull String value) { + this(index, value, true); + } + + public CustomModelDataPredicate(int index, @NotNull String value, boolean expected) { + super(expected); + this.index = index; + this.value = value; + this.withType(Type.MATCH); + } + + @Override + protected void addExtraFields(com.google.gson.JsonObject jsonObject) { + jsonObject.addProperty("index", this.index); + jsonObject.addProperty("value", this.value); + } + + @Override + protected String propertyName() { + return "custom_model_data"; + } +} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/match/TrimMaterialPredicate.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/match/TrimMaterialPredicate.java new file mode 100644 index 00000000..a8a96a63 --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/match/TrimMaterialPredicate.java @@ -0,0 +1,29 @@ +package fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate.match; + +import com.google.gson.JsonObject; +import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate.BedrockPredicate; +import org.jetbrains.annotations.NotNull; + +public class TrimMaterialPredicate extends BedrockPredicate { + private final String material; + + public TrimMaterialPredicate(@NotNull String material) { + this(material, true); + } + + public TrimMaterialPredicate(@NotNull String material, boolean expected) { + super(expected); + this.material = material; + this.withType(Type.MATCH); + } + + @Override + protected void addExtraFields(JsonObject jsonObject) { + jsonObject.addProperty("value", this.material); + } + + @Override + protected String propertyName() { + return "trim_material"; + } +} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/range_dispatch/BundleFullnessPredicate.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/range_dispatch/BundleFullnessPredicate.java new file mode 100644 index 00000000..750cdc5f --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/range_dispatch/BundleFullnessPredicate.java @@ -0,0 +1,14 @@ +package fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate.range_dispatch; + +public class BundleFullnessPredicate extends RangeDispatchPredicate { + + + public BundleFullnessPredicate(double threshold, Float scale) { + super(threshold, scale, null); + } + + @Override + protected String propertyName() { + return "bundle_fullness"; + } +} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/range_dispatch/CountPredicate.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/range_dispatch/CountPredicate.java new file mode 100644 index 00000000..dccfb136 --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/range_dispatch/CountPredicate.java @@ -0,0 +1,13 @@ +package fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate.range_dispatch; + +public class CountPredicate extends RangeDispatchPredicate { + + public CountPredicate(double threshold, Float scale, Boolean normalize) { + super(threshold, scale, normalize); + } + + @Override + protected String propertyName() { + return "count"; + } +} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/range_dispatch/CustomModelDataPredicate.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/range_dispatch/CustomModelDataPredicate.java new file mode 100644 index 00000000..3d6c83dd --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/range_dispatch/CustomModelDataPredicate.java @@ -0,0 +1,13 @@ +package fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate.range_dispatch; + +public class CustomModelDataPredicate extends RangeDispatchPredicate { + + public CustomModelDataPredicate(double threshold, Float scale) { + super(threshold, scale, null); + } + + @Override + protected String propertyName() { + return "custom_model_data"; + } +} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/range_dispatch/DamagePredicate.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/range_dispatch/DamagePredicate.java new file mode 100644 index 00000000..f030728d --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/range_dispatch/DamagePredicate.java @@ -0,0 +1,13 @@ +package fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate.range_dispatch; + +public class DamagePredicate extends RangeDispatchPredicate { + + public DamagePredicate(double threshold, Float scale, Boolean normalize) { + super(threshold, scale, normalize); + } + + @Override + protected String propertyName() { + return "damage"; + } +} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/range_dispatch/RangeDispatchPredicate.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/range_dispatch/RangeDispatchPredicate.java new file mode 100644 index 00000000..d7e72ff9 --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/range_dispatch/RangeDispatchPredicate.java @@ -0,0 +1,30 @@ +package fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate.range_dispatch; + +import com.google.gson.JsonObject; +import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate.BedrockPredicate; + +public abstract class RangeDispatchPredicate extends BedrockPredicate { + private final double threshold; + private final Float scale; + private final Boolean normalize; + + public RangeDispatchPredicate(double threshold, Float scale, Boolean normalize) { + super(true); + this.threshold = threshold; + this.scale = scale; + this.normalize = normalize; + this.withType(Type.RANGE_DISPATCH); + } + + @Override + protected void addExtraFields(JsonObject jsonObject) { + jsonObject.addProperty("threshold", this.threshold); + if (this.scale != null && this.scale != 1.0f) { + jsonObject.addProperty("scale", this.scale); + } + if (this.normalize != null) { + jsonObject.addProperty("normalize", this.normalize); + } + } + +} diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockItemLoader.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockItemLoader.java index 812e5c44..b5e135d7 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockItemLoader.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockItemLoader.java @@ -40,8 +40,8 @@ public ItemMapping load() { ItemModelItemMapping onFalse = new ItemModelItemMapping(material, this.itemId, null); ItemModelItemMapping onTrue = new ItemModelItemMapping(material, this.itemId + "_" + conditionModelConfiguration.getProperty(), null); - onTrue.setBedrockPredicate(conditionModelConfiguration.getOnTruePredicate()); - onFalse.setBedrockPredicate(conditionModelConfiguration.getOnFalsePredicate()); + onTrue.addBedrockPredicate(conditionModelConfiguration.getOnTruePredicate()); + onFalse.addBedrockPredicate(conditionModelConfiguration.getOnFalsePredicate()); this.convertItem(onTrue); this.convertItem(onFalse); From 9d9b708512a224e0644cac9d4e7eaa7efb353c87 Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Thu, 11 Jun 2026 12:47:29 +0200 Subject: [PATCH 026/116] fix: merge master --- .../bedrock/ItemTextureConfiguration.java | 2 +- .../item/predicate/BedrockPredicate.java | 4 +- .../models/ModelConfigurationRegistry.java | 11 +- .../tints/TintConfigurationRegistry.java | 7 +- .../api/format/Message.java | 1 + .../api/manager/FileCacheManager.java | 6 +- .../api/utils/FileUtils.java | 12 +- .../api/utils/VersionFilter.java | 10 +- .../common/utils/SnakeUtils.java | 6 +- .../utils/yaml/file/YamlConfiguration.java | 6 +- .../CraftEngineConverter.java | 7 - .../craftengineconverter/RegistryHelper.java | 16 +-- .../converter/Converter.java | 2 +- .../converter/bedrock/BedrockConverter.java | 2 +- .../converter/bedrock/BedrockItemLoader.java | 2 +- .../converter/itemsadder/IAConverter.java | 4 +- .../converter/nexo/NexoConverter.java | 2 - .../database/DataBaseManager.java | 1 - .../utils/JsonFileValidator.java | 4 - .../BedrockConverterTest.java | 1 - .../craftengineconverter/SystemLogger.java | 128 ------------------ 21 files changed, 38 insertions(+), 196 deletions(-) delete mode 100644 Plugin/src/test/java/fr/robie/craftengineconverter/SystemLogger.java diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/ItemTextureConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/ItemTextureConfiguration.java index d827debe..60353f3f 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/ItemTextureConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/ItemTextureConfiguration.java @@ -2,8 +2,8 @@ import com.google.gson.JsonObject; import fr.robie.craftengineconverter.api.configuration.bedrock.texture.TextureData; -import fr.robie.craftengineconverter.api.logger.Logger; import fr.robie.craftengineconverter.api.manager.FileCacheManager; +import fr.robie.messageflow.logger.Logger; import org.jetbrains.annotations.NotNull; import java.nio.file.Path; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/BedrockPredicate.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/BedrockPredicate.java index edf94ffa..d69eea7b 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/BedrockPredicate.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/BedrockPredicate.java @@ -31,7 +31,9 @@ protected void addExtraFields(JsonObject jsonObject) { public @NotNull JsonObject serialize() { JsonObject jsonObject = new JsonObject(); - jsonObject.addProperty("type", this.type.name().toLowerCase()); + if (this.type != null) { + jsonObject.addProperty("type", this.type.name().toLowerCase()); + } jsonObject.addProperty("property", this.propertyName()); if (!this.expected) { jsonObject.addProperty("expected", false); diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/ModelConfigurationRegistry.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/ModelConfigurationRegistry.java index 72bff115..f4145f4a 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/ModelConfigurationRegistry.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/ModelConfigurationRegistry.java @@ -1,9 +1,8 @@ package fr.robie.craftengineconverter.api.configuration.loader.models; import fr.robie.craftengineconverter.api.configuration.item.models.ModelConfiguration; -import fr.robie.craftengineconverter.api.logger.LogType; -import fr.robie.craftengineconverter.api.logger.Logger; import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; +import fr.robie.messageflow.logger.Logger; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -11,13 +10,13 @@ import java.util.Map; public class ModelConfigurationRegistry { - private static final Map LOADERS = new HashMap<>(); + private static final Map> LOADERS = new HashMap<>(); private ModelConfigurationRegistry() { throw new UnsupportedOperationException("ModelConfigurationRegistry is a utility class and cannot be instantiated."); } - public static void register(@NotNull String type, @NotNull ModelConfigurationLoader loader) { + public static void register(@NotNull String type, @NotNull ModelConfigurationLoader loader) { LOADERS.put(type, loader); } @@ -27,9 +26,9 @@ public static ModelConfiguration load(@Nullable ConfigurationSection section) { return null; } String type = section.getString("type", "model"); - ModelConfigurationLoader loader = LOADERS.get(type); + ModelConfigurationLoader loader = LOADERS.get(type); if (loader == null) { - Logger.info("Unknown model type '" + type + "', skipping.", LogType.WARNING); + Logger.warn("Unknown model type '" + type + "', skipping."); return null; } return loader.load(section); diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/tints/TintConfigurationRegistry.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/tints/TintConfigurationRegistry.java index fb806ea0..1edf5999 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/tints/TintConfigurationRegistry.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/tints/TintConfigurationRegistry.java @@ -1,9 +1,8 @@ package fr.robie.craftengineconverter.api.configuration.loader.models.tints; import fr.robie.craftengineconverter.api.configuration.item.models.tints.TintConfiguration; -import fr.robie.craftengineconverter.api.logger.LogType; -import fr.robie.craftengineconverter.api.logger.Logger; import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; +import fr.robie.messageflow.logger.Logger; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -29,7 +28,7 @@ public static TintConfiguration load(@Nullable ConfigurationSection section) { } String type = section.getString("type"); if (type == null) { - Logger.info("Tint section is missing 'type' field, skipping.", LogType.WARNING); + Logger.warn("Tint section is missing 'type' field, skipping."); return null; } if (type.startsWith("minecraft:")) { @@ -37,7 +36,7 @@ public static TintConfiguration load(@Nullable ConfigurationSection section) { } TintConfigurationLoader loader = LOADERS.get(type); if (loader == null) { - Logger.info("Unknown tint type '" + type + "', skipping.", LogType.WARNING); + Logger.info("Unknown tint type '" + type + "', skipping."); return null; } return loader.load(section); diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/format/Message.java b/API/src/main/java/fr/robie/craftengineconverter/api/format/Message.java index de3289c3..87ea6567 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/format/Message.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/format/Message.java @@ -236,6 +236,7 @@ public enum Message implements fr.robie.messageflow.model.Message { ERROR__FILE_OPERATIONS__FORCE_SHUTDOWN("error.file-operations.force-shutdown", "Forcing shutdown of file operation threads"), ERROR__JSON__MALFORMED_AUTO_FIXED("error.json.malformed-auto-fixed", "Malformed JSON detected in §e%file%§c, auto-fixed."), ERROR__JSON__LOAD_FAILURE("error.json.load-failure", "Unable to load JSON file '%file%': file not found or invalid JSON format"), + ERROR__JSON__SAVE_FAILURE("error.json.save-failure", "Unable to save JSON file '%file%': §e%message%§c"), ERROR__PACK_CONVERSION__EXCEPTION("error.pack-conversion.exception", "An error occurred during pack conversion for plugin §e%plugin%§c"), ERROR__PLUGIN__CONFIGURATION__TYPE_MISMATCH("error.plugin.configuration.type-mismatch", "§cType mismatch for §e%path%§c in configuration, expected §e%expected%§c but got §e%got%§c, using default value: §e%default%§c"), diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/manager/FileCacheManager.java b/API/src/main/java/fr/robie/craftengineconverter/api/manager/FileCacheManager.java index 9bbb4ca9..e7f15012 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/manager/FileCacheManager.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/manager/FileCacheManager.java @@ -4,10 +4,6 @@ import com.google.gson.stream.JsonReader; import fr.robie.craftengineconverter.api.cache.FileCache; import fr.robie.craftengineconverter.api.format.Message; -import fr.robie.craftengineconverter.api.logger.LogType; -import fr.robie.craftengineconverter.api.logger.Logger; - -import fr.robie.craftengineconverter.common.cache.FileCache; import fr.robie.messageflow.formatter.Placeholder; import fr.robie.messageflow.logger.Logger; import org.bukkit.configuration.file.YamlConfiguration; @@ -75,7 +71,7 @@ public static void saveJsonToFile(@NotNull Path path, @NotNull JsonObject json) try (var writer = Files.newBufferedWriter(path)) { GSON.toJson(json, writer); } catch (Exception e) { - Logger.showException(Message.ERROR__JSON__SAVE_FAILURE, e, "file", path.toString()); + Logger.error(Message.ERROR__JSON__LOAD_FAILURE, e, Placeholder.of("file", path.toAbsolutePath().toString(), "message", e.getMessage())); } } diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/utils/FileUtils.java b/API/src/main/java/fr/robie/craftengineconverter/api/utils/FileUtils.java index df39a39f..ca989959 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/utils/FileUtils.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/utils/FileUtils.java @@ -1,8 +1,8 @@ package fr.robie.craftengineconverter.api.utils; import fr.robie.craftengineconverter.api.format.Message; -import fr.robie.craftengineconverter.api.logger.LogType; -import fr.robie.craftengineconverter.api.logger.Logger; +import fr.robie.messageflow.formatter.Placeholder; +import fr.robie.messageflow.logger.Logger; import org.jetbrains.annotations.NotNull; import java.io.File; @@ -19,12 +19,12 @@ public static void deleteDirectory(@NotNull File directory) { if (file.isDirectory()) { deleteDirectory(file); } else if (!file.delete()) { - Logger.debug(Message.WARNING__FILE__DELETE_FAILURE, LogType.ERROR, "file", file.getName(), "path", file.getAbsolutePath()); + Logger.error(Message.WARNING__FILE__DELETE_FAILURE, Placeholder.of("file", file.getName(), "path", file.getAbsolutePath())); } } } if (!directory.delete()) { - Logger.debug(Message.WARNING__FOLDER__DELETE_FAILURE, LogType.ERROR, "folder", directory.getName(), "path", directory.getAbsolutePath()); + Logger.error(Message.WARNING__FOLDER__DELETE_FAILURE, Placeholder.of("folder", directory.getName(), "path", directory.getAbsolutePath())); } } @@ -35,7 +35,7 @@ public static boolean mkdirs(@NotNull File directory) { if (directory.mkdirs()) { return true; } - Logger.info(Message.ERROR__MKDIR_FAILURE, LogType.ERROR, "directory", directory.getName(), "path", directory.getAbsolutePath()); + Logger.info(Message.ERROR__MKDIR_FAILURE, Placeholder.of("directory", directory.getName(), "path", directory.getAbsolutePath())); return false; } @@ -91,7 +91,7 @@ public static void copyFile(@NotNull File source, @NotNull File destination) { StandardCopyOption.REPLACE_EXISTING ); } catch (IOException e) { - Logger.debug(Message.ERROR__FILE__COPY_EXCEPTION, "file", destination.getName(), "message", e.getMessage()); + Logger.error(Message.ERROR__FILE__COPY_EXCEPTION, Placeholder.of("file", destination.getName(), "message", e.getMessage())); } } diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/utils/VersionFilter.java b/API/src/main/java/fr/robie/craftengineconverter/api/utils/VersionFilter.java index 1634f15d..4f2a26d0 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/utils/VersionFilter.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/utils/VersionFilter.java @@ -4,8 +4,8 @@ import fr.robie.craftengineconverter.api.annotations.SinceVersion; import fr.robie.craftengineconverter.api.annotations.SpigotOnly; import fr.robie.craftengineconverter.api.annotations.UntilVersion; -import fr.robie.craftengineconverter.api.logger.Logger; import fr.robie.craftengineconverter.api.manager.FoliaCompatibilityManager; +import fr.robie.messageflow.logger.Logger; public final class VersionFilter { @@ -14,11 +14,9 @@ private VersionFilter() { public static boolean passes(Class clazz, String label) { if (clazz.isAnnotationPresent(PaperOnly.class) && !FoliaCompatibilityManager.getInstance().isPaperOrFolia()) { - Logger.debug("Skipping %label% — @PaperOnly, running Spigot.", "label", label); return false; } if (clazz.isAnnotationPresent(SpigotOnly.class) && FoliaCompatibilityManager.getInstance().isPaperOrFolia()) { - Logger.debug("Skipping %label% — @SpigotOnly, running Paper.", "label", label); return false; } @@ -28,7 +26,6 @@ public static boolean passes(Class clazz, String label) { if (since != null) { MinecraftVersion minimum = MinecraftVersion.parse(since.value()); if (!server.isAtLeast(minimum)) { - Logger.debug("Skipping %label% — requires >= %version%, server is %server%.", "label", label, "version", since.value(), "server", server); return false; } } @@ -36,10 +33,7 @@ public static boolean passes(Class clazz, String label) { UntilVersion until = clazz.getAnnotation(UntilVersion.class); if (until != null) { MinecraftVersion maximum = MinecraftVersion.parse(until.value()); - if (!server.isAtMost(maximum)) { - Logger.debug("Skipping %label% — requires <= %version%, server is %server%.", "label", label, "version", until.value(), "server", server); - return false; - } + return server.isAtMost(maximum); } return true; diff --git a/Common/src/main/java/fr/robie/craftengineconverter/common/utils/SnakeUtils.java b/Common/src/main/java/fr/robie/craftengineconverter/common/utils/SnakeUtils.java index efa92f0d..5a286e7c 100644 --- a/Common/src/main/java/fr/robie/craftengineconverter/common/utils/SnakeUtils.java +++ b/Common/src/main/java/fr/robie/craftengineconverter/common/utils/SnakeUtils.java @@ -1,11 +1,7 @@ package fr.robie.craftengineconverter.common.utils; - -import fr.robie.craftengineconverter.common.utils.directive.SmartConstructor; -import fr.robie.messageflow.logger.Logger; -import fr.robie.craftengineconverter.api.logger.LogType; -import fr.robie.craftengineconverter.api.logger.Logger; import fr.robie.craftengineconverter.common.utils.yaml.constructor.SmartConstructor; +import fr.robie.messageflow.logger.Logger; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.yaml.snakeyaml.DumperOptions; diff --git a/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/file/YamlConfiguration.java b/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/file/YamlConfiguration.java index 3db72c25..421c4a61 100644 --- a/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/file/YamlConfiguration.java +++ b/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/file/YamlConfiguration.java @@ -1,10 +1,10 @@ package fr.robie.craftengineconverter.common.utils.yaml.file; import com.google.common.base.Preconditions; -import fr.robie.craftengineconverter.api.logger.Logger; import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; import fr.robie.craftengineconverter.common.utils.yaml.constructor.SmartConstructor; import fr.robie.craftengineconverter.common.utils.yaml.serialization.ConfigurationSerialization; +import fr.robie.messageflow.logger.Logger; import org.bukkit.configuration.InvalidConfigurationException; import org.jetbrains.annotations.NotNull; import org.yaml.snakeyaml.DumperOptions; @@ -278,7 +278,7 @@ public static YamlConfiguration loadConfiguration(@NotNull File file) { config.load(file); } catch (FileNotFoundException ignored) { } catch (IOException | InvalidConfigurationException ex) { - Logger.showException("Cannot load configuration from file: " + file, ex); + Logger.error("Cannot load configuration from file: " + file, ex); } return config; @@ -293,7 +293,7 @@ public static YamlConfiguration loadConfiguration(@NotNull Reader reader) { try { config.load(reader); } catch (IOException | InvalidConfigurationException ex) { - Logger.showException("Cannot load configuration from stream.", ex); + Logger.error("Cannot load configuration from stream.", ex); } return config; diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/CraftEngineConverter.java b/Plugin/src/main/java/fr/robie/craftengineconverter/CraftEngineConverter.java index 6c8bf26c..6aa8a69c 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/CraftEngineConverter.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/CraftEngineConverter.java @@ -8,11 +8,6 @@ import fr.robie.craftengineconverter.api.enums.Languages; import fr.robie.craftengineconverter.api.enums.Plugins; import fr.robie.craftengineconverter.api.format.Message; -import fr.robie.craftengineconverter.api.format.MessageFormatter; -import fr.robie.craftengineconverter.api.logger.BukkitLogger; -import fr.robie.craftengineconverter.api.logger.ComponentLogger; -import fr.robie.craftengineconverter.api.logger.LogType; -import fr.robie.craftengineconverter.api.logger.Logger; import fr.robie.craftengineconverter.api.manager.FileCacheManager; import fr.robie.craftengineconverter.api.manager.FoliaCompatibilityManager; import fr.robie.craftengineconverter.api.packet.PacketLoader; @@ -21,8 +16,6 @@ import fr.robie.craftengineconverter.behavior.BehaviorRegister; import fr.robie.craftengineconverter.command.CraftEngineConverterCommand; import fr.robie.craftengineconverter.common.CraftEngineConverterPlugin; -import fr.robie.craftengineconverter.common.manager.FileCacheManager; -import fr.robie.craftengineconverter.common.format.ClassicMeta; import fr.robie.craftengineconverter.common.scanner.BlockStateMappingScanner; import fr.robie.craftengineconverter.common.utils.CraftEngineImageUtils; import fr.robie.craftengineconverter.converter.Converter; diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/RegistryHelper.java b/Plugin/src/main/java/fr/robie/craftengineconverter/RegistryHelper.java index c6cfa188..a55027a5 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/RegistryHelper.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/RegistryHelper.java @@ -13,10 +13,10 @@ import fr.robie.craftengineconverter.api.configuration.loader.models.select.SelectModelConfigurationRegistry; import fr.robie.craftengineconverter.api.configuration.loader.models.tints.TintConfigurationLoader; import fr.robie.craftengineconverter.api.configuration.loader.models.tints.TintConfigurationRegistry; -import fr.robie.craftengineconverter.api.logger.Logger; import fr.robie.craftengineconverter.api.reflections.ReflectionsCache; import fr.robie.craftengineconverter.api.utils.VersionFilter; import fr.robie.craftengineconverter.common.CraftEngineConverterPlugin; +import fr.robie.messageflow.logger.Logger; import org.jetbrains.annotations.NotNull; import org.reflections.Reflections; @@ -66,9 +66,9 @@ private void loadModelConfigurationRegistry() { } count++; } catch (ClassCastException e) { - Logger.showException("Class " + clazz.getName() + " cannot be cast to ModelConfigurationLoader", e); + Logger.error("Class " + clazz.getName() + " cannot be cast to ModelConfigurationLoader", e); } catch (Exception e) { - Logger.showException("Failed to load ModelConfigurationLoader " + clazz.getName() + " for names " + Arrays.toString(annotation.value()), e); + Logger.error("Failed to load ModelConfigurationLoader " + clazz.getName() + " for names " + Arrays.toString(annotation.value()), e); } } @@ -101,7 +101,7 @@ private void loadTintConfigurationRegistry() { } count++; } catch (Exception e) { - fr.robie.craftengineconverter.api.logger.Logger.showException("Failed to load TintConfigurationLoader " + clazz.getName() + " for names " + java.util.Arrays.toString(annotation.value()), e); + Logger.error("Failed to load TintConfigurationLoader " + clazz.getName() + " for names " + java.util.Arrays.toString(annotation.value()), e); } } Logger.info("Loaded " + count + " TintConfigurationLoaders"); @@ -132,9 +132,9 @@ private void loadSelectModelConfigurationRegistry() { } count++; } catch (ClassCastException e) { - Logger.showException("Class " + clazz.getName() + " cannot be cast to ModelConfigurationLoader", e); + Logger.error("Class " + clazz.getName() + " cannot be cast to ModelConfigurationLoader", e); } catch (Exception e) { - Logger.showException("Failed to load SelectModelConfigurationLoader " + clazz.getName() + " for names " + Arrays.toString(annotation.value()), e); + Logger.error("Failed to load SelectModelConfigurationLoader " + clazz.getName() + " for names " + Arrays.toString(annotation.value()), e); } } Logger.info("Loaded " + count + " SelectModelConfigurationLoaders"); @@ -164,9 +164,9 @@ private void loadRangeDispatchModelConfigurationRegistry() { } count++; } catch (ClassCastException e) { - Logger.showException("Class " + clazz.getName() + " cannot be cast to ModelConfigurationLoader", e); + Logger.error("Class " + clazz.getName() + " cannot be cast to ModelConfigurationLoader", e); } catch (Exception e) { - Logger.showException("Failed to load RangeDispatchModelConfigurationLoader " + clazz.getName() + " for names " + Arrays.toString(annotation.value()), e); + Logger.error("Failed to load RangeDispatchModelConfigurationLoader " + clazz.getName() + " for names " + Arrays.toString(annotation.value()), e); } } diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/Converter.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/Converter.java index 09293543..6692d658 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/Converter.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/Converter.java @@ -9,8 +9,8 @@ import fr.robie.craftengineconverter.api.enums.ConverterOption; import fr.robie.craftengineconverter.api.enums.Plugins; import fr.robie.craftengineconverter.api.format.Message; -import fr.robie.craftengineconverter.api.logger.LogType; import fr.robie.craftengineconverter.api.manager.FileCacheManager; +import fr.robie.craftengineconverter.api.progress.BukkitProgressBar; import fr.robie.craftengineconverter.api.utils.ObjectUtils; import fr.robie.craftengineconverter.converter.settings.BasicConverterSettings; import fr.robie.craftengineconverter.utils.ConfigFile; diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockConverter.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockConverter.java index fa37cc13..caebe0fe 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockConverter.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockConverter.java @@ -4,11 +4,11 @@ import fr.robie.craftengineconverter.api.configuration.bedrock.ManifestConfiguration; import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.MappingsConfiguration; import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.ItemMapping; -import fr.robie.craftengineconverter.api.logger.Logger; import fr.robie.craftengineconverter.api.manager.FileCacheManager; import fr.robie.craftengineconverter.api.utils.FileUtils; import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; import fr.robie.craftengineconverter.common.utils.yaml.file.YamlConfiguration; +import fr.robie.messageflow.logger.Logger; import org.jetbrains.annotations.NotNull; import java.io.File; diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockItemLoader.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockItemLoader.java index b5e135d7..7ebbc173 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockItemLoader.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockItemLoader.java @@ -12,8 +12,8 @@ import fr.robie.craftengineconverter.api.configuration.item.models.model.GenerationConfiguration; import fr.robie.craftengineconverter.api.configuration.item.models.model.SimpleModelConfiguration; import fr.robie.craftengineconverter.api.configuration.loader.models.ModelConfigurationRegistry; -import fr.robie.craftengineconverter.api.logger.Logger; import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; +import fr.robie.messageflow.logger.Logger; import org.bukkit.Material; import org.jetbrains.annotations.NotNull; diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/itemsadder/IAConverter.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/itemsadder/IAConverter.java index 286f5276..fea0e37d 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/itemsadder/IAConverter.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/itemsadder/IAConverter.java @@ -20,8 +20,6 @@ import fr.robie.craftengineconverter.api.enums.Plugins; import fr.robie.craftengineconverter.api.enums.RecipeType; import fr.robie.craftengineconverter.api.format.Message; -import fr.robie.craftengineconverter.api.logger.LogType; -import fr.robie.craftengineconverter.api.logger.Logger; import fr.robie.craftengineconverter.api.manager.FileCacheManager; import fr.robie.craftengineconverter.api.progress.BukkitProgressBar; @@ -600,7 +598,7 @@ private void convertRecipesSync(Optional optionalPlayer) { return; } if (outputFolder.exists()) { - this.deleteDirectory(outputFolder); + FileUtils.deleteDirectory(outputFolder); } if (!outputFolder.mkdirs()) { this.logDebug(Message.ERROR__CONVERTER__IA__OUTPUT_FOLDER_CREATION_FAILED, Logger.LogType.ERROR, Placeholder.of("path", outputFolder.getAbsolutePath())); diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoConverter.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoConverter.java index 58c9ac68..5b8f3d1c 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoConverter.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoConverter.java @@ -18,8 +18,6 @@ import fr.robie.craftengineconverter.api.enums.Plugins; import fr.robie.craftengineconverter.api.enums.RecipeType; import fr.robie.craftengineconverter.api.format.Message; -import fr.robie.craftengineconverter.api.logger.LogType; -import fr.robie.craftengineconverter.api.logger.Logger; import fr.robie.craftengineconverter.api.manager.FileCacheManager; import fr.robie.craftengineconverter.api.progress.BukkitProgressBar; diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/database/DataBaseManager.java b/Plugin/src/main/java/fr/robie/craftengineconverter/database/DataBaseManager.java index c8119c4c..0c162ac3 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/database/DataBaseManager.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/database/DataBaseManager.java @@ -8,7 +8,6 @@ import fr.robie.craftengineconverter.api.database.StorageType; import fr.robie.craftengineconverter.api.history.BlockHistory; import fr.robie.craftengineconverter.api.history.EntityHistory; -import fr.robie.craftengineconverter.api.logger.LogType; import fr.robie.craftengineconverter.api.manager.FileCacheManager; import fr.robie.craftengineconverter.common.CraftEngineConverterPlugin; import fr.robie.craftengineconverter.database.migrations.WorldBlockConverterHistorical; diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/utils/JsonFileValidator.java b/Plugin/src/main/java/fr/robie/craftengineconverter/utils/JsonFileValidator.java index 3aa94e4d..40ab6a8f 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/utils/JsonFileValidator.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/utils/JsonFileValidator.java @@ -4,14 +4,10 @@ import com.google.gson.JsonElement; import com.google.gson.JsonObject; import fr.robie.craftengineconverter.api.cache.FileCacheEntry; -import fr.robie.craftengineconverter.api.logger.LogType; -import fr.robie.craftengineconverter.api.logger.Logger; import fr.robie.craftengineconverter.api.manager.FileCacheManager; import fr.robie.craftengineconverter.api.progress.BukkitProgressBar; import fr.robie.craftengineconverter.common.CraftEngineConverterPlugin; -import fr.robie.craftengineconverter.common.cache.FileCacheEntry; -import fr.robie.craftengineconverter.common.manager.FileCacheManager; import fr.robie.messageflow.logger.Logger; import org.bukkit.Material; import org.bukkit.entity.Player; diff --git a/Plugin/src/test/java/fr/robie/craftengineconverter/BedrockConverterTest.java b/Plugin/src/test/java/fr/robie/craftengineconverter/BedrockConverterTest.java index 9f938333..de68e43a 100644 --- a/Plugin/src/test/java/fr/robie/craftengineconverter/BedrockConverterTest.java +++ b/Plugin/src/test/java/fr/robie/craftengineconverter/BedrockConverterTest.java @@ -12,7 +12,6 @@ public class BedrockConverterTest { @BeforeAll static void setup() { - new SystemLogger(); ClassLoader classLoader = CraftEngineConverterPlugin.class.getClassLoader(); RegistryHelper registryHelper = new RegistryHelper(classLoader); diff --git a/Plugin/src/test/java/fr/robie/craftengineconverter/SystemLogger.java b/Plugin/src/test/java/fr/robie/craftengineconverter/SystemLogger.java deleted file mode 100644 index 78ecb4a4..00000000 --- a/Plugin/src/test/java/fr/robie/craftengineconverter/SystemLogger.java +++ /dev/null @@ -1,128 +0,0 @@ -package fr.robie.craftengineconverter; - -import fr.robie.craftengineconverter.api.logger.LogType; -import fr.robie.craftengineconverter.api.logger.Logger; -import org.jetbrains.annotations.Nullable; - -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -public class SystemLogger extends Logger { - - private static final String ANSI_RESET = "\u001B[0m"; - - public SystemLogger() { - super("CraftEngineConverter"); - } - - @Override - public void log(@Nullable String subPrefix, String message, LogType logType, Object... args) { - String prefix = subPrefix != null ? "[" + this.prefix + "] [" + subPrefix + "] " : "[" + this.prefix + "] "; - - String ansiColor = toAnsi(logType.getColor()); - String parsed = this.parseText(message, args); - - System.out.println(prefix + ansiColor + stripFormatting(parsed) + ANSI_RESET); - } - - private static String toAnsi(String color) { - if (color == null || color.isEmpty()) return ""; - if (color.startsWith("§") && color.length() == 2) { - String ansi = legacyCodeToAnsi(Character.toLowerCase(color.charAt(1))); - return ansi != null ? ansi : ""; - } - if (color.startsWith("<") && color.endsWith(">")) { - String tag = color.substring(1, color.length() - 1).toLowerCase(); - String ansi = miniMessageTagToAnsi(tag); - return ansi != null ? ansi : ""; - } - return ""; - } - - private static String stripFormatting(String text) { - StringBuilder sb = new StringBuilder(text.length()); - for (int i = 0; i < text.length(); i++) { - if (text.charAt(i) == '§' && i + 1 < text.length()) { - char code = Character.toLowerCase(text.charAt(i + 1)); - String ansi = legacyCodeToAnsi(code); - if (ansi != null) sb.append(ansi); - i++; - continue; - } - sb.append(text.charAt(i)); - } - text = sb.toString(); - - text = text.replace("", ANSI_RESET); - text = text.replaceAll("]+>", ANSI_RESET); - - text = text.replace("", "\u001B[1m"); - text = text.replace("", "\u001B[3m"); - text = text.replace("", "\u001B[4m"); - text = text.replace("", "\u001B[9m"); - - text = Pattern.compile("<[^>]+>").matcher(text).replaceAll(match -> { - String tag = match.group().substring(1, match.group().length() - 1).toLowerCase(); - String ansi = miniMessageTagToAnsi(tag); - return ansi != null ? Matcher.quoteReplacement(ansi) : ""; - }); - - return text; - } - - @Nullable - private static String legacyCodeToAnsi(char code) { - return switch (code) { - case '0' -> "\u001B[30m"; // black - case '1' -> "\u001B[34m"; // dark_blue - case '2' -> "\u001B[32m"; // dark_green - case '3' -> "\u001B[36m"; // dark_aqua - case '4' -> "\u001B[31m"; // dark_red - case '5' -> "\u001B[35m"; // dark_purple - case '6' -> "\u001B[33m"; // gold - case '7' -> "\u001B[37m"; // gray - case '8' -> "\u001B[90m"; // dark_gray - case '9' -> "\u001B[94m"; // blue - case 'a' -> "\u001B[92m"; // green - case 'b' -> "\u001B[96m"; // aqua - case 'c' -> "\u001B[91m"; // red - case 'd' -> "\u001B[95m"; // light_purple - case 'e' -> "\u001B[93m"; // yellow - case 'f' -> "\u001B[97m"; // white - case 'l' -> "\u001B[1m"; // bold - case 'o' -> "\u001B[3m"; // italic - case 'n' -> "\u001B[4m"; // underline - case 'm' -> "\u001B[9m"; // strikethrough - case 'r' -> ANSI_RESET; - default -> null; - }; - } - - @Nullable - private static String miniMessageTagToAnsi(String tag) { - return switch (tag) { - case "black" -> "\u001B[30m"; - case "dark_blue" -> "\u001B[34m"; - case "dark_green" -> "\u001B[32m"; - case "dark_aqua" -> "\u001B[36m"; - case "dark_red" -> "\u001B[31m"; - case "dark_purple" -> "\u001B[35m"; - case "gold" -> "\u001B[33m"; - case "gray" -> "\u001B[37m"; - case "dark_gray" -> "\u001B[90m"; - case "blue" -> "\u001B[94m"; - case "green" -> "\u001B[92m"; - case "aqua" -> "\u001B[96m"; - case "red" -> "\u001B[91m"; - case "light_purple" -> "\u001B[95m"; - case "yellow" -> "\u001B[93m"; - case "white" -> "\u001B[97m"; - case "bold" -> "\u001B[1m"; - case "italic" -> "\u001B[3m"; - case "underlined" -> "\u001B[4m"; - case "strikethrough"-> "\u001B[9m"; - case "reset" -> ANSI_RESET; - default -> null; - }; - } -} \ No newline at end of file From 785c2f0a36f27a688d9631f93ddb5a716af72528 Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Thu, 11 Jun 2026 12:56:27 +0200 Subject: [PATCH 027/116] additions for reflections --- .../api/ReflectionsCache.java | 22 ----- .../api/annotations/RequiresPlugin.java | 31 +++++++ .../api/loader/ClassRegistry.java | 69 ++++++++++++++ .../api/loader/ConstructorStrategy.java | 8 ++ .../api/reflections/ReflectionsCache.java | 4 +- .../api/utils/Comparison.java | 21 +++++ .../api/utils/MinecraftVersion.java | 88 +++++++++--------- .../api/utils/PluginVersion.java | 90 +++++++++++++++++++ .../api/utils/VersionFilter.java | 58 ++++++++++-- .../yaml/directive/VersionKeyDirective.java | 2 +- .../craftengineconverter/RegistryHelper.java | 8 +- 11 files changed, 319 insertions(+), 82 deletions(-) delete mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/ReflectionsCache.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/annotations/RequiresPlugin.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/loader/ClassRegistry.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/loader/ConstructorStrategy.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/utils/Comparison.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/utils/PluginVersion.java diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/ReflectionsCache.java b/API/src/main/java/fr/robie/craftengineconverter/api/ReflectionsCache.java deleted file mode 100644 index 13d88ef7..00000000 --- a/API/src/main/java/fr/robie/craftengineconverter/api/ReflectionsCache.java +++ /dev/null @@ -1,22 +0,0 @@ -package fr.robie.craftengineconverter.api; - -import org.reflections.Reflections; - -import java.util.HashMap; -import java.util.Map; - -public class ReflectionsCache { - private static final ReflectionsCache INSTANCE = new ReflectionsCache(); - private final Map cache = new HashMap<>(); - - private ReflectionsCache() { - } - - public static ReflectionsCache getInstance() { - return INSTANCE; - } - - public Reflections getOrCreate(Object caller, String namespace) { - return this.cache.computeIfAbsent(namespace, key -> new Reflections(namespace)); - } -} \ No newline at end of file diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/annotations/RequiresPlugin.java b/API/src/main/java/fr/robie/craftengineconverter/api/annotations/RequiresPlugin.java new file mode 100644 index 00000000..220749e9 --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/annotations/RequiresPlugin.java @@ -0,0 +1,31 @@ +package fr.robie.craftengineconverter.api.annotations; + +import fr.robie.craftengineconverter.api.utils.Comparison; +import org.jetbrains.annotations.NotNull; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.TYPE) +public @interface RequiresPlugin { + @NotNull + String value(); + + @NotNull + String version() default ""; + + @NotNull + Comparison type() default Comparison.GREATER_THAN_OR_EQUAL_TO; + + @NotNull + CheckMode checkMode() default CheckMode.EXISTS; + + enum CheckMode { + EXISTS, + EXISTS_AND_ENABLED + } + +} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/loader/ClassRegistry.java b/API/src/main/java/fr/robie/craftengineconverter/api/loader/ClassRegistry.java new file mode 100644 index 00000000..9578786d --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/loader/ClassRegistry.java @@ -0,0 +1,69 @@ +package fr.robie.craftengineconverter.api.loader; + +import org.bukkit.plugin.Plugin; + +import java.util.ArrayList; +import java.util.List; +import java.util.function.Consumer; + +public class ClassRegistry { + + private final List> strategies = new ArrayList<>(); + private final Consumer registrar; + private final Class expectedType; + private Consumer errorLogger; + + private ClassRegistry(Class expectedType, Consumer registrar) { + this.expectedType = expectedType; + this.registrar = registrar; + } + + public static ClassRegistry of(Class type, Consumer registrar) { + return new ClassRegistry<>(type, registrar); + } + + public ClassRegistry tryConstructor(ConstructorStrategy

strategy) { + this.strategies.add(strategy); + return this; + } + + public ClassRegistry errorLogger(Consumer errorLogger) { + this.errorLogger = errorLogger; + return this; + } + + public ClassRegistry tryNoArgsConstructor() { + return this.tryConstructor((clazz, plugin) -> clazz.getDeclaredConstructor().newInstance()); + } + + public boolean load(P plugin, Class clazz) { + for (ConstructorStrategy

strategy : this.strategies) { + try { + Object instance = strategy.instantiate(clazz, plugin); + if (this.expectedType.isInstance(instance)) { + this.registrar.accept(this.expectedType.cast(instance)); + return true; + } + } catch (Exception ignored) { + } + } + + if (this.errorLogger != null) { + StringBuilder stringBuilder = new StringBuilder(); + stringBuilder.append("Could not find a valid constructor for ").append(clazz.getName()).append(". Available constructors: "); + for (int i = 0; i < clazz.getDeclaredConstructors().length; i++) { + stringBuilder.append(clazz.getDeclaredConstructors()[i]); + if (i < clazz.getDeclaredConstructors().length - 1) { + stringBuilder.append(", "); + } + } + this.errorLogger.accept(stringBuilder.toString()); + } + + return false; + } + + public Class getExpectedType() { + return this.expectedType; + } +} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/loader/ConstructorStrategy.java b/API/src/main/java/fr/robie/craftengineconverter/api/loader/ConstructorStrategy.java new file mode 100644 index 00000000..61a968d9 --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/loader/ConstructorStrategy.java @@ -0,0 +1,8 @@ +package fr.robie.craftengineconverter.api.loader; + +import org.bukkit.plugin.Plugin; + +@FunctionalInterface +public interface ConstructorStrategy

{ + Object instantiate(Class clazz, P plugin) throws Exception; +} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/reflections/ReflectionsCache.java b/API/src/main/java/fr/robie/craftengineconverter/api/reflections/ReflectionsCache.java index c82a13fb..64b278b2 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/reflections/ReflectionsCache.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/reflections/ReflectionsCache.java @@ -1,6 +1,6 @@ package fr.robie.craftengineconverter.api.reflections; -import org.bukkit.plugin.java.JavaPlugin; +import org.bukkit.plugin.Plugin; import org.jetbrains.annotations.NotNull; import org.reflections.Reflections; import org.reflections.scanners.Scanners; @@ -25,7 +25,7 @@ public static synchronized ReflectionsCache getInstance() { return instance; } - public Reflections getOrCreate(@NotNull JavaPlugin plugin, @NotNull String packageName) { + public Reflections getOrCreate(@NotNull Plugin plugin, @NotNull String packageName) { if (packageName.trim().isEmpty()) { throw new IllegalArgumentException("Package name cannot be empty"); } diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/utils/Comparison.java b/API/src/main/java/fr/robie/craftengineconverter/api/utils/Comparison.java new file mode 100644 index 00000000..349b6518 --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/utils/Comparison.java @@ -0,0 +1,21 @@ +package fr.robie.craftengineconverter.api.utils; + +public enum Comparison { + GREATER_THAN, + GREATER_THAN_OR_EQUAL_TO, + LESS_THAN, + LESS_THAN_OR_EQUAL_TO, + EQUAL, + NOT_EQUAL; + + public boolean compare(int result) { + return switch (this) { + case GREATER_THAN -> result > 0; + case GREATER_THAN_OR_EQUAL_TO -> result >= 0; + case LESS_THAN -> result < 0; + case LESS_THAN_OR_EQUAL_TO -> result <= 0; + case EQUAL -> result == 0; + case NOT_EQUAL -> result != 0; + }; + } +} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/utils/MinecraftVersion.java b/API/src/main/java/fr/robie/craftengineconverter/api/utils/MinecraftVersion.java index b42c19a7..778873d9 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/utils/MinecraftVersion.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/utils/MinecraftVersion.java @@ -1,10 +1,17 @@ package fr.robie.craftengineconverter.api.utils; +import fr.robie.messageflow.logger.Logger; import org.bukkit.Bukkit; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; public final class MinecraftVersion implements Comparable { + private static final Map PARSE_CACHE = new ConcurrentHashMap<>(); - private static MinecraftVersion current; + private static MinecraftVersion currentVersion; private final int major; private final int minor; @@ -16,56 +23,53 @@ private MinecraftVersion(int major, int minor, int patch) { this.patch = patch; } - /** - * Returns the current server's Minecraft version, parsed once and cached. - */ - public static MinecraftVersion current() { - if (current == null) { - String bukkitVersion; - try { - bukkitVersion = Bukkit.getBukkitVersion(); - } catch (NoClassDefFoundError | Exception e) { // In case we're running in an environment without Bukkit (e.g., during testing), we can't get the version, so we default to (0, 0, 0). - bukkitVersion = null; - } - current = parse(bukkitVersion); + public static MinecraftVersion getCurrentVersion() { + if (currentVersion == null) { + currentVersion = parse(Bukkit.getBukkitVersion()); } - return current; + return currentVersion; } - /** - * Parses a version string such as {@code "1.21.4"} or {@code "1.21.4-R0.1-SNAPSHOT"}. - * If parsing fails, returns {@code (0, 0, 0)} and logs a warning — this causes all - * {@code @SinceVersion} checks to fail conservatively rather than crashing. - */ - public static MinecraftVersion parse(String raw) { - if (raw == null || raw.isBlank()) { - return new MinecraftVersion(0, 0, 0); - } - // Strip everything after the first '-' → "1.21.4-R0.1-SNAPSHOT" becomes "1.21.4" - String clean = raw.contains("-") ? raw.substring(0, raw.indexOf('-')) : raw; - String[] parts = clean.split("\\."); - try { - int major = parts.length > 0 ? Integer.parseInt(parts[0]) : 0; - int minor = parts.length > 1 ? Integer.parseInt(parts[1]) : 0; - int patch = parts.length > 2 ? Integer.parseInt(parts[2]) : 0; - return new MinecraftVersion(major, minor, patch); - } catch (NumberFormatException e) { + @NotNull + public static MinecraftVersion parse(@Nullable String rawVersion) { + if (rawVersion == null || rawVersion.isBlank()) { return new MinecraftVersion(0, 0, 0); } + return PARSE_CACHE.computeIfAbsent(rawVersion, raw -> { + String clean = raw.contains("-") ? raw.substring(0, raw.indexOf('-')) : raw; + String[] parts = clean.split("\\."); + try { + int major = parts.length > 0 ? Integer.parseInt(parts[0]) : 0; + int minor = parts.length > 1 ? Integer.parseInt(parts[1]) : 0; + int patch = parts.length > 2 ? Integer.parseInt(parts[2]) : 0; + return new MinecraftVersion(major, minor, patch); + } catch (NumberFormatException e) { + Logger.error("Could not parse Minecraft value '" + raw + "'. Version-gated classes will be skipped. (" + e.getMessage() + ")", e); + return new MinecraftVersion(0, 0, 0); + } + }); } /** - * Returns {@code true} if this version is greater than or equal to {@code other}. + * Returns {@code true} if this value is greater than or equal to {@code other}. */ public boolean isAtLeast(MinecraftVersion other) { - return this.compareTo(other) >= 0; + return compareTo(other) >= 0; } /** - * Returns {@code true} if this version is less than or equal to {@code other}. + * Returns {@code true} if this value is less than or equal to {@code other}. */ public boolean isAtMost(MinecraftVersion other) { - return this.compareTo(other) <= 0; + return compareTo(other) <= 0; + } + + public boolean isBefore(MinecraftVersion other) { + return compareTo(other) < 0; + } + + public boolean isAfter(MinecraftVersion other) { + return compareTo(other) > 0; } public int getMajor() { @@ -93,22 +97,18 @@ public int compareTo(MinecraftVersion other) { @Override public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (!(obj instanceof MinecraftVersion other)) { - return false; - } + if (this == obj) return true; + if (!(obj instanceof MinecraftVersion other)) return false; return this.major == other.major && this.minor == other.minor && this.patch == other.patch; } @Override public int hashCode() { - return 31 * (31 * this.major + this.minor) + this.patch; + return 31 * (31 * major + minor) + patch; } @Override public String toString() { - return this.major + "." + this.minor + (this.patch != 0 ? "." + this.patch : ""); + return major + "." + minor + (patch != 0 ? "." + patch : ""); } } diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/utils/PluginVersion.java b/API/src/main/java/fr/robie/craftengineconverter/api/utils/PluginVersion.java new file mode 100644 index 00000000..9e430fab --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/utils/PluginVersion.java @@ -0,0 +1,90 @@ +package fr.robie.craftengineconverter.api.utils; + +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.Arrays; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +public final class PluginVersion implements Comparable { + private static final Map PARSE_CACHE = new ConcurrentHashMap<>(); + + private final int[] segments; + + private PluginVersion(int[] segments) { + this.segments = stripLeadingZeros(segments); + } + + /** + * Strips leading zero segments: [0, 61, 2] → [61, 2]. + * Keeps at least one segment to represent version "0". + */ + private static int[] stripLeadingZeros(int[] segments) { + int start = 0; + while (start < segments.length - 1 && segments[start] == 0) { + start++; + } + return start == 0 ? segments : Arrays.copyOfRange(segments, start, segments.length); + } + + @NotNull + public static PluginVersion parse(@Nullable String rawVersion) { + if (rawVersion == null || rawVersion.isBlank()) { + return new PluginVersion(new int[]{0}); + } + return PARSE_CACHE.computeIfAbsent(rawVersion, raw -> { + String clean = raw.contains("-") ? raw.substring(0, raw.indexOf('-')) : raw; + String[] parts = clean.split("\\."); + int[] segments = new int[parts.length]; + for (int i = 0; i < parts.length; i++) { + String part = parts[i].replaceAll("[^0-9]", ""); + try { + segments[i] = part.isEmpty() ? 0 : Integer.parseInt(part); + } catch (NumberFormatException e) { + segments[i] = 0; + } + } + return new PluginVersion(segments); + }); + } + + @Override + public int compareTo(@NotNull PluginVersion other) { + int length = Math.max(this.segments.length, other.segments.length); + for (int i = 0; i < length; i++) { + if (i >= this.segments.length) return -1; + if (i >= other.segments.length) return 1; + if (this.segments[i] != other.segments[i]) { + return Integer.compare(this.segments[i], other.segments[i]); + } + } + return 0; + } + + public boolean isNewerThan(@NotNull PluginVersion other) { return compareTo(other) > 0; } + public boolean isOlderThan(@NotNull PluginVersion other) { return compareTo(other) < 0; } + public boolean isSameAs(@NotNull PluginVersion other) { return compareTo(other) == 0; } + + @Override + public boolean equals(Object obj) { + if (this == obj) return true; + if (!(obj instanceof PluginVersion other)) return false; + return Arrays.equals(this.segments, other.segments); + } + + @Override + public int hashCode() { + return Arrays.hashCode(segments); + } + + @Override + public String toString() { + StringBuilder builder = new StringBuilder(); + for (int i = 0; i < segments.length; i++) { + if (i > 0) builder.append('.'); + builder.append(segments[i]); + } + return builder.toString(); + } +} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/utils/VersionFilter.java b/API/src/main/java/fr/robie/craftengineconverter/api/utils/VersionFilter.java index 4f2a26d0..114707c0 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/utils/VersionFilter.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/utils/VersionFilter.java @@ -1,18 +1,22 @@ package fr.robie.craftengineconverter.api.utils; -import fr.robie.craftengineconverter.api.annotations.PaperOnly; -import fr.robie.craftengineconverter.api.annotations.SinceVersion; -import fr.robie.craftengineconverter.api.annotations.SpigotOnly; -import fr.robie.craftengineconverter.api.annotations.UntilVersion; +import fr.robie.craftengineconverter.api.annotations.*; +import fr.robie.craftengineconverter.api.loader.ClassRegistry; import fr.robie.craftengineconverter.api.manager.FoliaCompatibilityManager; -import fr.robie.messageflow.logger.Logger; +import fr.robie.craftengineconverter.api.reflections.ReflectionsCache; +import org.bukkit.Bukkit; +import org.bukkit.plugin.Plugin; +import org.jetbrains.annotations.NotNull; +import org.reflections.Reflections; + +import java.lang.annotation.Annotation; public final class VersionFilter { private VersionFilter() { } - public static boolean passes(Class clazz, String label) { + public static boolean passes(Class clazz) { if (clazz.isAnnotationPresent(PaperOnly.class) && !FoliaCompatibilityManager.getInstance().isPaperOrFolia()) { return false; } @@ -20,12 +24,30 @@ public static boolean passes(Class clazz, String label) { return false; } - MinecraftVersion server = MinecraftVersion.current(); + RequiresPlugin requiresPlugin = clazz.getAnnotation(RequiresPlugin.class); + if (requiresPlugin != null) { + Plugin plugin = Bukkit.getPluginManager().getPlugin(requiresPlugin.value()); + + if (plugin == null) return false; + + if (requiresPlugin.checkMode() == RequiresPlugin.CheckMode.EXISTS_AND_ENABLED && !plugin.isEnabled()) return false; + + String requiredVersionStr = requiresPlugin.version(); + if (!requiredVersionStr.isEmpty()) { + PluginVersion pluginVersion = PluginVersion.parse(plugin.getDescription().getVersion()); + PluginVersion requiredVersion = PluginVersion.parse(requiredVersionStr); + if (!requiresPlugin.type().compare(pluginVersion.compareTo(requiredVersion))) { + return false; + } + } + } + + MinecraftVersion serverVersion = MinecraftVersion.getCurrentVersion(); SinceVersion since = clazz.getAnnotation(SinceVersion.class); if (since != null) { MinecraftVersion minimum = MinecraftVersion.parse(since.value()); - if (!server.isAtLeast(minimum)) { + if (!serverVersion.isAtLeast(minimum)) { return false; } } @@ -33,9 +55,27 @@ public static boolean passes(Class clazz, String label) { UntilVersion until = clazz.getAnnotation(UntilVersion.class); if (until != null) { MinecraftVersion maximum = MinecraftVersion.parse(until.value()); - return server.isAtMost(maximum); + return serverVersion.isAtMost(maximum); } return true; } + + public static int scanAndRegister( + @NotNull String packageName, + @NotNull P plugin, + @NotNull Class annotation, + @NotNull ClassRegistry registry) { + + Reflections reflection = ReflectionsCache.getInstance().getOrCreate(plugin, packageName); + int count = 0; + + for (Class clazz : reflection.getTypesAnnotatedWith(annotation)) { + if (!registry.getExpectedType().isAssignableFrom(clazz)) continue; + if (!passes(clazz)) continue; + if (registry.load(plugin, clazz)) count++; + } + + return count; + } } \ No newline at end of file diff --git a/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/directive/VersionKeyDirective.java b/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/directive/VersionKeyDirective.java index fb93e0a6..b04d31cc 100644 --- a/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/directive/VersionKeyDirective.java +++ b/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/directive/VersionKeyDirective.java @@ -53,7 +53,7 @@ private static boolean evaluate(@NotNull String key) { String verA = m.group(2); String verB = m.group(3); - MinecraftVersion current = MinecraftVersion.current(); + MinecraftVersion current = MinecraftVersion.getCurrentVersion(); if (verB != null) { MinecraftVersion min = MinecraftVersion.parse(verA); diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/RegistryHelper.java b/Plugin/src/main/java/fr/robie/craftengineconverter/RegistryHelper.java index a55027a5..453a4672 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/RegistryHelper.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/RegistryHelper.java @@ -49,7 +49,7 @@ private void loadModelConfigurationRegistry() { if (!ModelConfigurationLoader.class.isAssignableFrom(clazz)) { continue; } - if (!VersionFilter.passes(clazz, clazz.getSimpleName())) { + if (!VersionFilter.passes(clazz)) { continue; } AutoModelConfigurationLoader annotation = clazz.getAnnotation(AutoModelConfigurationLoader.class); @@ -90,7 +90,7 @@ private void loadTintConfigurationRegistry() { if (!TintConfigurationLoader.class.isAssignableFrom(clazz)) { continue; } - if (!fr.robie.craftengineconverter.api.utils.VersionFilter.passes(clazz, clazz.getSimpleName())) { + if (!fr.robie.craftengineconverter.api.utils.VersionFilter.passes(clazz)) { continue; } AutoTintConfigurationLoader annotation = clazz.getAnnotation(AutoTintConfigurationLoader.class); @@ -116,7 +116,7 @@ private void loadSelectModelConfigurationRegistry() { if (!ModelConfigurationLoader.class.isAssignableFrom(clazz)) { continue; } - if (!VersionFilter.passes(clazz, clazz.getSimpleName())) { + if (!VersionFilter.passes(clazz)) { continue; } AutoSelectModelConfigurationLoader annotation = clazz.getAnnotation(AutoSelectModelConfigurationLoader.class); @@ -148,7 +148,7 @@ private void loadRangeDispatchModelConfigurationRegistry() { if (!ModelConfigurationLoader.class.isAssignableFrom(clazz)) { continue; } - if (!VersionFilter.passes(clazz, clazz.getSimpleName())) { + if (!VersionFilter.passes(clazz)) { continue; } AutoRangeDispatchConfigurationLoader annotation = clazz.getAnnotation(AutoRangeDispatchConfigurationLoader.class); From bcaddd21efbc434fb6c9ca7c335b241ab5a4e332 Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Thu, 11 Jun 2026 15:17:48 +0200 Subject: [PATCH 028/116] change all bukkit yaml to own library + fix issue with test loading inside MinecraftVersion class --- API/pom.xml | 5 + .../api/configuration/Configuration.java | 4 +- .../api/configuration/ConfigurationKey.java | 2 +- .../CraftEngineItemsConfiguration.java | 4 +- .../configuration/SectionSerializable.java | 2 +- .../conditions/AbstractCondition.java | 2 +- .../conditions/AllOfCondition.java | 2 +- .../conditions/AnyOfCondition.java | 2 +- .../conditions/DistanceCondition.java | 2 +- .../conditions/EnchantmentCondition.java | 2 +- .../conditions/ExpressionCondition.java | 2 +- .../conditions/HandCondition.java | 2 +- .../conditions/InventoryHasItemCondition.java | 2 +- .../conditions/InvertedCondition.java | 2 +- .../conditions/IsNullCondition.java | 2 +- .../conditions/MatchBlockCondition.java | 2 +- .../MatchBlockPropertyCondition.java | 2 +- .../conditions/MatchEntityCondition.java | 2 +- .../MatchFurnitureVariantCondition.java | 2 +- .../conditions/MatchItemCondition.java | 2 +- .../conditions/OnCooldownCondition.java | 2 +- .../conditions/PermissionCondition.java | 2 +- .../conditions/RandomCondition.java | 2 +- .../conditions/RegexCondition.java | 2 +- .../conditions/StringContainsCondition.java | 2 +- .../conditions/StringEqualsCondition.java | 2 +- .../conditions/TableBonusCondition.java | 2 +- .../conditions/WorldGuardRegionCondition.java | 2 +- .../api/configuration/events/Event.java | 2 +- .../events/EventConfiguration.java | 2 +- .../functions/internal/DropLootFunction.java | 1 - .../api/configuration/image/Bitmap.java | 2 +- ...MultipleCharactersBitmapConfiguration.java | 2 +- .../configuration/image/ReferenceBitmap.java | 2 +- .../SingleCharacterBitmapConfiguration.java | 2 +- .../item/ItemConfigurationSerializable.java | 4 +- .../configuration/item/LoreConfiguration.java | 4 +- .../item/OversizedInGuiConfiguration.java | 4 +- .../behavior/block/BlockConfiguration.java | 4 +- .../item/behavior/block/BlockSettings.java | 2 +- .../entities/BlockEntityConfiguration.java | 2 +- .../block/states/BlockAppearance.java | 2 +- .../block/states/BlockStateProperty.java | 2 +- .../block/states/MultiStateBlock.java | 2 +- .../block/states/SectionProvider.java | 2 +- .../block/states/SingleStateBlock.java | 2 +- .../behavior/block/states/StateBlock.java | 2 +- .../defaults/AbstractDefaultBlockState.java | 2 +- .../defaults/DirectionalBlockState.java | 2 +- .../defaults/HorizontalFacingBlockState.java | 2 +- .../states/defaults/PillarBlockState.java | 2 +- .../AnchorTypeBlockStateProperty.java | 2 +- .../properties/AxisBlockStateProperty.java | 2 +- .../properties/BooleanBlockStateProperty.java | 2 +- .../DirectionBlockStateProperty.java | 2 +- .../DoubleBlockHalfBlockStateProperty.java | 2 +- .../properties/HingeBlockStateProperty.java | 2 +- ...HorizontalDirectionBlockStateProperty.java | 2 +- .../properties/IntBlockStateProperty.java | 2 +- .../SingleBlockHalfBlockStateProperty.java | 2 +- .../SlabTypeBlockStateProperty.java | 2 +- .../SofaShapeBlockStateProperty.java | 2 +- .../StairsShapeBlockStateProperty.java | 2 +- .../properties/StringBlockStateProperty.java | 2 +- .../furniture/FurnitureConfiguration.java | 4 +- .../item/behavior/furniture/Placement.java | 2 +- .../item/behavior/furniture/Rules.java | 2 +- .../OverwritableItemNameConfiguration.java | 4 +- .../OverwritableLoreConfiguration.java | 4 +- .../components/AttackRangeConfiguration.java | 4 +- .../BlocksAttacksConfiguration.java | 4 +- .../components/BreakSoundConfiguration.java | 4 +- .../components/CanBreakConfiguration.java | 4 +- .../components/CanPlaceOnConfiguration.java | 4 +- .../components/ConsumableConfiguration.java | 5 +- .../components/CustomDataConfiguration.java | 4 +- .../DamageResistantConfiguration.java | 4 +- .../components/DamageTypeConfiguration.java | 4 +- .../DeathProtectionConfiguration.java | 4 +- .../components/EnchantableConfiguration.java | 4 +- ...EnchantmentGlintOverrideConfiguration.java | 4 +- .../item/components/FoodConfiguration.java | 4 +- .../item/components/GliderConfiguration.java | 4 +- .../HideTooltipDisplayConfiguration.java | 4 +- .../components/ItemModelConfiguration.java | 4 +- .../JukeboxPlayableConfiguration.java | 4 +- .../KineticWeaponConfiguration.java | 4 +- .../item/components/MaxDamageComponent.java | 4 +- .../components/MaxStackSizeConfiguration.java | 4 +- .../MinimumAttackChargeConfiguration.java | 4 +- .../PaintingVariantConfiguration.java | 4 +- .../PiercingWeaponConfiguration.java | 4 +- .../PlayerProfileConfiguration.java | 4 +- .../SwingAnimationConfiguration.java | 4 +- .../item/components/ToolConfiguration.java | 4 +- .../TooltipDisplayConfiguration.java | 4 +- .../components/UseCooldownConfiguration.java | 4 +- .../components/UseEffectsConfiguration.java | 4 +- .../components/UseRemainderConfiguration.java | 4 +- .../item/components/WeaponConfiguration.java | 4 +- .../data/AttributeModifiersConfiguration.java | 4 +- .../item/data/BlockStateConfiguration.java | 4 +- .../data/CustomModelDataConfiguration.java | 4 +- .../item/data/CustomNameConfiguration.java | 4 +- .../item/data/DyedColorConfiguration.java | 4 +- .../item/data/EnchantmentConfiguration.java | 4 +- .../item/data/HideTooltipConfiguration.java | 4 +- .../item/data/ItemNameConfiguration.java | 4 +- .../item/data/MaxDamageConfiguration.java | 4 +- .../item/data/TooltipStyleConfiguration.java | 4 +- .../item/data/UnbreakableConfiguration.java | 4 +- .../item/loottables/LootPool.java | 2 +- .../item/loottables/LootTable.java | 2 +- .../loottables/entries/AbstractLootEntry.java | 2 +- .../loottables/entries/AlternativesEntry.java | 2 +- .../item/loottables/entries/ExpEntry.java | 2 +- .../entries/FurnitureItemEntry.java | 2 +- .../item/loottables/entries/ItemEntry.java | 2 +- .../formulas/AbstractLootFormula.java | 2 +- .../BinomialWithBonusCountFormula.java | 2 +- .../functions/AbstractLootFunction.java | 2 +- .../functions/ApplyBonusFunction.java | 2 +- .../functions/ApplyDataFunction.java | 2 +- .../loottables/functions/DropExpFunction.java | 2 +- .../functions/LimitCountFunction.java | 2 +- .../functions/SetCountFunction.java | 2 +- .../item/models/ModelConfiguration.java | 2 +- .../CompositeModelConfiguration.java | 2 +- .../ComponentConditionConfiguration.java | 2 +- .../ConditionModelConfiguration.java | 2 +- ...CustomModelDataConditionConfiguration.java | 2 +- .../HasComponentConditionConfiguration.java | 2 +- .../KeybindDownConditionConfiguration.java | 2 +- .../model/SimpleModelConfiguration.java | 2 +- .../CompassRangeDispatchConfiguration.java | 2 +- .../CountRangeDispatchConfiguration.java | 2 +- ...omModelDataRangeDispatchConfiguration.java | 2 +- .../DamageRangeDispatchConfiguration.java | 2 +- .../RangeDispatchModelConfiguration.java | 2 +- .../TimeRangeDispatchConfiguration.java | 2 +- .../UseCycleRangeDispatchConfiguration.java | 2 +- ...UseDurationRangeDispatchConfiguration.java | 2 +- .../select/BlockStateSelectConfiguration.java | 2 +- .../select/ComponentSelectConfiguration.java | 2 +- .../CustomModelDataSelectConfiguration.java | 2 +- .../select/LocalTimeSelectConfiguration.java | 2 +- .../select/SelectModelConfiguration.java | 2 +- .../special/SpecialModelConfiguration.java | 2 +- .../AnvilRepairItemConfiguration.java | 4 +- .../settings/DropDisplayConfiguration.java | 4 +- .../settings/EquippableConfiguration.java | 4 +- .../FuelTimeSettingConfiguration.java | 4 +- .../settings/GlowDropColorConfiguration.java | 4 +- .../InvulnerableSettingConfiguration.java | 4 +- .../ProjectileSettingConfiguration.java | 4 +- .../RepairableSettingConfiguration.java | 4 +- .../models/AbstractConditionLoader.java | 2 +- .../models/ModelConfigurationLoader.java | 2 +- .../models/ModelConfigurationRegistry.java | 2 +- .../CompositeModelConfigurationLoader.java | 2 +- .../condition/ComponentConditionLoader.java | 2 +- .../ConditionModelConfigurationLoader.java | 2 +- .../CustomModelDataConditionLoader.java | 2 +- .../HasComponentConditionLoader.java | 2 +- .../condition/KeybindDownConditionLoader.java | 2 +- .../model/SimpleModelConfigurationLoader.java | 2 +- ...tractRangeDispatchConfigurationLoader.java | 2 +- ...mpassRangeDispatchConfigurationLoader.java | 2 +- ...CountRangeDispatchConfigurationLoader.java | 2 +- ...lDataRangeDispatchConfigurationLoader.java | 2 +- ...amageRangeDispatchConfigurationLoader.java | 2 +- .../RangeDispatchConfigurationRegistry.java | 3 +- .../TimeRangeDispatchConfigurationLoader.java | 2 +- ...CycleRangeDispatchConfigurationLoader.java | 2 +- ...ationRangeDispatchConfigurationLoader.java | 2 +- ...bstractSelectModelConfigurationLoader.java | 2 +- .../BlockStateSelectConfigurationLoader.java | 2 +- .../ChargeTypeSelectConfigurationLoader.java | 2 +- .../ComponentSelectConfigurationLoader.java | 2 +- ...tomModelDataSelectConfigurationLoader.java | 2 +- ...splayContextSelectConfigurationLoader.java | 2 +- .../LocalTimeSelectConfigurationLoader.java | 2 +- .../MainHandSelectConfigurationLoader.java | 2 +- .../SelectModelConfigurationRegistry.java | 2 +- .../models/tints/TintConfigurationLoader.java | 2 +- .../tints/TintConfigurationRegistry.java | 2 +- .../loader/tints/ConstantTintLoader.java | 2 +- .../tints/CustomModelDataTintLoader.java | 2 +- .../loader/tints/DyeTintLoader.java | 2 +- .../loader/tints/FireworkTintLoader.java | 2 +- .../loader/tints/GrassTintLoader.java | 2 +- .../loader/tints/MapColorTintLoader.java | 2 +- .../loader/tints/PotionTintLoader.java | 2 +- .../loader/tints/TeamTintLoader.java | 2 +- .../configuration/recipe/AbstractRecipe.java | 2 +- .../configuration/recipe/BrewingRecipe.java | 2 +- .../configuration/recipe/CookingRecipe.java | 2 +- .../recipe/CraftingAbstractRecipe.java | 2 +- .../configuration/recipe/ShapedRecipe.java | 2 +- .../configuration/recipe/ShapelessRecipe.java | 2 +- .../recipe/StonecuttingRecipe.java | 2 +- .../recipe/ingredient/CraftingIngredient.java | 2 +- .../recipe/ingredient/RecipeResult.java | 2 +- .../smithing/AbstractSmithingRecipe.java | 2 +- .../smithing/SmithingTransformRecipe.java | 2 +- .../recipe/smithing/SmithingTrimRecipe.java | 2 +- .../sound/JukeboxSongConfiguration.java | 2 +- .../sound/SoundConfiguration.java | 2 +- .../utils/BlockPredicateConfiguration.java | 4 +- .../api/enums/ArmorConverter.java | 2 +- .../api/manager/FileCacheManager.java | 2 +- .../ConfigurationSerializationUtils.java | 2 +- .../api/utils/MinecraftVersion.java | 8 +- .../api/utils/ObjectUtils.java | 2 +- .../api/yaml/Configuration.java | 21 - .../api/yaml/ConfigurationOptions.java | 38 - .../api/yaml/ConfigurationSection.java | 185 --- Common/pom.xml | 5 + .../scanner/BlockStateMappingScanner.java | 16 +- .../common/utils/SnakeUtils.java | 1074 ----------------- .../utils/yaml/MemoryConfiguration.java | 82 -- .../yaml/MemoryConfigurationOptions.java | 31 - .../common/utils/yaml/MemorySection.java | 984 --------------- .../common/utils/yaml/SectionPathData.java | 51 - .../yaml/constructor/SmartConstructor.java | 231 ---- .../utils/yaml/directive/KeyDirective.java | 18 - .../yaml/directive/KeyDirectiveRegistry.java | 37 - .../yaml/directive/MergeKeyDirective.java | 42 - .../yaml/directive/PluginKeyDirective.java | 3 +- .../yaml/directive/VersionKeyDirective.java | 5 +- .../utils/yaml/file/FileConfiguration.java | 89 -- .../yaml/file/FileConfigurationOptions.java | 71 -- .../utils/yaml/file/YamlConfiguration.java | 301 ----- .../yaml/file/YamlConfigurationOptions.java | 91 -- .../utils/yaml/file/YamlRepresenter.java | 44 - .../ConfigurationSerialization.java | 220 ---- .../utils/yaml/YamlConfigurationTest.java | 243 ---- Plugin/pom.xml | 7 + .../CraftEngineConverter.java | 5 + .../converter/Converter.java | 4 +- .../converter/CraftEngineItemUtils.java | 2 +- .../converter/ItemConverter.java | 4 +- .../converter/bedrock/BedrockConverter.java | 4 +- .../converter/bedrock/BedrockItemLoader.java | 2 +- .../converter/itemsadder/IAConverter.java | 130 +- .../itemsadder/IAItemsConverter.java | 4 +- .../converter/nexo/NexoConverter.java | 306 ++--- .../converter/nexo/NexoItemConverter.java | 5 +- .../database/DataBaseManager.java | 2 +- .../utils/ConfigFile.java | 2 +- pom.xml | 7 + 251 files changed, 509 insertions(+), 4415 deletions(-) delete mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/yaml/Configuration.java delete mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/yaml/ConfigurationOptions.java delete mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/yaml/ConfigurationSection.java delete mode 100644 Common/src/main/java/fr/robie/craftengineconverter/common/utils/SnakeUtils.java delete mode 100644 Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/MemoryConfiguration.java delete mode 100644 Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/MemoryConfigurationOptions.java delete mode 100644 Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/MemorySection.java delete mode 100644 Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/SectionPathData.java delete mode 100644 Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/constructor/SmartConstructor.java delete mode 100644 Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/directive/KeyDirective.java delete mode 100644 Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/directive/KeyDirectiveRegistry.java delete mode 100644 Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/directive/MergeKeyDirective.java delete mode 100644 Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/file/FileConfiguration.java delete mode 100644 Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/file/FileConfigurationOptions.java delete mode 100644 Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/file/YamlConfiguration.java delete mode 100644 Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/file/YamlConfigurationOptions.java delete mode 100644 Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/file/YamlRepresenter.java delete mode 100644 Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/serialization/ConfigurationSerialization.java delete mode 100644 Common/src/test/java/fr/robie/craftengineconverter/common/utils/yaml/YamlConfigurationTest.java diff --git a/API/pom.xml b/API/pom.xml index 3ec6d285..b06e79d5 100644 --- a/API/pom.xml +++ b/API/pom.xml @@ -52,5 +52,10 @@ message-flow provided + + + fr.robie + yamllibrary + \ No newline at end of file diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/Configuration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/Configuration.java index db192b0d..5ca08c89 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/Configuration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/Configuration.java @@ -10,8 +10,8 @@ import fr.robie.craftengineconverter.api.progress.ProgressBarUtils; import fr.robie.messageflow.formatter.Placeholder; import fr.robie.messageflow.logger.Logger; -import org.bukkit.configuration.ConfigurationSection; -import org.bukkit.configuration.file.YamlConfiguration; +import fr.robie.yamllibrary.ConfigurationSection; +import fr.robie.yamllibrary.file.YamlConfiguration; import org.jetbrains.annotations.NotNull; import java.io.File; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/ConfigurationKey.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/ConfigurationKey.java index 6a177fea..532f3bd4 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/ConfigurationKey.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/ConfigurationKey.java @@ -6,8 +6,8 @@ import fr.robie.craftengineconverter.api.enums.Languages; import fr.robie.craftengineconverter.api.enums.LimitType; import fr.robie.craftengineconverter.api.utils.ConfigurationDeserializer; +import fr.robie.yamllibrary.ConfigurationSection; import org.bukkit.Material; -import org.bukkit.configuration.ConfigurationSection; import org.jetbrains.annotations.NotNull; import java.util.*; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/CraftEngineItemsConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/CraftEngineItemsConfiguration.java index 127739cf..ec11339f 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/CraftEngineItemsConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/CraftEngineItemsConfiguration.java @@ -2,9 +2,9 @@ import fr.robie.craftengineconverter.api.configuration.item.ItemConfigurationSerializable; import fr.robie.craftengineconverter.api.configuration.item.models.ModelConfiguration; +import fr.robie.yamllibrary.ConfigurationSection; +import fr.robie.yamllibrary.file.YamlConfiguration; import org.bukkit.Material; -import org.bukkit.configuration.ConfigurationSection; -import org.bukkit.configuration.file.YamlConfiguration; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/SectionSerializable.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/SectionSerializable.java index 7e226ffa..6ecd370e 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/SectionSerializable.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/SectionSerializable.java @@ -1,6 +1,6 @@ package fr.robie.craftengineconverter.api.configuration; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; public interface SectionSerializable { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/AbstractCondition.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/AbstractCondition.java index 94e6a66b..67c94a0f 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/AbstractCondition.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/AbstractCondition.java @@ -1,6 +1,6 @@ package fr.robie.craftengineconverter.api.configuration.conditions; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; public abstract class AbstractCondition implements Condition { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/AllOfCondition.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/AllOfCondition.java index aca0f32c..e726c8ce 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/AllOfCondition.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/AllOfCondition.java @@ -1,7 +1,7 @@ package fr.robie.craftengineconverter.api.configuration.conditions; import fr.robie.craftengineconverter.api.utils.ConfigurationSerializationUtils; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; import java.util.List; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/AnyOfCondition.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/AnyOfCondition.java index 63fa08b7..48c4dd0a 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/AnyOfCondition.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/AnyOfCondition.java @@ -1,7 +1,7 @@ package fr.robie.craftengineconverter.api.configuration.conditions; import fr.robie.craftengineconverter.api.utils.ConfigurationSerializationUtils; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; import java.util.List; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/DistanceCondition.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/DistanceCondition.java index e8d6ea0e..cac78e20 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/DistanceCondition.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/DistanceCondition.java @@ -1,6 +1,6 @@ package fr.robie.craftengineconverter.api.configuration.conditions; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; public class DistanceCondition extends AbstractCondition { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/EnchantmentCondition.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/EnchantmentCondition.java index 2d7a95f3..4315cf8c 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/EnchantmentCondition.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/EnchantmentCondition.java @@ -1,6 +1,6 @@ package fr.robie.craftengineconverter.api.configuration.conditions; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; import java.util.Objects; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/ExpressionCondition.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/ExpressionCondition.java index 31b31f67..5e2fcec2 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/ExpressionCondition.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/ExpressionCondition.java @@ -1,6 +1,6 @@ package fr.robie.craftengineconverter.api.configuration.conditions; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; import java.util.Objects; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/HandCondition.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/HandCondition.java index b6fa0969..a44825a0 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/HandCondition.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/HandCondition.java @@ -1,7 +1,7 @@ package fr.robie.craftengineconverter.api.configuration.conditions; import fr.robie.craftengineconverter.api.enums.Hand; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; import java.util.Locale; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/InventoryHasItemCondition.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/InventoryHasItemCondition.java index 60acad78..08e31057 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/InventoryHasItemCondition.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/InventoryHasItemCondition.java @@ -1,6 +1,6 @@ package fr.robie.craftengineconverter.api.configuration.conditions; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; import java.util.Objects; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/InvertedCondition.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/InvertedCondition.java index 44da3050..0d99309d 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/InvertedCondition.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/InvertedCondition.java @@ -1,7 +1,7 @@ package fr.robie.craftengineconverter.api.configuration.conditions; import fr.robie.craftengineconverter.api.utils.ConfigurationSerializationUtils; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; public class InvertedCondition extends AbstractCondition { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/IsNullCondition.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/IsNullCondition.java index 4d930a42..93e4c757 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/IsNullCondition.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/IsNullCondition.java @@ -1,6 +1,6 @@ package fr.robie.craftengineconverter.api.configuration.conditions; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; import java.util.Objects; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/MatchBlockCondition.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/MatchBlockCondition.java index 6b655e3b..9468bf06 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/MatchBlockCondition.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/MatchBlockCondition.java @@ -1,6 +1,6 @@ package fr.robie.craftengineconverter.api.configuration.conditions; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; import java.util.Objects; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/MatchBlockPropertyCondition.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/MatchBlockPropertyCondition.java index 5fd158ae..2fac6601 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/MatchBlockPropertyCondition.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/MatchBlockPropertyCondition.java @@ -1,6 +1,6 @@ package fr.robie.craftengineconverter.api.configuration.conditions; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; import java.util.Map; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/MatchEntityCondition.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/MatchEntityCondition.java index 3c27bb39..7c7295c7 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/MatchEntityCondition.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/MatchEntityCondition.java @@ -1,6 +1,6 @@ package fr.robie.craftengineconverter.api.configuration.conditions; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; import java.util.Objects; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/MatchFurnitureVariantCondition.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/MatchFurnitureVariantCondition.java index 0023f698..42d74d71 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/MatchFurnitureVariantCondition.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/MatchFurnitureVariantCondition.java @@ -1,6 +1,6 @@ package fr.robie.craftengineconverter.api.configuration.conditions; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; import java.util.List; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/MatchItemCondition.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/MatchItemCondition.java index 6c642656..a4dc3543 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/MatchItemCondition.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/MatchItemCondition.java @@ -1,6 +1,6 @@ package fr.robie.craftengineconverter.api.configuration.conditions; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; import java.util.List; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/OnCooldownCondition.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/OnCooldownCondition.java index 536d59cd..a470941b 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/OnCooldownCondition.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/OnCooldownCondition.java @@ -1,6 +1,6 @@ package fr.robie.craftengineconverter.api.configuration.conditions; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; import java.util.Objects; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/PermissionCondition.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/PermissionCondition.java index 4a953890..a70eb0da 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/PermissionCondition.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/PermissionCondition.java @@ -1,6 +1,6 @@ package fr.robie.craftengineconverter.api.configuration.conditions; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; import java.util.Objects; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/RandomCondition.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/RandomCondition.java index 9ababbeb..078fb300 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/RandomCondition.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/RandomCondition.java @@ -1,6 +1,6 @@ package fr.robie.craftengineconverter.api.configuration.conditions; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; public class RandomCondition extends AbstractCondition { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/RegexCondition.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/RegexCondition.java index 8a3b8f72..81efc42b 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/RegexCondition.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/RegexCondition.java @@ -1,6 +1,6 @@ package fr.robie.craftengineconverter.api.configuration.conditions; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; import java.util.Objects; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/StringContainsCondition.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/StringContainsCondition.java index 42822d4d..828c572c 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/StringContainsCondition.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/StringContainsCondition.java @@ -1,6 +1,6 @@ package fr.robie.craftengineconverter.api.configuration.conditions; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; import java.util.Objects; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/StringEqualsCondition.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/StringEqualsCondition.java index 7f1cb3c1..9114d987 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/StringEqualsCondition.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/StringEqualsCondition.java @@ -1,6 +1,6 @@ package fr.robie.craftengineconverter.api.configuration.conditions; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; import java.util.Objects; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/TableBonusCondition.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/TableBonusCondition.java index 5c21b162..72803655 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/TableBonusCondition.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/TableBonusCondition.java @@ -1,6 +1,6 @@ package fr.robie.craftengineconverter.api.configuration.conditions; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; import java.util.List; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/WorldGuardRegionCondition.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/WorldGuardRegionCondition.java index 32fa4505..e841c0ed 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/WorldGuardRegionCondition.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/WorldGuardRegionCondition.java @@ -1,6 +1,6 @@ package fr.robie.craftengineconverter.api.configuration.conditions; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; import java.util.List; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/events/Event.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/events/Event.java index 7cc04f53..5db11608 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/events/Event.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/events/Event.java @@ -1,6 +1,6 @@ package fr.robie.craftengineconverter.api.configuration.events; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; public interface Event { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/events/EventConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/events/EventConfiguration.java index 69239b6d..98bf8c3a 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/events/EventConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/events/EventConfiguration.java @@ -1,7 +1,7 @@ package fr.robie.craftengineconverter.api.configuration.events; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; import java.util.ArrayList; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/functions/internal/DropLootFunction.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/functions/internal/DropLootFunction.java index 30dcb28b..7e4965f4 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/functions/internal/DropLootFunction.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/functions/internal/DropLootFunction.java @@ -2,7 +2,6 @@ import fr.robie.craftengineconverter.api.configuration.item.loottables.LootTable; import fr.robie.craftengineconverter.api.utils.ConfigurationSerializationUtils; -import org.bukkit.configuration.file.YamlConfiguration; import java.util.Map; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/image/Bitmap.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/image/Bitmap.java index baa4939e..738dd765 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/image/Bitmap.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/image/Bitmap.java @@ -1,6 +1,6 @@ package fr.robie.craftengineconverter.api.configuration.image; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; public abstract class Bitmap> implements BitmapConfiguration { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/image/MultipleCharactersBitmapConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/image/MultipleCharactersBitmapConfiguration.java index 7d94e418..8dab26b5 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/image/MultipleCharactersBitmapConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/image/MultipleCharactersBitmapConfiguration.java @@ -1,6 +1,6 @@ package fr.robie.craftengineconverter.api.configuration.image; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; import java.util.ArrayList; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/image/ReferenceBitmap.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/image/ReferenceBitmap.java index fd0f3a9a..a841c839 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/image/ReferenceBitmap.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/image/ReferenceBitmap.java @@ -1,6 +1,6 @@ package fr.robie.craftengineconverter.api.configuration.image; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; import java.util.Objects; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/image/SingleCharacterBitmapConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/image/SingleCharacterBitmapConfiguration.java index 05118ef6..42c39c13 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/image/SingleCharacterBitmapConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/image/SingleCharacterBitmapConfiguration.java @@ -1,6 +1,6 @@ package fr.robie.craftengineconverter.api.configuration.image; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; public class SingleCharacterBitmapConfiguration extends Bitmap { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/ItemConfigurationSerializable.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/ItemConfigurationSerializable.java index a6853bc4..d0124e28 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/ItemConfigurationSerializable.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/ItemConfigurationSerializable.java @@ -1,8 +1,8 @@ package fr.robie.craftengineconverter.api.configuration.item; import fr.robie.craftengineconverter.api.configuration.item.behavior.block.states.SectionProvider; -import org.bukkit.configuration.ConfigurationSection; -import org.bukkit.configuration.file.YamlConfiguration; +import fr.robie.yamllibrary.ConfigurationSection; +import fr.robie.yamllibrary.file.YamlConfiguration; import org.jetbrains.annotations.NotNull; public interface ItemConfigurationSerializable extends SectionProvider { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/LoreConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/LoreConfiguration.java index 39d6be39..d4b006b8 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/LoreConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/LoreConfiguration.java @@ -1,7 +1,7 @@ package fr.robie.craftengineconverter.api.configuration.item; -import org.bukkit.configuration.ConfigurationSection; -import org.bukkit.configuration.file.YamlConfiguration; +import fr.robie.yamllibrary.ConfigurationSection; +import fr.robie.yamllibrary.file.YamlConfiguration; import org.jetbrains.annotations.NotNull; import java.util.List; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/OversizedInGuiConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/OversizedInGuiConfiguration.java index ed8dc475..258b5ad7 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/OversizedInGuiConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/OversizedInGuiConfiguration.java @@ -1,7 +1,7 @@ package fr.robie.craftengineconverter.api.configuration.item; -import org.bukkit.configuration.ConfigurationSection; -import org.bukkit.configuration.file.YamlConfiguration; +import fr.robie.yamllibrary.ConfigurationSection; +import fr.robie.yamllibrary.file.YamlConfiguration; import org.jetbrains.annotations.NotNull; public class OversizedInGuiConfiguration implements ItemConfigurationSerializable { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/BlockConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/BlockConfiguration.java index 77ea0c55..569c024f 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/BlockConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/BlockConfiguration.java @@ -4,8 +4,8 @@ import fr.robie.craftengineconverter.api.configuration.item.ItemConfigurationSerializable; import fr.robie.craftengineconverter.api.configuration.item.behavior.block.states.StateBlock; import fr.robie.craftengineconverter.api.configuration.item.loottables.LootConfiguration; -import org.bukkit.configuration.ConfigurationSection; -import org.bukkit.configuration.file.YamlConfiguration; +import fr.robie.yamllibrary.ConfigurationSection; +import fr.robie.yamllibrary.file.YamlConfiguration; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/BlockSettings.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/BlockSettings.java index 55730ec4..d1e4b11d 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/BlockSettings.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/BlockSettings.java @@ -1,10 +1,10 @@ package fr.robie.craftengineconverter.api.configuration.item.behavior.block; import fr.robie.craftengineconverter.api.common.TrackableSettings; +import fr.robie.yamllibrary.ConfigurationSection; import net.momirealms.craftengine.core.block.setting.PushReaction; import net.momirealms.craftengine.core.util.Instrument; import net.momirealms.craftengine.core.util.Tristate; -import org.bukkit.configuration.ConfigurationSection; import org.jetbrains.annotations.NotNull; import java.util.List; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/entities/BlockEntityConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/entities/BlockEntityConfiguration.java index 90919cfc..26ead4ef 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/entities/BlockEntityConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/entities/BlockEntityConfiguration.java @@ -1,7 +1,7 @@ package fr.robie.craftengineconverter.api.configuration.item.behavior.block.entities; import fr.robie.craftengineconverter.api.configuration.item.behavior.block.states.SectionProvider; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; import java.util.ArrayList; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/BlockAppearance.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/BlockAppearance.java index ed670ff5..5da887ad 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/BlockAppearance.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/BlockAppearance.java @@ -7,7 +7,7 @@ import fr.robie.craftengineconverter.api.enums.CraftEngineBlockState; import fr.robie.craftengineconverter.api.enums.Plugins; import fr.robie.craftengineconverter.api.utils.BlockStateResult; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/BlockStateProperty.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/BlockStateProperty.java index 874b1767..b4aa2fa2 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/BlockStateProperty.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/BlockStateProperty.java @@ -1,6 +1,6 @@ package fr.robie.craftengineconverter.api.configuration.item.behavior.block.states; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; public interface BlockStateProperty extends SectionProvider { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/MultiStateBlock.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/MultiStateBlock.java index 65dc2d6c..d105eaf7 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/MultiStateBlock.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/MultiStateBlock.java @@ -1,6 +1,6 @@ package fr.robie.craftengineconverter.api.configuration.item.behavior.block.states; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; import java.util.ArrayList; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/SectionProvider.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/SectionProvider.java index 9cfa30fb..4d9b2eda 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/SectionProvider.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/SectionProvider.java @@ -1,6 +1,6 @@ package fr.robie.craftengineconverter.api.configuration.item.behavior.block.states; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; public interface SectionProvider { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/SingleStateBlock.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/SingleStateBlock.java index a10325c5..1f6d3de9 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/SingleStateBlock.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/SingleStateBlock.java @@ -3,7 +3,7 @@ import fr.robie.craftengineconverter.api.configuration.item.models.ModelConfiguration; import fr.robie.craftengineconverter.api.enums.CraftEngineBlockState; import fr.robie.craftengineconverter.api.enums.Plugins; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; public class SingleStateBlock implements StateBlock { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/StateBlock.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/StateBlock.java index fea1c0da..25d2e4c2 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/StateBlock.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/StateBlock.java @@ -1,6 +1,6 @@ package fr.robie.craftengineconverter.api.configuration.item.behavior.block.states; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; public interface StateBlock extends SectionProvider { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/defaults/AbstractDefaultBlockState.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/defaults/AbstractDefaultBlockState.java index c3f9178a..c5f9cb21 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/defaults/AbstractDefaultBlockState.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/defaults/AbstractDefaultBlockState.java @@ -6,7 +6,7 @@ import fr.robie.craftengineconverter.api.configuration.item.behavior.block.states.MultiStateBlock; import fr.robie.craftengineconverter.api.configuration.item.behavior.block.states.properties.BooleanBlockStateProperty; import fr.robie.craftengineconverter.api.configuration.item.models.ModelConfiguration; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/defaults/DirectionalBlockState.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/defaults/DirectionalBlockState.java index b37eae59..f2c735a5 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/defaults/DirectionalBlockState.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/defaults/DirectionalBlockState.java @@ -6,8 +6,8 @@ import fr.robie.craftengineconverter.api.configuration.item.models.ModelConfiguration; import fr.robie.craftengineconverter.api.enums.CraftEngineBlockState; import fr.robie.craftengineconverter.api.enums.Plugins; +import fr.robie.yamllibrary.ConfigurationSection; import net.momirealms.craftengine.core.util.Direction; -import org.bukkit.configuration.ConfigurationSection; import org.jetbrains.annotations.NotNull; import java.util.Locale; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/defaults/HorizontalFacingBlockState.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/defaults/HorizontalFacingBlockState.java index b36a711b..68d1005f 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/defaults/HorizontalFacingBlockState.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/defaults/HorizontalFacingBlockState.java @@ -7,7 +7,7 @@ import fr.robie.craftengineconverter.api.configuration.utils.HorizontalDirection; import fr.robie.craftengineconverter.api.enums.CraftEngineBlockState; import fr.robie.craftengineconverter.api.enums.Plugins; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; import java.util.Locale; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/defaults/PillarBlockState.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/defaults/PillarBlockState.java index 082bdaa3..df420841 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/defaults/PillarBlockState.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/defaults/PillarBlockState.java @@ -9,8 +9,8 @@ import fr.robie.craftengineconverter.api.configuration.item.models.model.SimpleModelConfiguration; import fr.robie.craftengineconverter.api.enums.CraftEngineBlockState; import fr.robie.craftengineconverter.api.enums.Plugins; +import fr.robie.yamllibrary.ConfigurationSection; import net.momirealms.craftengine.core.util.Direction; -import org.bukkit.configuration.ConfigurationSection; import org.jetbrains.annotations.NotNull; public class PillarBlockState extends MultiStateBlock { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/AnchorTypeBlockStateProperty.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/AnchorTypeBlockStateProperty.java index 6c4335db..413ab85f 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/AnchorTypeBlockStateProperty.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/AnchorTypeBlockStateProperty.java @@ -1,8 +1,8 @@ package fr.robie.craftengineconverter.api.configuration.item.behavior.block.states.properties; import fr.robie.craftengineconverter.api.configuration.item.behavior.block.states.BlockStateProperty; +import fr.robie.yamllibrary.ConfigurationSection; import net.momirealms.craftengine.core.block.property.type.AnchorType; -import org.bukkit.configuration.ConfigurationSection; import org.jetbrains.annotations.NotNull; import org.jspecify.annotations.NonNull; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/AxisBlockStateProperty.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/AxisBlockStateProperty.java index 1cff0427..58518690 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/AxisBlockStateProperty.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/AxisBlockStateProperty.java @@ -1,8 +1,8 @@ package fr.robie.craftengineconverter.api.configuration.item.behavior.block.states.properties; import fr.robie.craftengineconverter.api.configuration.item.behavior.block.states.BlockStateProperty; +import fr.robie.yamllibrary.ConfigurationSection; import net.momirealms.craftengine.core.util.Direction; -import org.bukkit.configuration.ConfigurationSection; import org.jetbrains.annotations.NotNull; import org.jspecify.annotations.NonNull; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/BooleanBlockStateProperty.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/BooleanBlockStateProperty.java index 1460c499..5353c51b 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/BooleanBlockStateProperty.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/BooleanBlockStateProperty.java @@ -1,7 +1,7 @@ package fr.robie.craftengineconverter.api.configuration.item.behavior.block.states.properties; import fr.robie.craftengineconverter.api.configuration.item.behavior.block.states.BlockStateProperty; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; public class BooleanBlockStateProperty implements BlockStateProperty { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/DirectionBlockStateProperty.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/DirectionBlockStateProperty.java index 60fed62a..d883c5f9 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/DirectionBlockStateProperty.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/DirectionBlockStateProperty.java @@ -1,8 +1,8 @@ package fr.robie.craftengineconverter.api.configuration.item.behavior.block.states.properties; import fr.robie.craftengineconverter.api.configuration.item.behavior.block.states.BlockStateProperty; +import fr.robie.yamllibrary.ConfigurationSection; import net.momirealms.craftengine.core.util.Direction; -import org.bukkit.configuration.ConfigurationSection; import org.jetbrains.annotations.NotNull; import java.util.Locale; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/DoubleBlockHalfBlockStateProperty.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/DoubleBlockHalfBlockStateProperty.java index c56e807c..05b781bf 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/DoubleBlockHalfBlockStateProperty.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/DoubleBlockHalfBlockStateProperty.java @@ -1,8 +1,8 @@ package fr.robie.craftengineconverter.api.configuration.item.behavior.block.states.properties; import fr.robie.craftengineconverter.api.configuration.item.behavior.block.states.BlockStateProperty; +import fr.robie.yamllibrary.ConfigurationSection; import net.momirealms.craftengine.core.block.property.type.DoubleBlockHalf; -import org.bukkit.configuration.ConfigurationSection; import org.jetbrains.annotations.NotNull; import org.jspecify.annotations.NonNull; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/HingeBlockStateProperty.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/HingeBlockStateProperty.java index aa0b079f..4fd138cb 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/HingeBlockStateProperty.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/HingeBlockStateProperty.java @@ -1,8 +1,8 @@ package fr.robie.craftengineconverter.api.configuration.item.behavior.block.states.properties; import fr.robie.craftengineconverter.api.configuration.item.behavior.block.states.BlockStateProperty; +import fr.robie.yamllibrary.ConfigurationSection; import org.bukkit.block.data.type.Door; -import org.bukkit.configuration.ConfigurationSection; import org.jetbrains.annotations.NotNull; import org.jspecify.annotations.NonNull; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/HorizontalDirectionBlockStateProperty.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/HorizontalDirectionBlockStateProperty.java index aa815fcf..ecb4bb00 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/HorizontalDirectionBlockStateProperty.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/HorizontalDirectionBlockStateProperty.java @@ -2,7 +2,7 @@ import fr.robie.craftengineconverter.api.configuration.item.behavior.block.states.BlockStateProperty; import fr.robie.craftengineconverter.api.configuration.utils.HorizontalDirection; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; import org.jspecify.annotations.NonNull; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/IntBlockStateProperty.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/IntBlockStateProperty.java index 04c5ad44..829ed33d 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/IntBlockStateProperty.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/IntBlockStateProperty.java @@ -1,7 +1,7 @@ package fr.robie.craftengineconverter.api.configuration.item.behavior.block.states.properties; import fr.robie.craftengineconverter.api.configuration.item.behavior.block.states.BlockStateProperty; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; import org.jspecify.annotations.NonNull; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/SingleBlockHalfBlockStateProperty.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/SingleBlockHalfBlockStateProperty.java index 8aaeba9d..d31cd54a 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/SingleBlockHalfBlockStateProperty.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/SingleBlockHalfBlockStateProperty.java @@ -1,8 +1,8 @@ package fr.robie.craftengineconverter.api.configuration.item.behavior.block.states.properties; import fr.robie.craftengineconverter.api.configuration.item.behavior.block.states.BlockStateProperty; +import fr.robie.yamllibrary.ConfigurationSection; import net.momirealms.craftengine.core.block.property.type.SingleBlockHalf; -import org.bukkit.configuration.ConfigurationSection; import org.jetbrains.annotations.NotNull; import org.jspecify.annotations.NonNull; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/SlabTypeBlockStateProperty.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/SlabTypeBlockStateProperty.java index d485a230..7c328f31 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/SlabTypeBlockStateProperty.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/SlabTypeBlockStateProperty.java @@ -1,8 +1,8 @@ package fr.robie.craftengineconverter.api.configuration.item.behavior.block.states.properties; import fr.robie.craftengineconverter.api.configuration.item.behavior.block.states.BlockStateProperty; +import fr.robie.yamllibrary.ConfigurationSection; import net.momirealms.craftengine.core.block.property.type.SlabType; -import org.bukkit.configuration.ConfigurationSection; import org.jetbrains.annotations.NotNull; import org.jspecify.annotations.NonNull; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/SofaShapeBlockStateProperty.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/SofaShapeBlockStateProperty.java index bf9cb334..68697271 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/SofaShapeBlockStateProperty.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/SofaShapeBlockStateProperty.java @@ -1,8 +1,8 @@ package fr.robie.craftengineconverter.api.configuration.item.behavior.block.states.properties; import fr.robie.craftengineconverter.api.configuration.item.behavior.block.states.BlockStateProperty; +import fr.robie.yamllibrary.ConfigurationSection; import net.momirealms.craftengine.core.block.property.type.SofaShape; -import org.bukkit.configuration.ConfigurationSection; import org.jetbrains.annotations.NotNull; import org.jspecify.annotations.NonNull; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/StairsShapeBlockStateProperty.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/StairsShapeBlockStateProperty.java index 47a43fbf..b88f0b0a 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/StairsShapeBlockStateProperty.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/StairsShapeBlockStateProperty.java @@ -1,8 +1,8 @@ package fr.robie.craftengineconverter.api.configuration.item.behavior.block.states.properties; import fr.robie.craftengineconverter.api.configuration.item.behavior.block.states.BlockStateProperty; +import fr.robie.yamllibrary.ConfigurationSection; import net.momirealms.craftengine.core.block.property.type.StairsShape; -import org.bukkit.configuration.ConfigurationSection; import org.jetbrains.annotations.NotNull; import org.jspecify.annotations.NonNull; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/StringBlockStateProperty.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/StringBlockStateProperty.java index bcbd3881..95e0e3cb 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/StringBlockStateProperty.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/StringBlockStateProperty.java @@ -1,7 +1,7 @@ package fr.robie.craftengineconverter.api.configuration.item.behavior.block.states.properties; import fr.robie.craftengineconverter.api.configuration.item.behavior.block.states.BlockStateProperty; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; import org.jspecify.annotations.NonNull; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/furniture/FurnitureConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/furniture/FurnitureConfiguration.java index f146d4df..10543334 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/furniture/FurnitureConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/furniture/FurnitureConfiguration.java @@ -3,8 +3,8 @@ import fr.robie.craftengineconverter.api.configuration.events.Event; import fr.robie.craftengineconverter.api.configuration.item.ItemConfigurationSerializable; import fr.robie.craftengineconverter.api.configuration.item.loottables.LootConfiguration; -import org.bukkit.configuration.ConfigurationSection; -import org.bukkit.configuration.file.YamlConfiguration; +import fr.robie.yamllibrary.ConfigurationSection; +import fr.robie.yamllibrary.file.YamlConfiguration; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/furniture/Placement.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/furniture/Placement.java index 172e41e9..0c48a01f 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/furniture/Placement.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/furniture/Placement.java @@ -2,7 +2,7 @@ import fr.robie.craftengineconverter.api.configuration.item.behavior.furniture.element.Element; import fr.robie.craftengineconverter.api.configuration.item.behavior.furniture.hitbox.Hitbox; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import java.util.ArrayList; import java.util.List; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/furniture/Rules.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/furniture/Rules.java index 70ca704e..1dff1b43 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/furniture/Rules.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/furniture/Rules.java @@ -1,7 +1,7 @@ package fr.robie.craftengineconverter.api.configuration.item.behavior.furniture; +import fr.robie.yamllibrary.ConfigurationSection; import net.momirealms.craftengine.core.entity.furniture.AlignmentRule; -import org.bukkit.configuration.ConfigurationSection; import org.jetbrains.annotations.NotNull; public class Rules { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/clientbounddata/OverwritableItemNameConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/clientbounddata/OverwritableItemNameConfiguration.java index f848ba6b..c8ac3475 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/clientbounddata/OverwritableItemNameConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/clientbounddata/OverwritableItemNameConfiguration.java @@ -1,8 +1,8 @@ package fr.robie.craftengineconverter.api.configuration.item.clientbounddata; import fr.robie.craftengineconverter.api.configuration.item.ItemConfigurationSerializable; -import org.bukkit.configuration.ConfigurationSection; -import org.bukkit.configuration.file.YamlConfiguration; +import fr.robie.yamllibrary.ConfigurationSection; +import fr.robie.yamllibrary.file.YamlConfiguration; import org.jetbrains.annotations.NotNull; public class OverwritableItemNameConfiguration implements ItemConfigurationSerializable { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/clientbounddata/OverwritableLoreConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/clientbounddata/OverwritableLoreConfiguration.java index 6eec27b7..60a33b88 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/clientbounddata/OverwritableLoreConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/clientbounddata/OverwritableLoreConfiguration.java @@ -1,8 +1,8 @@ package fr.robie.craftengineconverter.api.configuration.item.clientbounddata; import fr.robie.craftengineconverter.api.configuration.item.ItemConfigurationSerializable; -import org.bukkit.configuration.ConfigurationSection; -import org.bukkit.configuration.file.YamlConfiguration; +import fr.robie.yamllibrary.ConfigurationSection; +import fr.robie.yamllibrary.file.YamlConfiguration; import org.jetbrains.annotations.NotNull; import java.util.List; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/AttackRangeConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/AttackRangeConfiguration.java index e5c26ebb..94a2d55f 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/AttackRangeConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/AttackRangeConfiguration.java @@ -3,8 +3,8 @@ import com.google.gson.JsonObject; import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.component.BedrockComponent; import fr.robie.craftengineconverter.api.configuration.item.ItemConfigurationSerializable; -import org.bukkit.configuration.ConfigurationSection; -import org.bukkit.configuration.file.YamlConfiguration; +import fr.robie.yamllibrary.ConfigurationSection; +import fr.robie.yamllibrary.file.YamlConfiguration; import org.jetbrains.annotations.NotNull; public class AttackRangeConfiguration implements ItemConfigurationSerializable, BedrockComponent { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/BlocksAttacksConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/BlocksAttacksConfiguration.java index 011de5cb..d8550dc9 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/BlocksAttacksConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/BlocksAttacksConfiguration.java @@ -1,8 +1,8 @@ package fr.robie.craftengineconverter.api.configuration.item.components; import fr.robie.craftengineconverter.api.configuration.item.ItemConfigurationSerializable; -import org.bukkit.configuration.ConfigurationSection; -import org.bukkit.configuration.file.YamlConfiguration; +import fr.robie.yamllibrary.ConfigurationSection; +import fr.robie.yamllibrary.file.YamlConfiguration; import org.jetbrains.annotations.NotNull; import java.util.List; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/BreakSoundConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/BreakSoundConfiguration.java index 133e4664..7585dadd 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/BreakSoundConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/BreakSoundConfiguration.java @@ -1,8 +1,8 @@ package fr.robie.craftengineconverter.api.configuration.item.components; import fr.robie.craftengineconverter.api.configuration.item.ItemConfigurationSerializable; -import org.bukkit.configuration.ConfigurationSection; -import org.bukkit.configuration.file.YamlConfiguration; +import fr.robie.yamllibrary.ConfigurationSection; +import fr.robie.yamllibrary.file.YamlConfiguration; import org.jetbrains.annotations.NotNull; public class BreakSoundConfiguration implements ItemConfigurationSerializable { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/CanBreakConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/CanBreakConfiguration.java index c331effb..c697c834 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/CanBreakConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/CanBreakConfiguration.java @@ -2,8 +2,8 @@ import fr.robie.craftengineconverter.api.configuration.item.ItemConfigurationSerializable; import fr.robie.craftengineconverter.api.configuration.utils.BlockPredicateConfiguration; -import org.bukkit.configuration.ConfigurationSection; -import org.bukkit.configuration.file.YamlConfiguration; +import fr.robie.yamllibrary.ConfigurationSection; +import fr.robie.yamllibrary.file.YamlConfiguration; import org.jetbrains.annotations.NotNull; import java.util.List; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/CanPlaceOnConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/CanPlaceOnConfiguration.java index 788f436d..a3221597 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/CanPlaceOnConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/CanPlaceOnConfiguration.java @@ -2,8 +2,8 @@ import fr.robie.craftengineconverter.api.configuration.item.ItemConfigurationSerializable; import fr.robie.craftengineconverter.api.configuration.utils.BlockPredicateConfiguration; -import org.bukkit.configuration.ConfigurationSection; -import org.bukkit.configuration.file.YamlConfiguration; +import fr.robie.yamllibrary.ConfigurationSection; +import fr.robie.yamllibrary.file.YamlConfiguration; import org.jetbrains.annotations.NotNull; import java.util.List; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/ConsumableConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/ConsumableConfiguration.java index ea224f52..7e53bd85 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/ConsumableConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/ConsumableConfiguration.java @@ -5,12 +5,11 @@ import fr.robie.craftengineconverter.api.configuration.item.AbstractEffectsConfiguration; import fr.robie.craftengineconverter.api.enums.item.component.ConsumableAnimation; import fr.robie.craftengineconverter.api.utils.item.component.ConsumeEffect; -import org.bukkit.configuration.ConfigurationSection; -import org.bukkit.configuration.file.YamlConfiguration; +import fr.robie.yamllibrary.ConfigurationSection; +import fr.robie.yamllibrary.file.YamlConfiguration; import org.jetbrains.annotations.NotNull; import java.util.List; -import java.util.Locale; public class ConsumableConfiguration extends AbstractEffectsConfiguration implements BedrockComponent { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/CustomDataConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/CustomDataConfiguration.java index 80cae095..f9509ad1 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/CustomDataConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/CustomDataConfiguration.java @@ -1,8 +1,8 @@ package fr.robie.craftengineconverter.api.configuration.item.components; import fr.robie.craftengineconverter.api.configuration.item.ItemConfigurationSerializable; -import org.bukkit.configuration.ConfigurationSection; -import org.bukkit.configuration.file.YamlConfiguration; +import fr.robie.yamllibrary.ConfigurationSection; +import fr.robie.yamllibrary.file.YamlConfiguration; import org.jetbrains.annotations.NotNull; import java.util.List; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/DamageResistantConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/DamageResistantConfiguration.java index 216d87ff..9b457724 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/DamageResistantConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/DamageResistantConfiguration.java @@ -1,8 +1,8 @@ package fr.robie.craftengineconverter.api.configuration.item.components; import fr.robie.craftengineconverter.api.configuration.item.ItemConfigurationSerializable; -import org.bukkit.configuration.ConfigurationSection; -import org.bukkit.configuration.file.YamlConfiguration; +import fr.robie.yamllibrary.ConfigurationSection; +import fr.robie.yamllibrary.file.YamlConfiguration; import org.jetbrains.annotations.NotNull; public class DamageResistantConfiguration implements ItemConfigurationSerializable { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/DamageTypeConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/DamageTypeConfiguration.java index 9eb5517b..9287f5aa 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/DamageTypeConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/DamageTypeConfiguration.java @@ -1,8 +1,8 @@ package fr.robie.craftengineconverter.api.configuration.item.components; import fr.robie.craftengineconverter.api.configuration.item.ItemConfigurationSerializable; -import org.bukkit.configuration.ConfigurationSection; -import org.bukkit.configuration.file.YamlConfiguration; +import fr.robie.yamllibrary.ConfigurationSection; +import fr.robie.yamllibrary.file.YamlConfiguration; import org.jetbrains.annotations.NotNull; public class DamageTypeConfiguration implements ItemConfigurationSerializable { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/DeathProtectionConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/DeathProtectionConfiguration.java index 4ef74753..8b7f389f 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/DeathProtectionConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/DeathProtectionConfiguration.java @@ -2,8 +2,8 @@ import fr.robie.craftengineconverter.api.configuration.item.AbstractEffectsConfiguration; import fr.robie.craftengineconverter.api.utils.item.component.ConsumeEffect; -import org.bukkit.configuration.ConfigurationSection; -import org.bukkit.configuration.file.YamlConfiguration; +import fr.robie.yamllibrary.ConfigurationSection; +import fr.robie.yamllibrary.file.YamlConfiguration; import org.jetbrains.annotations.NotNull; import java.util.ArrayList; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/EnchantableConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/EnchantableConfiguration.java index 0def9d02..9ee5b7ff 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/EnchantableConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/EnchantableConfiguration.java @@ -3,8 +3,8 @@ import com.google.gson.JsonObject; import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.component.BedrockComponent; import fr.robie.craftengineconverter.api.configuration.item.ItemConfigurationSerializable; -import org.bukkit.configuration.ConfigurationSection; -import org.bukkit.configuration.file.YamlConfiguration; +import fr.robie.yamllibrary.ConfigurationSection; +import fr.robie.yamllibrary.file.YamlConfiguration; import org.jetbrains.annotations.NotNull; public class EnchantableConfiguration implements ItemConfigurationSerializable, BedrockComponent { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/EnchantmentGlintOverrideConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/EnchantmentGlintOverrideConfiguration.java index f8e0c589..6e3fbf80 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/EnchantmentGlintOverrideConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/EnchantmentGlintOverrideConfiguration.java @@ -3,8 +3,8 @@ import com.google.gson.JsonObject; import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.component.BedrockComponent; import fr.robie.craftengineconverter.api.configuration.item.ItemConfigurationSerializable; -import org.bukkit.configuration.ConfigurationSection; -import org.bukkit.configuration.file.YamlConfiguration; +import fr.robie.yamllibrary.ConfigurationSection; +import fr.robie.yamllibrary.file.YamlConfiguration; import org.jetbrains.annotations.NotNull; public class EnchantmentGlintOverrideConfiguration implements ItemConfigurationSerializable, BedrockComponent { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/FoodConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/FoodConfiguration.java index 68801649..2395e998 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/FoodConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/FoodConfiguration.java @@ -3,8 +3,8 @@ import com.google.gson.JsonObject; import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.component.BedrockComponent; import fr.robie.craftengineconverter.api.configuration.item.ItemConfigurationSerializable; -import org.bukkit.configuration.ConfigurationSection; -import org.bukkit.configuration.file.YamlConfiguration; +import fr.robie.yamllibrary.ConfigurationSection; +import fr.robie.yamllibrary.file.YamlConfiguration; import org.jetbrains.annotations.NotNull; public class FoodConfiguration implements ItemConfigurationSerializable, BedrockComponent { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/GliderConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/GliderConfiguration.java index c134a1f6..3b9e17c7 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/GliderConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/GliderConfiguration.java @@ -1,8 +1,8 @@ package fr.robie.craftengineconverter.api.configuration.item.components; import fr.robie.craftengineconverter.api.configuration.item.ItemConfigurationSerializable; -import org.bukkit.configuration.ConfigurationSection; -import org.bukkit.configuration.file.YamlConfiguration; +import fr.robie.yamllibrary.ConfigurationSection; +import fr.robie.yamllibrary.file.YamlConfiguration; import org.jetbrains.annotations.NotNull; public class GliderConfiguration implements ItemConfigurationSerializable { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/HideTooltipDisplayConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/HideTooltipDisplayConfiguration.java index 8a41ab8b..93fee1be 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/HideTooltipDisplayConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/HideTooltipDisplayConfiguration.java @@ -1,8 +1,8 @@ package fr.robie.craftengineconverter.api.configuration.item.components; import fr.robie.craftengineconverter.api.configuration.item.ItemConfigurationSerializable; -import org.bukkit.configuration.ConfigurationSection; -import org.bukkit.configuration.file.YamlConfiguration; +import fr.robie.yamllibrary.ConfigurationSection; +import fr.robie.yamllibrary.file.YamlConfiguration; import org.jetbrains.annotations.NotNull; public class HideTooltipDisplayConfiguration implements ItemConfigurationSerializable { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/ItemModelConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/ItemModelConfiguration.java index 0bac9cdb..6ab9d010 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/ItemModelConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/ItemModelConfiguration.java @@ -1,8 +1,8 @@ package fr.robie.craftengineconverter.api.configuration.item.components; import fr.robie.craftengineconverter.api.configuration.item.ItemConfigurationSerializable; -import org.bukkit.configuration.ConfigurationSection; -import org.bukkit.configuration.file.YamlConfiguration; +import fr.robie.yamllibrary.ConfigurationSection; +import fr.robie.yamllibrary.file.YamlConfiguration; import org.jetbrains.annotations.NotNull; public class ItemModelConfiguration implements ItemConfigurationSerializable { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/JukeboxPlayableConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/JukeboxPlayableConfiguration.java index 298cd08d..f8e1468f 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/JukeboxPlayableConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/JukeboxPlayableConfiguration.java @@ -1,8 +1,8 @@ package fr.robie.craftengineconverter.api.configuration.item.components; import fr.robie.craftengineconverter.api.configuration.item.ItemConfigurationSerializable; -import org.bukkit.configuration.ConfigurationSection; -import org.bukkit.configuration.file.YamlConfiguration; +import fr.robie.yamllibrary.ConfigurationSection; +import fr.robie.yamllibrary.file.YamlConfiguration; import org.jetbrains.annotations.NotNull; public class JukeboxPlayableConfiguration implements ItemConfigurationSerializable { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/KineticWeaponConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/KineticWeaponConfiguration.java index d4362ade..d3ee4048 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/KineticWeaponConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/KineticWeaponConfiguration.java @@ -3,8 +3,8 @@ import com.google.gson.JsonObject; import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.component.BedrockComponent; import fr.robie.craftengineconverter.api.configuration.item.ItemConfigurationSerializable; -import org.bukkit.configuration.ConfigurationSection; -import org.bukkit.configuration.file.YamlConfiguration; +import fr.robie.yamllibrary.ConfigurationSection; +import fr.robie.yamllibrary.file.YamlConfiguration; import org.jetbrains.annotations.NotNull; public class KineticWeaponConfiguration implements ItemConfigurationSerializable, BedrockComponent { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/MaxDamageComponent.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/MaxDamageComponent.java index 1a221718..b961c61b 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/MaxDamageComponent.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/MaxDamageComponent.java @@ -3,8 +3,8 @@ import com.google.gson.JsonObject; import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.component.BedrockComponent; import fr.robie.craftengineconverter.api.configuration.item.ItemConfigurationSerializable; -import org.bukkit.configuration.ConfigurationSection; -import org.bukkit.configuration.file.YamlConfiguration; +import fr.robie.yamllibrary.ConfigurationSection; +import fr.robie.yamllibrary.file.YamlConfiguration; import org.jetbrains.annotations.NotNull; public class MaxDamageComponent implements ItemConfigurationSerializable, BedrockComponent { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/MaxStackSizeConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/MaxStackSizeConfiguration.java index e9a59ed2..76cd8fa0 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/MaxStackSizeConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/MaxStackSizeConfiguration.java @@ -3,8 +3,8 @@ import com.google.gson.JsonObject; import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.component.BedrockComponent; import fr.robie.craftengineconverter.api.configuration.item.ItemConfigurationSerializable; -import org.bukkit.configuration.ConfigurationSection; -import org.bukkit.configuration.file.YamlConfiguration; +import fr.robie.yamllibrary.ConfigurationSection; +import fr.robie.yamllibrary.file.YamlConfiguration; import org.jetbrains.annotations.NotNull; public class MaxStackSizeConfiguration implements ItemConfigurationSerializable, BedrockComponent { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/MinimumAttackChargeConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/MinimumAttackChargeConfiguration.java index b5084bd0..dd602a52 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/MinimumAttackChargeConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/MinimumAttackChargeConfiguration.java @@ -1,8 +1,8 @@ package fr.robie.craftengineconverter.api.configuration.item.components; import fr.robie.craftengineconverter.api.configuration.item.ItemConfigurationSerializable; -import org.bukkit.configuration.ConfigurationSection; -import org.bukkit.configuration.file.YamlConfiguration; +import fr.robie.yamllibrary.ConfigurationSection; +import fr.robie.yamllibrary.file.YamlConfiguration; import org.jetbrains.annotations.NotNull; public class MinimumAttackChargeConfiguration implements ItemConfigurationSerializable { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/PaintingVariantConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/PaintingVariantConfiguration.java index 68dc5841..db983b53 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/PaintingVariantConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/PaintingVariantConfiguration.java @@ -1,8 +1,8 @@ package fr.robie.craftengineconverter.api.configuration.item.components; import fr.robie.craftengineconverter.api.configuration.item.ItemConfigurationSerializable; -import org.bukkit.configuration.ConfigurationSection; -import org.bukkit.configuration.file.YamlConfiguration; +import fr.robie.yamllibrary.ConfigurationSection; +import fr.robie.yamllibrary.file.YamlConfiguration; import org.jetbrains.annotations.NotNull; public class PaintingVariantConfiguration implements ItemConfigurationSerializable { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/PiercingWeaponConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/PiercingWeaponConfiguration.java index 0aa99007..36eca184 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/PiercingWeaponConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/PiercingWeaponConfiguration.java @@ -3,8 +3,8 @@ import com.google.gson.JsonObject; import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.component.BedrockComponent; import fr.robie.craftengineconverter.api.configuration.item.ItemConfigurationSerializable; -import org.bukkit.configuration.ConfigurationSection; -import org.bukkit.configuration.file.YamlConfiguration; +import fr.robie.yamllibrary.ConfigurationSection; +import fr.robie.yamllibrary.file.YamlConfiguration; import org.jetbrains.annotations.NotNull; public class PiercingWeaponConfiguration implements ItemConfigurationSerializable, BedrockComponent { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/PlayerProfileConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/PlayerProfileConfiguration.java index b6db4343..a82681ec 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/PlayerProfileConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/PlayerProfileConfiguration.java @@ -1,8 +1,8 @@ package fr.robie.craftengineconverter.api.configuration.item.components; import fr.robie.craftengineconverter.api.configuration.item.ItemConfigurationSerializable; -import org.bukkit.configuration.ConfigurationSection; -import org.bukkit.configuration.file.YamlConfiguration; +import fr.robie.yamllibrary.ConfigurationSection; +import fr.robie.yamllibrary.file.YamlConfiguration; import org.jetbrains.annotations.NotNull; import java.util.ArrayList; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/SwingAnimationConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/SwingAnimationConfiguration.java index b5b4e5f4..8ec9f4ef 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/SwingAnimationConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/SwingAnimationConfiguration.java @@ -3,8 +3,8 @@ import com.google.gson.JsonObject; import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.component.BedrockComponent; import fr.robie.craftengineconverter.api.configuration.item.ItemConfigurationSerializable; -import org.bukkit.configuration.ConfigurationSection; -import org.bukkit.configuration.file.YamlConfiguration; +import fr.robie.yamllibrary.ConfigurationSection; +import fr.robie.yamllibrary.file.YamlConfiguration; import org.jetbrains.annotations.NotNull; import java.util.Locale; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/ToolConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/ToolConfiguration.java index 85b0e0ad..57a91c99 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/ToolConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/ToolConfiguration.java @@ -3,8 +3,8 @@ import com.google.gson.JsonObject; import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.component.BedrockComponent; import fr.robie.craftengineconverter.api.configuration.item.ItemConfigurationSerializable; -import org.bukkit.configuration.ConfigurationSection; -import org.bukkit.configuration.file.YamlConfiguration; +import fr.robie.yamllibrary.ConfigurationSection; +import fr.robie.yamllibrary.file.YamlConfiguration; import org.jetbrains.annotations.NotNull; import java.util.ArrayList; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/TooltipDisplayConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/TooltipDisplayConfiguration.java index 6bf61291..b77dfefe 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/TooltipDisplayConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/TooltipDisplayConfiguration.java @@ -1,8 +1,8 @@ package fr.robie.craftengineconverter.api.configuration.item.components; import fr.robie.craftengineconverter.api.configuration.item.ItemConfigurationSerializable; -import org.bukkit.configuration.ConfigurationSection; -import org.bukkit.configuration.file.YamlConfiguration; +import fr.robie.yamllibrary.ConfigurationSection; +import fr.robie.yamllibrary.file.YamlConfiguration; import org.jetbrains.annotations.NotNull; import java.util.List; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/UseCooldownConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/UseCooldownConfiguration.java index 81cd5c64..39853ea6 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/UseCooldownConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/UseCooldownConfiguration.java @@ -3,8 +3,8 @@ import com.google.gson.JsonObject; import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.component.BedrockComponent; import fr.robie.craftengineconverter.api.configuration.item.ItemConfigurationSerializable; -import org.bukkit.configuration.ConfigurationSection; -import org.bukkit.configuration.file.YamlConfiguration; +import fr.robie.yamllibrary.ConfigurationSection; +import fr.robie.yamllibrary.file.YamlConfiguration; import org.jetbrains.annotations.NotNull; public class UseCooldownConfiguration implements ItemConfigurationSerializable, BedrockComponent { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/UseEffectsConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/UseEffectsConfiguration.java index db219f16..eb1bc679 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/UseEffectsConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/UseEffectsConfiguration.java @@ -3,8 +3,8 @@ import com.google.gson.JsonObject; import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.component.BedrockComponent; import fr.robie.craftengineconverter.api.configuration.item.ItemConfigurationSerializable; -import org.bukkit.configuration.ConfigurationSection; -import org.bukkit.configuration.file.YamlConfiguration; +import fr.robie.yamllibrary.ConfigurationSection; +import fr.robie.yamllibrary.file.YamlConfiguration; import org.jetbrains.annotations.NotNull; public class UseEffectsConfiguration implements ItemConfigurationSerializable, BedrockComponent { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/UseRemainderConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/UseRemainderConfiguration.java index ed5d40f8..eae3edb3 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/UseRemainderConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/UseRemainderConfiguration.java @@ -1,8 +1,8 @@ package fr.robie.craftengineconverter.api.configuration.item.components; import fr.robie.craftengineconverter.api.configuration.item.ItemConfigurationSerializable; -import org.bukkit.configuration.ConfigurationSection; -import org.bukkit.configuration.file.YamlConfiguration; +import fr.robie.yamllibrary.ConfigurationSection; +import fr.robie.yamllibrary.file.YamlConfiguration; import org.jetbrains.annotations.NotNull; public class UseRemainderConfiguration implements ItemConfigurationSerializable { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/WeaponConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/WeaponConfiguration.java index d47645b8..0819b20e 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/WeaponConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/WeaponConfiguration.java @@ -1,8 +1,8 @@ package fr.robie.craftengineconverter.api.configuration.item.components; import fr.robie.craftengineconverter.api.configuration.item.ItemConfigurationSerializable; -import org.bukkit.configuration.ConfigurationSection; -import org.bukkit.configuration.file.YamlConfiguration; +import fr.robie.yamllibrary.ConfigurationSection; +import fr.robie.yamllibrary.file.YamlConfiguration; import org.jetbrains.annotations.NotNull; public class WeaponConfiguration implements ItemConfigurationSerializable { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/AttributeModifiersConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/AttributeModifiersConfiguration.java index 045c48ef..949d76e2 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/AttributeModifiersConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/AttributeModifiersConfiguration.java @@ -1,8 +1,8 @@ package fr.robie.craftengineconverter.api.configuration.item.data; import fr.robie.craftengineconverter.api.configuration.item.ItemConfigurationSerializable; -import org.bukkit.configuration.ConfigurationSection; -import org.bukkit.configuration.file.YamlConfiguration; +import fr.robie.yamllibrary.ConfigurationSection; +import fr.robie.yamllibrary.file.YamlConfiguration; import org.jetbrains.annotations.NotNull; import java.util.*; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/BlockStateConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/BlockStateConfiguration.java index 51a3382b..286c50f1 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/BlockStateConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/BlockStateConfiguration.java @@ -1,8 +1,8 @@ package fr.robie.craftengineconverter.api.configuration.item.data; import fr.robie.craftengineconverter.api.configuration.item.ItemConfigurationSerializable; -import org.bukkit.configuration.ConfigurationSection; -import org.bukkit.configuration.file.YamlConfiguration; +import fr.robie.yamllibrary.ConfigurationSection; +import fr.robie.yamllibrary.file.YamlConfiguration; import org.jetbrains.annotations.NotNull; import java.util.Map; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/CustomModelDataConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/CustomModelDataConfiguration.java index 56b0fcc4..4cfbedb9 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/CustomModelDataConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/CustomModelDataConfiguration.java @@ -1,8 +1,8 @@ package fr.robie.craftengineconverter.api.configuration.item.data; import fr.robie.craftengineconverter.api.configuration.item.ItemConfigurationSerializable; -import org.bukkit.configuration.ConfigurationSection; -import org.bukkit.configuration.file.YamlConfiguration; +import fr.robie.yamllibrary.ConfigurationSection; +import fr.robie.yamllibrary.file.YamlConfiguration; import org.jetbrains.annotations.NotNull; public class CustomModelDataConfiguration implements ItemConfigurationSerializable { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/CustomNameConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/CustomNameConfiguration.java index d20ae439..4458706f 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/CustomNameConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/CustomNameConfiguration.java @@ -1,8 +1,8 @@ package fr.robie.craftengineconverter.api.configuration.item.data; import fr.robie.craftengineconverter.api.configuration.item.ItemConfigurationSerializable; -import org.bukkit.configuration.ConfigurationSection; -import org.bukkit.configuration.file.YamlConfiguration; +import fr.robie.yamllibrary.ConfigurationSection; +import fr.robie.yamllibrary.file.YamlConfiguration; import org.jetbrains.annotations.NotNull; public class CustomNameConfiguration implements ItemConfigurationSerializable { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/DyedColorConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/DyedColorConfiguration.java index 0113c356..a54fb717 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/DyedColorConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/DyedColorConfiguration.java @@ -1,9 +1,9 @@ package fr.robie.craftengineconverter.api.configuration.item.data; import fr.robie.craftengineconverter.api.configuration.item.ItemConfigurationSerializable; +import fr.robie.yamllibrary.ConfigurationSection; import org.bukkit.DyeColor; -import org.bukkit.configuration.ConfigurationSection; -import org.bukkit.configuration.file.YamlConfiguration; +import fr.robie.yamllibrary.file.YamlConfiguration; import org.jetbrains.annotations.NotNull; import java.util.Locale; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/EnchantmentConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/EnchantmentConfiguration.java index d78789ed..a46de033 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/EnchantmentConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/EnchantmentConfiguration.java @@ -2,8 +2,8 @@ import fr.robie.craftengineconverter.api.configuration.item.ItemConfigurationSerializable; import fr.robie.craftengineconverter.api.utils.EnchantmentCompatibility; -import org.bukkit.configuration.ConfigurationSection; -import org.bukkit.configuration.file.YamlConfiguration; +import fr.robie.yamllibrary.ConfigurationSection; +import fr.robie.yamllibrary.file.YamlConfiguration; import org.jetbrains.annotations.NotNull; import java.util.HashMap; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/HideTooltipConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/HideTooltipConfiguration.java index db8568cd..293209c7 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/HideTooltipConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/HideTooltipConfiguration.java @@ -2,8 +2,8 @@ import fr.robie.craftengineconverter.api.configuration.item.ItemConfigurationSerializable; import fr.robie.craftengineconverter.api.enums.ComponentFlag; -import org.bukkit.configuration.ConfigurationSection; -import org.bukkit.configuration.file.YamlConfiguration; +import fr.robie.yamllibrary.ConfigurationSection; +import fr.robie.yamllibrary.file.YamlConfiguration; import org.jetbrains.annotations.NotNull; import java.util.*; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/ItemNameConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/ItemNameConfiguration.java index b260dbe8..f3496421 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/ItemNameConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/ItemNameConfiguration.java @@ -1,8 +1,8 @@ package fr.robie.craftengineconverter.api.configuration.item.data; import fr.robie.craftengineconverter.api.configuration.item.AbstractItemConfiguration; -import org.bukkit.configuration.ConfigurationSection; -import org.bukkit.configuration.file.YamlConfiguration; +import fr.robie.yamllibrary.ConfigurationSection; +import fr.robie.yamllibrary.file.YamlConfiguration; import org.jetbrains.annotations.NotNull; public class ItemNameConfiguration extends AbstractItemConfiguration { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/MaxDamageConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/MaxDamageConfiguration.java index 96268b46..b0920e9f 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/MaxDamageConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/MaxDamageConfiguration.java @@ -1,8 +1,8 @@ package fr.robie.craftengineconverter.api.configuration.item.data; import fr.robie.craftengineconverter.api.configuration.item.ItemConfigurationSerializable; -import org.bukkit.configuration.ConfigurationSection; -import org.bukkit.configuration.file.YamlConfiguration; +import fr.robie.yamllibrary.ConfigurationSection; +import fr.robie.yamllibrary.file.YamlConfiguration; import org.jetbrains.annotations.NotNull; public class MaxDamageConfiguration implements ItemConfigurationSerializable { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/TooltipStyleConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/TooltipStyleConfiguration.java index eb9ae99d..8eb10aa8 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/TooltipStyleConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/TooltipStyleConfiguration.java @@ -1,9 +1,9 @@ package fr.robie.craftengineconverter.api.configuration.item.data; import fr.robie.craftengineconverter.api.configuration.item.ItemConfigurationSerializable; +import fr.robie.yamllibrary.ConfigurationSection; +import fr.robie.yamllibrary.file.YamlConfiguration; import org.bukkit.NamespacedKey; -import org.bukkit.configuration.ConfigurationSection; -import org.bukkit.configuration.file.YamlConfiguration; import org.jetbrains.annotations.NotNull; public class TooltipStyleConfiguration implements ItemConfigurationSerializable { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/UnbreakableConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/UnbreakableConfiguration.java index 909d69b5..934eb30e 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/UnbreakableConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/UnbreakableConfiguration.java @@ -1,8 +1,8 @@ package fr.robie.craftengineconverter.api.configuration.item.data; import fr.robie.craftengineconverter.api.configuration.item.ItemConfigurationSerializable; -import org.bukkit.configuration.ConfigurationSection; -import org.bukkit.configuration.file.YamlConfiguration; +import fr.robie.yamllibrary.ConfigurationSection; +import fr.robie.yamllibrary.file.YamlConfiguration; import org.jetbrains.annotations.NotNull; public class UnbreakableConfiguration implements ItemConfigurationSerializable { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/loottables/LootPool.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/loottables/LootPool.java index 991f5516..815c6578 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/loottables/LootPool.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/loottables/LootPool.java @@ -4,7 +4,7 @@ import fr.robie.craftengineconverter.api.configuration.item.loottables.entries.LootEntry; import fr.robie.craftengineconverter.api.configuration.item.loottables.functions.LootFunction; import fr.robie.craftengineconverter.api.utils.ConfigurationSerializationUtils; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; import java.util.ArrayList; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/loottables/LootTable.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/loottables/LootTable.java index d2cdbbd6..8a54a449 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/loottables/LootTable.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/loottables/LootTable.java @@ -2,7 +2,7 @@ import fr.robie.craftengineconverter.api.configuration.item.loottables.functions.LootFunction; import fr.robie.craftengineconverter.api.utils.ConfigurationSerializationUtils; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; import java.util.ArrayList; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/loottables/entries/AbstractLootEntry.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/loottables/entries/AbstractLootEntry.java index fb36fd9c..9d02024b 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/loottables/entries/AbstractLootEntry.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/loottables/entries/AbstractLootEntry.java @@ -3,7 +3,7 @@ import fr.robie.craftengineconverter.api.configuration.conditions.Condition; import fr.robie.craftengineconverter.api.configuration.item.loottables.functions.LootFunction; import fr.robie.craftengineconverter.api.utils.ConfigurationSerializationUtils; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; import java.util.ArrayList; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/loottables/entries/AlternativesEntry.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/loottables/entries/AlternativesEntry.java index e87ccda1..d7778423 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/loottables/entries/AlternativesEntry.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/loottables/entries/AlternativesEntry.java @@ -1,7 +1,7 @@ package fr.robie.craftengineconverter.api.configuration.item.loottables.entries; import fr.robie.craftengineconverter.api.utils.ConfigurationSerializationUtils; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; import java.util.ArrayList; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/loottables/entries/ExpEntry.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/loottables/entries/ExpEntry.java index b77adae1..1a2668d0 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/loottables/entries/ExpEntry.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/loottables/entries/ExpEntry.java @@ -1,6 +1,6 @@ package fr.robie.craftengineconverter.api.configuration.item.loottables.entries; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; import java.util.Objects; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/loottables/entries/FurnitureItemEntry.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/loottables/entries/FurnitureItemEntry.java index 4e7e462e..2a8f531f 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/loottables/entries/FurnitureItemEntry.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/loottables/entries/FurnitureItemEntry.java @@ -1,6 +1,6 @@ package fr.robie.craftengineconverter.api.configuration.item.loottables.entries; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; import java.util.Objects; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/loottables/entries/ItemEntry.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/loottables/entries/ItemEntry.java index 795fc179..abfd287c 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/loottables/entries/ItemEntry.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/loottables/entries/ItemEntry.java @@ -1,6 +1,6 @@ package fr.robie.craftengineconverter.api.configuration.item.loottables.entries; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; import java.util.Objects; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/loottables/formulas/AbstractLootFormula.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/loottables/formulas/AbstractLootFormula.java index 055ce019..80f8550d 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/loottables/formulas/AbstractLootFormula.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/loottables/formulas/AbstractLootFormula.java @@ -1,6 +1,6 @@ package fr.robie.craftengineconverter.api.configuration.item.loottables.formulas; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; public abstract class AbstractLootFormula implements LootFormula { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/loottables/formulas/BinomialWithBonusCountFormula.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/loottables/formulas/BinomialWithBonusCountFormula.java index ecfd9f42..ce3cd6fa 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/loottables/formulas/BinomialWithBonusCountFormula.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/loottables/formulas/BinomialWithBonusCountFormula.java @@ -1,6 +1,6 @@ package fr.robie.craftengineconverter.api.configuration.item.loottables.formulas; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; public class BinomialWithBonusCountFormula extends AbstractLootFormula { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/loottables/functions/AbstractLootFunction.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/loottables/functions/AbstractLootFunction.java index 637f8f0a..2fd73032 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/loottables/functions/AbstractLootFunction.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/loottables/functions/AbstractLootFunction.java @@ -2,7 +2,7 @@ import fr.robie.craftengineconverter.api.configuration.conditions.Condition; import fr.robie.craftengineconverter.api.utils.ConfigurationSerializationUtils; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; import java.util.ArrayList; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/loottables/functions/ApplyBonusFunction.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/loottables/functions/ApplyBonusFunction.java index cfd0bb37..7c9fabd2 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/loottables/functions/ApplyBonusFunction.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/loottables/functions/ApplyBonusFunction.java @@ -2,7 +2,7 @@ import fr.robie.craftengineconverter.api.configuration.item.loottables.formulas.LootFormula; import fr.robie.craftengineconverter.api.utils.ConfigurationSerializationUtils; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; import java.util.Objects; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/loottables/functions/ApplyDataFunction.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/loottables/functions/ApplyDataFunction.java index 3f5d59d9..a55fddb1 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/loottables/functions/ApplyDataFunction.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/loottables/functions/ApplyDataFunction.java @@ -1,6 +1,6 @@ package fr.robie.craftengineconverter.api.configuration.item.loottables.functions; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; import java.util.Map; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/loottables/functions/DropExpFunction.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/loottables/functions/DropExpFunction.java index 932c488b..d82d7c6e 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/loottables/functions/DropExpFunction.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/loottables/functions/DropExpFunction.java @@ -1,6 +1,6 @@ package fr.robie.craftengineconverter.api.configuration.item.loottables.functions; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; import java.util.Objects; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/loottables/functions/LimitCountFunction.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/loottables/functions/LimitCountFunction.java index 18477cf9..d55da717 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/loottables/functions/LimitCountFunction.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/loottables/functions/LimitCountFunction.java @@ -1,6 +1,6 @@ package fr.robie.craftengineconverter.api.configuration.item.loottables.functions; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; public class LimitCountFunction extends AbstractLootFunction { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/loottables/functions/SetCountFunction.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/loottables/functions/SetCountFunction.java index 5c395859..85921b35 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/loottables/functions/SetCountFunction.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/loottables/functions/SetCountFunction.java @@ -1,6 +1,6 @@ package fr.robie.craftengineconverter.api.configuration.item.loottables.functions; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; import java.util.Objects; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/ModelConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/ModelConfiguration.java index dab4a16a..a4bb367c 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/ModelConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/ModelConfiguration.java @@ -1,7 +1,7 @@ package fr.robie.craftengineconverter.api.configuration.item.models; import fr.robie.craftengineconverter.api.configuration.SectionSerializable; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.Contract; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/composite/CompositeModelConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/composite/CompositeModelConfiguration.java index 03038c95..c96ff731 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/composite/CompositeModelConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/composite/CompositeModelConfiguration.java @@ -2,7 +2,7 @@ import fr.robie.craftengineconverter.api.configuration.item.models.ModelConfiguration; import fr.robie.craftengineconverter.api.utils.ConfigurationSerializationUtils; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; import java.util.ArrayList; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/condition/ComponentConditionConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/condition/ComponentConditionConfiguration.java index 80300556..3739513a 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/condition/ComponentConditionConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/condition/ComponentConditionConfiguration.java @@ -1,6 +1,6 @@ package fr.robie.craftengineconverter.api.configuration.item.models.condition; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; public class ComponentConditionConfiguration extends ConditionModelConfiguration { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/condition/ConditionModelConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/condition/ConditionModelConfiguration.java index db34baf6..62e5ba8f 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/condition/ConditionModelConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/condition/ConditionModelConfiguration.java @@ -4,7 +4,7 @@ import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate.condition.*; import fr.robie.craftengineconverter.api.configuration.item.models.ModelConfiguration; import fr.robie.craftengineconverter.api.utils.ConfigurationSerializationUtils; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/condition/CustomModelDataConditionConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/condition/CustomModelDataConditionConfiguration.java index c952ca48..a189c1e0 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/condition/CustomModelDataConditionConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/condition/CustomModelDataConditionConfiguration.java @@ -1,6 +1,6 @@ package fr.robie.craftengineconverter.api.configuration.item.models.condition; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; public class CustomModelDataConditionConfiguration extends ConditionModelConfiguration { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/condition/HasComponentConditionConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/condition/HasComponentConditionConfiguration.java index ce0abcd5..013b8528 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/condition/HasComponentConditionConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/condition/HasComponentConditionConfiguration.java @@ -1,6 +1,6 @@ package fr.robie.craftengineconverter.api.configuration.item.models.condition; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; public class HasComponentConditionConfiguration extends ConditionModelConfiguration { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/condition/KeybindDownConditionConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/condition/KeybindDownConditionConfiguration.java index 26238d18..690b3eec 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/condition/KeybindDownConditionConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/condition/KeybindDownConditionConfiguration.java @@ -1,6 +1,6 @@ package fr.robie.craftengineconverter.api.configuration.item.models.condition; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; public class KeybindDownConditionConfiguration extends ConditionModelConfiguration { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/model/SimpleModelConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/model/SimpleModelConfiguration.java index 5d90969d..95ae772e 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/model/SimpleModelConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/model/SimpleModelConfiguration.java @@ -3,7 +3,7 @@ import fr.robie.craftengineconverter.api.configuration.item.models.ModelConfiguration; import fr.robie.craftengineconverter.api.configuration.item.models.tints.TintConfiguration; import fr.robie.craftengineconverter.api.utils.ConfigurationSerializationUtils; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/range_dispatch/CompassRangeDispatchConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/range_dispatch/CompassRangeDispatchConfiguration.java index fd7669e4..4212fa7a 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/range_dispatch/CompassRangeDispatchConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/range_dispatch/CompassRangeDispatchConfiguration.java @@ -1,6 +1,6 @@ package fr.robie.craftengineconverter.api.configuration.item.models.range_dispatch; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; public class CompassRangeDispatchConfiguration extends RangeDispatchModelConfiguration { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/range_dispatch/CountRangeDispatchConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/range_dispatch/CountRangeDispatchConfiguration.java index a3f1a82d..19b6fdd4 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/range_dispatch/CountRangeDispatchConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/range_dispatch/CountRangeDispatchConfiguration.java @@ -1,6 +1,6 @@ package fr.robie.craftengineconverter.api.configuration.item.models.range_dispatch; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; public class CountRangeDispatchConfiguration extends RangeDispatchModelConfiguration { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/range_dispatch/CustomModelDataRangeDispatchConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/range_dispatch/CustomModelDataRangeDispatchConfiguration.java index dfa3d1ef..c73717aa 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/range_dispatch/CustomModelDataRangeDispatchConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/range_dispatch/CustomModelDataRangeDispatchConfiguration.java @@ -1,6 +1,6 @@ package fr.robie.craftengineconverter.api.configuration.item.models.range_dispatch; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; public class CustomModelDataRangeDispatchConfiguration extends RangeDispatchModelConfiguration { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/range_dispatch/DamageRangeDispatchConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/range_dispatch/DamageRangeDispatchConfiguration.java index 47966031..1d32c223 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/range_dispatch/DamageRangeDispatchConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/range_dispatch/DamageRangeDispatchConfiguration.java @@ -1,6 +1,6 @@ package fr.robie.craftengineconverter.api.configuration.item.models.range_dispatch; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; public class DamageRangeDispatchConfiguration extends RangeDispatchModelConfiguration { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/range_dispatch/RangeDispatchModelConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/range_dispatch/RangeDispatchModelConfiguration.java index 4c3ae38f..08d2f369 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/range_dispatch/RangeDispatchModelConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/range_dispatch/RangeDispatchModelConfiguration.java @@ -2,7 +2,7 @@ import fr.robie.craftengineconverter.api.configuration.item.models.ModelConfiguration; import fr.robie.craftengineconverter.api.utils.ConfigurationSerializationUtils; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/range_dispatch/TimeRangeDispatchConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/range_dispatch/TimeRangeDispatchConfiguration.java index 6d6bd10c..efed6b55 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/range_dispatch/TimeRangeDispatchConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/range_dispatch/TimeRangeDispatchConfiguration.java @@ -1,6 +1,6 @@ package fr.robie.craftengineconverter.api.configuration.item.models.range_dispatch; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; import java.util.Objects; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/range_dispatch/UseCycleRangeDispatchConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/range_dispatch/UseCycleRangeDispatchConfiguration.java index 5098fb82..3c41e615 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/range_dispatch/UseCycleRangeDispatchConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/range_dispatch/UseCycleRangeDispatchConfiguration.java @@ -1,6 +1,6 @@ package fr.robie.craftengineconverter.api.configuration.item.models.range_dispatch; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; public class UseCycleRangeDispatchConfiguration extends RangeDispatchModelConfiguration { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/range_dispatch/UseDurationRangeDispatchConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/range_dispatch/UseDurationRangeDispatchConfiguration.java index b77ad2df..33d14368 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/range_dispatch/UseDurationRangeDispatchConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/range_dispatch/UseDurationRangeDispatchConfiguration.java @@ -1,6 +1,6 @@ package fr.robie.craftengineconverter.api.configuration.item.models.range_dispatch; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; public class UseDurationRangeDispatchConfiguration extends RangeDispatchModelConfiguration { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/select/BlockStateSelectConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/select/BlockStateSelectConfiguration.java index ee3e1a20..21b1aec0 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/select/BlockStateSelectConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/select/BlockStateSelectConfiguration.java @@ -1,6 +1,6 @@ package fr.robie.craftengineconverter.api.configuration.item.models.select; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; public class BlockStateSelectConfiguration extends SelectModelConfiguration { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/select/ComponentSelectConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/select/ComponentSelectConfiguration.java index c2c9863e..24c540c5 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/select/ComponentSelectConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/select/ComponentSelectConfiguration.java @@ -1,6 +1,6 @@ package fr.robie.craftengineconverter.api.configuration.item.models.select; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; import java.util.Objects; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/select/CustomModelDataSelectConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/select/CustomModelDataSelectConfiguration.java index 81a00136..2a8f23c3 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/select/CustomModelDataSelectConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/select/CustomModelDataSelectConfiguration.java @@ -1,6 +1,6 @@ package fr.robie.craftengineconverter.api.configuration.item.models.select; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; public class CustomModelDataSelectConfiguration extends SelectModelConfiguration { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/select/LocalTimeSelectConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/select/LocalTimeSelectConfiguration.java index 30207893..8ec9a688 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/select/LocalTimeSelectConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/select/LocalTimeSelectConfiguration.java @@ -1,6 +1,6 @@ package fr.robie.craftengineconverter.api.configuration.item.models.select; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/select/SelectModelConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/select/SelectModelConfiguration.java index fc7f89e4..9e753cf3 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/select/SelectModelConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/select/SelectModelConfiguration.java @@ -2,7 +2,7 @@ import fr.robie.craftengineconverter.api.configuration.item.models.ModelConfiguration; import fr.robie.craftengineconverter.api.utils.ConfigurationSerializationUtils; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/special/SpecialModelConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/special/SpecialModelConfiguration.java index 3886361a..71308d4b 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/special/SpecialModelConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/special/SpecialModelConfiguration.java @@ -1,7 +1,7 @@ package fr.robie.craftengineconverter.api.configuration.item.models.special; import fr.robie.craftengineconverter.api.configuration.item.models.ModelConfiguration; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; public class SpecialModelConfiguration implements ModelConfiguration { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/settings/AnvilRepairItemConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/settings/AnvilRepairItemConfiguration.java index 21de4ef5..bc03bec1 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/settings/AnvilRepairItemConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/settings/AnvilRepairItemConfiguration.java @@ -1,9 +1,9 @@ package fr.robie.craftengineconverter.api.configuration.item.settings; import fr.robie.craftengineconverter.api.configuration.item.ItemConfigurationSerializable; +import fr.robie.yamllibrary.ConfigurationSection; +import fr.robie.yamllibrary.file.YamlConfiguration; import net.momirealms.craftengine.core.item.setting.value.AnvilRepairItem; -import org.bukkit.configuration.ConfigurationSection; -import org.bukkit.configuration.file.YamlConfiguration; import org.jetbrains.annotations.NotNull; import java.util.ArrayList; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/settings/DropDisplayConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/settings/DropDisplayConfiguration.java index c151b731..0d6ee5db 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/settings/DropDisplayConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/settings/DropDisplayConfiguration.java @@ -1,8 +1,8 @@ package fr.robie.craftengineconverter.api.configuration.item.settings; import fr.robie.craftengineconverter.api.configuration.item.ItemConfigurationSerializable; -import org.bukkit.configuration.ConfigurationSection; -import org.bukkit.configuration.file.YamlConfiguration; +import fr.robie.yamllibrary.ConfigurationSection; +import fr.robie.yamllibrary.file.YamlConfiguration; import org.jetbrains.annotations.NotNull; public class DropDisplayConfiguration implements ItemConfigurationSerializable { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/settings/EquippableConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/settings/EquippableConfiguration.java index 76d12647..0805c9af 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/settings/EquippableConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/settings/EquippableConfiguration.java @@ -1,9 +1,9 @@ package fr.robie.craftengineconverter.api.configuration.item.settings; import fr.robie.craftengineconverter.api.configuration.item.ItemConfigurationSerializable; +import fr.robie.yamllibrary.ConfigurationSection; import net.momirealms.craftengine.core.entity.EquipmentSlot; -import org.bukkit.configuration.ConfigurationSection; -import org.bukkit.configuration.file.YamlConfiguration; +import fr.robie.yamllibrary.file.YamlConfiguration; import org.jetbrains.annotations.NotNull; import java.util.Locale; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/settings/FuelTimeSettingConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/settings/FuelTimeSettingConfiguration.java index 8aa7a993..13a6b23c 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/settings/FuelTimeSettingConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/settings/FuelTimeSettingConfiguration.java @@ -1,8 +1,8 @@ package fr.robie.craftengineconverter.api.configuration.item.settings; import fr.robie.craftengineconverter.api.configuration.item.ItemConfigurationSerializable; -import org.bukkit.configuration.ConfigurationSection; -import org.bukkit.configuration.file.YamlConfiguration; +import fr.robie.yamllibrary.ConfigurationSection; +import fr.robie.yamllibrary.file.YamlConfiguration; import org.jetbrains.annotations.NotNull; public class FuelTimeSettingConfiguration implements ItemConfigurationSerializable { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/settings/GlowDropColorConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/settings/GlowDropColorConfiguration.java index ad67627b..0f0af1e7 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/settings/GlowDropColorConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/settings/GlowDropColorConfiguration.java @@ -1,9 +1,9 @@ package fr.robie.craftengineconverter.api.configuration.item.settings; import fr.robie.craftengineconverter.api.configuration.item.ItemConfigurationSerializable; +import fr.robie.yamllibrary.ConfigurationSection; +import fr.robie.yamllibrary.file.YamlConfiguration; import org.bukkit.DyeColor; -import org.bukkit.configuration.ConfigurationSection; -import org.bukkit.configuration.file.YamlConfiguration; import org.jetbrains.annotations.NotNull; import java.util.Locale; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/settings/InvulnerableSettingConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/settings/InvulnerableSettingConfiguration.java index 08751df7..4e3912fc 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/settings/InvulnerableSettingConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/settings/InvulnerableSettingConfiguration.java @@ -1,8 +1,8 @@ package fr.robie.craftengineconverter.api.configuration.item.settings; import fr.robie.craftengineconverter.api.configuration.item.ItemConfigurationSerializable; -import org.bukkit.configuration.ConfigurationSection; -import org.bukkit.configuration.file.YamlConfiguration; +import fr.robie.yamllibrary.ConfigurationSection; +import fr.robie.yamllibrary.file.YamlConfiguration; import org.jetbrains.annotations.NotNull; import java.util.List; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/settings/ProjectileSettingConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/settings/ProjectileSettingConfiguration.java index 0678a9e1..7b4ce6cd 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/settings/ProjectileSettingConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/settings/ProjectileSettingConfiguration.java @@ -1,8 +1,8 @@ package fr.robie.craftengineconverter.api.configuration.item.settings; import fr.robie.craftengineconverter.api.configuration.item.ItemConfigurationSerializable; -import org.bukkit.configuration.ConfigurationSection; -import org.bukkit.configuration.file.YamlConfiguration; +import fr.robie.yamllibrary.ConfigurationSection; +import fr.robie.yamllibrary.file.YamlConfiguration; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/settings/RepairableSettingConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/settings/RepairableSettingConfiguration.java index 0df581c5..07392046 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/settings/RepairableSettingConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/settings/RepairableSettingConfiguration.java @@ -1,8 +1,8 @@ package fr.robie.craftengineconverter.api.configuration.item.settings; import fr.robie.craftengineconverter.api.configuration.item.ItemConfigurationSerializable; -import org.bukkit.configuration.ConfigurationSection; -import org.bukkit.configuration.file.YamlConfiguration; +import fr.robie.yamllibrary.ConfigurationSection; +import fr.robie.yamllibrary.file.YamlConfiguration; import org.jetbrains.annotations.NotNull; public class RepairableSettingConfiguration implements ItemConfigurationSerializable { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/AbstractConditionLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/AbstractConditionLoader.java index 7608bf32..b3c1c5f4 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/AbstractConditionLoader.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/AbstractConditionLoader.java @@ -2,7 +2,7 @@ import fr.robie.craftengineconverter.api.configuration.item.models.ModelConfiguration; import fr.robie.craftengineconverter.api.configuration.item.models.condition.ConditionModelConfiguration; -import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; public abstract class AbstractConditionLoader implements ModelConfigurationLoader { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/ModelConfigurationLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/ModelConfigurationLoader.java index 9dd10916..b39a9ac1 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/ModelConfigurationLoader.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/ModelConfigurationLoader.java @@ -1,7 +1,7 @@ package fr.robie.craftengineconverter.api.configuration.loader.models; import fr.robie.craftengineconverter.api.configuration.item.models.ModelConfiguration; -import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/ModelConfigurationRegistry.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/ModelConfigurationRegistry.java index f4145f4a..fe1f3324 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/ModelConfigurationRegistry.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/ModelConfigurationRegistry.java @@ -1,8 +1,8 @@ package fr.robie.craftengineconverter.api.configuration.loader.models; import fr.robie.craftengineconverter.api.configuration.item.models.ModelConfiguration; -import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; import fr.robie.messageflow.logger.Logger; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/composite/CompositeModelConfigurationLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/composite/CompositeModelConfigurationLoader.java index 29814fe2..268069eb 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/composite/CompositeModelConfigurationLoader.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/composite/CompositeModelConfigurationLoader.java @@ -5,7 +5,7 @@ import fr.robie.craftengineconverter.api.configuration.item.models.composite.CompositeModelConfiguration; import fr.robie.craftengineconverter.api.configuration.loader.models.ModelConfigurationLoader; import fr.robie.craftengineconverter.api.configuration.loader.models.ModelConfigurationRegistry; -import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/condition/ComponentConditionLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/condition/ComponentConditionLoader.java index 4d497a05..154ccf91 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/condition/ComponentConditionLoader.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/condition/ComponentConditionLoader.java @@ -4,7 +4,7 @@ import fr.robie.craftengineconverter.api.configuration.item.models.ModelConfiguration; import fr.robie.craftengineconverter.api.configuration.item.models.condition.ComponentConditionConfiguration; import fr.robie.craftengineconverter.api.configuration.loader.models.AbstractConditionLoader; -import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/condition/ConditionModelConfigurationLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/condition/ConditionModelConfigurationLoader.java index 0c66b49d..7bd3ae20 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/condition/ConditionModelConfigurationLoader.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/condition/ConditionModelConfigurationLoader.java @@ -4,7 +4,7 @@ import fr.robie.craftengineconverter.api.configuration.item.models.ModelConfiguration; import fr.robie.craftengineconverter.api.configuration.item.models.condition.ConditionModelConfiguration; import fr.robie.craftengineconverter.api.configuration.loader.models.AbstractConditionLoader; -import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/condition/CustomModelDataConditionLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/condition/CustomModelDataConditionLoader.java index f9026e46..58c7dc9e 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/condition/CustomModelDataConditionLoader.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/condition/CustomModelDataConditionLoader.java @@ -4,7 +4,7 @@ import fr.robie.craftengineconverter.api.configuration.item.models.ModelConfiguration; import fr.robie.craftengineconverter.api.configuration.item.models.condition.CustomModelDataConditionConfiguration; import fr.robie.craftengineconverter.api.configuration.loader.models.AbstractConditionLoader; -import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/condition/HasComponentConditionLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/condition/HasComponentConditionLoader.java index 7e743e78..b29857da 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/condition/HasComponentConditionLoader.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/condition/HasComponentConditionLoader.java @@ -4,7 +4,7 @@ import fr.robie.craftengineconverter.api.configuration.item.models.ModelConfiguration; import fr.robie.craftengineconverter.api.configuration.item.models.condition.HasComponentConditionConfiguration; import fr.robie.craftengineconverter.api.configuration.loader.models.AbstractConditionLoader; -import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/condition/KeybindDownConditionLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/condition/KeybindDownConditionLoader.java index 1f5cb90c..6fd679a6 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/condition/KeybindDownConditionLoader.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/condition/KeybindDownConditionLoader.java @@ -4,7 +4,7 @@ import fr.robie.craftengineconverter.api.configuration.item.models.ModelConfiguration; import fr.robie.craftengineconverter.api.configuration.item.models.condition.KeybindDownConditionConfiguration; import fr.robie.craftengineconverter.api.configuration.loader.models.AbstractConditionLoader; -import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/model/SimpleModelConfigurationLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/model/SimpleModelConfigurationLoader.java index 3d7cb4bd..d921dbe6 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/model/SimpleModelConfigurationLoader.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/model/SimpleModelConfigurationLoader.java @@ -7,7 +7,7 @@ import fr.robie.craftengineconverter.api.configuration.item.models.tints.TintConfiguration; import fr.robie.craftengineconverter.api.configuration.loader.models.ModelConfigurationLoader; import fr.robie.craftengineconverter.api.configuration.loader.models.tints.TintConfigurationRegistry; -import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/range_dispatch/AbstractRangeDispatchConfigurationLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/range_dispatch/AbstractRangeDispatchConfigurationLoader.java index 222baa1e..71af395b 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/range_dispatch/AbstractRangeDispatchConfigurationLoader.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/range_dispatch/AbstractRangeDispatchConfigurationLoader.java @@ -4,7 +4,7 @@ import fr.robie.craftengineconverter.api.configuration.item.models.range_dispatch.RangeDispatchModelConfiguration; import fr.robie.craftengineconverter.api.configuration.loader.models.ModelConfigurationLoader; import fr.robie.craftengineconverter.api.configuration.loader.models.ModelConfigurationRegistry; -import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; import java.util.List; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/range_dispatch/CompassRangeDispatchConfigurationLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/range_dispatch/CompassRangeDispatchConfigurationLoader.java index 12d3fbf1..29766a75 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/range_dispatch/CompassRangeDispatchConfigurationLoader.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/range_dispatch/CompassRangeDispatchConfigurationLoader.java @@ -2,7 +2,7 @@ import fr.robie.craftengineconverter.api.annotations.AutoRangeDispatchConfigurationLoader; import fr.robie.craftengineconverter.api.configuration.item.models.range_dispatch.CompassRangeDispatchConfiguration; -import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; import org.jspecify.annotations.Nullable; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/range_dispatch/CountRangeDispatchConfigurationLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/range_dispatch/CountRangeDispatchConfigurationLoader.java index 812fc776..ce523514 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/range_dispatch/CountRangeDispatchConfigurationLoader.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/range_dispatch/CountRangeDispatchConfigurationLoader.java @@ -2,7 +2,7 @@ import fr.robie.craftengineconverter.api.annotations.AutoRangeDispatchConfigurationLoader; import fr.robie.craftengineconverter.api.configuration.item.models.range_dispatch.CountRangeDispatchConfiguration; -import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; import org.jspecify.annotations.Nullable; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/range_dispatch/CustomModelDataRangeDispatchConfigurationLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/range_dispatch/CustomModelDataRangeDispatchConfigurationLoader.java index 83f9948f..0c9bde78 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/range_dispatch/CustomModelDataRangeDispatchConfigurationLoader.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/range_dispatch/CustomModelDataRangeDispatchConfigurationLoader.java @@ -2,7 +2,7 @@ import fr.robie.craftengineconverter.api.annotations.AutoRangeDispatchConfigurationLoader; import fr.robie.craftengineconverter.api.configuration.item.models.range_dispatch.CustomModelDataRangeDispatchConfiguration; -import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; import org.jspecify.annotations.Nullable; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/range_dispatch/DamageRangeDispatchConfigurationLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/range_dispatch/DamageRangeDispatchConfigurationLoader.java index abf31b51..5a192823 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/range_dispatch/DamageRangeDispatchConfigurationLoader.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/range_dispatch/DamageRangeDispatchConfigurationLoader.java @@ -2,7 +2,7 @@ import fr.robie.craftengineconverter.api.annotations.AutoRangeDispatchConfigurationLoader; import fr.robie.craftengineconverter.api.configuration.item.models.range_dispatch.DamageRangeDispatchConfiguration; -import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; import org.jspecify.annotations.Nullable; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/range_dispatch/RangeDispatchConfigurationRegistry.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/range_dispatch/RangeDispatchConfigurationRegistry.java index bae2b8af..321bd054 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/range_dispatch/RangeDispatchConfigurationRegistry.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/range_dispatch/RangeDispatchConfigurationRegistry.java @@ -2,6 +2,7 @@ import fr.robie.craftengineconverter.api.configuration.item.models.range_dispatch.RangeDispatchModelConfiguration; import fr.robie.craftengineconverter.api.configuration.loader.models.ModelConfigurationLoader; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -16,7 +17,7 @@ public static void register(@NotNull String property, @NotNull ModelConfiguratio } @Nullable - public static RangeDispatchModelConfiguration load(@Nullable fr.robie.craftengineconverter.api.yaml.ConfigurationSection section) { + public static RangeDispatchModelConfiguration load(@Nullable ConfigurationSection section) { if (section == null) { return null; } diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/range_dispatch/TimeRangeDispatchConfigurationLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/range_dispatch/TimeRangeDispatchConfigurationLoader.java index a07a5075..a40b039b 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/range_dispatch/TimeRangeDispatchConfigurationLoader.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/range_dispatch/TimeRangeDispatchConfigurationLoader.java @@ -2,7 +2,7 @@ import fr.robie.craftengineconverter.api.annotations.AutoRangeDispatchConfigurationLoader; import fr.robie.craftengineconverter.api.configuration.item.models.range_dispatch.TimeRangeDispatchConfiguration; -import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; import org.jspecify.annotations.Nullable; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/range_dispatch/UseCycleRangeDispatchConfigurationLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/range_dispatch/UseCycleRangeDispatchConfigurationLoader.java index a51625e6..32d79fe3 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/range_dispatch/UseCycleRangeDispatchConfigurationLoader.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/range_dispatch/UseCycleRangeDispatchConfigurationLoader.java @@ -2,7 +2,7 @@ import fr.robie.craftengineconverter.api.annotations.AutoRangeDispatchConfigurationLoader; import fr.robie.craftengineconverter.api.configuration.item.models.range_dispatch.UseCycleRangeDispatchConfiguration; -import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; import org.jspecify.annotations.Nullable; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/range_dispatch/UseDurationRangeDispatchConfigurationLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/range_dispatch/UseDurationRangeDispatchConfigurationLoader.java index 7a58cc3e..679b3f48 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/range_dispatch/UseDurationRangeDispatchConfigurationLoader.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/range_dispatch/UseDurationRangeDispatchConfigurationLoader.java @@ -2,7 +2,7 @@ import fr.robie.craftengineconverter.api.annotations.AutoRangeDispatchConfigurationLoader; import fr.robie.craftengineconverter.api.configuration.item.models.range_dispatch.UseDurationRangeDispatchConfiguration; -import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; import org.jspecify.annotations.Nullable; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/AbstractSelectModelConfigurationLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/AbstractSelectModelConfigurationLoader.java index fcbb0bba..2563fb4f 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/AbstractSelectModelConfigurationLoader.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/AbstractSelectModelConfigurationLoader.java @@ -4,7 +4,7 @@ import fr.robie.craftengineconverter.api.configuration.item.models.select.SelectModelConfiguration; import fr.robie.craftengineconverter.api.configuration.loader.models.ModelConfigurationLoader; import fr.robie.craftengineconverter.api.configuration.loader.models.ModelConfigurationRegistry; -import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/BlockStateSelectConfigurationLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/BlockStateSelectConfigurationLoader.java index 4912ff76..b53b70e5 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/BlockStateSelectConfigurationLoader.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/BlockStateSelectConfigurationLoader.java @@ -2,7 +2,7 @@ import fr.robie.craftengineconverter.api.annotations.AutoSelectModelConfigurationLoader; import fr.robie.craftengineconverter.api.configuration.item.models.select.BlockStateSelectConfiguration; -import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; @AutoSelectModelConfigurationLoader({"block_state", "minecraft:block_state"}) diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/ChargeTypeSelectConfigurationLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/ChargeTypeSelectConfigurationLoader.java index 498621bc..9063baa5 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/ChargeTypeSelectConfigurationLoader.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/ChargeTypeSelectConfigurationLoader.java @@ -4,7 +4,7 @@ import fr.robie.craftengineconverter.api.configuration.item.models.range_dispatch.ChargeType; import fr.robie.craftengineconverter.api.configuration.item.models.select.ChargeTypeSelectConfiguration; import fr.robie.craftengineconverter.api.configuration.item.models.select.SelectModelConfiguration; -import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; @AutoSelectModelConfigurationLoader({"charge_type", "minecraft:charge_type"}) diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/ComponentSelectConfigurationLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/ComponentSelectConfigurationLoader.java index 841273d3..58fe2c3f 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/ComponentSelectConfigurationLoader.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/ComponentSelectConfigurationLoader.java @@ -3,7 +3,7 @@ import fr.robie.craftengineconverter.api.annotations.AutoSelectModelConfigurationLoader; import fr.robie.craftengineconverter.api.configuration.item.models.select.ComponentSelectConfiguration; import fr.robie.craftengineconverter.api.configuration.item.models.select.SelectModelConfiguration; -import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; @AutoSelectModelConfigurationLoader({"component", "minecraft:component"}) diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/CustomModelDataSelectConfigurationLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/CustomModelDataSelectConfigurationLoader.java index 1b921bd3..e5f8ea1c 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/CustomModelDataSelectConfigurationLoader.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/CustomModelDataSelectConfigurationLoader.java @@ -3,7 +3,7 @@ import fr.robie.craftengineconverter.api.annotations.AutoSelectModelConfigurationLoader; import fr.robie.craftengineconverter.api.configuration.item.models.select.CustomModelDataSelectConfiguration; import fr.robie.craftengineconverter.api.configuration.item.models.select.SelectModelConfiguration; -import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; @AutoSelectModelConfigurationLoader({"custom_model_data", "minecraft:custom_model_data"}) diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/DisplayContextSelectConfigurationLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/DisplayContextSelectConfigurationLoader.java index cd691f76..a89d1736 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/DisplayContextSelectConfigurationLoader.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/DisplayContextSelectConfigurationLoader.java @@ -4,7 +4,7 @@ import fr.robie.craftengineconverter.api.configuration.item.models.select.DisplayContent; import fr.robie.craftengineconverter.api.configuration.item.models.select.DisplayContentSelectConfiguration; import fr.robie.craftengineconverter.api.configuration.item.models.select.SelectModelConfiguration; -import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; @AutoSelectModelConfigurationLoader({"display_context", "minecraft:display_context"}) diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/LocalTimeSelectConfigurationLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/LocalTimeSelectConfigurationLoader.java index f8f90fb4..6cc8caf7 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/LocalTimeSelectConfigurationLoader.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/LocalTimeSelectConfigurationLoader.java @@ -3,7 +3,7 @@ import fr.robie.craftengineconverter.api.annotations.AutoSelectModelConfigurationLoader; import fr.robie.craftengineconverter.api.configuration.item.models.select.LocalTimeSelectConfiguration; import fr.robie.craftengineconverter.api.configuration.item.models.select.SelectModelConfiguration; -import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; @AutoSelectModelConfigurationLoader({"local_time", "minecraft:local_time"}) diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/MainHandSelectConfigurationLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/MainHandSelectConfigurationLoader.java index dec25760..7ab7b38d 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/MainHandSelectConfigurationLoader.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/MainHandSelectConfigurationLoader.java @@ -4,7 +4,7 @@ import fr.robie.craftengineconverter.api.configuration.item.models.select.MainHand; import fr.robie.craftengineconverter.api.configuration.item.models.select.MainHandSelectConfiguration; import fr.robie.craftengineconverter.api.configuration.item.models.select.SelectModelConfiguration; -import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; @AutoSelectModelConfigurationLoader({"main_hand", "minecraft:main_hand"}) diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/SelectModelConfigurationRegistry.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/SelectModelConfigurationRegistry.java index a9fdaaf9..d7343e52 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/SelectModelConfigurationRegistry.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/SelectModelConfigurationRegistry.java @@ -2,7 +2,7 @@ import fr.robie.craftengineconverter.api.configuration.item.models.select.SelectModelConfiguration; import fr.robie.craftengineconverter.api.configuration.loader.models.ModelConfigurationLoader; -import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/tints/TintConfigurationLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/tints/TintConfigurationLoader.java index 60979d00..486f974d 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/tints/TintConfigurationLoader.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/tints/TintConfigurationLoader.java @@ -1,7 +1,7 @@ package fr.robie.craftengineconverter.api.configuration.loader.models.tints; import fr.robie.craftengineconverter.api.configuration.item.models.tints.TintConfiguration; -import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/tints/TintConfigurationRegistry.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/tints/TintConfigurationRegistry.java index 1edf5999..2d05af13 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/tints/TintConfigurationRegistry.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/tints/TintConfigurationRegistry.java @@ -1,7 +1,7 @@ package fr.robie.craftengineconverter.api.configuration.loader.models.tints; import fr.robie.craftengineconverter.api.configuration.item.models.tints.TintConfiguration; -import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import fr.robie.messageflow.logger.Logger; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/ConstantTintLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/ConstantTintLoader.java index 8add3dc2..5366caf9 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/ConstantTintLoader.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/ConstantTintLoader.java @@ -3,7 +3,7 @@ import fr.robie.craftengineconverter.api.annotations.AutoTintConfigurationLoader; import fr.robie.craftengineconverter.api.configuration.item.models.tints.ConstantTintConfiguration; import fr.robie.craftengineconverter.api.configuration.loader.models.tints.TintConfigurationLoader; -import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jspecify.annotations.NonNull; @AutoTintConfigurationLoader({"constant", "minecraft:constant"}) diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/CustomModelDataTintLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/CustomModelDataTintLoader.java index 1452cb2d..15fce618 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/CustomModelDataTintLoader.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/CustomModelDataTintLoader.java @@ -3,7 +3,7 @@ import fr.robie.craftengineconverter.api.annotations.AutoTintConfigurationLoader; import fr.robie.craftengineconverter.api.configuration.item.models.tints.CustomModelDataTintConfiguration; import fr.robie.craftengineconverter.api.configuration.loader.models.tints.TintConfigurationLoader; -import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jspecify.annotations.NonNull; @AutoTintConfigurationLoader({"custom_model_data", "minecraft:custom_model_data"}) diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/DyeTintLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/DyeTintLoader.java index eac87397..48bc03ff 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/DyeTintLoader.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/DyeTintLoader.java @@ -3,7 +3,7 @@ import fr.robie.craftengineconverter.api.annotations.AutoTintConfigurationLoader; import fr.robie.craftengineconverter.api.configuration.item.models.tints.DyeTintConfiguration; import fr.robie.craftengineconverter.api.configuration.loader.models.tints.TintConfigurationLoader; -import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jspecify.annotations.NonNull; @AutoTintConfigurationLoader({"dye", "minecraft:dye"}) diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/FireworkTintLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/FireworkTintLoader.java index 8da7f662..e45274f2 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/FireworkTintLoader.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/FireworkTintLoader.java @@ -3,7 +3,7 @@ import fr.robie.craftengineconverter.api.annotations.AutoTintConfigurationLoader; import fr.robie.craftengineconverter.api.configuration.item.models.tints.FireworkTintConfiguration; import fr.robie.craftengineconverter.api.configuration.loader.models.tints.TintConfigurationLoader; -import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jspecify.annotations.NonNull; @AutoTintConfigurationLoader({"firework", "minecraft:firework"}) diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/GrassTintLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/GrassTintLoader.java index 86f4eacb..52068c70 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/GrassTintLoader.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/GrassTintLoader.java @@ -3,7 +3,7 @@ import fr.robie.craftengineconverter.api.annotations.AutoTintConfigurationLoader; import fr.robie.craftengineconverter.api.configuration.item.models.tints.GrassTintConfiguration; import fr.robie.craftengineconverter.api.configuration.loader.models.tints.TintConfigurationLoader; -import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jspecify.annotations.NonNull; @AutoTintConfigurationLoader({"grass", "minecraft:grass"}) diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/MapColorTintLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/MapColorTintLoader.java index 720004b3..2f48f5a0 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/MapColorTintLoader.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/MapColorTintLoader.java @@ -3,7 +3,7 @@ import fr.robie.craftengineconverter.api.annotations.AutoTintConfigurationLoader; import fr.robie.craftengineconverter.api.configuration.item.models.tints.MapColorTintConfiguration; import fr.robie.craftengineconverter.api.configuration.loader.models.tints.TintConfigurationLoader; -import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jspecify.annotations.NonNull; @AutoTintConfigurationLoader({"map_color", "minecraft:map_color"}) diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/PotionTintLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/PotionTintLoader.java index 130ca0b6..7b333b6c 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/PotionTintLoader.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/PotionTintLoader.java @@ -3,7 +3,7 @@ import fr.robie.craftengineconverter.api.annotations.AutoTintConfigurationLoader; import fr.robie.craftengineconverter.api.configuration.item.models.tints.PotionTintConfiguration; import fr.robie.craftengineconverter.api.configuration.loader.models.tints.TintConfigurationLoader; -import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jspecify.annotations.NonNull; @AutoTintConfigurationLoader({"potion", "minecraft:potion"}) diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/TeamTintLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/TeamTintLoader.java index 3685a644..0c18c948 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/TeamTintLoader.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/tints/TeamTintLoader.java @@ -3,7 +3,7 @@ import fr.robie.craftengineconverter.api.annotations.AutoTintConfigurationLoader; import fr.robie.craftengineconverter.api.configuration.item.models.tints.TeamTintConfiguration; import fr.robie.craftengineconverter.api.configuration.loader.models.tints.TintConfigurationLoader; -import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jspecify.annotations.NonNull; @AutoTintConfigurationLoader({"team", "minecraft:team"}) diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/recipe/AbstractRecipe.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/recipe/AbstractRecipe.java index bd1c8ab3..f29e3edc 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/recipe/AbstractRecipe.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/recipe/AbstractRecipe.java @@ -7,7 +7,7 @@ import fr.robie.craftengineconverter.api.configuration.recipe.ingredient.RecipeResult; import fr.robie.craftengineconverter.api.enums.RecipeType; import fr.robie.craftengineconverter.api.utils.ConfigurationSerializationUtils; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/recipe/BrewingRecipe.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/recipe/BrewingRecipe.java index aa87bbce..bfa9cceb 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/recipe/BrewingRecipe.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/recipe/BrewingRecipe.java @@ -1,7 +1,7 @@ package fr.robie.craftengineconverter.api.configuration.recipe; import fr.robie.craftengineconverter.api.enums.RecipeType; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; public class BrewingRecipe extends AbstractRecipe { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/recipe/CookingRecipe.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/recipe/CookingRecipe.java index c620efb1..b19e7eae 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/recipe/CookingRecipe.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/recipe/CookingRecipe.java @@ -1,8 +1,8 @@ package fr.robie.craftengineconverter.api.configuration.recipe; import fr.robie.craftengineconverter.api.enums.RecipeType; +import fr.robie.yamllibrary.ConfigurationSection; import net.momirealms.craftengine.core.item.recipe.CookingRecipeCategory; -import org.bukkit.configuration.ConfigurationSection; import org.jetbrains.annotations.NotNull; public class CookingRecipe extends CraftingAbstractRecipe { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/recipe/CraftingAbstractRecipe.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/recipe/CraftingAbstractRecipe.java index 6bf668b2..f8079366 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/recipe/CraftingAbstractRecipe.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/recipe/CraftingAbstractRecipe.java @@ -1,7 +1,7 @@ package fr.robie.craftengineconverter.api.configuration.recipe; import fr.robie.craftengineconverter.api.enums.RecipeType; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/recipe/ShapedRecipe.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/recipe/ShapedRecipe.java index 5e378393..4f413f4f 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/recipe/ShapedRecipe.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/recipe/ShapedRecipe.java @@ -2,8 +2,8 @@ import fr.robie.craftengineconverter.api.configuration.recipe.ingredient.CraftingIngredient; import fr.robie.craftengineconverter.api.enums.RecipeType; +import fr.robie.yamllibrary.ConfigurationSection; import net.momirealms.craftengine.core.item.recipe.CraftingRecipeCategory; -import org.bukkit.configuration.ConfigurationSection; import org.jetbrains.annotations.NotNull; import java.util.*; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/recipe/ShapelessRecipe.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/recipe/ShapelessRecipe.java index a172247e..96b60d7b 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/recipe/ShapelessRecipe.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/recipe/ShapelessRecipe.java @@ -3,8 +3,8 @@ import fr.robie.craftengineconverter.api.configuration.recipe.ingredient.CraftingIngredient; import fr.robie.craftengineconverter.api.enums.RecipeType; import fr.robie.craftengineconverter.api.utils.ConfigurationSerializationUtils; +import fr.robie.yamllibrary.ConfigurationSection; import net.momirealms.craftengine.core.item.recipe.CraftingRecipeCategory; -import org.bukkit.configuration.ConfigurationSection; import org.jetbrains.annotations.NotNull; import java.util.ArrayList; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/recipe/StonecuttingRecipe.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/recipe/StonecuttingRecipe.java index c57b56e7..01624999 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/recipe/StonecuttingRecipe.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/recipe/StonecuttingRecipe.java @@ -1,7 +1,7 @@ package fr.robie.craftengineconverter.api.configuration.recipe; import fr.robie.craftengineconverter.api.enums.RecipeType; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; public class StonecuttingRecipe extends AbstractRecipe { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/recipe/ingredient/CraftingIngredient.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/recipe/ingredient/CraftingIngredient.java index 214befde..0cb11e28 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/recipe/ingredient/CraftingIngredient.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/recipe/ingredient/CraftingIngredient.java @@ -1,7 +1,7 @@ package fr.robie.craftengineconverter.api.configuration.recipe.ingredient; import fr.robie.craftengineconverter.api.configuration.SectionSerializable; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; import java.util.ArrayList; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/recipe/ingredient/RecipeResult.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/recipe/ingredient/RecipeResult.java index 0eed27f3..7ed56b11 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/recipe/ingredient/RecipeResult.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/recipe/ingredient/RecipeResult.java @@ -3,7 +3,7 @@ import fr.robie.craftengineconverter.api.configuration.SectionSerializable; import fr.robie.craftengineconverter.api.configuration.recipe.postprocessor.PostProcessor; import fr.robie.craftengineconverter.api.utils.ConfigurationSerializationUtils; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; import java.util.ArrayList; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/recipe/smithing/AbstractSmithingRecipe.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/recipe/smithing/AbstractSmithingRecipe.java index 6bfcd975..e58ef89b 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/recipe/smithing/AbstractSmithingRecipe.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/recipe/smithing/AbstractSmithingRecipe.java @@ -2,7 +2,7 @@ import fr.robie.craftengineconverter.api.configuration.recipe.AbstractRecipe; import fr.robie.craftengineconverter.api.enums.RecipeType; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/recipe/smithing/SmithingTransformRecipe.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/recipe/smithing/SmithingTransformRecipe.java index 84a21a86..b0aa276a 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/recipe/smithing/SmithingTransformRecipe.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/recipe/smithing/SmithingTransformRecipe.java @@ -3,7 +3,7 @@ import fr.robie.craftengineconverter.api.configuration.recipe.postprocessor.PostProcessor; import fr.robie.craftengineconverter.api.enums.RecipeType; import fr.robie.craftengineconverter.api.utils.ConfigurationSerializationUtils; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; import java.util.ArrayList; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/recipe/smithing/SmithingTrimRecipe.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/recipe/smithing/SmithingTrimRecipe.java index d528c60b..ffd7aeaf 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/recipe/smithing/SmithingTrimRecipe.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/recipe/smithing/SmithingTrimRecipe.java @@ -1,7 +1,7 @@ package fr.robie.craftengineconverter.api.configuration.recipe.smithing; import fr.robie.craftengineconverter.api.enums.RecipeType; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/sound/JukeboxSongConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/sound/JukeboxSongConfiguration.java index 60ebefbd..ee907ee0 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/sound/JukeboxSongConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/sound/JukeboxSongConfiguration.java @@ -1,7 +1,7 @@ package fr.robie.craftengineconverter.api.configuration.sound; import fr.robie.craftengineconverter.api.configuration.SectionSerializable; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; public class JukeboxSongConfiguration implements SectionSerializable { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/sound/SoundConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/sound/SoundConfiguration.java index adff8b5e..159a6e0a 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/sound/SoundConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/sound/SoundConfiguration.java @@ -1,7 +1,7 @@ package fr.robie.craftengineconverter.api.configuration.sound; import fr.robie.craftengineconverter.api.configuration.SectionSerializable; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; import java.util.ArrayList; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/utils/BlockPredicateConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/utils/BlockPredicateConfiguration.java index 89078b64..0c390d21 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/utils/BlockPredicateConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/utils/BlockPredicateConfiguration.java @@ -1,8 +1,8 @@ package fr.robie.craftengineconverter.api.configuration.utils; import fr.robie.craftengineconverter.api.configuration.item.ItemConfigurationSerializable; -import org.bukkit.configuration.ConfigurationSection; -import org.bukkit.configuration.file.YamlConfiguration; +import fr.robie.yamllibrary.ConfigurationSection; +import fr.robie.yamllibrary.file.YamlConfiguration; import org.jetbrains.annotations.NotNull; import java.util.ArrayList; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/enums/ArmorConverter.java b/API/src/main/java/fr/robie/craftengineconverter/api/enums/ArmorConverter.java index 4098c24c..024e1d18 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/enums/ArmorConverter.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/enums/ArmorConverter.java @@ -2,7 +2,7 @@ import fr.robie.craftengineconverter.api.configuration.Configuration; import fr.robie.craftengineconverter.api.configuration.ConfigurationKey; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; import java.util.*; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/manager/FileCacheManager.java b/API/src/main/java/fr/robie/craftengineconverter/api/manager/FileCacheManager.java index e7f15012..b00503b2 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/manager/FileCacheManager.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/manager/FileCacheManager.java @@ -6,7 +6,7 @@ import fr.robie.craftengineconverter.api.format.Message; import fr.robie.messageflow.formatter.Placeholder; import fr.robie.messageflow.logger.Logger; -import org.bukkit.configuration.file.YamlConfiguration; +import fr.robie.yamllibrary.file.YamlConfiguration; import org.jetbrains.annotations.NotNull; import java.nio.file.Files; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/utils/ConfigurationSerializationUtils.java b/API/src/main/java/fr/robie/craftengineconverter/api/utils/ConfigurationSerializationUtils.java index 3810a45e..63c7f417 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/utils/ConfigurationSerializationUtils.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/utils/ConfigurationSerializationUtils.java @@ -1,7 +1,7 @@ package fr.robie.craftengineconverter.api.utils; import fr.robie.craftengineconverter.api.configuration.SectionSerializable; -import org.bukkit.configuration.file.YamlConfiguration; +import fr.robie.yamllibrary.file.YamlConfiguration; import org.jetbrains.annotations.NotNull; import java.util.Collection; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/utils/MinecraftVersion.java b/API/src/main/java/fr/robie/craftengineconverter/api/utils/MinecraftVersion.java index 778873d9..7c0d65cc 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/utils/MinecraftVersion.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/utils/MinecraftVersion.java @@ -25,7 +25,13 @@ private MinecraftVersion(int major, int minor, int patch) { public static MinecraftVersion getCurrentVersion() { if (currentVersion == null) { - currentVersion = parse(Bukkit.getBukkitVersion()); + String bukkitVersion; + try { + bukkitVersion = Bukkit.getBukkitVersion(); + } catch (NoClassDefFoundError | Exception e) { // In case we're running in an environment without Bukkit (e.g., during testing), we can't get the version, so we default to (0, 0, 0). + bukkitVersion = null; + } + currentVersion = parse(bukkitVersion); } return currentVersion; } diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/utils/ObjectUtils.java b/API/src/main/java/fr/robie/craftengineconverter/api/utils/ObjectUtils.java index 063a3ead..c3053fe3 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/utils/ObjectUtils.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/utils/ObjectUtils.java @@ -1,6 +1,6 @@ package fr.robie.craftengineconverter.api.utils; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.Contract; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/yaml/Configuration.java b/API/src/main/java/fr/robie/craftengineconverter/api/yaml/Configuration.java deleted file mode 100644 index d64567a1..00000000 --- a/API/src/main/java/fr/robie/craftengineconverter/api/yaml/Configuration.java +++ /dev/null @@ -1,21 +0,0 @@ -package fr.robie.craftengineconverter.api.yaml; - -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -import java.util.Map; - -public interface Configuration extends ConfigurationSection { - @Override - void addDefault(@NotNull String path, @Nullable Object value); - - void addDefaults(@NotNull Map defaults); - - void addDefaults(@NotNull Configuration defaults); - - void setDefaults(@NotNull Configuration defaults); - - @Nullable Configuration getDefaults(); - - @NotNull ConfigurationOptions options(); -} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/yaml/ConfigurationOptions.java b/API/src/main/java/fr/robie/craftengineconverter/api/yaml/ConfigurationOptions.java deleted file mode 100644 index 6487098f..00000000 --- a/API/src/main/java/fr/robie/craftengineconverter/api/yaml/ConfigurationOptions.java +++ /dev/null @@ -1,38 +0,0 @@ -package fr.robie.craftengineconverter.api.yaml; - -import org.jetbrains.annotations.NotNull; - -public class ConfigurationOptions { - private char pathSeparator = '.'; - private boolean copyDefaults = false; - private final Configuration configuration; - - protected ConfigurationOptions(@NotNull Configuration configuration) { - this.configuration = configuration; - } - - @NotNull - public Configuration configuration() { - return this.configuration; - } - - public char pathSeparator() { - return this.pathSeparator; - } - - @NotNull - public ConfigurationOptions pathSeparator(char value) { - this.pathSeparator = value; - return this; - } - - public boolean copyDefaults() { - return this.copyDefaults; - } - - @NotNull - public ConfigurationOptions copyDefaults(boolean value) { - this.copyDefaults = value; - return this; - } -} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/yaml/ConfigurationSection.java b/API/src/main/java/fr/robie/craftengineconverter/api/yaml/ConfigurationSection.java deleted file mode 100644 index 3136f690..00000000 --- a/API/src/main/java/fr/robie/craftengineconverter/api/yaml/ConfigurationSection.java +++ /dev/null @@ -1,185 +0,0 @@ -package fr.robie.craftengineconverter.api.yaml; - -import org.bukkit.configuration.serialization.ConfigurationSerializable; -import org.jetbrains.annotations.Contract; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -import java.util.List; -import java.util.Map; -import java.util.Set; - -public interface ConfigurationSection { - @NotNull Set getKeys(boolean deep); - - @NotNull Map getValues(boolean deep); - - boolean contains(@NotNull String path); - - boolean contains(@NotNull String path, boolean ignoreDefault); - - boolean isSet(@NotNull String path); - - @Nullable - String getCurrentPath(); - - @NotNull - String getName(); - - @Nullable - Configuration getRoot(); - - @Nullable - ConfigurationSection getParent(); - - @Nullable - Object get(@NotNull String path); - - @Contract("_, !null -> !null") - @Nullable - Object get(@NotNull String path, @Nullable Object def); - - void set(@NotNull String path, @Nullable Object value); - - @NotNull - ConfigurationSection createSection(@NotNull String path); - - @NotNull - ConfigurationSection createSection(@NotNull String path, @NotNull Map map); - - @Nullable - String getString(@NotNull String path); - - @Contract("_, !null -> !null") - @Nullable - String getString(@NotNull String path, @Nullable String def); - - boolean isString(@NotNull String path); - - int getInt(@NotNull String path); - - int getInt(@NotNull String path, int def); - - boolean isInt(@NotNull String path); - - boolean getBoolean(@NotNull String path); - - boolean getBoolean(@NotNull String path, boolean def); - - boolean isBoolean(@NotNull String path); - - double getDouble(@NotNull String path); - - double getDouble(@NotNull String path, double def); - - boolean isDouble(@NotNull String path); - - long getLong(@NotNull String path); - - - long getLong(@NotNull String path, long def); - - - boolean isLong(@NotNull String path); - - - @Nullable - List getList(@NotNull String path); - - - @Contract("_, !null -> !null") - @Nullable - List getList(@NotNull String path, @Nullable List def); - - - boolean isList(@NotNull String path); - - - @NotNull - List getStringList(@NotNull String path); - - - @NotNull - List getIntegerList(@NotNull String path); - - - @NotNull - List getBooleanList(@NotNull String path); - - - @NotNull - List getDoubleList(@NotNull String path); - - - @NotNull - List getFloatList(@NotNull String path); - - - @NotNull - List getLongList(@NotNull String path); - - - @NotNull - List getByteList(@NotNull String path); - - - @NotNull - List getCharacterList(@NotNull String path); - - - @NotNull - List getShortList(@NotNull String path); - - - @NotNull - List> getMapList(@NotNull String path); - - @NotNull - List getSectionList(@NotNull String path); - - - @Nullable - T getObject(@NotNull String path, @NotNull Class clazz); - - - @Contract("_, _, !null -> !null") - @Nullable - T getObject(@NotNull String path, @NotNull Class clazz, @Nullable T def); - - - @Nullable - T getSerializable(@NotNull String path, @NotNull Class clazz); - - - @Contract("_, _, !null -> !null") - @Nullable - T getSerializable(@NotNull String path, @NotNull Class clazz, @Nullable T def); - - - @Nullable - ConfigurationSection getConfigurationSection(@NotNull String path); - - - boolean isConfigurationSection(@NotNull String path); - - - @Nullable - ConfigurationSection getDefaultSection(); - - - void addDefault(@NotNull String path, @Nullable Object value); - - - @NotNull - List getComments(@NotNull String path); - - - @NotNull - List getInlineComments(@NotNull String path); - - - void setComments(@NotNull String path, @Nullable List comments); - - - void setInlineComments(@NotNull String path, @Nullable List comments); -} diff --git a/Common/pom.xml b/Common/pom.xml index 7df456a7..223939da 100644 --- a/Common/pom.xml +++ b/Common/pom.xml @@ -45,6 +45,11 @@ message-flow provided + + + fr.robie + yamllibrary + diff --git a/Common/src/main/java/fr/robie/craftengineconverter/common/scanner/BlockStateMappingScanner.java b/Common/src/main/java/fr/robie/craftengineconverter/common/scanner/BlockStateMappingScanner.java index 230e33a4..3e3f3799 100644 --- a/Common/src/main/java/fr/robie/craftengineconverter/common/scanner/BlockStateMappingScanner.java +++ b/Common/src/main/java/fr/robie/craftengineconverter/common/scanner/BlockStateMappingScanner.java @@ -1,7 +1,8 @@ package fr.robie.craftengineconverter.common.scanner; import fr.robie.craftengineconverter.api.enums.CraftEngineBlockState; -import fr.robie.craftengineconverter.common.utils.SnakeUtils; +import fr.robie.yamllibrary.ConfigurationSection; +import fr.robie.yamllibrary.file.YamlConfiguration; import org.bukkit.Bukkit; import org.bukkit.Material; import org.bukkit.block.data.BlockData; @@ -89,17 +90,14 @@ private void scanDirectory(File dir) { } private void processFile(File file) { - SnakeUtils yaml = SnakeUtils.loadSmart(file); - if (yaml == null) { - return; - } + YamlConfiguration configuration = YamlConfiguration.loadConfiguration(file); for (String mappingKey : MAPPING_KEYS) { - Map mappings = yaml.getMap(mappingKey); - if (mappings == null) { - continue; + ConfigurationSection configurationSection = configuration.getConfigurationSection(mappingKey); + if (configurationSection != null) { + Map mappings = configurationSection.getValues(true); + this.processMappings(mappings); } - this.processMappings(mappings); } } diff --git a/Common/src/main/java/fr/robie/craftengineconverter/common/utils/SnakeUtils.java b/Common/src/main/java/fr/robie/craftengineconverter/common/utils/SnakeUtils.java deleted file mode 100644 index 5a286e7c..00000000 --- a/Common/src/main/java/fr/robie/craftengineconverter/common/utils/SnakeUtils.java +++ /dev/null @@ -1,1074 +0,0 @@ -package fr.robie.craftengineconverter.common.utils; - -import fr.robie.craftengineconverter.common.utils.yaml.constructor.SmartConstructor; -import fr.robie.messageflow.logger.Logger; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.yaml.snakeyaml.DumperOptions; -import org.yaml.snakeyaml.LoaderOptions; -import org.yaml.snakeyaml.Yaml; -import org.yaml.snakeyaml.representer.Representer; - -import java.io.*; -import java.util.*; -import java.util.regex.Pattern; - -/** - * SnakeUtils - A utility class for managing YAML files with convenient access methods. - *

- * This class provides a fluent API for reading, writing, and manipulating YAML data - * with support for nested keys using dot notation (e.g., "section.subsection.key"). - *

- * Features: - * - Load and save YAML files - * - Navigate nested structures with dot notation - * - Type-safe getters for common data types (String, int, double, boolean) - * - Section management (get, create, update sections) - * - Data manipulation (add, remove, merge, clone) - * - Auto-save capability - * - Implements AutoCloseable for try-with-resources support - *

- * Example usage: - *

- * try (SnakeUtils yaml = new SnakeUtils(new File("config.yml"), true)) {
- *     yaml.addData("server.port", 8080);
- *     String host = yaml.getString("server.host", "localhost");
- *     SnakeUtils dbSection = yaml.getOrCreateSection("database");
- *     // Auto-saved on close
- * }
- * 
- * - * @author Robie - * @version 1.0 - */ -public class SnakeUtils implements AutoCloseable { - private final File targetFile; - private final Map data; - private final boolean autoSave; - - /** - * Creates a new SnakeUtils instance from a YAML file. - * - * @param targetFile The YAML file to load. If the file doesn't exist or is empty, - * an empty data structure will be initialized - * @param autoSave If true, changes will be automatically saved when close() is called. - * Useful with try-with-resources pattern - * @throws IOException If the file cannot be read - */ - public SnakeUtils(@NotNull File targetFile, boolean autoSave) throws IOException { - this.targetFile = targetFile; - Yaml yaml = new Yaml(); - Map loadedData; - try (FileInputStream fis = new FileInputStream(targetFile)) { - loadedData = yaml.load(fis); - } - this.data = (loadedData != null) ? loadedData : new LinkedHashMap<>(); - this.autoSave = autoSave; - } - - /** - * Creates a new SnakeUtils instance from a YAML file with auto-save disabled. - * - * @param targetFile The YAML file to load. If the file doesn't exist or is empty, - * an empty data structure will be initialized - * @throws IOException If the file cannot be read - */ - public SnakeUtils(@NotNull File targetFile) throws IOException { - this(targetFile, false); - } - - public SnakeUtils(@NotNull InputStream inputStream) throws IOException { - Yaml yaml = new Yaml(); - Map loadedData = yaml.load(inputStream); - this.data = (loadedData != null) ? loadedData : new LinkedHashMap<>(); - this.targetFile = File.createTempFile("snakeutils_temp_" + System.currentTimeMillis(), ".yml"); - this.autoSave = false; - } - - /** - * Creates a SnakeUtils from a file using the SmartConstructor, - * so all $$ directives are resolved transparently. - * - * @param file the YAML file to load - * @return a SnakeUtils instance with directives applied, or null on error - */ - @Nullable - public static SnakeUtils loadSmart(@NotNull File file) { - try { - LoaderOptions options = new LoaderOptions(); - SmartConstructor constructor = new SmartConstructor(options); - DumperOptions dumper = new DumperOptions(); - dumper.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK); - Yaml yaml = new Yaml(constructor, new Representer(dumper), dumper); - try (FileInputStream fis = new FileInputStream(file)) { - Map data = yaml.load(fis); - SnakeUtils su = SnakeUtils.createEmpty(file); - su.getData().clear(); - if (data != null) { - su.getData().putAll(data); - } - return su; - } - } catch (IOException e) { - Logger.error("Failed to load smart YAML: " + file, e); - return null; - } - } - - /** - * Adds or updates data at the specified key path using dot notation. - * Creates nested sections as needed. - *

- * Example: - *

-     * addData("server.database.host", "localhost");
-     * // Creates: server -> database -> host: "localhost"
-     * 
- * - * @param key The key path with dot notation (e.g., "section.subsection.key") - * @param value The value to store (can be any object, Map, List, etc.) - */ - public void addData(@NotNull String key, @NotNull Object value) { - this.addData(key, value, "."); - } - - /** - * Adds or updates data at the specified key path using a custom delimiter. - * Creates nested sections as needed. - * - * @param key The key path with custom delimiter - * @param value The value to store (can be any object, Map, List, etc.) - * @param delimiter The delimiter to use for splitting the key path (e.g., ".", "/", ":") - */ - public void addData(@NotNull String key, @NotNull Object value, @NotNull String delimiter) { - if (key.isEmpty()) { - return; - } - - String[] keys = key.split(Pattern.quote(delimiter)); - - if (keys.length == 0) { - return; - } - - Map currentMap = this.data; - for (int i = 0; i < keys.length - 1; i++) { - String k = keys[i]; - if (!currentMap.containsKey(k) || !(currentMap.get(k) instanceof Map)) { - currentMap.put(k, new java.util.LinkedHashMap()); - } - //noinspection unchecked - currentMap = (Map) currentMap.get(k); - } - currentMap.put(keys[keys.length - 1], value); - } - - /** - * Gets the raw data Map containing all YAML data. - * Modifications to this map will affect the underlying data. - * - * @return The data Map (never null, but may be empty) - */ - public Map getData() { - return this.data; - } - - /** - * Gets the target file associated with this SnakeUtils instance. - * - * @return The target file for save operations - */ - public File getTargetFile() { - return this.targetFile; - } - - /** - * Retrieves a value from the data using a delimited key path. - * Internal method supporting custom delimiters. - * - * @param key The key path with delimiter (e.g., "section.subsection.key") - * @param delimiter The delimiter to use for splitting the key path - * @return The value found, or null if absent or path is invalid - */ - @Nullable - private Object getValue(@NotNull String key, @NotNull String delimiter) { - if (key.isEmpty() || this.data == null) { - return null; - } - - String[] keys = key.split(Pattern.quote(delimiter)); - - if (keys.length == 0) { - return null; - } - - Map currentMap = this.data; - - for (int i = 0; i < keys.length - 1; i++) { - String k = keys[i]; - if (!currentMap.containsKey(k) || !(currentMap.get(k) instanceof Map)) { - return null; - } - //noinspection unchecked - currentMap = (Map) currentMap.get(k); - } - - return currentMap.get(keys[keys.length - 1]); - } - - /** - * Retrieves a value from the data using dot notation. - * - * @param key The key path with dot notation (e.g., "section.subsection.key") - * @return The value found, or null if absent or path is invalid - */ - @Nullable - private Object getValue(@NotNull String key) { - return this.getValue(key, "."); - } - - @NotNull - public Object getObject(@NotNull String key) { - return this.getValue(key); - } - - /** - * Retrieves an integer value from the specified key path. - * Returns 0 if the value is absent or cannot be parsed as an integer. - * - * @param key The key path with dot notation - * @return The integer value, or 0 if absent/invalid - */ - public int getInt(@NotNull String key) { - return this.getInt(key, 0); - } - - /** - * Retrieves an integer value from the specified key path with a default value. - * Attempts to parse the value as an integer if it's not a Number type. - * - * @param key The key path with dot notation - * @param defaultValue The value to return if the key doesn't exist or cannot be parsed - * @return The integer value, or defaultValue if absent/invalid - */ - public int getInt(@NotNull String key, int defaultValue) { - Object value = this.getValue(key); - if (value == null) { - return defaultValue; - } - - if (value instanceof Number) { - return ((Number) value).intValue(); - } - - try { - return Integer.parseInt(value.toString()); - } catch (NumberFormatException e) { - return defaultValue; - } - } - - /** - * Retrieves a double value from the specified key path. - * Returns 0.0 if the value is absent or cannot be parsed as a double. - * - * @param key The key path with dot notation - * @return The double value, or 0.0 if absent/invalid - */ - public double getDouble(@NotNull String key) { - return this.getDouble(key, 0.0); - } - - /** - * Retrieves a double value from the specified key path with a default value. - * Attempts to parse the value as a double if it's not a Number type. - * - * @param key The key path with dot notation - * @param defaultValue The value to return if the key doesn't exist or cannot be parsed - * @return The double value, or defaultValue if absent/invalid - */ - public double getDouble(@NotNull String key, double defaultValue) { - Object value = this.getValue(key); - if (value == null) { - return defaultValue; - } - - if (value instanceof Number) { - return ((Number) value).doubleValue(); - } - - try { - return Double.parseDouble(value.toString()); - } catch (NumberFormatException e) { - return defaultValue; - } - } - - /** - * Retrieves a String value from the specified key path. - * Returns null if the value is absent. Converts any non-null value to String. - * - * @param key The key path with dot notation - * @return The String value, or null if absent - */ - @Nullable - public String getString(@NotNull String key) { - return this.getString(key, null); - } - - /** - * Retrieves a String value from the specified key path with a default value. - * Converts any non-null value to String using toString(). - * - * @param key The key path with dot notation - * @param defaultValue The value to return if the key doesn't exist - * @return The String value, or defaultValue if absent - */ - @Nullable - public String getString(@NotNull String key, @Nullable String defaultValue) { - Object value = this.getValue(key); - return (value != null) ? value.toString() : defaultValue; - } - - /** - * Retrieves a boolean value from the specified key path. - * Returns false if the value is absent or cannot be parsed as a boolean. - * - * @param key The key path with dot notation - * @return The boolean value, or false if absent/invalid - */ - public boolean getBoolean(@NotNull String key) { - return this.getBoolean(key, false); - } - - /** - * Retrieves a boolean value from the specified key path with a default value. - * Attempts to parse the value as a boolean using Boolean.parseBoolean() if not a Boolean type. - * - * @param key The key path with dot notation - * @param defaultValue The value to return if the key doesn't exist - * @return The boolean value, or defaultValue if absent - */ - public boolean getBoolean(@NotNull String key, boolean defaultValue) { - Object value = this.getValue(key); - if (value == null) { - return defaultValue; - } - - if (value instanceof Boolean) { - return (Boolean) value; - } - - return Boolean.parseBoolean(value.toString()); - } - - /** - * Retrieves a Map value from the specified key path. - * This is useful for accessing nested sections as raw Map objects. - * - * @param key The key path with dot notation - * @return The Map value, or null if absent or not a Map type - */ - @SuppressWarnings("unchecked") - @Nullable - public Map getMap(@NotNull String key) { - Object value = this.getValue(key); - return (value instanceof Map) ? (Map) value : null; - } - - /** - * Retrieves a List of Maps from the specified key path. - * This is useful for accessing lists of complex objects stored as maps. - *

- * Example YAML: - *

-     * players:
-     *   - name: John
-     *     score: 100
-     *   - name: Jane
-     *     score: 200
-     * 
- *

- * Usage: - *

-     * List<Map<String, Object>> players = config.getListMap("players");
-     * if (players != null) {
-     *     for (Map<String, Object> player : players) {
-     *         String name = (String) player.get("name");
-     *         Integer score = (Integer) player.get("score");
-     *     }
-     * }
-     * 
- * - * @param key The key path with dot notation - * @return The List of Maps, or null if absent, not a List, or contains non-Map elements - */ - @SuppressWarnings("unchecked") - @NotNull - public List> getListMap(@NotNull String key) { - Object value = this.getValue(key); - if (!(value instanceof List list)) { - return new ArrayList<>(); - } - - List> result = new ArrayList<>(); - - for (Object item : list) { - if (!(item instanceof Map)) { - return new ArrayList<>(); - } - result.add((Map) item); - } - - return result; - } - - /** - * Retrieves a subsection as a new SnakeUtils instance. - * This allows you to work directly with a nested section as if it were a separate YAML file. - * The returned SnakeUtils is independent and backed by a temporary file. - *

- * Example: - *

-     * SnakeUtils config = new SnakeUtils(new File("config.yml"));
-     * SnakeUtils dbSection = config.getSection("database");
-     * if (dbSection != null) {
-     *     String host = dbSection.getString("host");
-     * }
-     * 
- * - * @param key The key path to the section (e.g., "database" or "server.database") - * @return A new SnakeUtils instance for the section, or null if the section doesn't exist or isn't a Map - */ - @Nullable - public SnakeUtils getSection(@NotNull String key) { - Map sectionData = this.getMap(key); - if (sectionData == null) { - return null; - } - - try { - File tempFile = File.createTempFile("snakeutils_section_" + key.replace(".", "_"), ".yml"); - - DumperOptions options = new DumperOptions(); - options.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK); - Yaml yaml = new Yaml(options); - - try (FileWriter writer = new FileWriter(tempFile)) { - yaml.dump(sectionData, writer); - } - - SnakeUtils sectionUtils = new SnakeUtils(tempFile); - - tempFile.deleteOnExit(); - - return sectionUtils; - } catch (IOException e) { - Logger.error("Failed to create section SnakeUtils for key: " + key, e); - return null; - } - } - - /** - * Retrieves a subsection as a SnakeUtils instance, creating it if it doesn't exist. - * This is useful when you want to ensure a section exists before working with it. - *

- * Example: - *

-     * SnakeUtils config = new SnakeUtils(new File("config.yml"));
-     * SnakeUtils dbSection = config.getOrCreateSection("database");
-     * dbSection.addData("host", "localhost");
-     * dbSection.addData("port", 3306);
-     * config.setSection("database", dbSection); // Sync changes back
-     * 
- * - * @param key The key path to the section (e.g., "database" or "config.database") - * @return A SnakeUtils instance for the section (never null) - * @throws RuntimeException if the section cannot be created - */ - @NotNull - public SnakeUtils getOrCreateSection(@NotNull String key) { - SnakeUtils section = this.getSection(key); - if (section != null) { - return section; - } - - this.addData(key, new java.util.LinkedHashMap()); - - section = this.getSection(key); - if (section == null) { - throw new RuntimeException("Failed to create section: " + key); - } - - return section; - } - - /** - * Updates a section with data from another SnakeUtils instance. - * This completely replaces the existing section with the new data. - *

- * Use this to sync changes made to a section obtained via getSection() or getOrCreateSection(). - *

- * Example: - *

-     * SnakeUtils section = config.getOrCreateSection("player");
-     * section.addData("name", "John");
-     * config.setSection("player", section); // Apply changes to parent
-     * 
- * - * @param key The key path to the section (e.g., "database" or "config.database") - * @param section The SnakeUtils instance containing the new data - */ - public void setSection(@NotNull String key, @NotNull SnakeUtils section) { - this.addData(key, section.getData()); - } - - /** - * Updates a section with data from a Map. - * This completely replaces the existing section with the new data. - * - * @param key The key path to the section (e.g., "database" or "config.database") - * @param sectionData The Map containing the new data - */ - public void setSection(@NotNull String key, @NotNull Map sectionData) { - this.addData(key, sectionData); - } - - /** - * Retrieves a List value from the specified key path. - * Useful for accessing YAML arrays/lists. - *

- * Example: - *

-     * List<Object> items = yaml.getList("server.allowed-ips");
-     * if (items != null) {
-     *     for (Object item : items) {
-     *         System.out.println(item);
-     *     }
-     * }
-     * 
- * - * @param key The key path with dot notation - * @return The List value, or null if absent or not a List type - */ - @SuppressWarnings("unchecked") - @Nullable - public List getList(@NotNull String key) { - Object value = this.getValue(key); - return (value instanceof List) ? (List) value : null; - } - - @NotNull - public List getStringList(@NotNull String key) { - List rawList = this.getList(key); - List stringList = new ArrayList<>(); - if (rawList != null) { - for (Object item : rawList) { - if (item != null) { - stringList.add(item.toString()); - } - } - } - return stringList; - } - - /** - * Checks if a key exists in the data. - * Supports nested keys with dot notation. - * - * @param key The key path with dot notation (e.g., "section.subsection.key") - * @return true if the key exists, false otherwise - */ - public boolean contains(@NotNull String key) { - return this.getValue(key) != null; - } - - /** - * Checks if a key exists in the data (alias of contains). - * Supports nested keys with dot notation. - * - * @param key The key path with dot notation (e.g., "section.subsection.key") - * @return true if the key exists, false otherwise - */ - public boolean containsKey(@NotNull String key) { - return this.contains(key); - } - - /** - * Checks if the data structure is empty (no root-level keys). - * - * @return true if no data is present, false otherwise - */ - public boolean isEmpty() { - return this.data == null || this.data.isEmpty(); - } - - /** - * Returns the number of keys at the root level. - * Does not count nested keys. - * - * @return The number of root-level keys - */ - public int size() { - return (this.data != null) ? this.data.size() : 0; - } - - /** - * Clears all data from this SnakeUtils instance. - * After calling this, the data structure will be empty. - */ - public void clear() { - if (this.data != null) { - this.data.clear(); - } - } - - /** - * Retrieves all keys at the root level. - *

- * Example: - *

-     * Set<String> keys = yaml.getKeys();
-     * for (String key : keys) {
-     *     System.out.println(key);
-     * }
-     * 
- * - * @return Set of root-level keys (never null, but may be empty) - */ - @NotNull - public Set getKeys() { - return (this.data != null) ? this.data.keySet() : Collections.emptySet(); - } - - /** - * Retrieves all keys from a specific section. - * Useful for iterating over nested sections. - *

- * Example: - *

-     * Set<String> dbKeys = yaml.getKeys("database");
-     * for (String key : dbKeys) {
-     *     System.out.println(key + ": " + yaml.getString("database." + key));
-     * }
-     * 
- * - * @param key The key path to the section (e.g., "database" or "config.database") - * @return Set of keys in the section (never null, but may be empty if section doesn't exist) - */ - @NotNull - public Set getKeys(@NotNull String key) { - Map section = this.getMap(key); - return (section != null) ? section.keySet() : Collections.emptySet(); - } - - /** - * Removes a key and its value from the data. - * Supports nested keys with dot notation. - *

- * Example: - *

-     * yaml.removeData("database.password"); // Removes only the password key
-     * yaml.removeData("database"); // Removes the entire database section
-     * 
- * - * @param key The key path with dot notation (e.g., "section.subsection.key") - * @return true if the key was removed, false if it didn't exist - */ - public boolean removeData(@NotNull String key) { - return this.removeData(key, "."); - } - - /** - * Removes a key and its value from the data using a custom delimiter. - * - * @param key The key path with custom delimiter - * @param delimiter The delimiter to use for splitting the key path - * @return true if the key was removed, false if it didn't exist - */ - public boolean removeData(@NotNull String key, @NotNull String delimiter) { - if (key.isEmpty() || this.data == null) { - return false; - } - - String[] keys = key.split(Pattern.quote(delimiter)); - - if (keys.length == 0) { - return false; - } - - Map currentMap = this.data; - - for (int i = 0; i < keys.length - 1; i++) { - String k = keys[i]; - if (!currentMap.containsKey(k) || !(currentMap.get(k) instanceof Map)) { - return false; - } - //noinspection unchecked - currentMap = (Map) currentMap.get(k); - } - - return currentMap.remove(keys[keys.length - 1]) != null; - } - - /** - * Saves the current data to the target file. - * Creates parent directories if they don't exist. - * - * @throws IOException If the file cannot be written - */ - public void save() throws IOException { - this.save(this.targetFile); - } - - /** - * Saves the current data to a specific file. - * Creates parent directories if they don't exist. - * Useful for saving to a different location than the original file. - * - * @param file The destination file for saving - * @throws IOException If the file cannot be written - */ - public void save(@NotNull File file) throws IOException { - File parentDir = file.getParentFile(); - if (parentDir != null && !parentDir.exists() && !parentDir.mkdirs()) { - throw new IOException("Failed to create parent directories for file: " + file); - } - - DumperOptions options = new DumperOptions(); - options.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK); - Yaml yaml = new Yaml(options); - - try (FileWriter writer = new FileWriter(file)) { - yaml.dump(this.data, writer); - } - } - - /** - * Reloads the data from the target file. - * Discards any unsaved changes and reloads from disk. - * Useful for detecting external changes to the file. - * - * @throws IOException If the file cannot be read - */ - public void reload() throws IOException { - Yaml yaml = new Yaml(); - try (FileInputStream fis = new FileInputStream(this.targetFile)) { - Map newData = yaml.load(fis); - this.data.clear(); - if (newData != null) { - this.data.putAll(newData); - } - } - } - - /** - * Merges data from another SnakeUtils instance into this one. - * Existing values are overwritten by the new values. - * Nested Maps are merged recursively. - *

- * Example: - *

-     * SnakeUtils defaults = SnakeUtils.load("defaults.yml");
-     * SnakeUtils user = SnakeUtils.load("user.yml");
-     * defaults.merge(user); // User settings override defaults
-     * 
- * - * @param other The SnakeUtils instance to merge from - */ - public void merge(@NotNull SnakeUtils other) { - if (other.data != null) { - this.mergeMap(this.data, other.data); - } - } - - /** - * Merges a Map into the current data. - * Existing values are overwritten by the new values. - * Nested Maps are merged recursively. - * - * @param dataToMerge The Map to merge into the current data - */ - public void merge(@NotNull Map dataToMerge) { - this.mergeMap(this.data, dataToMerge); - } - - /** - * Recursively merges two Maps. - * When both target and source contain a Map at the same key, they are merged recursively. - * Otherwise, the source value overwrites the target value. - * - * @param target The target Map to merge into - * @param source The source Map to merge from - */ - @SuppressWarnings("unchecked") - private void mergeMap(Map target, Map source) { - for (Map.Entry entry : source.entrySet()) { - String key = entry.getKey(); - Object value = entry.getValue(); - - if (value instanceof Map && target.get(key) instanceof Map) { - this.mergeMap((Map) target.get(key), (Map) value); - } else { - target.put(key, value); - } - } - } - - /** - * Copies all data to another SnakeUtils instance. - * Clears the target's data first, then copies all data from this instance. - * - * @param target The destination SnakeUtils instance - */ - public void copyTo(@NotNull SnakeUtils target) { - target.data.clear(); - target.data.putAll(this.data); - } - - /** - * Creates a deep clone of the data Map. - * All nested Maps and Lists are recursively cloned. - * Modifications to the clone will not affect the original data. - * - * @return A new Map containing a deep copy of all data - */ - @NotNull - public Map clone() { - return this.deepClone(this.data); - } - - /** - * Recursively clones a Map and all its nested structures. - * Creates new instances of Maps and Lists to ensure deep copying. - * - * @param original The original Map to clone - * @return A deep copy of the original Map - */ - @SuppressWarnings("unchecked") - private Map deepClone(Map original) { - Map copy = new java.util.LinkedHashMap<>(); - for (Map.Entry entry : original.entrySet()) { - Object value = entry.getValue(); - if (value instanceof Map) { - copy.put(entry.getKey(), this.deepClone((Map) value)); - } else if (value instanceof List) { - copy.put(entry.getKey(), new java.util.ArrayList<>((List) value)); - } else { - copy.put(entry.getKey(), value); - } - } - return copy; - } - - /** - * Converts the current data to a YAML-formatted string. - * Useful for debugging or displaying the data without writing to a file. - *

- * Example: - *

-     * SnakeUtils yaml = new SnakeUtils(new File("config.yml"));
-     * System.out.println(yaml.toYamlString());
-     * 
- * - * @return A YAML-formatted string representation of the data - */ - @NotNull - public String toYamlString() { - DumperOptions options = new DumperOptions(); - options.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK); - Yaml yaml = new Yaml(options); - return yaml.dump(this.data); - } - - // =============== STATIC METHODS =============== - - /** - * Creates a new SnakeUtils instance from a YAML file. - * This is a convenient static factory method that handles IOExceptions gracefully. - *

- * Example: - *

-     * SnakeUtils yaml = SnakeUtils.load(new File("config.yml"));
-     * if (yaml != null) {
-     *     // File loaded successfully
-     * }
-     * 
- * - * @param file The YAML file to load - * @return A new SnakeUtils instance, or null if an IOException occurs - */ - @Nullable - public static SnakeUtils load(@NotNull File file) { - try { - return new SnakeUtils(file); - } catch (IOException e) { - Logger.error("Failed to load YAML file: " + file, e); - return null; - } - } - - /** - * Creates a new SnakeUtils instance from a file path string. - * Convenient overload that accepts a String path instead of a File object. - *

- * Example: - *

-     * SnakeUtils yaml = SnakeUtils.load("config.yml");
-     * SnakeUtils yaml2 = SnakeUtils.load("C:/configs/database.yml");
-     * 
- * - * @param filePath The path to the YAML file to load - * @return A new SnakeUtils instance, or null if an IOException occurs - */ - @Nullable - public static SnakeUtils load(@NotNull String filePath) { - return load(new File(filePath)); - } - - @NotNull - public static SnakeUtils createEmpty() { - try { - File tempFile = File.createTempFile("snakeutils_empty_", ".yml"); - try (FileWriter writer = new FileWriter(tempFile)) { - writer.write("{}"); - } - SnakeUtils utils = new SnakeUtils(tempFile); - utils.clear(); - tempFile.deleteOnExit(); - return utils; - } catch (IOException e) { - throw new RuntimeException("Failed to create empty SnakeUtils", e); - } - } - - /** - * Creates an empty SnakeUtils instance with a target file. - * The instance starts with no data, but has a file associated for future saves. - *

- * Example: - *

-     * SnakeUtils yaml = SnakeUtils.createEmpty(new File("new-config.yml"));
-     * yaml.addData("version", "1.0");
-     * yaml.save(); // Saves to new-config.yml
-     * 
- * - * @param targetFile The target file for save operations - * @return A new empty SnakeUtils instance (never null) - * @throws RuntimeException if the empty instance cannot be created - */ - @NotNull - public static SnakeUtils createEmpty(@NotNull File targetFile) { - try { - File parentDir = targetFile.getParentFile(); - if (parentDir != null && !parentDir.exists()) { - if (!parentDir.mkdirs()) { - throw new IOException("Failed to create parent directories for: " + targetFile); - } - } - - if (!targetFile.exists()) { - try (FileWriter writer = new FileWriter(targetFile)) { - writer.write("{}"); - } - } - - SnakeUtils utils = new SnakeUtils(targetFile); - utils.clear(); - return utils; - } catch (IOException e) { - throw new RuntimeException("Failed to create empty SnakeUtils for file: " + targetFile, e); - } - } - - /** - * Saves a Map directly to a YAML file without creating a SnakeUtils instance. - * Useful for one-off saves when you already have a Map of data. - * Creates parent directories if they don't exist. - *

- * Example: - *

-     * Map<String, Object> data = new LinkedHashMap<>();
-     * data.put("key", "value");
-     * boolean success = SnakeUtils.saveToFile(data, new File("output.yml"));
-     * 
- * - * @param data The data Map to save - * @param file The destination file - * @return true if the save was successful, false if an IOException occurred - */ - public static boolean saveToFile(@NotNull Map data, @NotNull File file) { - try { - File parentDir = file.getParentFile(); - if (parentDir != null && !parentDir.exists() && !parentDir.mkdirs()) { - Logger.debug("Failed to create parent directories for file: " + file); - return false; - } - - DumperOptions options = new DumperOptions(); - options.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK); - Yaml yaml = new Yaml(options); - - try (FileWriter writer = new FileWriter(file)) { - yaml.dump(data, writer); - } - return true; - } catch (IOException e) { - Logger.error("Failed to save YAML file: " + file, e); - return false; - } - } - - /** - * Loads a Map directly from a YAML file without creating a SnakeUtils instance. - * Useful for quick reads when you don't need the full SnakeUtils functionality. - *

- * Example: - *

-     * Map<String, Object> data = SnakeUtils.loadFromFile(new File("config.yml"));
-     * if (data != null) {
-     *     String value = (String) data.get("key");
-     * }
-     * 
- * - * @param file The YAML file to load - * @return A Map containing the YAML data, or null if the file doesn't exist or an error occurs - */ - @Nullable - public static Map loadFromFile(@NotNull File file) { - if (!file.exists() || !file.isFile()) { - return null; - } - - try (FileInputStream fis = new FileInputStream(file)) { - Yaml yaml = new Yaml(); - return yaml.load(fis); - } catch (IOException e) { - Logger.error("Failed to load YAML file: " + file, e); - return null; - } - } - - /** - * Closes this SnakeUtils instance and automatically saves if auto-save is enabled. - * This method is called automatically when used with try-with-resources. - *

- * Example: - *

-     * try (SnakeUtils yaml = new SnakeUtils(new File("config.yml"), true)) {
-     *     yaml.addData("key", "value");
-     *     // Auto-saved on close
-     * } catch (Exception e) {
-     *     e.printStackTrace();
-     * }
-     * 
- * - * @throws Exception if save() fails when auto-save is enabled - */ - @Override - public void close() throws Exception { - if (this.autoSave) { - this.save(); - } - } -} diff --git a/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/MemoryConfiguration.java b/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/MemoryConfiguration.java deleted file mode 100644 index cbcc95c1..00000000 --- a/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/MemoryConfiguration.java +++ /dev/null @@ -1,82 +0,0 @@ -package fr.robie.craftengineconverter.common.utils.yaml; - -import com.google.common.base.Preconditions; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -import java.util.Map; - - -public class MemoryConfiguration extends MemorySection implements fr.robie.craftengineconverter.api.yaml.Configuration { - protected fr.robie.craftengineconverter.api.yaml.Configuration defaults; - protected MemoryConfigurationOptions options; - - - public MemoryConfiguration() { - } - - - public MemoryConfiguration(@Nullable fr.robie.craftengineconverter.api.yaml.Configuration defaults) { - this.defaults = defaults; - } - - @Override - public void addDefault(@NotNull String path, @Nullable Object value) { - Preconditions.checkArgument(path != null, "Path may not be null"); - - if (this.defaults == null) { - this.defaults = new MemoryConfiguration(); - } - - this.defaults.set(path, value); - } - - @Override - public void addDefaults(@NotNull Map defaults) { - Preconditions.checkArgument(defaults != null, "Defaults may not be null"); - - for (Map.Entry entry : defaults.entrySet()) { - this.addDefault(entry.getKey(), entry.getValue()); - } - } - - @Override - public void addDefaults(@NotNull fr.robie.craftengineconverter.api.yaml.Configuration defaults) { - Preconditions.checkArgument(defaults != null, "Defaults may not be null"); - - for (String key : defaults.getKeys(true)) { - if (!defaults.isConfigurationSection(key)) { - this.addDefault(key, defaults.get(key)); - } - } - } - - @Override - public void setDefaults(@NotNull fr.robie.craftengineconverter.api.yaml.Configuration defaults) { - Preconditions.checkNotNull(defaults, "Defaults may not be null"); - - this.defaults = defaults; - } - - @Override - @Nullable - public fr.robie.craftengineconverter.api.yaml.Configuration getDefaults() { - return this.defaults; - } - - @Nullable - @Override - public fr.robie.craftengineconverter.api.yaml.ConfigurationSection getParent() { - return null; - } - - @Override - @NotNull - public MemoryConfigurationOptions options() { - if (this.options == null) { - this.options = new MemoryConfigurationOptions(this); - } - - return this.options; - } -} diff --git a/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/MemoryConfigurationOptions.java b/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/MemoryConfigurationOptions.java deleted file mode 100644 index e32eab47..00000000 --- a/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/MemoryConfigurationOptions.java +++ /dev/null @@ -1,31 +0,0 @@ -package fr.robie.craftengineconverter.common.utils.yaml; - -import fr.robie.craftengineconverter.api.yaml.ConfigurationOptions; -import org.jetbrains.annotations.NotNull; - -public class MemoryConfigurationOptions extends ConfigurationOptions { - - protected MemoryConfigurationOptions(@NotNull MemoryConfiguration configuration) { - super(configuration); - } - - @NotNull - @Override - public MemoryConfiguration configuration() { - return (MemoryConfiguration) super.configuration(); - } - - @NotNull - @Override - public MemoryConfigurationOptions copyDefaults(boolean value) { - super.copyDefaults(value); - return this; - } - - @NotNull - @Override - public MemoryConfigurationOptions pathSeparator(char value) { - super.pathSeparator(value); - return this; - } -} diff --git a/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/MemorySection.java b/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/MemorySection.java deleted file mode 100644 index d11caf2a..00000000 --- a/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/MemorySection.java +++ /dev/null @@ -1,984 +0,0 @@ -package fr.robie.craftengineconverter.common.utils.yaml; - -import com.google.common.base.Preconditions; -import com.google.common.base.Strings; -import fr.robie.craftengineconverter.api.yaml.Configuration; -import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; -import org.bukkit.configuration.serialization.ConfigurationSerializable; -import org.jetbrains.annotations.Contract; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -import java.util.*; - -import static org.bukkit.util.NumberConversions.*; - - -public class MemorySection implements ConfigurationSection { - protected final Map map = new LinkedHashMap(); - private final Configuration root; - private final ConfigurationSection parent; - private final String path; - private final String fullPath; - - - protected MemorySection() { - if (!(this instanceof Configuration)) { - throw new IllegalStateException("Cannot construct a root MemorySection when not a Configuration"); - } - - this.path = ""; - this.fullPath = ""; - this.parent = null; - this.root = (Configuration) this; - } - - - protected MemorySection(@NotNull ConfigurationSection parent, @NotNull String path) { - Preconditions.checkNotNull(parent, "Parent cannot be null"); - Preconditions.checkNotNull(path, "Path cannot be null"); - - this.path = path; - this.parent = parent; - this.root = parent.getRoot(); - - Preconditions.checkArgument(this.root != null, "Path cannot be orphaned"); - - this.fullPath = createPath(parent, path); - } - - @Override - public @NotNull Set getKeys(boolean deep) { - Set result = new LinkedHashSet(); - - Configuration root = this.getRoot(); - if (root != null && root.options().copyDefaults()) { - ConfigurationSection defaults = this.getDefaultSection(); - - if (defaults != null) { - result.addAll(defaults.getKeys(deep)); - } - } - - this.mapChildrenKeys(result, this, deep); - - return result; - } - - @Override - @NotNull - public Map getValues(boolean deep) { - Map result = new LinkedHashMap(); - - Configuration root = this.getRoot(); - if (root != null && root.options().copyDefaults()) { - ConfigurationSection defaults = this.getDefaultSection(); - - if (defaults != null) { - result.putAll(defaults.getValues(deep)); - } - } - - this.mapChildrenValues(result, this, deep); - - return result; - } - - @Override - public boolean contains(@NotNull String path) { - return this.contains(path, false); - } - - @Override - public boolean contains(@NotNull String path, boolean ignoreDefault) { - return ((ignoreDefault) ? this.get(path, null) : this.get(path)) != null; - } - - @Override - public boolean isSet(@NotNull String path) { - Configuration root = this.getRoot(); - if (root == null) { - return false; - } - if (root.options().copyDefaults()) { - return this.contains(path); - } - return this.get(path, null) != null; - } - - @Override - @NotNull - public String getCurrentPath() { - return this.fullPath; - } - - @Override - @NotNull - public String getName() { - return this.path; - } - - @Override - @Nullable - public Configuration getRoot() { - return this.root; - } - - @Override - @Nullable - public ConfigurationSection getParent() { - return this.parent; - } - - @Override - public void addDefault(@NotNull String path, @Nullable Object value) { - Preconditions.checkNotNull(path, "Path cannot be null"); - - Configuration root = this.getRoot(); - if (root == null) { - throw new IllegalStateException("Cannot add default without root"); - } - if (root == this) { - throw new UnsupportedOperationException("Unsupported addDefault(String, Object) implementation"); - } - root.addDefault(createPath(this, path), value); - } - - @Override - @Nullable - public ConfigurationSection getDefaultSection() { - Configuration root = this.getRoot(); - Configuration defaults = root == null ? null : root.getDefaults(); - - if (defaults != null) { - if (defaults.isConfigurationSection(this.getCurrentPath())) { - return defaults.getConfigurationSection(this.getCurrentPath()); - } - } - - return null; - } - - @Override - public void set(@NotNull String path, @Nullable Object value) { - Preconditions.checkArgument(!Strings.isNullOrEmpty(path), "Cannot set to an empty path"); - - Configuration root = this.getRoot(); - if (root == null) { - throw new IllegalStateException("Cannot use section without a root"); - } - - final char separator = root.options().pathSeparator(); - - int i1 = -1, i2; - Object current = this; - while ((i1 = path.indexOf(separator, i2 = i1 + 1)) != -1) { - String node = path.substring(i2, i1); - Object sub = this.getPart(current, node); - - if (sub instanceof ConfigurationSection) { - current = sub; - } else if (sub instanceof List) { - current = sub; - } else { - if (value == null) { - return; - } - if (current instanceof ConfigurationSection sec) { - current = sec.createSection(node); - } else { - @SuppressWarnings("unchecked") - List l = (List) current; - int index = Integer.parseInt(node); - while (l.size() <= index) { - l.add(null); - } - ConfigurationSection newSection = new MemorySection(this.root, createPath(this, path.substring(0, i1))); - l.set(index, newSection); - current = newSection; - } - } - } - - String key = path.substring(i2); - if (current instanceof MemorySection sec) { - if (value == null) { - sec.map.remove(key); - } else { - SectionPathData entry = sec.map.get(key); - if (entry == null) { - sec.map.put(key, new SectionPathData(value)); - } else { - entry.setData(value); - } - } - } else if (current instanceof ConfigurationSection sec) { - sec.set(key, value); - } else { - @SuppressWarnings("unchecked") - List l = (List) current; - try { - int index = Integer.parseInt(key); - while (l.size() <= index) { - l.add(null); - } - l.set(index, value); - } catch (NumberFormatException ignored) { - } - } - } - - @Override - @Nullable - public Object get(@NotNull String path) { - return this.get(path, this.getDefault(path)); - } - - @Override - @Contract("_, !null -> !null") - @Nullable - public Object get(@NotNull String path, @Nullable Object def) { - Preconditions.checkNotNull(path, "Path cannot be null"); - - if (path.isEmpty()) { - return this; - } - - Configuration root = this.getRoot(); - if (root == null) { - throw new IllegalStateException("Cannot access section without a root"); - } - - final char separator = root.options().pathSeparator(); - - int i1 = -1, i2; - Object current = this; - while ((i1 = path.indexOf(separator, i2 = i1 + 1)) != -1) { - current = this.getPart(current, path.substring(i2, i1)); - if (current == null) { - return def; - } - } - - String key = path.substring(i2); - Object result = this.getPart(current, key); - return (result == null) ? def : result; - } - - @Nullable - private Object getPart(@Nullable Object current, @NotNull String node) { - if (current instanceof MemorySection sec) { - SectionPathData result = sec.map.get(node); - return (result == null) ? sec.getDefault(node) : result.getData(); - } else if (current instanceof ConfigurationSection sec) { - return sec.get(node, null); - } else if (current instanceof List list) { - try { - int index = Integer.parseInt(node); - if (index >= 0 && index < list.size()) { - return list.get(index); - } - } catch (NumberFormatException ignored) { - } - } - return null; - } - - @Override - @NotNull - public ConfigurationSection createSection(@NotNull String path) { - Preconditions.checkArgument(!Strings.isNullOrEmpty(path), "Cannot create section at empty path"); - Configuration root = this.getRoot(); - if (root == null) { - throw new IllegalStateException("Cannot create section without a root"); - } - - final char separator = root.options().pathSeparator(); - - int i1 = -1, i2; - Object current = this; - while ((i1 = path.indexOf(separator, i2 = i1 + 1)) != -1) { - String node = path.substring(i2, i1); - Object sub = this.getPart(current, node); - if (sub instanceof ConfigurationSection) { - current = sub; - } else if (sub instanceof List) { - current = sub; - } else if (current instanceof ConfigurationSection sec) { - current = sec.createSection(node); - } else { - @SuppressWarnings("unchecked") - List l = (List) current; - int index = Integer.parseInt(node); - while (l.size() <= index) { - l.add(null); - } - Object existing = l.get(index); - if (existing instanceof ConfigurationSection) { - current = existing; - } else { - ConfigurationSection newSection = new MemorySection(this.root, createPath(this, path.substring(0, i1))); - l.set(index, newSection); - current = newSection; - } - } - } - - String key = path.substring(i2); - if (current instanceof MemorySection sec) { - ConfigurationSection result = new MemorySection(sec, key); - sec.map.put(key, new SectionPathData(result)); - return result; - } else if (current instanceof ConfigurationSection sec) { - return sec.createSection(key); - } else { - @SuppressWarnings("unchecked") - List l = (List) current; - int index = Integer.parseInt(key); - while (l.size() <= index) { - l.add(null); - } - ConfigurationSection newSection = new MemorySection(this.root, createPath(this, path)); - l.set(index, newSection); - return newSection; - } - } - - @Override - @NotNull - public ConfigurationSection createSection(@NotNull String path, @NotNull Map map) { - ConfigurationSection section = this.createSection(path); - - for (Map.Entry entry : map.entrySet()) { - if (entry.getValue() instanceof Map) { - section.createSection(entry.getKey().toString(), (Map) entry.getValue()); - } else { - section.set(entry.getKey().toString(), entry.getValue()); - } - } - - return section; - } - - - @Override - @Nullable - public String getString(@NotNull String path) { - Object def = this.getDefault(path); - return this.getString(path, def != null ? def.toString() : null); - } - - @Override - @Contract("_, !null -> !null") - @Nullable - public String getString(@NotNull String path, @Nullable String def) { - Object val = this.get(path, def); - return (val != null) ? val.toString() : def; - } - - @Override - public boolean isString(@NotNull String path) { - Object val = this.get(path); - return val instanceof String; - } - - @Override - public int getInt(@NotNull String path) { - Object def = this.getDefault(path); - return this.getInt(path, (def instanceof Number) ? toInt(def) : 0); - } - - @Override - public int getInt(@NotNull String path, int def) { - Object val = this.get(path, def); - return (val instanceof Number) ? toInt(val) : def; - } - - @Override - public boolean isInt(@NotNull String path) { - Object val = this.get(path); - return val instanceof Integer; - } - - @Override - public boolean getBoolean(@NotNull String path) { - Object def = this.getDefault(path); - return this.getBoolean(path, (def instanceof Boolean) ? (Boolean) def : false); - } - - @Override - public boolean getBoolean(@NotNull String path, boolean def) { - Object val = this.get(path, def); - return (val instanceof Boolean) ? (Boolean) val : def; - } - - @Override - public boolean isBoolean(@NotNull String path) { - Object val = this.get(path); - return val instanceof Boolean; - } - - @Override - public double getDouble(@NotNull String path) { - Object def = this.getDefault(path); - return this.getDouble(path, (def instanceof Number) ? toDouble(def) : 0); - } - - @Override - public double getDouble(@NotNull String path, double def) { - Object val = this.get(path, def); - return (val instanceof Number) ? toDouble(val) : def; - } - - @Override - public boolean isDouble(@NotNull String path) { - Object val = this.get(path); - return val instanceof Double; - } - - @Override - public long getLong(@NotNull String path) { - Object def = this.getDefault(path); - return this.getLong(path, (def instanceof Number) ? toLong(def) : 0); - } - - @Override - public long getLong(@NotNull String path, long def) { - Object val = this.get(path, def); - return (val instanceof Number) ? toLong(val) : def; - } - - @Override - public boolean isLong(@NotNull String path) { - Object val = this.get(path); - return val instanceof Long; - } - - - @Override - @Nullable - public List getList(@NotNull String path) { - Object def = this.getDefault(path); - return this.getList(path, (def instanceof List) ? (List) def : null); - } - - @Override - @Contract("_, !null -> !null") - @Nullable - public List getList(@NotNull String path, @Nullable List def) { - Object val = this.get(path, def); - return (List) ((val instanceof List) ? val : def); - } - - @Override - public boolean isList(@NotNull String path) { - Object val = this.get(path); - return val instanceof List; - } - - @Override - @NotNull - public List getStringList(@NotNull String path) { - List list = this.getList(path); - - if (list == null) { - return new ArrayList(0); - } - - List result = new ArrayList(); - - for (Object object : list) { - if ((object instanceof String) || (this.isPrimitiveWrapper(object))) { - result.add(String.valueOf(object)); - } - } - - return result; - } - - @Override - @NotNull - public List getIntegerList(@NotNull String path) { - List list = this.getList(path); - - if (list == null) { - return new ArrayList(0); - } - - List result = new ArrayList(); - - for (Object object : list) { - if (object instanceof Integer) { - result.add((Integer) object); - } else if (object instanceof String) { - try { - result.add(Integer.valueOf((String) object)); - } catch (Exception ex) { - } - } else if (object instanceof Character) { - result.add((int) ((Character) object).charValue()); - } else if (object instanceof Number) { - result.add(((Number) object).intValue()); - } - } - - return result; - } - - @Override - @NotNull - public List getBooleanList(@NotNull String path) { - List list = this.getList(path); - - if (list == null) { - return new ArrayList(0); - } - - List result = new ArrayList(); - - for (Object object : list) { - if (object instanceof Boolean) { - result.add((Boolean) object); - } else if (object instanceof String) { - if (Boolean.TRUE.toString().equals(object)) { - result.add(true); - } else if (Boolean.FALSE.toString().equals(object)) { - result.add(false); - } - } - } - - return result; - } - - @Override - @NotNull - public List getDoubleList(@NotNull String path) { - List list = this.getList(path); - - if (list == null) { - return new ArrayList(0); - } - - List result = new ArrayList(); - - for (Object object : list) { - if (object instanceof Double) { - result.add((Double) object); - } else if (object instanceof String) { - try { - result.add(Double.valueOf((String) object)); - } catch (Exception ex) { - } - } else if (object instanceof Character) { - result.add((double) (Character) object); - } else if (object instanceof Number) { - result.add(((Number) object).doubleValue()); - } - } - - return result; - } - - @Override - @NotNull - public List getFloatList(@NotNull String path) { - List list = this.getList(path); - - if (list == null) { - return new ArrayList(0); - } - - List result = new ArrayList(); - - for (Object object : list) { - if (object instanceof Float) { - result.add((Float) object); - } else if (object instanceof String) { - try { - result.add(Float.valueOf((String) object)); - } catch (Exception ignored) { - } - } else if (object instanceof Character) { - result.add((float) (Character) object); - } else if (object instanceof Number) { - result.add(((Number) object).floatValue()); - } - } - - return result; - } - - @Override - @NotNull - public List getLongList(@NotNull String path) { - List list = this.getList(path); - - if (list == null) { - return new ArrayList(0); - } - - List result = new ArrayList(); - - for (Object object : list) { - if (object instanceof Long) { - result.add((Long) object); - } else if (object instanceof String) { - try { - result.add(Long.valueOf((String) object)); - } catch (Exception ignored) { - } - } else if (object instanceof Character) { - result.add((long) (Character) object); - } else if (object instanceof Number) { - result.add(((Number) object).longValue()); - } - } - - return result; - } - - @Override - @NotNull - public List getByteList(@NotNull String path) { - List list = this.getList(path); - - if (list == null) { - return new ArrayList(0); - } - - List result = new ArrayList(); - - for (Object object : list) { - if (object instanceof Byte) { - result.add((Byte) object); - } else if (object instanceof String) { - try { - result.add(Byte.valueOf((String) object)); - } catch (Exception ignored) { - } - } else if (object instanceof Character) { - result.add((byte) ((Character) object).charValue()); - } else if (object instanceof Number) { - result.add(((Number) object).byteValue()); - } - } - - return result; - } - - @Override - @NotNull - public List getCharacterList(@NotNull String path) { - List list = this.getList(path); - - if (list == null) { - return new ArrayList<>(0); - } - - List result = new ArrayList(); - - for (Object object : list) { - if (object instanceof Character) { - result.add((Character) object); - } else if (object instanceof String str) { - - if (str.length() == 1) { - result.add(str.charAt(0)); - } - } else if (object instanceof Number) { - result.add((char) ((Number) object).intValue()); - } - } - - return result; - } - - @Override - @NotNull - public List getShortList(@NotNull String path) { - List list = this.getList(path); - - if (list == null) { - return new ArrayList(0); - } - - List result = new ArrayList(); - - for (Object object : list) { - if (object instanceof Short) { - result.add((Short) object); - } else if (object instanceof String) { - try { - result.add(Short.valueOf((String) object)); - } catch (Exception ignored) { - } - } else if (object instanceof Character) { - result.add((short) ((Character) object).charValue()); - } else if (object instanceof Number) { - result.add(((Number) object).shortValue()); - } - } - - return result; - } - - @Override - @NotNull - public List> getMapList(@NotNull String path) { - List list = this.getList(path); - List> result = new ArrayList>(); - - if (list == null) { - return result; - } - - for (Object object : list) { - if (object instanceof Map) { - result.add((Map) object); - } else if (object instanceof ConfigurationSection section) { - result.add(section.getValues(false)); - } - } - - return result; - } - - @Override - @NotNull - public List getSectionList(@NotNull String path) { - List list = this.getList(path); - List result = new ArrayList<>(); - - if (list == null) { - return result; - } - - int index = 0; - for (Object object : list) { - if (object instanceof ConfigurationSection) { - result.add((ConfigurationSection) object); - } else if (object instanceof Map map) { - result.add(this.createSection(path + "." + index, map)); - } - index++; - } - - return result; - } - - - @Nullable - @Override - public T getObject(@NotNull String path, @NotNull Class clazz) { - Preconditions.checkNotNull(clazz, "Class cannot be null"); - Object def = this.getDefault(path); - return this.getObject(path, clazz, (clazz.isInstance(def)) ? clazz.cast(def) : null); - } - - @Contract("_, _, !null -> !null") - @Nullable - @Override - public T getObject(@NotNull String path, @NotNull Class clazz, @Nullable T def) { - Preconditions.checkNotNull(clazz, "Class cannot be null"); - Object val = this.get(path, def); - return (clazz.isInstance(val)) ? clazz.cast(val) : def; - } - - @Nullable - @Override - public T getSerializable(@NotNull String path, @NotNull Class clazz) { - return this.getObject(path, clazz); - } - - @Contract("_, _, !null -> !null") - @Nullable - @Override - public T getSerializable(@NotNull String path, @NotNull Class clazz, @Nullable T def) { - return this.getObject(path, clazz, def); - } - - @Override - @Nullable - public ConfigurationSection getConfigurationSection(@NotNull String path) { - Object val = this.get(path, null); - if (val != null) { - return (val instanceof ConfigurationSection) ? (ConfigurationSection) val : null; - } - - val = this.get(path, this.getDefault(path)); - return (val instanceof ConfigurationSection) ? this.createSection(path) : null; - } - - @Override - public boolean isConfigurationSection(@NotNull String path) { - Object val = this.get(path); - return val instanceof ConfigurationSection; - } - - protected boolean isPrimitiveWrapper(@Nullable Object input) { - return input instanceof Integer || input instanceof Boolean - || input instanceof Character || input instanceof Byte - || input instanceof Short || input instanceof Double - || input instanceof Long || input instanceof Float; - } - - @Nullable - protected Object getDefault(@NotNull String path) { - Preconditions.checkArgument(path != null, "Path cannot be null"); - - Configuration root = this.getRoot(); - Configuration defaults = root == null ? null : root.getDefaults(); - return (defaults == null) ? null : defaults.get(createPath(this, path)); - } - - protected void mapChildrenKeys(@NotNull Set output, @NotNull ConfigurationSection section, boolean deep) { - if (section instanceof MemorySection sec) { - - for (Map.Entry entry : sec.map.entrySet()) { - output.add(createPath(section, entry.getKey(), this)); - - if ((deep) && (entry.getValue().getData() instanceof ConfigurationSection subsection)) { - this.mapChildrenKeys(output, subsection, deep); - } - } - } else { - Set keys = section.getKeys(deep); - - for (String key : keys) { - output.add(createPath(section, key, this)); - } - } - } - - protected void mapChildrenValues(@NotNull Map output, @NotNull ConfigurationSection section, boolean deep) { - if (section instanceof MemorySection sec) { - - for (Map.Entry entry : sec.map.entrySet()) { - - - String childPath = createPath(section, entry.getKey(), this); - output.remove(childPath); - output.put(childPath, entry.getValue().getData()); - - if (entry.getValue().getData() instanceof ConfigurationSection) { - if (deep) { - this.mapChildrenValues(output, (ConfigurationSection) entry.getValue().getData(), deep); - } - } - } - } else { - Map values = section.getValues(deep); - - for (Map.Entry entry : values.entrySet()) { - output.put(createPath(section, entry.getKey(), this), entry.getValue()); - } - } - } - - - @NotNull - public static String createPath(@NotNull ConfigurationSection section, @Nullable String key) { - return createPath(section, key, (section == null) ? null : section.getRoot()); - } - - - @NotNull - public static String createPath(@NotNull ConfigurationSection section, @Nullable String key, @Nullable ConfigurationSection relativeTo) { - Preconditions.checkNotNull(section, "Cannot create path without a section"); - Configuration root = section.getRoot(); - if (root == null) { - throw new IllegalStateException("Cannot create path without a root"); - } - char separator = root.options().pathSeparator(); - - StringBuilder builder = new StringBuilder(); - for (ConfigurationSection parent = section; (parent != null) && (parent != relativeTo); parent = parent.getParent()) { - if (!builder.isEmpty()) { - builder.insert(0, separator); - } - builder.insert(0, parent.getName()); - } - - if ((key != null) && (!key.isEmpty())) { - if (!builder.isEmpty()) { - builder.append(separator); - } - - builder.append(key); - } - - return builder.toString(); - } - - @Override - @NotNull - public List getComments(@NotNull final String path) { - final SectionPathData pathData = this.getSectionPathData(path); - return pathData == null ? Collections.emptyList() : pathData.getComments(); - } - - @Override - @NotNull - public List getInlineComments(@NotNull final String path) { - final SectionPathData pathData = this.getSectionPathData(path); - return pathData == null ? Collections.emptyList() : pathData.getInlineComments(); - } - - @Override - public void setComments(@NotNull final String path, @Nullable final List comments) { - final SectionPathData pathData = this.getSectionPathData(path); - if (pathData != null) { - pathData.setComments(comments); - } - } - - @Override - public void setInlineComments(@NotNull final String path, @Nullable final List comments) { - final SectionPathData pathData = this.getSectionPathData(path); - if (pathData != null) { - pathData.setInlineComments(comments); - } - } - - @Nullable - private SectionPathData getSectionPathData(@NotNull String path) { - Preconditions.checkNotNull(path, "Path cannot be null"); - - Configuration root = this.getRoot(); - if (root == null) { - throw new IllegalStateException("Cannot access section without a root"); - } - - final char separator = root.options().pathSeparator(); - - - int i1 = -1, i2; - ConfigurationSection section = this; - while ((i1 = path.indexOf(separator, i2 = i1 + 1)) != -1) { - section = section.getConfigurationSection(path.substring(i2, i1)); - if (section == null) { - return null; - } - } - - String key = path.substring(i2); - if (section == this) { - return this.map.get(key); - } else if (section instanceof MemorySection) { - return ((MemorySection) section).getSectionPathData(key); - } - return null; - } - - @Override - public String toString() { - Configuration root = this.getRoot(); - return this.getClass().getSimpleName() + - "[path='" + - this.getCurrentPath() + - "', root='" + - (root == null ? null : root.getClass().getSimpleName()) + - "']"; - } -} diff --git a/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/SectionPathData.java b/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/SectionPathData.java deleted file mode 100644 index 1c7372bf..00000000 --- a/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/SectionPathData.java +++ /dev/null @@ -1,51 +0,0 @@ -package fr.robie.craftengineconverter.common.utils.yaml; - -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -import java.util.Collections; -import java.util.List; - -final class SectionPathData { - - private Object data; - private List comments; - private List inlineComments; - - public SectionPathData(@Nullable Object data) { - this.data = data; - this.comments = Collections.emptyList(); - this.inlineComments = Collections.emptyList(); - } - - @Nullable - public Object getData() { - return this.data; - } - - public void setData(@Nullable final Object data) { - this.data = data; - } - - - @NotNull - public List getComments() { - return this.comments; - } - - - public void setComments(@Nullable final List comments) { - this.comments = (comments == null) ? Collections.emptyList() : Collections.unmodifiableList(comments); - } - - - @NotNull - public List getInlineComments() { - return this.inlineComments; - } - - - public void setInlineComments(@Nullable final List inlineComments) { - this.inlineComments = (inlineComments == null) ? Collections.emptyList() : Collections.unmodifiableList(inlineComments); - } -} diff --git a/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/constructor/SmartConstructor.java b/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/constructor/SmartConstructor.java deleted file mode 100644 index 8466780f..00000000 --- a/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/constructor/SmartConstructor.java +++ /dev/null @@ -1,231 +0,0 @@ -package fr.robie.craftengineconverter.common.utils.yaml.constructor; - -import fr.robie.craftengineconverter.common.utils.yaml.directive.KeyDirective; -import fr.robie.craftengineconverter.common.utils.yaml.directive.KeyDirectiveRegistry; -import fr.robie.craftengineconverter.common.utils.yaml.serialization.ConfigurationSerialization; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.yaml.snakeyaml.LoaderOptions; -import org.yaml.snakeyaml.constructor.SafeConstructor; -import org.yaml.snakeyaml.nodes.MappingNode; -import org.yaml.snakeyaml.nodes.Node; -import org.yaml.snakeyaml.nodes.NodeTuple; -import org.yaml.snakeyaml.nodes.ScalarNode; - -import java.util.LinkedHashMap; -import java.util.Map; - -public class SmartConstructor extends SafeConstructor { - - private static final String PREFIX = "$$"; - private static final String FALLBACK_STRIPPED = "fallback"; - - public SmartConstructor(@NotNull LoaderOptions options) { - super(options); - } - - @Override - public void flattenMapping(@NotNull final MappingNode node) { - super.flattenMapping(node); - } - - @Nullable - public Object construct(@NotNull Node node) { - return this.constructObject(node); - } - - @Override - public Object constructObject(Node node) { - if (node instanceof MappingNode mn && this.isValueSelectorNode(mn)) { - return this.constructValueSelector(mn); - } - Object result = super.constructObject(node); - if (result instanceof Map map && map.containsKey(ConfigurationSerialization.SERIALIZED_TYPE_KEY)) { - try { - //noinspection unchecked - return ConfigurationSerialization.deserializeObject((Map) map); - } catch (Exception ignored) { - } - } - return result; - } - - @Override - protected Map constructMapping(MappingNode node) { - Map map = new LinkedHashMap<>(); - - for (NodeTuple tuple : node.getValue()) { - if (!(tuple.getKeyNode() instanceof ScalarNode scalarNode)) { - continue; - } - - String key = this.constructScalar(scalarNode); - Node valueNode = tuple.getValueNode(); - - if (key.startsWith(PREFIX)) { - String strippedKey = key.substring(PREFIX.length()); - KeyDirective directive = KeyDirectiveRegistry.findMatch(strippedKey); - if (directive != null) { - directive.handleBlockMerge(map, strippedKey, valueNode, this); - } - } else if (key.contains("::")) { - this.processDeepKey(map, key, valueNode); - } else { - Object value = this.constructObjectPublic(valueNode); - this.setWithMerge(map, key, value, key); - } - } - - return map; - } - - private boolean isValueSelectorNode(MappingNode node) { - if (node.getValue().isEmpty()) { - return false; - } - for (NodeTuple t : node.getValue()) { - if (!(t.getKeyNode() instanceof ScalarNode sn)) { - return false; - } - if (!sn.getValue().startsWith(PREFIX)) { - return false; - } - } - return true; - } - - @SuppressWarnings("unchecked") - private void processDeepKey(Map rootMap, String fullKey, Node valueNode) { - String[] parts = fullKey.split("::"); - Object current = rootMap; - - for (int i = 0; i < parts.length - 1; i++) { - String part = parts[i]; - String nextPart = parts[i + 1]; - boolean isNextIndex = this.isInteger(nextPart); - - if (current instanceof Map) { - Map map = (Map) current; - Object existing = map.get(part); - - if (existing != null) { - current = existing; - } else { - Object next; - if (isNextIndex) { - next = new java.util.ArrayList<>(); - } else { - next = new LinkedHashMap<>(); - } - map.put(part, next); - current = next; - } - } else if (current instanceof java.util.List) { - java.util.List list = (java.util.List) current; - int index = Integer.parseInt(part); - - while (list.size() <= index) { - list.add(null); - } - - Object existing = list.get(index); - if (existing != null) { - current = existing; - } else { - Object next; - if (isNextIndex) { - next = new java.util.ArrayList<>(); - } else { - next = new LinkedHashMap<>(); - } - list.set(index, next); - current = next; - } - } - } - - String finalPart = parts[parts.length - 1]; - Object value = this.constructObjectPublic(valueNode); - - if (current instanceof Map) { - this.setWithMerge((Map) current, finalPart, value, fullKey); - } else if (current instanceof java.util.List) { - java.util.List list = (java.util.List) current; - int index = Integer.parseInt(finalPart); - while (list.size() <= index) { - list.add(null); - } - list.set(index, value); - } - } - - private boolean isInteger(String s) { - if (s == null || s.isEmpty()) { - return false; - } - for (int i = 0; i < s.length(); i++) { - if (!Character.isDigit(s.charAt(i))) { - return false; - } - } - return true; - } - - private Object constructValueSelector(MappingNode node) { - Object fallback = null; - Object matched = null; - - for (NodeTuple tuple : node.getValue()) { - String key = this.constructScalar((ScalarNode) tuple.getKeyNode()); - String strippedKey = key.startsWith(PREFIX) ? key.substring(PREFIX.length()) : key; - - if (FALLBACK_STRIPPED.equals(strippedKey)) { - fallback = this.constructObjectPublic(tuple.getValueNode()); - continue; - } - - KeyDirective directive = KeyDirectiveRegistry.findMatch(strippedKey); - if (directive != null) { - Object candidate = directive.handleValueSelect(strippedKey, tuple.getValueNode(), this); - if (candidate != null) { - matched = candidate; - } - } - } - - return matched != null ? matched : fallback; - } - - public Object constructObjectPublic(@NotNull Node node) { - return this.constructObject(node); - } - - @SuppressWarnings("unchecked") - public void mergeInto(@NotNull Map target, @NotNull Map source, @NotNull String parentPath) { - for (Map.Entry e : source.entrySet()) { - String key = e.getKey().toString(); - Object srcVal = e.getValue(); - Object tgtVal = target.get(key); - - String path = parentPath.isEmpty() ? key : parentPath + "." + key; - - if (tgtVal == null) { - target.put(key, srcVal); - } else if (tgtVal instanceof Map && srcVal instanceof Map) { - this.mergeInto((Map) tgtVal, (Map) srcVal, path); - } else { - target.put(key, srcVal); - } - } - } - - @SuppressWarnings("unchecked") - private void setWithMerge(Map map, String key, Object value, String path) { - Object existing = map.get(key); - if (existing instanceof Map && value instanceof Map) { - this.mergeInto((Map) existing, (Map) value, path); - } else { - map.put(key, value); - } - } -} \ No newline at end of file diff --git a/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/directive/KeyDirective.java b/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/directive/KeyDirective.java deleted file mode 100644 index d7086ed3..00000000 --- a/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/directive/KeyDirective.java +++ /dev/null @@ -1,18 +0,0 @@ -package fr.robie.craftengineconverter.common.utils.yaml.directive; - -import fr.robie.craftengineconverter.common.utils.yaml.constructor.SmartConstructor; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.yaml.snakeyaml.nodes.Node; - -import java.util.Map; - -public interface KeyDirective { - - boolean matches(@NotNull String key); - - void handleBlockMerge(@NotNull Map targetMap, @NotNull String key, @NotNull Node valueNode, @NotNull SmartConstructor constructor); - - @Nullable - Object handleValueSelect(@NotNull String key, @NotNull Node valueNode, @NotNull SmartConstructor constructor); -} \ No newline at end of file diff --git a/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/directive/KeyDirectiveRegistry.java b/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/directive/KeyDirectiveRegistry.java deleted file mode 100644 index 11532ab5..00000000 --- a/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/directive/KeyDirectiveRegistry.java +++ /dev/null @@ -1,37 +0,0 @@ -package fr.robie.craftengineconverter.common.utils.yaml.directive; - -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -public final class KeyDirectiveRegistry { - private static final List DIRECTIVES = new ArrayList<>(); - - static { - register(new VersionKeyDirective()); - register(new PluginKeyDirective()); - register(new MergeKeyDirective()); - } - - private KeyDirectiveRegistry() {} - - public static void register(@NotNull KeyDirective directive) { - DIRECTIVES.add(directive); - } - - @NotNull - public static List getAll() { - return Collections.unmodifiableList(DIRECTIVES); - } - - @Nullable - public static KeyDirective findMatch(@NotNull String key) { - for (KeyDirective d : DIRECTIVES) { - if (d.matches(key)) return d; - } - return null; - } -} \ No newline at end of file diff --git a/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/directive/MergeKeyDirective.java b/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/directive/MergeKeyDirective.java deleted file mode 100644 index 0c6030b8..00000000 --- a/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/directive/MergeKeyDirective.java +++ /dev/null @@ -1,42 +0,0 @@ -package fr.robie.craftengineconverter.common.utils.yaml.directive; - -import fr.robie.craftengineconverter.common.utils.yaml.constructor.SmartConstructor; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.yaml.snakeyaml.nodes.Node; - -import java.util.List; -import java.util.Map; - -public class MergeKeyDirective implements KeyDirective { - - @Override - public boolean matches(@NotNull String key) { - return key.startsWith("merge"); - } - - @Override - public void handleBlockMerge(@NotNull Map targetMap, @NotNull String key, @NotNull Node valueNode, @NotNull SmartConstructor constructor) { - Object val = constructor.constructObjectPublic(valueNode); - - if (val instanceof Map) { - @SuppressWarnings("unchecked") - Map map = (Map) val; - constructor.mergeInto(targetMap, map, key); - } else if (val instanceof List) { - for (Object item : (List) val) { - if (item instanceof Map) { - @SuppressWarnings("unchecked") - Map map = (Map) item; - constructor.mergeInto(targetMap, map, key); - } - } - } - } - - @Override - @Nullable - public Object handleValueSelect(@NotNull String key, @NotNull Node valueNode, @NotNull SmartConstructor constructor) { - return constructor.constructObjectPublic(valueNode); - } -} diff --git a/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/directive/PluginKeyDirective.java b/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/directive/PluginKeyDirective.java index de4a8bb3..29b36eb8 100644 --- a/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/directive/PluginKeyDirective.java +++ b/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/directive/PluginKeyDirective.java @@ -1,6 +1,7 @@ package fr.robie.craftengineconverter.common.utils.yaml.directive; -import fr.robie.craftengineconverter.common.utils.yaml.constructor.SmartConstructor; +import fr.robie.yamllibrary.constructor.SmartConstructor; +import fr.robie.yamllibrary.directive.KeyDirective; import org.bukkit.Bukkit; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; diff --git a/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/directive/VersionKeyDirective.java b/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/directive/VersionKeyDirective.java index b04d31cc..cb7c5fc2 100644 --- a/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/directive/VersionKeyDirective.java +++ b/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/directive/VersionKeyDirective.java @@ -1,7 +1,8 @@ package fr.robie.craftengineconverter.common.utils.yaml.directive; import fr.robie.craftengineconverter.api.utils.MinecraftVersion; -import fr.robie.craftengineconverter.common.utils.yaml.constructor.SmartConstructor; +import fr.robie.yamllibrary.constructor.SmartConstructor; +import fr.robie.yamllibrary.directive.KeyDirective; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.yaml.snakeyaml.nodes.MappingNode; @@ -12,7 +13,7 @@ import java.util.regex.Pattern; public class VersionKeyDirective implements KeyDirective { - private static final Pattern VERSION_PATTERN = Pattern.compile("^(>=|<=|>|<|!=|==)?([\\d][\\d.]*)(?:~([\\d][\\d.]*))?(?:#.*)?$"); + private static final Pattern VERSION_PATTERN = Pattern.compile("^(>=|<=|>|<|!=|==)?(\\d[\\d.]*)(?:~(\\d[\\d.]*))?(?:#.*)?$"); @Override public boolean matches(@NotNull String key) { diff --git a/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/file/FileConfiguration.java b/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/file/FileConfiguration.java deleted file mode 100644 index e8d1bacb..00000000 --- a/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/file/FileConfiguration.java +++ /dev/null @@ -1,89 +0,0 @@ -package fr.robie.craftengineconverter.common.utils.yaml.file; - -import com.google.common.base.Preconditions; -import com.google.common.io.Files; -import fr.robie.craftengineconverter.api.yaml.Configuration; -import fr.robie.craftengineconverter.common.utils.yaml.MemoryConfiguration; -import org.bukkit.configuration.InvalidConfigurationException; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -import java.io.*; -import java.nio.charset.StandardCharsets; - -public abstract class FileConfiguration extends MemoryConfiguration { - - public FileConfiguration() { - super(); - } - - public FileConfiguration(@Nullable Configuration defaults) { - super(defaults); - } - - public void save(@NotNull File file) throws IOException { - Preconditions.checkNotNull(file, "File cannot be null"); - - Files.createParentDirs(file); - - String data = this.saveToString(); - - try (Writer writer = new OutputStreamWriter(new FileOutputStream(file), StandardCharsets.UTF_8)) { - writer.write(data); - } - } - - public void save(@NotNull String file) throws IOException { - Preconditions.checkNotNull(file, "File cannot be null"); - - this.save(new File(file)); - } - - @NotNull - public abstract String saveToString(); - - public void load(@NotNull File file) throws IOException, InvalidConfigurationException { - Preconditions.checkNotNull(file, "File cannot be null"); - - final FileInputStream stream = new FileInputStream(file); - - this.load(new InputStreamReader(stream, StandardCharsets.UTF_8)); - } - - public void load(@NotNull Reader reader) throws IOException, InvalidConfigurationException { - BufferedReader input = reader instanceof BufferedReader ? (BufferedReader) reader : new BufferedReader(reader); - - StringBuilder builder = new StringBuilder(); - - try { - String line; - - while ((line = input.readLine()) != null) { - builder.append(line); - builder.append('\n'); - } - } finally { - input.close(); - } - - this.loadFromString(builder.toString()); - } - - public void load(@NotNull String file) throws IOException, InvalidConfigurationException { - Preconditions.checkNotNull(file, "File cannot be null"); - - this.load(new File(file)); - } - - public abstract void loadFromString(@NotNull String contents) throws InvalidConfigurationException; - - @NotNull - @Override - public FileConfigurationOptions options() { - if (this.options == null) { - this.options = new FileConfigurationOptions(this); - } - - return (FileConfigurationOptions) this.options; - } -} diff --git a/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/file/FileConfigurationOptions.java b/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/file/FileConfigurationOptions.java deleted file mode 100644 index 4499b659..00000000 --- a/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/file/FileConfigurationOptions.java +++ /dev/null @@ -1,71 +0,0 @@ -package fr.robie.craftengineconverter.common.utils.yaml.file; - -import fr.robie.craftengineconverter.common.utils.yaml.MemoryConfiguration; -import fr.robie.craftengineconverter.common.utils.yaml.MemoryConfigurationOptions; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -import java.util.Collections; -import java.util.List; - -public class FileConfigurationOptions extends MemoryConfigurationOptions { - private List header = Collections.emptyList(); - private List footer = Collections.emptyList(); - private boolean parseComments = true; - - protected FileConfigurationOptions(@NotNull MemoryConfiguration configuration) { - super(configuration); - } - - @NotNull - @Override - public FileConfiguration configuration() { - return (FileConfiguration) super.configuration(); - } - - @NotNull - @Override - public FileConfigurationOptions copyDefaults(boolean value) { - super.copyDefaults(value); - return this; - } - - @NotNull - @Override - public FileConfigurationOptions pathSeparator(char value) { - super.pathSeparator(value); - return this; - } - - @NotNull - public List getHeader() { - return this.header; - } - - @NotNull - public FileConfigurationOptions setHeader(@Nullable List value) { - this.header = (value == null) ? Collections.emptyList() : Collections.unmodifiableList(value); - return this; - } - - @NotNull - public List getFooter() { - return this.footer; - } - - @NotNull - public FileConfigurationOptions setFooter(@Nullable List value) { - this.footer = (value == null) ? Collections.emptyList() : Collections.unmodifiableList(value); - return this; - } - - public boolean parseComments() { - return this.parseComments; - } - - @NotNull - public MemoryConfigurationOptions parseComments(boolean value) { - this.parseComments = value; - return this; - } -} diff --git a/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/file/YamlConfiguration.java b/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/file/YamlConfiguration.java deleted file mode 100644 index 421c4a61..00000000 --- a/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/file/YamlConfiguration.java +++ /dev/null @@ -1,301 +0,0 @@ -package fr.robie.craftengineconverter.common.utils.yaml.file; - -import com.google.common.base.Preconditions; -import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; -import fr.robie.craftengineconverter.common.utils.yaml.constructor.SmartConstructor; -import fr.robie.craftengineconverter.common.utils.yaml.serialization.ConfigurationSerialization; -import fr.robie.messageflow.logger.Logger; -import org.bukkit.configuration.InvalidConfigurationException; -import org.jetbrains.annotations.NotNull; -import org.yaml.snakeyaml.DumperOptions; -import org.yaml.snakeyaml.LoaderOptions; -import org.yaml.snakeyaml.Yaml; -import org.yaml.snakeyaml.comments.CommentLine; -import org.yaml.snakeyaml.comments.CommentType; -import org.yaml.snakeyaml.error.YAMLException; -import org.yaml.snakeyaml.nodes.*; -import org.yaml.snakeyaml.reader.UnicodeReader; - -import java.io.*; -import java.nio.charset.StandardCharsets; -import java.util.ArrayList; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; - -public class YamlConfiguration extends FileConfiguration { - private final DumperOptions yamlDumperOptions; - private final LoaderOptions yamlLoaderOptions; - private final SmartConstructor constructor; - private final YamlRepresenter representer; - private final Yaml yaml; - - public YamlConfiguration() { - this.yamlDumperOptions = new DumperOptions(); - this.yamlDumperOptions.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK); - this.yamlLoaderOptions = new LoaderOptions(); - this.yamlLoaderOptions.setMaxAliasesForCollections(Integer.MAX_VALUE); - this.yamlLoaderOptions.setCodePointLimit(Integer.MAX_VALUE); - this.yamlLoaderOptions.setNestingDepthLimit(100); - - this.constructor = new SmartConstructor(this.yamlLoaderOptions); - this.representer = new YamlRepresenter(this.yamlDumperOptions); - this.representer.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK); - - this.yaml = new Yaml(this.constructor, this.representer, this.yamlDumperOptions, this.yamlLoaderOptions); - } - - @NotNull - @Override - public String saveToString() { - this.yamlDumperOptions.setIndent(this.options().indent()); - this.yamlDumperOptions.setWidth(this.options().width()); - this.yamlDumperOptions.setProcessComments(this.options().parseComments()); - - MappingNode node = this.toNodeTree(this); - - node.setBlockComments(this.getCommentLines(this.saveHeader(this.options().getHeader()), CommentType.BLOCK)); - node.setEndComments(this.getCommentLines(this.options().getFooter(), CommentType.BLOCK)); - - StringWriter writer = new StringWriter(); - if (node.getBlockComments().isEmpty() && node.getEndComments().isEmpty() && node.getValue().isEmpty()) { - writer.write(""); - } else { - if (node.getValue().isEmpty()) { - node.setFlowStyle(DumperOptions.FlowStyle.FLOW); - } - this.yaml.serialize(node, writer); - } - return writer.toString(); - } - - @Override - public void loadFromString(@NotNull String contents) throws InvalidConfigurationException { - Preconditions.checkNotNull(contents, "Contents cannot be null"); - this.yamlLoaderOptions.setProcessComments(this.options().parseComments()); - this.yamlLoaderOptions.setCodePointLimit(this.options().codePointLimit()); - - MappingNode node; - try (Reader reader = new UnicodeReader(new ByteArrayInputStream(contents.getBytes(StandardCharsets.UTF_8)))) { - Node rawNode = this.yaml.compose(reader); - try { - node = (MappingNode) rawNode; - } catch (ClassCastException e) { - throw new InvalidConfigurationException("Top level is not a Map."); - } - } catch (YAMLException | IOException | ClassCastException e) { - throw new InvalidConfigurationException(e); - } - - this.map.clear(); - - if (node != null) { - this.adjustNodeComments(node); - this.options().setHeader(this.loadHeader(this.getCommentLines(node.getBlockComments()))); - this.options().setFooter(this.getCommentLines(node.getEndComments())); - this.fromNodeTree(node, this); - } - } - - private void adjustNodeComments(final MappingNode node) { - if (node.getBlockComments() == null && !node.getValue().isEmpty()) { - Node firstNode = node.getValue().getFirst().getKeyNode(); - List lines = firstNode.getBlockComments(); - if (lines != null) { - int index = -1; - for (int i = 0; i < lines.size(); i++) { - if (lines.get(i).getCommentType() == CommentType.BLANK_LINE) { - index = i; - } - } - if (index != -1) { - node.setBlockComments(lines.subList(0, index + 1)); - firstNode.setBlockComments(lines.subList(index + 1, lines.size())); - } - } - } - } - - private void fromNodeTree(@NotNull MappingNode input, @NotNull ConfigurationSection section) { - this.constructor.flattenMapping(input); - for (NodeTuple nodeTuple : input.getValue()) { - Node key = nodeTuple.getKeyNode(); - String keyString = String.valueOf(this.constructor.construct(key)); - Node value = nodeTuple.getValueNode(); - - while (value instanceof AnchorNode) { - value = ((AnchorNode) value).getRealNode(); - } - - if (value instanceof MappingNode && !this.hasSerializedTypeKey((MappingNode) value)) { - this.fromNodeTree((MappingNode) value, section.createSection(keyString)); - } else if (value instanceof SequenceNode) { - section.set(keyString, this.fromSequenceNode((SequenceNode) value, section, keyString)); - } else { - section.set(keyString, this.constructor.construct(value)); - } - - section.setComments(keyString, this.getCommentLines(key.getBlockComments())); - if (value instanceof MappingNode || value instanceof SequenceNode) { - section.setInlineComments(keyString, this.getCommentLines(key.getInLineComments())); - } else { - section.setInlineComments(keyString, this.getCommentLines(value.getInLineComments())); - } - } - } - - private List fromSequenceNode(@NotNull SequenceNode input, @NotNull ConfigurationSection section, @NotNull String path) { - List result = new ArrayList<>(); - int index = 0; - for (Node node : input.getValue()) { - Node value = node; - while (value instanceof AnchorNode) { - value = ((AnchorNode) value).getRealNode(); - } - - if (value instanceof MappingNode && !this.hasSerializedTypeKey((MappingNode) value)) { - ConfigurationSection subSection = section.createSection(path + "." + index); - this.fromNodeTree((MappingNode) value, subSection); - result.add(subSection); - } else if (value instanceof SequenceNode) { - result.add(this.fromSequenceNode((SequenceNode) value, section, path + "." + index)); - } else { - result.add(this.constructor.construct(value)); - } - index++; - } - return result; - } - - private boolean hasSerializedTypeKey(MappingNode node) { - for (NodeTuple nodeTuple : node.getValue()) { - Node keyNode = nodeTuple.getKeyNode(); - if (!(keyNode instanceof ScalarNode)) { - continue; - } - String key = ((ScalarNode) keyNode).getValue(); - if (key.equals(ConfigurationSerialization.SERIALIZED_TYPE_KEY)) { - return true; - } - } - return false; - } - - private MappingNode toNodeTree(@NotNull ConfigurationSection section) { - List nodeTuples = new ArrayList<>(); - for (Map.Entry entry : section.getValues(false).entrySet()) { - Node key = this.representer.represent(entry.getKey()); - Node value; - if (entry.getValue() instanceof ConfigurationSection) { - value = this.toNodeTree((ConfigurationSection) entry.getValue()); - } else { - value = this.representer.represent(entry.getValue()); - } - key.setBlockComments(this.getCommentLines(section.getComments(entry.getKey()), CommentType.BLOCK)); - if (value instanceof MappingNode || value instanceof SequenceNode) { - key.setInLineComments(this.getCommentLines(section.getInlineComments(entry.getKey()), CommentType.IN_LINE)); - } else { - value.setInLineComments(this.getCommentLines(section.getInlineComments(entry.getKey()), CommentType.IN_LINE)); - } - - nodeTuples.add(new NodeTuple(key, value)); - } - - return new MappingNode(Tag.MAP, nodeTuples, DumperOptions.FlowStyle.BLOCK); - } - - private List getCommentLines(List comments) { - List lines = new ArrayList<>(); - if (comments != null) { - for (CommentLine comment : comments) { - if (comment.getCommentType() == CommentType.BLANK_LINE) { - lines.add(null); - } else { - String line = comment.getValue(); - line = line.startsWith(" ") ? line.substring(1) : line; - lines.add(line); - } - } - } - return lines; - } - - private List getCommentLines(List comments, CommentType commentType) { - List lines = new ArrayList(); - for (String comment : comments) { - if (comment == null) { - lines.add(new CommentLine(null, null, "", CommentType.BLANK_LINE)); - } else { - String line = comment; - line = line.isEmpty() ? line : " " + line; - lines.add(new CommentLine(null, null, line, commentType)); - } - } - return lines; - } - - private List loadHeader(List header) { - LinkedList list = new LinkedList<>(header); - - if (!list.isEmpty()) { - list.removeLast(); - } - - while (!list.isEmpty() && list.peek() == null) { - list.remove(); - } - - return list; - } - - private List saveHeader(List header) { - LinkedList list = new LinkedList<>(header); - - if (!list.isEmpty()) { - list.add(null); - } - - return list; - } - - @NotNull - @Override - public YamlConfigurationOptions options() { - if (this.options == null) { - this.options = new YamlConfigurationOptions(this); - } - - return (YamlConfigurationOptions) this.options; - } - - @NotNull - public static YamlConfiguration loadConfiguration(@NotNull File file) { - Preconditions.checkNotNull(file, "File cannot be null"); - - YamlConfiguration config = new YamlConfiguration(); - - try { - config.load(file); - } catch (FileNotFoundException ignored) { - } catch (IOException | InvalidConfigurationException ex) { - Logger.error("Cannot load configuration from file: " + file, ex); - } - - return config; - } - - @NotNull - public static YamlConfiguration loadConfiguration(@NotNull Reader reader) { - Preconditions.checkNotNull(reader, "Reader cannot be null"); - - YamlConfiguration config = new YamlConfiguration(); - - try { - config.load(reader); - } catch (IOException | InvalidConfigurationException ex) { - Logger.error("Cannot load configuration from stream.", ex); - } - - return config; - } -} diff --git a/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/file/YamlConfigurationOptions.java b/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/file/YamlConfigurationOptions.java deleted file mode 100644 index d3b49e5b..00000000 --- a/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/file/YamlConfigurationOptions.java +++ /dev/null @@ -1,91 +0,0 @@ -package fr.robie.craftengineconverter.common.utils.yaml.file; - -import com.google.common.base.Preconditions; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -import java.util.List; - -public class YamlConfigurationOptions extends FileConfigurationOptions { - private int indent = 2; - private int width = 80; - private int codePointLimit = Integer.MAX_VALUE; - - protected YamlConfigurationOptions(@NotNull YamlConfiguration configuration) { - super(configuration); - } - - @NotNull - @Override - public YamlConfiguration configuration() { - return (YamlConfiguration) super.configuration(); - } - - @NotNull - @Override - public YamlConfigurationOptions copyDefaults(boolean value) { - super.copyDefaults(value); - return this; - } - - @NotNull - @Override - public YamlConfigurationOptions pathSeparator(char value) { - super.pathSeparator(value); - return this; - } - - @NotNull - @Override - public YamlConfigurationOptions setHeader(@Nullable List value) { - super.setHeader(value); - return this; - } - - @NotNull - @Override - public YamlConfigurationOptions setFooter(@Nullable List value) { - super.setFooter(value); - return this; - } - - @NotNull - @Override - public YamlConfigurationOptions parseComments(boolean value) { - super.parseComments(value); - return this; - } - - public int indent() { - return this.indent; - } - - @NotNull - public YamlConfigurationOptions indent(int value) { - Preconditions.checkArgument(value >= 2, "Indent must be at least 2 characters"); - Preconditions.checkArgument(value <= 9, "Indent cannot be greater than 9 characters"); - - this.indent = value; - return this; - } - - public int width() { - return this.width; - } - - @NotNull - public YamlConfigurationOptions width(int value) { - this.width = value; - return this; - } - - public int codePointLimit() { - return this.codePointLimit; - } - - @NotNull - public YamlConfigurationOptions codePointLimit(int codePointLimit) { - this.codePointLimit = codePointLimit; - return this; - } -} diff --git a/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/file/YamlRepresenter.java b/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/file/YamlRepresenter.java deleted file mode 100644 index 83abed29..00000000 --- a/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/file/YamlRepresenter.java +++ /dev/null @@ -1,44 +0,0 @@ -package fr.robie.craftengineconverter.common.utils.yaml.file; - -import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; -import fr.robie.craftengineconverter.common.utils.yaml.serialization.ConfigurationSerialization; -import org.bukkit.configuration.serialization.ConfigurationSerializable; -import org.jetbrains.annotations.NotNull; -import org.yaml.snakeyaml.DumperOptions; -import org.yaml.snakeyaml.nodes.Node; -import org.yaml.snakeyaml.representer.Representer; - -import java.util.LinkedHashMap; -import java.util.Map; - -public class YamlRepresenter extends Representer { - - public YamlRepresenter(@NotNull DumperOptions options) { - super(options); - this.multiRepresenters.put(ConfigurationSection.class, new RepresentConfigurationSection()); - this.multiRepresenters.put(ConfigurationSerializable.class, new RepresentConfigurationSerializable()); - this.multiRepresenters.remove(Enum.class); - } - - private class RepresentConfigurationSection extends RepresentMap { - @NotNull - @Override - public Node representData(@NotNull Object data) { - return super.representData(((ConfigurationSection) data).getValues(false)); - } - } - - private class RepresentConfigurationSerializable extends RepresentMap { - - @NotNull - @Override - public Node representData(@NotNull Object data) { - ConfigurationSerializable serializable = (ConfigurationSerializable) data; - Map values = new LinkedHashMap<>(); - values.put(ConfigurationSerialization.SERIALIZED_TYPE_KEY, ConfigurationSerialization.getAlias(serializable.getClass())); - values.putAll(serializable.serialize()); - - return super.representData(values); - } - } -} diff --git a/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/serialization/ConfigurationSerialization.java b/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/serialization/ConfigurationSerialization.java deleted file mode 100644 index df070650..00000000 --- a/Common/src/main/java/fr/robie/craftengineconverter/common/utils/yaml/serialization/ConfigurationSerialization.java +++ /dev/null @@ -1,220 +0,0 @@ -package fr.robie.craftengineconverter.common.utils.yaml.serialization; - -import com.google.common.base.Preconditions; -import org.bukkit.Color; -import org.bukkit.FireworkEffect; -import org.bukkit.Location; -import org.bukkit.attribute.AttributeModifier; -import org.bukkit.block.banner.Pattern; -import org.bukkit.block.spawner.SpawnRule; -import org.bukkit.configuration.serialization.ConfigurationSerializable; -import org.bukkit.configuration.serialization.DelegateDeserialization; -import org.bukkit.configuration.serialization.SerializableAs; -import org.bukkit.inventory.ItemStack; -import org.bukkit.potion.PotionEffect; -import org.bukkit.util.BlockVector; -import org.bukkit.util.BoundingBox; -import org.bukkit.util.Vector; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -import java.lang.reflect.Constructor; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.lang.reflect.Modifier; -import java.util.HashMap; -import java.util.Map; -import java.util.logging.Level; -import java.util.logging.Logger; - -public class ConfigurationSerialization { - public static final String SERIALIZED_TYPE_KEY = "=="; - private final Class clazz; - private static final Map> aliases = new HashMap<>(); - - static { - registerClass(Vector.class); - registerClass(BlockVector.class); - registerClass(ItemStack.class); - registerClass(Color.class); - registerClass(PotionEffect.class); - registerClass(FireworkEffect.class); - registerClass(Pattern.class); - registerClass(Location.class); - registerClass(AttributeModifier.class); - registerClass(BoundingBox.class); - registerClass(SpawnRule.class); - } - - protected ConfigurationSerialization(@NotNull Class clazz) { - this.clazz = clazz; - } - - @Nullable - protected Method getMethod(@NotNull String name) { - try { - Method method = this.clazz.getDeclaredMethod(name, Map.class); - - if (!ConfigurationSerializable.class.isAssignableFrom(method.getReturnType())) { - return null; - } - if (!Modifier.isStatic(method.getModifiers())) { - return null; - } - - return method; - } catch (NoSuchMethodException | SecurityException ex) { - return null; - } - } - - @Nullable - protected Constructor getConstructor() { - try { - return this.clazz.getConstructor(Map.class); - } catch (NoSuchMethodException | SecurityException ex) { - return null; - } - } - - @Nullable - protected ConfigurationSerializable deserializeViaMethod(@NotNull Method method, @NotNull Map args) { - try { - ConfigurationSerializable result = (ConfigurationSerializable) method.invoke(null, args); - - if (result == null) { - Logger.getLogger(ConfigurationSerialization.class.getName()).log(Level.SEVERE, "Could not call method '" + method + "' of " + this.clazz + " for deserialization: method returned null"); - } else { - return result; - } - } catch (Throwable ex) { - Logger.getLogger(ConfigurationSerialization.class.getName()).log( - Level.SEVERE, - "Could not call method '" + method + "' of " + this.clazz + " for deserialization", - ex instanceof InvocationTargetException ? ex.getCause() : ex); - } - - return null; - } - - @Nullable - protected ConfigurationSerializable deserializeViaCtor(@NotNull Constructor ctor, @NotNull Map args) { - try { - return ctor.newInstance(args); - } catch (Throwable ex) { - Logger.getLogger(ConfigurationSerialization.class.getName()).log( - Level.SEVERE, - "Could not call constructor '" + ctor + "' of " + this.clazz + " for deserialization", - ex instanceof InvocationTargetException ? ex.getCause() : ex); - } - - return null; - } - - @Nullable - public ConfigurationSerializable deserialize(@NotNull Map args) { - Preconditions.checkArgument(args != null, "Args must not be null"); - - ConfigurationSerializable result = null; - Method method = this.getMethod("deserialize"); - - if (method != null) { - result = this.deserializeViaMethod(method, args); - } - - if (result == null) { - method = this.getMethod("valueOf"); - - if (method != null) { - result = this.deserializeViaMethod(method, args); - } - } - - if (result == null) { - Constructor constructor = this.getConstructor(); - - if (constructor != null) { - result = this.deserializeViaCtor(constructor, args); - } - } - - return result; - } - - @Nullable - public static ConfigurationSerializable deserializeObject(@NotNull Map args, @NotNull Class clazz) { - return new ConfigurationSerialization(clazz).deserialize(args); - } - - @Nullable - public static ConfigurationSerializable deserializeObject(@NotNull Map args) { - Class clazz; - - if (args.containsKey(SERIALIZED_TYPE_KEY)) { - try { - String alias = (String) args.get(SERIALIZED_TYPE_KEY); - - if (alias == null) { - throw new IllegalArgumentException("Cannot have null alias"); - } - clazz = getClassByAlias(alias); - if (clazz == null) { - throw new IllegalArgumentException("Specified class does not exist ('" + alias + "')"); - } - } catch (ClassCastException ex) { - ex.fillInStackTrace(); - throw ex; - } - } else { - throw new IllegalArgumentException("Args doesn't contain type key ('" + SERIALIZED_TYPE_KEY + "')"); - } - - return new ConfigurationSerialization(clazz).deserialize(args); - } - - public static void registerClass(@NotNull Class clazz) { - DelegateDeserialization delegate = clazz.getAnnotation(DelegateDeserialization.class); - - if (delegate == null) { - registerClass(clazz, getAlias(clazz)); - registerClass(clazz, clazz.getName()); - } - } - - public static void registerClass(@NotNull Class clazz, @NotNull String alias) { - aliases.put(alias, clazz); - } - - public static void unregisterClass(@NotNull String alias) { - aliases.remove(alias); - } - - public static void unregisterClass(@NotNull Class clazz) { - while (aliases.values().remove(clazz)) { - } - } - - @Nullable - public static Class getClassByAlias(@NotNull String alias) { - return aliases.get(alias); - } - - @NotNull - public static String getAlias(@NotNull Class clazz) { - DelegateDeserialization delegate = clazz.getAnnotation(DelegateDeserialization.class); - - if (delegate != null) { - if (delegate.value() != clazz) { - return getAlias(delegate.value()); - } - } - - SerializableAs alias = clazz.getAnnotation(SerializableAs.class); - - if (alias != null) { - return alias.value(); - } - - return clazz.getName(); - } -} diff --git a/Common/src/test/java/fr/robie/craftengineconverter/common/utils/yaml/YamlConfigurationTest.java b/Common/src/test/java/fr/robie/craftengineconverter/common/utils/yaml/YamlConfigurationTest.java deleted file mode 100644 index ac5cdc15..00000000 --- a/Common/src/test/java/fr/robie/craftengineconverter/common/utils/yaml/YamlConfigurationTest.java +++ /dev/null @@ -1,243 +0,0 @@ -package fr.robie.craftengineconverter.common.utils.yaml; - -import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; -import fr.robie.craftengineconverter.common.utils.yaml.file.YamlConfiguration; -import fr.robie.craftengineconverter.common.utils.yaml.serialization.ConfigurationSerialization; -import org.bukkit.configuration.serialization.ConfigurationSerializable; -import org.bukkit.configuration.serialization.SerializableAs; -import org.jetbrains.annotations.NotNull; -import org.junit.jupiter.api.DisplayName; -import org.junit.jupiter.api.Nested; -import org.junit.jupiter.api.Test; - -import java.util.ArrayList; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; - -import static org.junit.jupiter.api.Assertions.*; - -public class YamlConfigurationTest { - - @Nested - @DisplayName("Index-based Retrieval Tests") - class RetrievalTests { - - @Test - @DisplayName("Should retrieve basic types via index path") - void testBasicIndexRetrieval() throws Exception { - String yaml = """ - items: - - name: "Item 0" - count: 64 - active: true - price: 10.5 - - name: "Item 1" - count: 1 - active: false - price: 5.0 - """; - YamlConfiguration config = new YamlConfiguration(); - config.loadFromString(yaml); - - assertEquals("Item 0", config.getString("items.0.name")); - assertEquals(64, config.getInt("items.0.count")); - assertTrue(config.getBoolean("items.0.active")); - assertEquals(10.5, config.getDouble("items.0.price")); - - assertEquals("Item 1", config.getString("items.1.name")); - assertEquals(1, config.getInt("items.1.count")); - assertFalse(config.getBoolean("items.1.active")); - assertEquals(5.0, config.getDouble("items.1.price")); - } - - @Test - @DisplayName("Should handle all primitive list types in sections within lists") - void testAllListTypes() throws Exception { - String yaml = """ - data: - - strings: [a, b, c] - ints: [1, 2, 3] - booleans: [true, false] - doubles: [1.1, 2.2] - longs: [100, 200] - bytes: [1, 2] - chars: [x, y] - shorts: [10, 20] - """; - YamlConfiguration config = new YamlConfiguration(); - config.loadFromString(yaml); - - assertEquals(List.of("a", "b", "c"), config.getStringList("data.0.strings")); - assertEquals(List.of(1, 2, 3), config.getIntegerList("data.0.ints")); - assertEquals(List.of(true, false), config.getBooleanList("data.0.booleans")); - assertEquals(List.of(1.1, 2.2), config.getDoubleList("data.0.doubles")); - assertEquals(List.of(100L, 200L), config.getLongList("data.0.longs")); - assertEquals(List.of((byte) 1, (byte) 2), config.getByteList("data.0.bytes")); - assertEquals(List.of('x', 'y'), config.getCharacterList("data.0.chars")); - assertEquals(List.of((short) 10, (short) 20), config.getShortList("data.0.shorts")); - } - - @Test - @DisplayName("Should handle invalid indices gracefully") - void testInvalidIndices() throws Exception { - String yaml = """ - list: [a, b] - """; - YamlConfiguration config = new YamlConfiguration(); - config.loadFromString(yaml); - - assertNull(config.get("list.2")); // Out of bounds - assertNull(config.get("list.-1")); // Negative - assertNull(config.get("list.abc")); // Not a number - } - - @Test - @DisplayName("Should support nested lists and sections") - void testDeepNesting() throws Exception { - String yaml = """ - root: - - nested_list: - - - val: "deep" - """; - YamlConfiguration config = new YamlConfiguration(); - config.loadFromString(yaml); - - assertEquals("deep", config.getString("root.0.nested_list.0.0.val")); - assertTrue(config.isConfigurationSection("root.0.nested_list.0.0")); - } - } - - @Nested - @DisplayName("Existence and Type Validation Tests") - class ValidationTests { - - @Test - @DisplayName("Should correctly identify sections and presence via index") - void testExistenceChecks() throws Exception { - String yaml = """ - list: - - key: value - """; - YamlConfiguration config = new YamlConfiguration(); - config.loadFromString(yaml); - - assertTrue(config.contains("list.0")); - assertTrue(config.contains("list.0.key")); - assertFalse(config.contains("list.1")); - assertFalse(config.contains("list.0.missing")); - - assertTrue(config.isConfigurationSection("list.0")); - assertFalse(config.isConfigurationSection("list.0.key")); - assertTrue(config.isString("list.0.key")); - } - } - - @Nested - @DisplayName("Manual Modification and Ambiguity Tests") - class ModificationTests { - - @Test - @DisplayName("Should create section with numeric name if parent is not a list") - void testNumericKeyAsSection() { - YamlConfiguration config = new YamlConfiguration(); - config.createSection("a.99").set("val", "foo"); - - assertFalse(config.isList("a"), "Parent should be a section, not a list"); - assertTrue(config.isConfigurationSection("a.99"), "Should be a section named 99"); - assertEquals("foo", config.getString("a.99.val")); - } - - @Test - @DisplayName("Should treat numeric key as index if parent is already a list") - void testNumericKeyAsIndex() { - YamlConfiguration config = new YamlConfiguration(); - config.set("list", new ArrayList<>()); - - config.createSection("list.0").set("name", "first"); - config.set("list.2.name", "third"); // Should pad with null at index 1 - - List list = config.getList("list"); - assertEquals(3, list.size()); - assertInstanceOf(ConfigurationSection.class, list.get(0)); - assertNull(list.get(1)); - assertInstanceOf(ConfigurationSection.class, list.get(2)); - - assertEquals("first", config.getString("list.0.name")); - assertEquals("third", config.getString("list.2.name")); - } - - @Test - @DisplayName("Should remove elements or values via index path") - void testRemoval() { - YamlConfiguration config = new YamlConfiguration(); - config.set("list", new ArrayList<>(List.of("a", "b", "c"))); - - config.set("list.1", null); // Should set element at index 1 to null - List list = config.getList("list"); - assertNull(list.get(1)); - } - } - - @Nested - @DisplayName("Serialization and Round-trip Tests") - class SerializationTests { - - @Test - @DisplayName("Should preserve list-section structure during save and load") - void testRoundTrip() throws Exception { - YamlConfiguration config = new YamlConfiguration(); - config.set("items", new ArrayList<>()); - ConfigurationSection item0 = config.createSection("items.0"); - item0.set("id", "stone"); - item0.set("amount", 64); - - String saved = config.saveToString(); - - YamlConfiguration reloaded = new YamlConfiguration(); - reloaded.loadFromString(saved); - - assertTrue(reloaded.isConfigurationSection("items.0")); - assertEquals("stone", reloaded.getString("items.0.id")); - assertEquals(64, reloaded.getInt("items.0.amount")); - } - - @Test - @DisplayName("Should handle ConfigurationSerializable within lists") - void testSerializableInList() throws Exception { - ConfigurationSerialization.registerClass(TestSerializable.class); - - String yaml = """ - items: - - ==: TestSerializable - val: "foo" - """; - - YamlConfiguration config = new YamlConfiguration(); - config.loadFromString(yaml); - - List list = config.getList("items"); - assertInstanceOf(TestSerializable.class, list.getFirst()); - assertEquals("foo", ((TestSerializable) list.getFirst()).val); - - ConfigurationSerialization.unregisterClass(TestSerializable.class); - } - } - - @SerializableAs("TestSerializable") - public static class TestSerializable implements ConfigurationSerializable { - public String val; - - public TestSerializable(Map map) { - this.val = (String) map.get("val"); - } - - @Override - public @NotNull Map serialize() { - Map map = new LinkedHashMap<>(); - map.put("val", this.val); - return map; - } - - } -} diff --git a/Plugin/pom.xml b/Plugin/pom.xml index 5a4e05af..535c86a2 100644 --- a/Plugin/pom.xml +++ b/Plugin/pom.xml @@ -35,6 +35,7 @@ org.bstats:bstats-base fr.maxlego08.sarah:sarah com.github.1robie.MessageFlow:message-flow + fr.robie:yamllibrary @@ -112,6 +113,12 @@ reflections + + fr.robie + yamllibrary + compile + + org.junit.jupiter diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/CraftEngineConverter.java b/Plugin/src/main/java/fr/robie/craftengineconverter/CraftEngineConverter.java index 6aa8a69c..32e4fe58 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/CraftEngineConverter.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/CraftEngineConverter.java @@ -18,6 +18,8 @@ import fr.robie.craftengineconverter.common.CraftEngineConverterPlugin; import fr.robie.craftengineconverter.common.scanner.BlockStateMappingScanner; import fr.robie.craftengineconverter.common.utils.CraftEngineImageUtils; +import fr.robie.craftengineconverter.common.utils.yaml.directive.PluginKeyDirective; +import fr.robie.craftengineconverter.common.utils.yaml.directive.VersionKeyDirective; import fr.robie.craftengineconverter.converter.Converter; import fr.robie.craftengineconverter.converter.itemsadder.IAConverter; import fr.robie.craftengineconverter.converter.nexo.NexoConverter; @@ -40,6 +42,7 @@ import fr.robie.messageflow.formatter.Placeholder; import fr.robie.messageflow.impl.MessageManager; import fr.robie.messageflow.logger.Logger; +import fr.robie.yamllibrary.directive.KeyDirectiveRegistry; import org.bstats.bukkit.Metrics; import org.bukkit.event.Listener; @@ -84,6 +87,8 @@ public void onLoad() { this.getServer().getPluginManager().disablePlugin(this); return; } + KeyDirectiveRegistry.register(new VersionKeyDirective()); + KeyDirectiveRegistry.register(new PluginKeyDirective()); this.reloadBlockStateMappings(); this.reloadConfig(); if (Plugins.PACKET_EVENTS.isPresent()) { diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/Converter.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/Converter.java index 6692d658..8e35efd7 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/Converter.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/Converter.java @@ -16,8 +16,8 @@ import fr.robie.craftengineconverter.utils.ConfigFile; import fr.robie.messageflow.formatter.Placeholder; import fr.robie.messageflow.logger.Logger; -import org.bukkit.configuration.ConfigurationSection; -import org.bukkit.configuration.file.YamlConfiguration; +import fr.robie.yamllibrary.ConfigurationSection; +import fr.robie.yamllibrary.file.YamlConfiguration; import org.bukkit.entity.Player; import org.jetbrains.annotations.Contract; import org.jetbrains.annotations.NotNull; diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/CraftEngineItemUtils.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/CraftEngineItemUtils.java index aeb3b2dd..75431a2d 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/CraftEngineItemUtils.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/CraftEngineItemUtils.java @@ -1,7 +1,7 @@ package fr.robie.craftengineconverter.converter; import fr.robie.craftengineconverter.api.utils.ObjectUtils; -import org.bukkit.configuration.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; public class CraftEngineItemUtils extends ObjectUtils { private final ConfigurationSection craftEngineItemSection; diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/ItemConverter.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/ItemConverter.java index 5acc0265..eb93ecb0 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/ItemConverter.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/ItemConverter.java @@ -6,8 +6,8 @@ import fr.robie.craftengineconverter.api.configuration.item.models.model.GenerationConfiguration; import fr.robie.craftengineconverter.api.configuration.item.models.model.SimpleModelConfiguration; import fr.robie.craftengineconverter.api.utils.ObjectUtils; -import org.bukkit.configuration.ConfigurationSection; -import org.bukkit.configuration.file.YamlConfiguration; +import fr.robie.yamllibrary.ConfigurationSection; +import fr.robie.yamllibrary.file.YamlConfiguration; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockConverter.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockConverter.java index caebe0fe..4fbe8bf8 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockConverter.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockConverter.java @@ -6,9 +6,9 @@ import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.ItemMapping; import fr.robie.craftengineconverter.api.manager.FileCacheManager; import fr.robie.craftengineconverter.api.utils.FileUtils; -import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; -import fr.robie.craftengineconverter.common.utils.yaml.file.YamlConfiguration; import fr.robie.messageflow.logger.Logger; +import fr.robie.yamllibrary.ConfigurationSection; +import fr.robie.yamllibrary.file.YamlConfiguration; import org.jetbrains.annotations.NotNull; import java.io.File; diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockItemLoader.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockItemLoader.java index 7ebbc173..3c5e3001 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockItemLoader.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockItemLoader.java @@ -12,7 +12,7 @@ import fr.robie.craftengineconverter.api.configuration.item.models.model.GenerationConfiguration; import fr.robie.craftengineconverter.api.configuration.item.models.model.SimpleModelConfiguration; import fr.robie.craftengineconverter.api.configuration.loader.models.ModelConfigurationRegistry; -import fr.robie.craftengineconverter.api.yaml.ConfigurationSection; +import fr.robie.yamllibrary.ConfigurationSection; import fr.robie.messageflow.logger.Logger; import org.bukkit.Material; import org.jetbrains.annotations.NotNull; diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/itemsadder/IAConverter.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/itemsadder/IAConverter.java index fea0e37d..5692265a 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/itemsadder/IAConverter.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/itemsadder/IAConverter.java @@ -21,7 +21,6 @@ import fr.robie.craftengineconverter.api.enums.RecipeType; import fr.robie.craftengineconverter.api.format.Message; import fr.robie.craftengineconverter.api.manager.FileCacheManager; - import fr.robie.craftengineconverter.api.progress.BukkitProgressBar; import fr.robie.craftengineconverter.api.utils.FileUtils; import fr.robie.craftengineconverter.common.BlockStatesMapper; @@ -30,17 +29,16 @@ import fr.robie.craftengineconverter.common.records.ImageConversion; import fr.robie.craftengineconverter.common.utils.CacheConversion; import fr.robie.craftengineconverter.common.utils.CraftEngineImageUtils; -import fr.robie.craftengineconverter.common.utils.SnakeUtils; import fr.robie.craftengineconverter.common.utils.enums.ia.IARecipesTypes; import fr.robie.craftengineconverter.converter.Converter; import fr.robie.craftengineconverter.utils.ConfigFile; import fr.robie.craftengineconverter.utils.JsonFileValidator; import fr.robie.messageflow.formatter.Placeholder; import fr.robie.messageflow.logger.Logger; +import fr.robie.yamllibrary.ConfigurationSection; import net.momirealms.craftengine.core.item.recipe.CookingRecipeCategory; import org.bukkit.Material; -import org.bukkit.configuration.ConfigurationSection; -import org.bukkit.configuration.file.YamlConfiguration; +import fr.robie.yamllibrary.file.YamlConfiguration; import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; @@ -358,30 +356,28 @@ protected void convertLanguagesSync(Optional optionalPlayer) { int totalEntries = 0; for (ConfigFile configFile : toConvert) { - try (SnakeUtils config = new SnakeUtils(configFile.sourceFile())) { - SnakeUtils langSection = config.getSection("minecraft_lang_overwrite"); + YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(configFile.sourceFile()); + if (yamlConfiguration.isConfigurationSection("minecraft_lang_overwrite")) { + ConfigurationSection langSection = yamlConfiguration.getConfigurationSection("minecraft_lang_overwrite"); if (langSection != null) { - - for (String translationKey : langSection.getKeys()) { - SnakeUtils translationSection = langSection.getSection(translationKey); + for (String translationKey : langSection.getKeys(false)) { + ConfigurationSection translationSection = langSection.getConfigurationSection(translationKey); if (translationSection == null) { continue; } - - Map entries = translationSection.getMap("entries"); + ConfigurationSection entries = translationSection.getConfigurationSection("entries"); List languages = translationSection.getStringList("languages"); - if (entries != null) { - totalEntries += entries.size() * languages.size(); + totalEntries += entries.getKeys(false).size() * languages.size(); } } } - SnakeUtils dictionarySection = config.getSection("dictionary"); + } + if (yamlConfiguration.isConfigurationSection("dictionary")) { + ConfigurationSection dictionarySection = yamlConfiguration.getConfigurationSection("dictionary"); if (dictionarySection != null) { - totalEntries += dictionarySection.getKeys().size(); + totalEntries += dictionarySection.getKeys(false).size(); } - } catch (Exception e) { - this.logDebug(Message.ERROR__CONVERTER__IA__LANGUAGES__COUNT_FAILURE, Logger.LogType.ERROR, Placeholder.of("file", configFile.sourceFile().getName())); } } @@ -395,19 +391,18 @@ protected void convertLanguagesSync(Optional optionalPlayer) { progressBar.start(); try { - File tempOutputFile = File.createTempFile("craftengine_ia_languages", ".yml"); - tempOutputFile.deleteOnExit(); + YamlConfiguration yamlConfiguration = new YamlConfiguration(); + yamlConfiguration.options().pathSeparator('\\'); - try (SnakeUtils ceTranslation = SnakeUtils.createEmpty(tempOutputFile)) { - while (!toConvert.isEmpty()) { - ConfigFile configFile = toConvert.poll(); - this.convertLanguageFile(configFile, ceTranslation, progressBar); - } + while (!toConvert.isEmpty()) { + ConfigFile configFile = toConvert.poll(); + this.convertLanguageFile(configFile, yamlConfiguration, progressBar); + } - if (!this.settings.dryRunEnabled()) { - ceTranslation.save(outputFolder); - } + if (!this.settings.dryRunEnabled()) { + yamlConfiguration.save(outputFolder); } + } catch (Exception e) { Logger.error(Message.ERROR__CONVERTER__IA__LANGUAGES__CONVERSION_EXCEPTION, e); } finally { @@ -415,62 +410,47 @@ protected void convertLanguagesSync(Optional optionalPlayer) { } } - private void convertLanguageFile(ConfigFile configFile, SnakeUtils ceTranslation, BukkitProgressBar progressBar) { - try (SnakeUtils toTranslate = new SnakeUtils(configFile.sourceFile())) { - SnakeUtils minecraftLangOverwrite = toTranslate.getSection("minecraft_lang_overwrite"); - if (minecraftLangOverwrite != null) { - - for (String translationGroup : minecraftLangOverwrite.getKeys()) { - SnakeUtils section = minecraftLangOverwrite.getSection(translationGroup); - if (section == null) { - continue; - } - - Map entries = section.getMap("entries"); - List languages = section.getStringList("languages"); + private void convertLanguageFile(ConfigFile configFile, YamlConfiguration ceTranslation, BukkitProgressBar progressBar) { + YamlConfiguration toTranslate = YamlConfiguration.loadConfiguration(configFile.sourceFile()); + ConfigurationSection minecraftLangOverwrite = toTranslate.getConfigurationSection("minecraft_lang_overwrite"); + if (minecraftLangOverwrite != null) { + for (String translationGroup : minecraftLangOverwrite.getKeys(false)) { + ConfigurationSection section = minecraftLangOverwrite.getConfigurationSection(translationGroup); + if (section == null) { + continue; + } - if (entries == null || entries.isEmpty() || languages.isEmpty()) { - continue; - } + ConfigurationSection entries = section.getConfigurationSection("entries"); + List languages = section.getStringList("languages"); + if (entries != null) { for (String langKey : languages) { String ceLangKey = langKey.equalsIgnoreCase("ALL") ? "en" : langKey.toLowerCase(Locale.ROOT); - - for (Map.Entry entry : entries.entrySet()) { - try { - String translationKey = "translations\\n" + ceLangKey + "\\n" + entry.getKey(); - ceTranslation.addData(translationKey, entry.getValue(), "\\n"); - } catch (Exception e) { - Placeholder.Builder placeholderBuilder = Placeholder.builder(); - placeholderBuilder.register("key", entry.getKey()) - .register("lang", ceLangKey) - .register("file", configFile.sourceFile().getName()); - this.logDebug(Message.ERROR__CONVERTER__IA__LANGUAGES__KEY_CONVERSION_FAILURE, Logger.LogType.ERROR, placeholderBuilder.build()); - } - progressBar.increment(); - } + this.writeTranslation(configFile, ceTranslation, progressBar, entries, ceLangKey); } } } - SnakeUtils dictionarySection = toTranslate.getSection("dictionary"); - if (dictionarySection != null) { - String dictionaryLang = toTranslate.getString("info.dictionary-lang", "en").toLowerCase(Locale.ROOT); - for (String dictKey : dictionarySection.getKeys()) { - try { - String ceDictKey = "translations\\n" + dictionaryLang + "\\n" + dictKey; - ceTranslation.addData(ceDictKey, dictionarySection.getString(dictKey), "\\n"); - } catch (Exception e) { - Placeholder.Builder placeholderBuilder = Placeholder.builder(); - placeholderBuilder.register("key", dictKey) - .register("lang", dictionaryLang) - .register("file", configFile.sourceFile().getName()); - this.logDebug(Message.ERROR__CONVERTER__IA__LANGUAGES__KEY_CONVERSION_FAILURE, Logger.LogType.ERROR, placeholderBuilder.build()); - } - progressBar.increment(); - } + } + ConfigurationSection dictionarySection = toTranslate.getConfigurationSection("dictionary"); + if (dictionarySection != null) { + String dictionaryLang = toTranslate.getString("info.dictionary-lang", "en").toLowerCase(Locale.ROOT); + this.writeTranslation(configFile, ceTranslation, progressBar, dictionarySection, dictionaryLang); + } + } + + private void writeTranslation(ConfigFile configFile, YamlConfiguration ceTranslation, BukkitProgressBar progressBar, ConfigurationSection dictionarySection, String dictionaryLang) { + for (String dictKey : dictionarySection.getKeys(false)) { + try { + String ceDictKey = "translations\\" + dictionaryLang + "\\" + dictKey; + ceTranslation.set(ceDictKey, dictionarySection.getString(dictKey)); + } catch (Exception e) { + Placeholder.Builder placeholderBuilder = Placeholder.builder(); + placeholderBuilder.register("key", dictKey) + .register("lang", dictionaryLang) + .register("file", configFile.sourceFile().getName()); + this.logDebug(Message.ERROR__CONVERTER__IA__LANGUAGES__KEY_CONVERSION_FAILURE, Logger.LogType.ERROR, placeholderBuilder.build()); } - } catch (Exception e) { - Logger.error(Message.ERROR__CONVERTER__IA__LANGUAGES__FILE_CONVERSION_FAILURE, e, Placeholder.of("file", configFile.sourceFile().getName())); + progressBar.increment(); } } diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/itemsadder/IAItemsConverter.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/itemsadder/IAItemsConverter.java index 331e9ce8..503d5252 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/itemsadder/IAItemsConverter.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/itemsadder/IAItemsConverter.java @@ -52,6 +52,7 @@ import fr.robie.craftengineconverter.converter.ItemConverter; import fr.robie.messageflow.formatter.Placeholder; import fr.robie.messageflow.logger.Logger; +import fr.robie.yamllibrary.ConfigurationSection; import net.momirealms.craftengine.core.attribute.AttributeModifier; import net.momirealms.craftengine.core.entity.EquipmentSlot; import net.momirealms.craftengine.core.entity.display.Billboard; @@ -61,8 +62,7 @@ import org.bukkit.Registry; import org.bukkit.attribute.Attribute; import org.bukkit.block.BlockFace; -import org.bukkit.configuration.ConfigurationSection; -import org.bukkit.configuration.file.YamlConfiguration; +import fr.robie.yamllibrary.file.YamlConfiguration; import org.bukkit.inventory.ItemFlag; import org.jetbrains.annotations.NotNull; diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoConverter.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoConverter.java index 5b8f3d1c..968d91d6 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoConverter.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoConverter.java @@ -19,23 +19,21 @@ import fr.robie.craftengineconverter.api.enums.RecipeType; import fr.robie.craftengineconverter.api.format.Message; import fr.robie.craftengineconverter.api.manager.FileCacheManager; - import fr.robie.craftengineconverter.api.progress.BukkitProgressBar; import fr.robie.craftengineconverter.api.utils.FileUtils; import fr.robie.craftengineconverter.common.BlockStatesMapper; import fr.robie.craftengineconverter.common.PluginNameMapper; import fr.robie.craftengineconverter.common.records.ImageConversion; import fr.robie.craftengineconverter.common.utils.CraftEngineImageUtils; -import fr.robie.craftengineconverter.common.utils.SnakeUtils; import fr.robie.craftengineconverter.converter.Converter; import fr.robie.craftengineconverter.utils.ConfigFile; import fr.robie.craftengineconverter.utils.JsonFileValidator; import fr.robie.messageflow.formatter.Placeholder; import fr.robie.messageflow.logger.Logger; +import fr.robie.yamllibrary.ConfigurationSection; +import fr.robie.yamllibrary.file.YamlConfiguration; import net.momirealms.craftengine.core.item.recipe.CookingRecipeCategory; import net.momirealms.craftengine.core.item.recipe.CraftingRecipeCategory; -import org.bukkit.configuration.ConfigurationSection; -import org.bukkit.configuration.file.YamlConfiguration; import org.bukkit.entity.Player; import org.jetbrains.annotations.Nullable; @@ -717,148 +715,114 @@ private void convertSoundsSync(Optional player) { } } - try (SnakeUtils nexoSounds = new SnakeUtils(inputSoundFile)) { - if (nexoSounds.isEmpty()) { - this.logDebug(Message.WARNING__CONVERTER__NEXO__SOUND__SOUNDS_FILE_EMPTY, Logger.LogType.INFO, Placeholder.of("path", inputSoundFile.getAbsolutePath())); - return; - } + fr.robie.yamllibrary.file.YamlConfiguration configuration = fr.robie.yamllibrary.file.YamlConfiguration.loadConfiguration(inputSoundFile); + List sounds = configuration.getSectionList("sounds"); - List> nexoSoundsList = nexoSounds.getListMap("sounds"); - if (nexoSoundsList.isEmpty()) { // No sounds to convert - nexoSounds.close(); - return; - } + int totalSounds = sounds.size(); - int totalSounds = nexoSoundsList.size(); - BukkitProgressBar progress = this.createProgressBar(player, totalSounds, "Converting Nexo sounds", "sounds", ConverterOption.SOUNDS); + BukkitProgressBar progress = this.createProgressBar(player, totalSounds, "Converting Nexo sounds", "sounds", ConverterOption.SOUNDS); - progress.start(); + progress.start(); + fr.robie.yamllibrary.file.YamlConfiguration convertedConfig = new fr.robie.yamllibrary.file.YamlConfiguration(); + fr.robie.yamllibrary.ConfigurationSection soundsSection = convertedConfig.createSection("sounds"); + fr.robie.yamllibrary.ConfigurationSection jukeboxSongsSection = convertedConfig.createSection("jukebox-songs"); + + for (fr.robie.yamllibrary.ConfigurationSection soundEntry : sounds) { try { - YamlConfiguration convertedConfig = new YamlConfiguration(); - ConfigurationSection soundsSection = convertedConfig.createSection("sounds"); - ConfigurationSection jukeboxSongsSection = convertedConfig.createSection("jukebox-songs"); +// this.convertSoundEntry(soundEntry.getValues(false), soundsSection, jukeboxSongsSection, progress); - for (Map soundEntry : nexoSoundsList) { - try { - this.convertSoundEntry(soundEntry, soundsSection, jukeboxSongsSection, progress); - } catch (Exception e) { - Object idObj = soundEntry.get("id"); - String soundId = idObj != null ? idObj.toString() : "unknown"; - this.logDebug(Message.ERROR__CONVERTER__FAILED_CONVERT_SOUND, Logger.LogType.ERROR, Placeholder.of("sound", soundId, "file", String.valueOf(inputSoundFile))); - progress.increment(); - } + String id = soundEntry.getString("id"); + if (id == null || id.isEmpty()) { + progress.increment(); + continue; } - if (!this.settings.dryRunEnabled()) { - if (jukeboxSongsSection.getKeys(false).isEmpty()) { - convertedConfig.set("jukebox-songs", null); - } - if (soundsSection.getKeys(false).isEmpty()) { - convertedConfig.set("sounds", null); + SoundConfiguration soundConfiguration = new SoundConfiguration() + .setReplace(soundEntry.getBoolean("replace", false)); + + String sound = soundEntry.getString("sound"); + if (sound != null && !sound.isEmpty()) { + soundConfiguration.addSound(this.createSound(sound, soundEntry)); + } + + List soundsList = soundEntry.getList("sounds"); + for (Object soundObj : soundsList) { + if (soundObj instanceof ConfigurationSection soundSection) { + String name = soundSection.getString("name"); + if (name != null && !name.isEmpty()) { + soundConfiguration.addSound(this.createSound(name, soundSection)); + } + } else if (soundObj instanceof String soundName) { + soundConfiguration.addSound(this.createSound(soundName, soundEntry)); } - convertedConfig.save(outputSoundFile); } - } catch (Exception e) { - Logger.error(Message.ERROR__CONVERTER__NEXO__SOUNDS__CONVERT_FAILURE, e, Placeholder.of("file", inputSoundFile.getName())); - } finally { - nexoSounds.close(); - progress.stop(); - } - } catch (Exception e) { - Logger.error(Message.ERROR__CONVERTER__NEXO__SOUNDS__LOAD_FAILURE, e, Placeholder.of("file", inputSoundFile.getName())); - } - } - private void convertSoundEntry(Map soundEntry, ConfigurationSection soundsSection, - ConfigurationSection jukeboxSongsSection, BukkitProgressBar progress) { - Object idObj = soundEntry.get("id"); - if (idObj == null) { - progress.increment(); - return; - } + fr.robie.yamllibrary.ConfigurationSection soundIdSection = soundsSection.createSection(id); + soundConfiguration.serialize(soundIdSection); - String soundId = idObj.toString(); - if (soundId.isEmpty()) { - progress.increment(); - return; - } + fr.robie.yamllibrary.ConfigurationSection jukeboxPlayable = soundEntry.getConfigurationSection("jukebox_playable"); + if (jukeboxPlayable != null) { + fr.robie.yamllibrary.ConfigurationSection jukeboxSoundSectionId = jukeboxSongsSection.createSection(id); + JukeboxSongConfiguration jukeboxConfig = new JukeboxSongConfiguration() + .setSound(id); - SoundConfiguration soundConfig = new SoundConfiguration() - .setReplace(this.parseBoolean(soundEntry.get("replace"))); + String durationStr = jukeboxPlayable.getString("duration"); + if (durationStr != null && durationStr.endsWith("s")) { + try { + double length = Double.parseDouble(durationStr.substring(0, durationStr.length() - 1)); + jukeboxConfig.setLength(length); + } catch (NumberFormatException e) { + this.logDebug(Message.ERROR__CONVERTER__NEXO__SOUND__INVALID_DURATION_FORMAT, Logger.LogType.INFO, Placeholder.of("duration", durationStr, "sound", id)); + } + } + String description = jukeboxPlayable.getString("description"); + if (description != null) { + jukeboxConfig.setDescription(description); + } + int comparatorOutput = jukeboxPlayable.getInt("comparator_output", 15); + jukeboxConfig.setComparatorOutput(comparatorOutput); - Object singleSound = soundEntry.get("sound"); - if (singleSound != null && this.isValidString(singleSound.toString())) { - soundConfig.addSound(this.createSound(singleSound.toString(), soundEntry)); - } + int range = jukeboxPlayable.getInt("range", 32); + jukeboxConfig.setRange(range); - Object soundsListObj = soundEntry.get("sounds"); - if (soundsListObj instanceof List soundsList) { - for (Object soundObj : soundsList) { - if (soundObj instanceof Map soundMap) { - @SuppressWarnings("unchecked") - Map finalSoundMap = (Map) soundMap; - Object nameObj = finalSoundMap.get("name"); - if (nameObj != null) { - soundConfig.addSound(this.createSound(nameObj.toString(), finalSoundMap)); - } - } else if (soundObj instanceof String soundName) { - soundConfig.addSound(this.createSound(soundName, soundEntry)); + jukeboxConfig.serialize(jukeboxSoundSectionId); } - } - } - ConfigurationSection soundIdSection = soundsSection.createSection(soundId); - soundConfig.serialize(soundIdSection); - - Object jukeboxPlayable = soundEntry.get("jukebox_playable"); - if (jukeboxPlayable instanceof Map jukeboxMap) { - @SuppressWarnings("unchecked") - Map finalJukeboxMap = (Map) jukeboxMap; - ConfigurationSection jukeboxSongSection = jukeboxSongsSection.createSection(soundId); - JukeboxSongConfiguration jukeboxConfig = new JukeboxSongConfiguration() - .setSound(soundId); + progress.increment(); - Object durationObj = finalJukeboxMap.get("duration"); - if (durationObj != null) { - String durationStr = durationObj.toString(); - if (durationStr.endsWith("s")) { - try { - double length = Double.parseDouble(durationStr.substring(0, durationStr.length() - 1)); - jukeboxConfig.setLength(length); - } catch (NumberFormatException e) { - this.logDebug(Message.ERROR__CONVERTER__NEXO__SOUND__INVALID_DURATION_FORMAT, Logger.LogType.INFO, Placeholder.of("duration", durationStr, "sound", soundId)); - } - } + } catch (Exception e) { + Object idObj = soundEntry.get("id"); + String soundId = idObj != null ? idObj.toString() : "unknown"; + this.logDebug(Message.ERROR__CONVERTER__FAILED_CONVERT_SOUND, Logger.LogType.ERROR, Placeholder.of("sound", soundId, "file", String.valueOf(inputSoundFile))); + progress.increment(); } + } - Object descriptionObj = finalJukeboxMap.get("description"); - if (descriptionObj != null) { - jukeboxConfig.setDescription(descriptionObj.toString()); + if (!this.settings.dryRunEnabled()) { + if (jukeboxSongsSection.getKeys(false).isEmpty()) { + convertedConfig.set("jukebox-songs", null); } - - int comparatorOutput = this.parseInt(finalJukeboxMap.get("comparator_output"), 15); - jukeboxConfig.setComparatorOutput(comparatorOutput); - - Object rangeObj = finalJukeboxMap.get("range"); - if (rangeObj != null) { - jukeboxConfig.setRange(this.parseInt(rangeObj, 32)); + if (soundsSection.getKeys(false).isEmpty()) { + convertedConfig.set("sounds", null); + } + try { + convertedConfig.save(outputSoundFile); + } catch (IOException e) { + Logger.error(Message.ERROR__CONVERTER__FAILED_SAVE_FILE, e, Placeholder.of("file", outputSoundFile.getAbsolutePath())); } - - jukeboxConfig.serialize(jukeboxSongSection); } - - progress.increment(); + progress.stop(); } - private Sound createSound(String soundName, Map properties) { - boolean stream = this.parseBoolean(properties.get("stream")); - boolean preload = this.parseBoolean(properties.get("preload")); - float volume = (float) this.parseDouble(properties.get("volume"), 1.0); - float pitch = (float) this.parseDouble(properties.get("pitch"), 1.0); - int weight = this.parseInt(properties.get("weight"), 1); - int attenuationDistance = this.parseInt(properties.get("attenuation_distance"), 16); + private Sound createSound(String soundName, fr.robie.yamllibrary.ConfigurationSection configurationSection) { + boolean stream = configurationSection.getBoolean("stream"); + boolean preload = configurationSection.getBoolean("preload"); + float volume = (float) configurationSection.getDouble("volume",1.0); + float pitch = (float) configurationSection.getDouble("pitch", 1.0); + int weight = configurationSection.getInt("weight",1); + int attenuationDistance = configurationSection.getInt("attenuation_distance",16); if (!stream && !preload && volume == 1.0f && pitch == 1.0f && weight == 1 && attenuationDistance == 16) { return new SimpleSound(soundName); @@ -882,84 +846,54 @@ private void convertLanguagesSync(Optional player) { return; } - try (SnakeUtils nexoLanguages = new SnakeUtils(languagesFile)) { - if (nexoLanguages.isEmpty()) { - this.logDebug(Message.WARNING__CONVERTER__NEXO__LANGUAGE__LANGUAGES_FILE_EMPTY, Logger.LogType.INFO, Placeholder.of("path", languagesFile.getAbsolutePath())); - return; - } - - Set languageKeys = nexoLanguages.getKeys(); - if (languageKeys.isEmpty()) { - this.logDebug(Message.WARNING__CONVERTER__NEXO__LANGUAGE__NO_LANGUAGES_FOUND, Logger.LogType.INFO, Placeholder.empty()); - return; - } + YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(languagesFile); + Set languagesKeys = yamlConfiguration.getKeys(false); - int totalTranslations = 0; - for (String langKey : languageKeys) { - Map langData = nexoLanguages.getMap(langKey); - if (langData != null) { - totalTranslations += langData.size(); - } + int totalTranslations = 0; + for (String langKey : languagesKeys) { + ConfigurationSection langSection = yamlConfiguration.getConfigurationSection(langKey); + if (langSection != null) { + totalTranslations += langSection.getKeys(false).size(); } + } - if (totalTranslations == 0) { - this.log(Message.WARNING__CONVERTER__NEXO__LANGUAGE__NO_LANGUAGES_FOUND, Logger.LogType.ERROR,Placeholder.empty()); - return; - } + if (totalTranslations == 0) { + this.log(Message.WARNING__CONVERTER__NEXO__LANGUAGE__NO_LANGUAGES_FOUND, Logger.LogType.INFO, Placeholder.empty()); + return; + } - BukkitProgressBar progress = this.createProgressBar(player, totalTranslations, "Converting Nexo languages", "translations", ConverterOption.LANGUAGES); + BukkitProgressBar progress = this.createProgressBar(player, totalTranslations, "Converting Nexo languages", "translations", ConverterOption.LANGUAGES); + progress.start(); - progress.start(); + try { + YamlConfiguration craftEngineLanguages = new YamlConfiguration(); + craftEngineLanguages.options().pathSeparator('\\'); - try { - File tempOutputFile = File.createTempFile("craftengine_languages", ".yml"); - tempOutputFile.deleteOnExit(); + for (String langKey : languagesKeys) { + ConfigurationSection langSection = yamlConfiguration.getConfigurationSection(langKey); + if (langSection == null) { + continue; + } - try (SnakeUtils craftEngineLanguages = SnakeUtils.createEmpty(tempOutputFile)) { - for (String langKey : languageKeys) { - try { - this.convertLanguage(langKey, nexoLanguages, craftEngineLanguages, progress); - } catch (Exception e) { - this.logDebug(Message.ERROR__CONVERTER__NEXO__LANGUAGE__FAILED_CONVERT_LANGUAGE, Logger.LogType.ERROR, Placeholder.of("lang", langKey, "file", languagesFile.getAbsolutePath())); - Map langData = nexoLanguages.getMap(langKey); - if (langData != null) { - progress.increment(langData.size()); - } - } - } - if (!this.settings.dryRunEnabled()) { - craftEngineLanguages.save(outputFile); + for (String translationKey : langSection.getKeys(false)) { + try { + String translationValue = langSection.getString(translationKey, ""); + String craftEngineLangKey = langKey.equals("global") ? "en" : langKey; + String finalTranslationKey = "translations\\" + craftEngineLangKey + "\\" + translationKey; + craftEngineLanguages.set(finalTranslationKey, translationValue); + } catch (Exception e) { + this.logDebug(Message.ERROR__CONVERTER__NEXO__LANGUAGE__FAILED_CONVERT_TRANSLATION, Logger.LogType.ERROR, Placeholder.of("key", translationKey, "lang", langKey)); } + progress.increment(); } - } catch (Exception e) { - Logger.error(Message.ERROR__CONVERTER__NEXO__LANGUAGES__CONVERT_FAILURE, e, Placeholder.of("file", languagesFile.getName())); - } finally { - progress.stop(); } - } catch (Exception e) { - Logger.error(Message.ERROR__CONVERTER__NEXO__LANGUAGES__LOAD_FAILURE, e, Placeholder.of("file", languagesFile.getName())); - } - } - private void convertLanguage(String langKey, SnakeUtils nexoLanguages, - SnakeUtils craftEngineLanguages, BukkitProgressBar progress) { - Map nexoLangData = nexoLanguages.getMap(langKey); - - if (nexoLangData == null || nexoLangData.isEmpty()) { - return; - } - - String craftEngineLangKey = langKey.equals("global") ? "en" : langKey; - - for (Map.Entry entry : nexoLangData.entrySet()) { - try { - String translationKey = "translations\\n" + craftEngineLangKey + "\\n" + entry.getKey(); - craftEngineLanguages.addData(translationKey, entry.getValue(), "\\n"); - } catch (Exception e) { - this.logDebug(Message.ERROR__CONVERTER__NEXO__LANGUAGE__FAILED_CONVERT_TRANSLATION, Logger.LogType.ERROR, Placeholder.of("key", entry.getKey(), "lang", langKey)); + if (!this.settings.dryRunEnabled()) { + craftEngineLanguages.save(outputFile); } - - progress.increment(); + } catch (IOException ignored) { + } finally { + progress.stop(); } } diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoItemConverter.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoItemConverter.java index bfcccbc8..91d1b39d 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoItemConverter.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoItemConverter.java @@ -47,7 +47,6 @@ import fr.robie.craftengineconverter.api.enums.*; import fr.robie.craftengineconverter.api.enums.item.component.ConsumableAnimation; import fr.robie.craftengineconverter.api.format.Message; - import fr.robie.craftengineconverter.api.utils.FloatsUtils; import fr.robie.craftengineconverter.api.utils.item.component.ConsumeEffect; import fr.robie.craftengineconverter.common.BlockStatesMapper; @@ -64,6 +63,8 @@ import fr.robie.craftengineconverter.utils.loots.MinecraftItemLoot; import fr.robie.messageflow.formatter.Placeholder; import fr.robie.messageflow.logger.Logger; +import fr.robie.yamllibrary.ConfigurationSection; +import fr.robie.yamllibrary.file.YamlConfiguration; import net.momirealms.craftengine.core.entity.EquipmentSlot; import net.momirealms.craftengine.core.entity.display.Billboard; import net.momirealms.craftengine.core.item.setting.value.AnvilRepairItem; @@ -75,8 +76,6 @@ import org.bukkit.block.data.BlockData; import org.bukkit.block.data.MultipleFacing; import org.bukkit.block.data.type.Tripwire; -import org.bukkit.configuration.ConfigurationSection; -import org.bukkit.configuration.file.YamlConfiguration; import org.bukkit.enchantments.Enchantment; import org.bukkit.inventory.ItemFlag; diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/database/DataBaseManager.java b/Plugin/src/main/java/fr/robie/craftengineconverter/database/DataBaseManager.java index 0c162ac3..33841dc5 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/database/DataBaseManager.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/database/DataBaseManager.java @@ -13,7 +13,7 @@ import fr.robie.craftengineconverter.database.migrations.WorldBlockConverterHistorical; import fr.robie.craftengineconverter.database.migrations.WorldEntityConverterHistorical; import fr.robie.craftengineconverter.utils.TypedCache; -import org.bukkit.configuration.file.YamlConfiguration; +import fr.robie.yamllibrary.file.YamlConfiguration; import org.jetbrains.annotations.NotNull; import org.jspecify.annotations.NonNull; diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/utils/ConfigFile.java b/Plugin/src/main/java/fr/robie/craftengineconverter/utils/ConfigFile.java index 33a1d865..dc9dfcfe 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/utils/ConfigFile.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/utils/ConfigFile.java @@ -1,6 +1,6 @@ package fr.robie.craftengineconverter.utils; -import org.bukkit.configuration.file.YamlConfiguration; +import fr.robie.yamllibrary.file.YamlConfiguration; import java.io.File; diff --git a/pom.xml b/pom.xml index 9fa5bf6c..809aec59 100644 --- a/pom.xml +++ b/pom.xml @@ -71,6 +71,13 @@ compile + + fr.robie + yamllibrary + 1.0-SNAPSHOT + provided + + io.papermc.paper From 3d34ba468b63f1b3667c50001dfbdd9a5615aab6 Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Tue, 7 Jul 2026 20:26:12 +0200 Subject: [PATCH 029/116] refactor: migrate command handling to paper-dispatch library + make plugin paper only --- Plugin/pom.xml | 6 + .../CraftEngineConverter.java | 18 +- .../CraftEngineConverterBootstrapper.java | 20 + .../CraftEngineConverterLoader.java | 26 + .../command/CraftEngineConverterCommand.java | 18 +- ...EngineConverterCommandClearFilesCache.java | 30 +- .../CraftEngineConverterCommandConvert.java | 134 +-- .../CraftEngineConverterCommandReload.java | 37 +- ...tEngineConverterCommandWorldConverter.java | 20 +- ...ommandWorldConverterClearCachedChunks.java | 27 +- ...ConverterCommandWorldConverterRestore.java | 109 +-- ...neConverterCommandWorldConverterStart.java | 69 +- .../utils/command/Arguments.java | 307 ------- .../utils/command/CommandManager.java | 356 -------- .../utils/command/CommandManagerInt.java | 30 - .../utils/command/CommandType.java | 12 - .../utils/command/Tab.java | 6 - .../utils/command/VCommand.java | 835 ------------------ Plugin/src/main/resources/paper-plugin.yml | 24 + Plugin/src/main/resources/plugin.yml | 13 - pom.xml | 20 +- 21 files changed, 327 insertions(+), 1790 deletions(-) create mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/CraftEngineConverterBootstrapper.java create mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/CraftEngineConverterLoader.java delete mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/utils/command/Arguments.java delete mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/utils/command/CommandManager.java delete mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/utils/command/CommandManagerInt.java delete mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/utils/command/CommandType.java delete mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/utils/command/Tab.java delete mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/utils/command/VCommand.java create mode 100644 Plugin/src/main/resources/paper-plugin.yml delete mode 100644 Plugin/src/main/resources/plugin.yml diff --git a/Plugin/pom.xml b/Plugin/pom.xml index 535c86a2..103b0fdd 100644 --- a/Plugin/pom.xml +++ b/Plugin/pom.xml @@ -119,6 +119,12 @@ compile + + com.github.1robie.paper-dispatch + paper-dispatch + compile + + org.junit.jupiter diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/CraftEngineConverter.java b/Plugin/src/main/java/fr/robie/craftengineconverter/CraftEngineConverter.java index 32e4fe58..9a79ec4b 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/CraftEngineConverter.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/CraftEngineConverter.java @@ -35,13 +35,13 @@ import fr.robie.craftengineconverter.hooks.placeholderapi.PlaceholderAPIUtils; import fr.robie.craftengineconverter.listener.WorldConverterManager; import fr.robie.craftengineconverter.utils.TagResolver; -import fr.robie.craftengineconverter.utils.command.CommandManager; import fr.robie.messageflow.configuration.ConfigurationManager; import fr.robie.messageflow.configuration.lang.EnumLanguageConfiguration; import fr.robie.messageflow.formatter.MessageFormatter; import fr.robie.messageflow.formatter.Placeholder; import fr.robie.messageflow.impl.MessageManager; import fr.robie.messageflow.logger.Logger; +import fr.robie.paperdispatch.manager.ICommandManager; import fr.robie.yamllibrary.directive.KeyDirectiveRegistry; import org.bstats.bukkit.Metrics; @@ -63,7 +63,7 @@ public final class CraftEngineConverter extends CraftEngineConverterPlugin { private final StorageManager storageManager = new DataBaseManager(this); private final ServerProfile serverProfile = new ServerProfileManager(this); private final FoliaCompatibilityManager foliaCompatibilityManager = new FoliaCompatibilityManager(this); - private final CommandManager commandManager = new CommandManager(this); + private final ICommandManager commandManager = new fr.robie.paperdispatch.manager.CommandManager<>(this); private final WorldConverterManager worldConverterManager = new WorldConverterManager(this); private final ITagResolver tagResolver = new TagResolver(); private final MessageManager messageManager; @@ -101,7 +101,7 @@ public void onLoad() { this.packetLoader.onLoad(); } - this.commandManager.loadCommands(); + this.commandManager.registerCommands(); BehaviorRegister.init(); } @@ -126,11 +126,7 @@ public void onEnable() { new RegistryHelper(this).loadRegistries(); - this.commandManager.registerCommand("craftengineconverter", new CraftEngineConverterCommand(this), "cengineconverter", "cec"); - - this.commandManager.validCommands(); - - this.commandManager.enableCommands(); + this.commandManager.registerCommand(new CraftEngineConverterCommand(this)); this.registerConverter(new NexoConverter(this)); this.registerConverter(new IAConverter(this)); @@ -231,8 +227,6 @@ public void onDisable() { this.metrics.shutdown(); - this.commandManager.disableCommands(); - if (this.placementTracker != null) { Logger.info("Conversion stats :"); Logger.info("Total blocks converted : " + this.placementTracker.getBlocksConverted() + " (Failed : " + this.placementTracker.getBlocksFailed() + ", Success rate : " + String.format("%.2f", this.placementTracker.getBlocksSuccessRate()) + "%)"); @@ -251,10 +245,6 @@ private void registerListener(@NotNull Listener listener) { this.getServer().getPluginManager().registerEvents(listener, this); } - public CommandManager getCommandManager() { - return this.commandManager; - } - @Override public MessageFormatter getMessageFormatter() { return this.messageFormatter; diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/CraftEngineConverterBootstrapper.java b/Plugin/src/main/java/fr/robie/craftengineconverter/CraftEngineConverterBootstrapper.java new file mode 100644 index 00000000..0c39de12 --- /dev/null +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/CraftEngineConverterBootstrapper.java @@ -0,0 +1,20 @@ +package fr.robie.craftengineconverter; + +import io.papermc.paper.plugin.bootstrap.BootstrapContext; +import io.papermc.paper.plugin.bootstrap.PluginBootstrap; +import io.papermc.paper.plugin.bootstrap.PluginProviderContext; +import org.bukkit.plugin.java.JavaPlugin; + +public class CraftEngineConverterBootstrapper implements PluginBootstrap { + + @Override + public void bootstrap(BootstrapContext context) { + + } + + @Override + public JavaPlugin createPlugin(PluginProviderContext context) { + return new CraftEngineConverter(); + } + +} diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/CraftEngineConverterLoader.java b/Plugin/src/main/java/fr/robie/craftengineconverter/CraftEngineConverterLoader.java new file mode 100644 index 00000000..378f6f2d --- /dev/null +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/CraftEngineConverterLoader.java @@ -0,0 +1,26 @@ +package fr.robie.craftengineconverter; + +import io.papermc.paper.plugin.loader.PluginClasspathBuilder; +import io.papermc.paper.plugin.loader.PluginLoader; +import io.papermc.paper.plugin.loader.library.impl.MavenLibraryResolver; +import org.eclipse.aether.artifact.DefaultArtifact; +import org.eclipse.aether.graph.Dependency; +import org.eclipse.aether.repository.RemoteRepository; + +public class CraftEngineConverterLoader implements PluginLoader { + + @Override + public void classloader(PluginClasspathBuilder classpathBuilder) { + final MavenLibraryResolver resolver = new MavenLibraryResolver(); + resolver.addRepository(new RemoteRepository.Builder( + "central", "default", MavenLibraryResolver.MAVEN_CENTRAL_DEFAULT_MIRROR + ).build()); + + resolver.addDependency(new Dependency( + new DefaultArtifact("org.reflections:reflections:0.10.2"), + null + )); + + classpathBuilder.addLibrary(resolver); + } +} diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/command/CraftEngineConverterCommand.java b/Plugin/src/main/java/fr/robie/craftengineconverter/command/CraftEngineConverterCommand.java index 48601bd7..6def2a6e 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/command/CraftEngineConverterCommand.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/command/CraftEngineConverterCommand.java @@ -2,14 +2,16 @@ import fr.robie.craftengineconverter.CraftEngineConverter; import fr.robie.craftengineconverter.common.permission.Permission; -import fr.robie.craftengineconverter.utils.command.CommandType; -import fr.robie.craftengineconverter.utils.command.VCommand; +import fr.robie.paperdispatch.command.BaseCommand; +import fr.robie.paperdispatch.command.CommandDispatch; +import fr.robie.paperdispatch.command.CommandResultType; +import org.jetbrains.annotations.NotNull; -public class CraftEngineConverterCommand extends VCommand { +public class CraftEngineConverterCommand extends BaseCommand { public CraftEngineConverterCommand(CraftEngineConverter craftEngineConverter) { - super(craftEngineConverter); - this.setPermission(Permission.COMMAND_USE); + super(craftEngineConverter, "craftengineconverter", "cengineconverter", "cec"); + this.setPermission(Permission.COMMAND_USE.asPermission()); this.addSubCommand(new CraftEngineConverterCommandReload(craftEngineConverter)); this.addSubCommand(new CraftEngineConverterCommandConvert(craftEngineConverter)); this.addSubCommand(new CraftEngineConverterCommandClearFilesCache(craftEngineConverter)); @@ -17,9 +19,7 @@ public CraftEngineConverterCommand(CraftEngineConverter craftEngineConverter) { } @Override - protected CommandType perform(CraftEngineConverter plugin) { - this.syntaxMessage(); - - return CommandType.SUCCESS; + protected @NotNull CommandResultType perform(@NotNull CommandDispatch commandDispatch) { + return CommandResultType.SUCCESS; } } diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/command/CraftEngineConverterCommandClearFilesCache.java b/Plugin/src/main/java/fr/robie/craftengineconverter/command/CraftEngineConverterCommandClearFilesCache.java index 211cf38d..76b0417b 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/command/CraftEngineConverterCommandClearFilesCache.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/command/CraftEngineConverterCommandClearFilesCache.java @@ -4,32 +4,36 @@ import fr.robie.craftengineconverter.api.builder.TimerBuilder; import fr.robie.craftengineconverter.api.format.Message; import fr.robie.craftengineconverter.api.manager.FileCacheManager; +import fr.robie.craftengineconverter.common.CraftEngineConverterPlugin; import fr.robie.craftengineconverter.common.permission.Permission; -import fr.robie.craftengineconverter.utils.command.CommandType; -import fr.robie.craftengineconverter.utils.command.VCommand; +import fr.robie.messageflow.formatter.MessageFormatter; import fr.robie.messageflow.formatter.Placeholder; +import fr.robie.paperdispatch.command.CommandDispatch; +import fr.robie.paperdispatch.command.CommandResultType; +import fr.robie.paperdispatch.command.SubCommand; +import org.jetbrains.annotations.NotNull; + +public class CraftEngineConverterCommandClearFilesCache extends SubCommand { + private final MessageFormatter messageFormatter; -public class CraftEngineConverterCommandClearFilesCache extends VCommand { public CraftEngineConverterCommandClearFilesCache(CraftEngineConverter plugin) { - super(plugin); - this.setPermission(Permission.COMMAND_CLEARFILESCACHE); - this.setDescription(Message.COMMAND__CLEAR_FILES_CACHE__DESCRIPTION); - this.addSubCommand("clearfilescache"); - this.addFlag("--all"); + super(plugin, "clearfilescache", "cfc"); + this.messageFormatter = plugin.getMessageFormatter(); + this.setPermission(Permission.COMMAND_CLEARFILESCACHE.asPermission()); + this.addFlag("all"); } @Override - protected CommandType perform(CraftEngineConverter plugin) { - boolean clearAll = this.containFlag("--all"); + protected @NotNull CommandResultType perform(@NotNull CommandDispatch commandDispatch) { long startTime = System.currentTimeMillis(); long clearedFiles; - if (clearAll) { + if (commandDispatch.hasFlag("all")) { clearedFiles = FileCacheManager.getTotalSize(); FileCacheManager.invalidateAllCaches(); } else { clearedFiles = FileCacheManager.cleanStaleEntries(); } - this.messageFormatter.sendMessage(Message.COMMAND__CLEAR_FILES_CACHE__COMPLETE,this.sender, Placeholder.of("cleared_files", String.valueOf(clearedFiles), "time", TimerBuilder.formatTimeAuto(System.currentTimeMillis() - startTime))); - return CommandType.SUCCESS; + this.messageFormatter.sendMessage(Message.COMMAND__CLEAR_FILES_CACHE__COMPLETE, commandDispatch.getSender(), Placeholder.of("cleared_files", String.valueOf(clearedFiles), "time", TimerBuilder.formatTimeAuto(System.currentTimeMillis() - startTime))); + return CommandResultType.SUCCESS; } } diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/command/CraftEngineConverterCommandConvert.java b/Plugin/src/main/java/fr/robie/craftengineconverter/command/CraftEngineConverterCommandConvert.java index 7907e804..93158e36 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/command/CraftEngineConverterCommandConvert.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/command/CraftEngineConverterCommandConvert.java @@ -1,119 +1,119 @@ package fr.robie.craftengineconverter.command; +import com.mojang.brigadier.arguments.StringArgumentType; import fr.robie.craftengineconverter.CraftEngineConverter; import fr.robie.craftengineconverter.api.builder.TimerBuilder; import fr.robie.craftengineconverter.api.enums.ConverterOption; import fr.robie.craftengineconverter.api.enums.CraftEngineBlockState; import fr.robie.craftengineconverter.api.format.Message; +import fr.robie.craftengineconverter.common.CraftEngineConverterPlugin; import fr.robie.craftengineconverter.common.permission.Permission; import fr.robie.craftengineconverter.converter.Converter; -import fr.robie.craftengineconverter.utils.command.CommandType; -import fr.robie.craftengineconverter.utils.command.VCommand; +import fr.robie.messageflow.formatter.MessageFormatter; import fr.robie.messageflow.formatter.Placeholder; +import fr.robie.paperdispatch.argument.EnumArgument; +import fr.robie.paperdispatch.command.CommandDispatch; +import fr.robie.paperdispatch.command.CommandResultType; +import fr.robie.paperdispatch.command.SubCommand; +import fr.robie.paperdispatch.flag.Flags; +import io.papermc.paper.command.brigadier.Commands; +import org.bukkit.command.CommandSender; +import org.jetbrains.annotations.NotNull; import java.util.*; import java.util.concurrent.CompletableFuture; import java.util.concurrent.atomic.AtomicInteger; -public class CraftEngineConverterCommandConvert extends VCommand { +public class CraftEngineConverterCommandConvert extends SubCommand { private final List> conversionTasks = new ArrayList<>(); + private final MessageFormatter messageFormatter; public CraftEngineConverterCommandConvert(CraftEngineConverter plugin) { - super(plugin); - this.setPermission(Permission.COMMAND_CONVERT); - this.setDescription(Message.COMMAND__CONVERTER__DESCRIPTION); - this.addSubCommand("convert"); - this.addOptionalArg("plugin", (sender, args) -> this.plugin.getConverterNames()); - this.addOptionalArg("type", (sender, args) -> { - Set options = new HashSet<>(); - for (ConverterOption o : ConverterOption.values()) { - options.add(o.name()); + super(plugin, "convert"); + this.messageFormatter = plugin.getMessageFormatter(); + this.setPermission(Permission.COMMAND_CONVERT.asPermission()); + + this.addOptionalArgument(Commands.argument("plugin", StringArgumentType.word()).suggests(((context, builder) -> { + this.plugin.getConverterNames().stream().filter(name -> name.toLowerCase(Locale.ROOT).startsWith(builder.getRemaining())).forEach(builder::suggest); + return builder.buildFuture(); + }))); + this.addOptionalArgument(Commands.argument("type", new EnumArgument<>(ConverterOption.class))); + + this.addFlag("dryrun"); + this.addFlag("force"); + this.addFlag(Flags.intFlag("threads").defaultTo(1)); + } + + private void disableAllConversions() { + if (!this.conversionTasks.isEmpty()) { + for (CompletableFuture task : new ArrayList<>(this.conversionTasks)) { + task.cancel(true); } - return options; - }); - this.addFlag("--dryrun"); - this.addFlag("--force"); - this.addFlag("--threads", Integer.class, 1); - this.setTabCompletor(); + this.conversionTasks.clear(); + } } @Override - protected CommandType perform(CraftEngineConverter plugin) { - boolean forceConversion = this.containFlag("--force"); + protected @NotNull CommandResultType perform(@NotNull CommandDispatch commandDispatch) { + CommandSender sender = commandDispatch.getSender(); + boolean forceConversion = commandDispatch.hasFlag("force"); if (!this.conversionTasks.isEmpty() && !forceConversion) { - this.messageFormatter.sendMessage(Message.COMMAND__CONVERTER__ALREADY_RUNNING, this.sender); - return CommandType.SUCCESS; + this.messageFormatter.sendMessage(Message.COMMAND__CONVERTER__ALREADY_RUNNING, sender); + return CommandResultType.SUCCESS; } if (forceConversion) { - this.messageFormatter.sendMessage(Message.COMMAND__CONVERTER__FORCE_STOPPING, this.sender); + this.messageFormatter.sendMessage(Message.COMMAND__CONVERTER__FORCE_STOPPING, sender); this.disableAllConversions(); } - String targetPlugin = this.argAsString(0); - ConverterOption converterOption = this.argAsEnum(1, ConverterOption.class, ConverterOption.ALL); - boolean dryRun = this.containFlag("--dryrun"); - if (dryRun) { - this.messageFormatter.sendMessage(Message.COMMAND__CONVERTER__DRY_RUN_NOTE, this.sender); - } - int threads = this.getFlagValueAsInteger("--threads"); + ConverterOption converterOption = commandDispatch.getArgument("type", ConverterOption.class, ConverterOption.ALL); + int threads = commandDispatch.getFlagValue("threads", Integer.class); if (threads < 1) { threads = 1; } else if (threads > Runtime.getRuntime().availableProcessors()) { int availableProcessors = Runtime.getRuntime().availableProcessors(); threads = availableProcessors; - this.messageFormatter.sendMessage(Message.COMMAND__CONVERTER__THREADS__ERROR_TOO_MANY, this.sender, Placeholder.of("max", String.valueOf(availableProcessors))); + this.messageFormatter.sendMessage(Message.COMMAND__CONVERTER__THREADS__ERROR_TOO_MANY, sender, Placeholder.of("max", String.valueOf(availableProcessors))); } - this.messageFormatter.sendMessage(Message.COMMAND__CONVERTER__THREADS__INFO, this.sender, Placeholder.of("threads", String.valueOf(threads))); + this.messageFormatter.sendMessage(Message.COMMAND__CONVERTER__THREADS__INFO, sender, Placeholder.of("threads", String.valueOf(threads))); CraftEngineBlockState.resetAllLimits(); - if (targetPlugin == null) { + Optional optionalPlugin = commandDispatch.getOptionalArgument("plugin", String.class); + if (optionalPlugin.isPresent()) { + String targetPlugin = optionalPlugin.get(); + Optional optionalConverter = plugin.getConverter(targetPlugin); + if (optionalConverter.isPresent()) { + long startTime = System.currentTimeMillis(); + this.messageFormatter.sendMessage(Message.COMMAND__CONVERTER__START__SINGLE, sender, Placeholder.of("plugin", targetPlugin)); + Converter converter = optionalConverter.get(); + CompletableFuture voidCompletableFuture = converter.convert(converterOption, Optional.ofNullable(commandDispatch.getPlayer()), commandDispatch.hasFlag("dryrun"), threads); + voidCompletableFuture.thenRun(() -> { + long endTime = System.currentTimeMillis(); + this.messageFormatter.sendMessage(Message.COMMAND__CONVERTER__COMPLETE__SINGLE, sender, Placeholder.of("plugin", targetPlugin, "time", TimerBuilder.formatTimeAuto(endTime - startTime))); + this.conversionTasks.remove(voidCompletableFuture); + }); + this.conversionTasks.add(voidCompletableFuture); + } else { + this.messageFormatter.sendMessage(Message.COMMAND__CONVERTER__NOT_SUPPORTED, sender, Placeholder.of("plugin", targetPlugin)); + } + } else { long startTime = System.currentTimeMillis(); - this.messageFormatter.sendMessage(Message.COMMAND__CONVERTER__START__ALL,this.sender); + this.messageFormatter.sendMessage(Message.COMMAND__CONVERTER__START__ALL,sender); Collection converters = plugin.getConverters(); AtomicInteger counter = new AtomicInteger(converters.size()); for (Converter converter : converters) { - CompletableFuture voidCompletableFuture = converter.convert(converterOption, Optional.ofNullable(this.player), dryRun, threads); + CompletableFuture voidCompletableFuture = converter.convert(converterOption, Optional.ofNullable(commandDispatch.getPlayer()), commandDispatch.hasFlag("dryrun"), threads); voidCompletableFuture.thenRun(() -> { int remaining = counter.decrementAndGet(); if (remaining == 0) { long endTime = System.currentTimeMillis(); - this.messageFormatter.sendMessage(Message.COMMAND__CONVERTER__COMPLETE__ALL, this.sender, Placeholder.of("time", TimerBuilder.formatTimeAuto(endTime - startTime))); + this.messageFormatter.sendMessage(Message.COMMAND__CONVERTER__COMPLETE__ALL, sender, Placeholder.of("time", TimerBuilder.formatTimeAuto(endTime - startTime))); } this.conversionTasks.remove(voidCompletableFuture); }); this.conversionTasks.add(voidCompletableFuture); } - } else { - Optional optionalConverter = plugin.getConverter(targetPlugin); - if (optionalConverter.isPresent()) { - long startTime = System.currentTimeMillis(); - this.messageFormatter.sendMessage(Message.COMMAND__CONVERTER__START__SINGLE, this.sender, Placeholder.of("plugin", targetPlugin)); - Converter converter = optionalConverter.get(); - CompletableFuture voidCompletableFuture = converter.convert(converterOption, Optional.ofNullable(this.player), dryRun, threads); - voidCompletableFuture.thenRun(() -> { - long endTime = System.currentTimeMillis(); - this.messageFormatter.sendMessage(Message.COMMAND__CONVERTER__COMPLETE__SINGLE, this.sender, Placeholder.of("plugin", targetPlugin, "time", TimerBuilder.formatTimeAuto(endTime - startTime))); - this.conversionTasks.remove(voidCompletableFuture); - }); - this.conversionTasks.add(voidCompletableFuture); - } else { - this.messageFormatter.sendMessage(Message.COMMAND__CONVERTER__NOT_SUPPORTED, this.sender, Placeholder.of("plugin", targetPlugin)); - } } - return CommandType.SUCCESS; - } - - private void disableAllConversions() { - if (!this.conversionTasks.isEmpty()) { - for (CompletableFuture task : new ArrayList<>(this.conversionTasks)) { - task.cancel(true); - } - this.conversionTasks.clear(); - } - } - - @Override - public void onDisable() { - this.disableAllConversions(); + return CommandResultType.SUCCESS; } } diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/command/CraftEngineConverterCommandReload.java b/Plugin/src/main/java/fr/robie/craftengineconverter/command/CraftEngineConverterCommandReload.java index 8102eb2c..78bcf3a3 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/command/CraftEngineConverterCommandReload.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/command/CraftEngineConverterCommandReload.java @@ -3,34 +3,41 @@ import fr.robie.craftengineconverter.CraftEngineConverter; import fr.robie.craftengineconverter.api.builder.TimerBuilder; import fr.robie.craftengineconverter.api.format.Message; - +import fr.robie.craftengineconverter.common.CraftEngineConverterPlugin; import fr.robie.craftengineconverter.common.permission.Permission; -import fr.robie.craftengineconverter.utils.command.CommandType; -import fr.robie.craftengineconverter.utils.command.VCommand; +import fr.robie.messageflow.formatter.MessageFormatter; import fr.robie.messageflow.formatter.Placeholder; import fr.robie.messageflow.logger.Logger; +import fr.robie.paperdispatch.command.CommandDispatch; +import fr.robie.paperdispatch.command.CommandResultType; +import fr.robie.paperdispatch.command.SubCommand; +import org.bukkit.command.CommandSender; +import org.jetbrains.annotations.NotNull; + +public class CraftEngineConverterCommandReload extends SubCommand { + private final MessageFormatter messageFormatter; -public class CraftEngineConverterCommandReload extends VCommand { public CraftEngineConverterCommandReload(CraftEngineConverter plugin) { - super(plugin); - this.addSubCommand("reload", "rl"); - this.setPermission(Permission.COMMAND_RELOAD); - this.setDescription(Message.COMMAND__RELOAD__DESCRIPTION); + super(plugin, "reload", "rl"); + this.messageFormatter = plugin.getMessageFormatter(); + this.setPermission(Permission.COMMAND_RELOAD.asPermission()); } @Override - protected CommandType perform(CraftEngineConverter plugin) { + protected fr.robie.paperdispatch.command.@NotNull CommandResultType perform(@NotNull CommandDispatch commandDispatch) { + CommandSender sender = commandDispatch.getSender(); try { long startTime = System.currentTimeMillis(); - plugin.reloadBlockStateMappings(); - plugin.reloadConfig(); - plugin.reloadMessages(); + commandDispatch.getPlugin().reloadBlockStateMappings(); + commandDispatch.getPlugin().reloadConfig(); + commandDispatch.getPlugin().reloadMessages(); long endTime = System.currentTimeMillis(); - this.messageFormatter.sendMessage(Message.COMMAND__RELOAD__SUCCESS, this.sender, Placeholder.of("time", TimerBuilder.formatTimeAuto(endTime - startTime))); + this.messageFormatter.sendMessage(Message.COMMAND__RELOAD__SUCCESS, sender, Placeholder.of("time", TimerBuilder.formatTimeAuto(endTime - startTime))); + return CommandResultType.SUCCESS; } catch (Exception e) { Logger.error("An error occurred while reloading the plugin.", e); - this.messageFormatter.sendMessage(Message.COMMAND__RELOAD__FAILURE, this.sender); + this.messageFormatter.sendMessage(Message.COMMAND__RELOAD__FAILURE, sender); + return CommandResultType.FAILURE; } - return CommandType.SUCCESS; } } diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/command/CraftEngineConverterCommandWorldConverter.java b/Plugin/src/main/java/fr/robie/craftengineconverter/command/CraftEngineConverterCommandWorldConverter.java index 598e3450..0a47df9a 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/command/CraftEngineConverterCommandWorldConverter.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/command/CraftEngineConverterCommandWorldConverter.java @@ -1,26 +1,24 @@ package fr.robie.craftengineconverter.command; import fr.robie.craftengineconverter.CraftEngineConverter; -import fr.robie.craftengineconverter.api.format.Message; import fr.robie.craftengineconverter.common.permission.Permission; -import fr.robie.craftengineconverter.utils.command.CommandType; -import fr.robie.craftengineconverter.utils.command.VCommand; +import fr.robie.paperdispatch.command.CommandDispatch; +import fr.robie.paperdispatch.command.CommandResultType; +import fr.robie.paperdispatch.command.SubCommand; +import org.jetbrains.annotations.NotNull; -public class CraftEngineConverterCommandWorldConverter extends VCommand { +public class CraftEngineConverterCommandWorldConverter extends SubCommand { public CraftEngineConverterCommandWorldConverter(CraftEngineConverter plugin) { - super(plugin); - this.setPermission(Permission.COMMAND_WORLDCONVERTER); - this.setDescription(Message.COMMAND__WORLD_CONVERTER__DESCRIPTION); - this.addSubCommand("worldconverter", "wc"); + super(plugin, "worldconverter", "wc"); + this.setPermission(Permission.COMMAND_WORLDCONVERTER.asPermission()); this.addSubCommand(new CraftEngineConverterCommandWorldConverterClearCachedChunks(plugin)); this.addSubCommand(new CraftEngineConverterCommandWorldConverterStart(plugin)); this.addSubCommand(new CraftEngineConverterCommandWorldConverterRestore(plugin)); } @Override - protected CommandType perform(CraftEngineConverter plugin) { - this.syntaxMessage(); - return CommandType.SUCCESS; + protected @NotNull CommandResultType perform(@NotNull CommandDispatch commandDispatch) { + return CommandResultType.SUCCESS; } } diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/command/CraftEngineConverterCommandWorldConverterClearCachedChunks.java b/Plugin/src/main/java/fr/robie/craftengineconverter/command/CraftEngineConverterCommandWorldConverterClearCachedChunks.java index d6d29bc0..32334c34 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/command/CraftEngineConverterCommandWorldConverterClearCachedChunks.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/command/CraftEngineConverterCommandWorldConverterClearCachedChunks.java @@ -3,34 +3,39 @@ import fr.robie.craftengineconverter.CraftEngineConverter; import fr.robie.craftengineconverter.api.builder.TimerBuilder; import fr.robie.craftengineconverter.api.format.Message; +import fr.robie.craftengineconverter.common.CraftEngineConverterPlugin; import fr.robie.craftengineconverter.common.permission.Permission; import fr.robie.craftengineconverter.listener.WorldConverterManager; -import fr.robie.craftengineconverter.utils.command.CommandType; -import fr.robie.craftengineconverter.utils.command.VCommand; +import fr.robie.messageflow.formatter.MessageFormatter; import fr.robie.messageflow.formatter.Placeholder; +import fr.robie.paperdispatch.command.CommandDispatch; +import fr.robie.paperdispatch.command.CommandResultType; +import fr.robie.paperdispatch.command.SubCommand; +import org.jetbrains.annotations.NotNull; + +public class CraftEngineConverterCommandWorldConverterClearCachedChunks extends SubCommand { + private final MessageFormatter messageFormatter; -public class CraftEngineConverterCommandWorldConverterClearCachedChunks extends VCommand { public CraftEngineConverterCommandWorldConverterClearCachedChunks(CraftEngineConverter plugin) { - super(plugin); - this.setPermission(Permission.COMMAND_WORLDCONVERTER_CLEAR_CACHED_CHUNKS); - this.setDescription(Message.COMMAND__WORLD_CONVERTER__CLEAR_CACHED_CHUNKS__DESCRIPTION); - this.addSubCommand("clear-cached-chunks"); + super(plugin, "clear-cached-chunks"); + this.messageFormatter = plugin.getMessageFormatter(); + this.setPermission(Permission.COMMAND_WORLDCONVERTER_CLEAR_CACHED_CHUNKS.asPermission()); } @Override - protected CommandType perform(CraftEngineConverter plugin) { + protected @NotNull CommandResultType perform(@NotNull CommandDispatch commandDispatch) { long startTime = System.currentTimeMillis(); - WorldConverterManager worldConverterManager = plugin.getWorldConverterManager(); + WorldConverterManager worldConverterManager = this.plugin.getWorldConverterManager(); int clearedChunks = worldConverterManager.getProcessedChunksCount(); worldConverterManager.clearProcessedChunks(); long endTime = System.currentTimeMillis(); - this.messageFormatter.sendMessage(Message.COMMAND__WORLD_CONVERTER__CLEAR_CACHED_CHUNKS__COMPLETE, this.sender, + this.messageFormatter.sendMessage(Message.COMMAND__WORLD_CONVERTER__CLEAR_CACHED_CHUNKS__COMPLETE, commandDispatch.getSender(), Placeholder.of("chunks", String.valueOf(clearedChunks), "time", TimerBuilder.formatTimeAuto(endTime - startTime))); - return CommandType.SUCCESS; + return CommandResultType.SUCCESS; } } diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/command/CraftEngineConverterCommandWorldConverterRestore.java b/Plugin/src/main/java/fr/robie/craftengineconverter/command/CraftEngineConverterCommandWorldConverterRestore.java index a2b61ad0..3f03ba31 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/command/CraftEngineConverterCommandWorldConverterRestore.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/command/CraftEngineConverterCommandWorldConverterRestore.java @@ -6,13 +6,15 @@ import fr.robie.craftengineconverter.api.format.Message; import fr.robie.craftengineconverter.api.history.BlockHistory; import fr.robie.craftengineconverter.api.history.EntityHistory; - import fr.robie.craftengineconverter.api.profile.ServerProfile; +import fr.robie.craftengineconverter.common.CraftEngineConverterPlugin; import fr.robie.craftengineconverter.common.permission.Permission; -import fr.robie.craftengineconverter.utils.command.CommandType; -import fr.robie.craftengineconverter.utils.command.VCommand; +import fr.robie.messageflow.formatter.MessageFormatter; import fr.robie.messageflow.formatter.Placeholder; import fr.robie.messageflow.logger.Logger; +import fr.robie.paperdispatch.command.CommandDispatch; +import fr.robie.paperdispatch.command.CommandResultType; +import fr.robie.paperdispatch.command.SubCommand; import net.momirealms.craftengine.bukkit.api.CraftEngineBlocks; import net.momirealms.craftengine.bukkit.api.CraftEngineFurniture; import org.bukkit.Bukkit; @@ -20,41 +22,76 @@ import org.bukkit.Material; import org.bukkit.World; import org.bukkit.block.Block; +import org.bukkit.command.CommandSender; import org.bukkit.entity.EntitySnapshot; +import org.jetbrains.annotations.NotNull; import java.util.ArrayList; import java.util.List; import java.util.concurrent.atomic.AtomicInteger; -public class CraftEngineConverterCommandWorldConverterRestore extends VCommand { +public class CraftEngineConverterCommandWorldConverterRestore extends SubCommand { + private final MessageFormatter messageFormatter; public CraftEngineConverterCommandWorldConverterRestore(CraftEngineConverter plugin) { - super(plugin); - this.setPermission(Permission.COMMAND_WORLDCONVERTER_RESTORE); - this.setDescription(Message.COMMAND__WORLD_CONVERTER__RESTORE__DESCRIPTION); - this.addSubCommand("restore"); - this.addFlag("--confirm"); + super(plugin, "restore", "r"); + this.messageFormatter = plugin.getMessageFormatter(); + this.setPermission(Permission.COMMAND_WORLDCONVERTER_RESTORE.asPermission()); + this.addFlag("confirm"); + } + + /** + * Restores a block to its original state. + * + * @param location The location of the block + * @param history The block history containing the original block data + */ + private void restoreBlock(Location location, BlockHistory history) { + Block block = location.getBlock(); + + if (CraftEngineBlocks.isCustomBlock(block)) { + CraftEngineBlocks.remove(block); + + } + + try { + org.bukkit.block.data.BlockData blockData = Bukkit.createBlockData(history.getOriginalBlock()); + block.setBlockData(blockData, false); + } catch (Exception e) { + Logger.error("Failed to parse block data: " + history.getOriginalBlock(), e); + try { + String materialName = history.getOriginalBlock().split("\\[")[0]; + Material material = Material.matchMaterial(materialName); + if (material != null) { + block.setType(material, false); + } + } catch (Exception ex) { + Logger.error("Failed to restore block, setting to AIR", ex); + block.setType(Material.AIR, false); + } + } } @Override - protected CommandType perform(CraftEngineConverter plugin) { + protected @NotNull CommandResultType perform(@NotNull CommandDispatch commandDispatch) { StorageManager dataBaseManager = this.plugin.getStorageManager(); ServerProfile serverProfile = this.plugin.getServerProfile(); + CommandSender sender = commandDispatch.getSender(); if (!dataBaseManager.isEnabled()) { - this.messageFormatter.sendMessage(Message.COMMAND__WORLD_CONVERTER__RESTORE__DATABASE_DISABLED, this.sender); - return CommandType.SUCCESS; + this.messageFormatter.sendMessage(Message.COMMAND__WORLD_CONVERTER__RESTORE__DATABASE_DISABLED, sender); + return CommandResultType.SUCCESS; } - boolean confirm = this.containFlag("--confirm"); + boolean confirm = commandDispatch.hasFlag("confirm"); int activeBlockConversions = serverProfile.getActiveBlockCount(); int activeEntityConversions = serverProfile.getActiveEntityCount(); int totalActiveConversions = activeBlockConversions + activeEntityConversions; if (totalActiveConversions == 0) { - this.messageFormatter.sendMessage(Message.COMMAND__WORLD_CONVERTER__RESTORE__ALL__NONE, this.sender); - return CommandType.SUCCESS; + this.messageFormatter.sendMessage(Message.COMMAND__WORLD_CONVERTER__RESTORE__ALL__NONE, sender); + return CommandResultType.SUCCESS; } Placeholder.Builder builder = Placeholder.builder(); @@ -62,11 +99,11 @@ protected CommandType perform(CraftEngineConverter plugin) { .register("blocks", String.valueOf(activeBlockConversions)) .register("entities", String.valueOf(activeEntityConversions)); if (!confirm) { - this.messageFormatter.sendMessage(Message.COMMAND__WORLD_CONVERTER__RESTORE__ALL__CONFIRM, this.sender, builder.build()); - return CommandType.SUCCESS; + this.messageFormatter.sendMessage(Message.COMMAND__WORLD_CONVERTER__RESTORE__ALL__CONFIRM, sender, builder.build()); + return CommandResultType.SUCCESS; } - this.messageFormatter.sendMessage(Message.COMMAND__WORLD_CONVERTER__RESTORE__ALL__START, this.sender, builder.build()); + this.messageFormatter.sendMessage(Message.COMMAND__WORLD_CONVERTER__RESTORE__ALL__START, sender, builder.build()); long startTime = System.currentTimeMillis(); AtomicInteger restoredBlockCount = new AtomicInteger(0); @@ -169,41 +206,9 @@ protected CommandType perform(CraftEngineConverter plugin) { .register("total_blocks", String.valueOf(totalBlockCount.get())) .register("total_entities", String.valueOf(totalEntityCount.get())) .register("time", TimerBuilder.formatTimeAuto(endTime - startTime)); - this.messageFormatter.sendMessage(Message.COMMAND__WORLD_CONVERTER__RESTORE__ALL__COMPLETE, this.sender, builder.build()); + this.messageFormatter.sendMessage(Message.COMMAND__WORLD_CONVERTER__RESTORE__ALL__COMPLETE, sender, builder.build()); }, totalDelayTicks + 1); - return CommandType.SUCCESS; - } - - /** - * Restores a block to its original state. - * - * @param location The location of the block - * @param history The block history containing the original block data - */ - private void restoreBlock(Location location, BlockHistory history) { - Block block = location.getBlock(); - - if (CraftEngineBlocks.isCustomBlock(block)) { - CraftEngineBlocks.remove(block); - - } - - try { - org.bukkit.block.data.BlockData blockData = Bukkit.createBlockData(history.getOriginalBlock()); - block.setBlockData(blockData, false); - } catch (Exception e) { - Logger.error("Failed to parse block data: " + history.getOriginalBlock(), e); - try { - String materialName = history.getOriginalBlock().split("\\[")[0]; - Material material = Material.matchMaterial(materialName); - if (material != null) { - block.setType(material, false); - } - } catch (Exception ex) { - Logger.error("Failed to restore block, setting to AIR", ex); - block.setType(Material.AIR, false); - } - } + return CommandResultType.SUCCESS; } } diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/command/CraftEngineConverterCommandWorldConverterStart.java b/Plugin/src/main/java/fr/robie/craftengineconverter/command/CraftEngineConverterCommandWorldConverterStart.java index 810c155d..d7348dbe 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/command/CraftEngineConverterCommandWorldConverterStart.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/command/CraftEngineConverterCommandWorldConverterStart.java @@ -5,51 +5,61 @@ import fr.robie.craftengineconverter.api.configuration.Configuration; import fr.robie.craftengineconverter.api.format.Message; import fr.robie.craftengineconverter.api.progress.BukkitProgressBar; +import fr.robie.craftengineconverter.common.CraftEngineConverterPlugin; import fr.robie.craftengineconverter.common.permission.Permission; import fr.robie.craftengineconverter.listener.WorldConverterManager; -import fr.robie.craftengineconverter.utils.command.CommandType; -import fr.robie.craftengineconverter.utils.command.VCommand; +import fr.robie.messageflow.formatter.MessageFormatter; import fr.robie.messageflow.formatter.Placeholder; +import fr.robie.paperdispatch.command.CommandDispatch; +import fr.robie.paperdispatch.command.CommandResultType; +import fr.robie.paperdispatch.command.SubCommand; +import fr.robie.paperdispatch.flag.Flags; import org.bukkit.Bukkit; import org.bukkit.World; +import org.bukkit.command.CommandSender; +import org.bukkit.entity.Player; +import org.jetbrains.annotations.NotNull; import java.util.List; import java.util.concurrent.CompletableFuture; -public class CraftEngineConverterCommandWorldConverterStart extends VCommand { +public class CraftEngineConverterCommandWorldConverterStart extends SubCommand { + private final MessageFormatter messageFormatter; private CompletableFuture currentConversion = null; public CraftEngineConverterCommandWorldConverterStart(CraftEngineConverter plugin) { - super(plugin); - this.setPermission(Permission.COMMAND_WORLDCONVERTER_START); - this.addSubCommand("start"); - this.addFlag("--force"); - this.addFlag("--chunks-per-tick", Integer.class, 10); + super(plugin, "start"); + this.messageFormatter = plugin.getMessageFormatter(); + this.setPermission(Permission.COMMAND_WORLDCONVERTER_START.asPermission()); + this.addFlag("force"); + this.addFlag(Flags.intFlag("chunks-per-tick", 1, 100).defaultTo(10)); + } + + public void onDisable() { + if (this.currentConversion != null && !this.currentConversion.isDone()) { + this.currentConversion.cancel(true); + } } @Override - protected CommandType perform(CraftEngineConverter plugin) { - WorldConverterManager worldConverterManager = plugin.getWorldConverterManager(); + protected @NotNull CommandResultType perform(@NotNull CommandDispatch commandDispatch) { + WorldConverterManager worldConverterManager = this.plugin.getWorldConverterManager(); - boolean forceConversion = this.containFlag("--force"); + boolean forceConversion = commandDispatch.hasFlag("force"); + CommandSender sender = commandDispatch.getSender(); if (this.currentConversion != null && !this.currentConversion.isDone() && !forceConversion) { - this.messageFormatter.sendMessage(Message.COMMAND__WORLD_CONVERTER__ALREADY_RUNNING, this.sender); - return CommandType.SUCCESS; + this.messageFormatter.sendMessage(Message.COMMAND__WORLD_CONVERTER__ALREADY_RUNNING, sender); + return CommandResultType.SUCCESS; } if (forceConversion && this.currentConversion != null && !this.currentConversion.isDone()) { - this.messageFormatter.sendMessage(Message.COMMAND__WORLD_CONVERTER__FORCE_STOPPING, this.sender); + this.messageFormatter.sendMessage(Message.COMMAND__WORLD_CONVERTER__FORCE_STOPPING, sender); worldConverterManager.cancelAllConversions(); this.currentConversion.cancel(true); } - int chunksPerTick = this.getFlagValueAsInteger("--chunks-per-tick"); - if (chunksPerTick < 1) { - chunksPerTick = 1; - } else if (chunksPerTick > 100) { - chunksPerTick = 100; - } + int chunksPerTick = commandDispatch.getFlagValue("chunks-per-tick", Integer.class); List worlds = Bukkit.getServer().getWorlds(); int totalChunks = 0; @@ -58,13 +68,14 @@ protected CommandType perform(CraftEngineConverter plugin) { } BukkitProgressBar.Builder builder = new BukkitProgressBar.Builder(totalChunks).options(Configuration.worldConverterProgressBarOptions).prefix("World Converter:").suffix("chunks").updateInterval(5000); - if (this.player != null) { - builder.player(this.player); + Player player = commandDispatch.getPlayer(); + if (player != null) { + builder.player(player); builder.showBar(false); } BukkitProgressBar progressBar = builder.build(this.plugin); - this.messageFormatter.sendMessage(Message.COMMAND__WORLD_CONVERTER__START, this.sender, Placeholder.of("chunks", String.valueOf(totalChunks))); + this.messageFormatter.sendMessage(Message.COMMAND__WORLD_CONVERTER__START, sender, Placeholder.of("chunks", String.valueOf(totalChunks))); int oldConvertedBlocks = worldConverterManager.getPlacementTracker().getBlocksConverted(); int oldConvertedFurniture = worldConverterManager.getPlacementTracker().getFurnitureConverted(); @@ -90,16 +101,8 @@ protected CommandType perform(CraftEngineConverter plugin) { .register("furniture", String.valueOf(convertedFurniture - oldConvertedFurniture)) .register("time", TimerBuilder.formatTimeAuto(endTime - startTime)); - this.messageFormatter.sendMessage(Message.COMMAND__WORLD_CONVERTER__COMPLETE, this.sender, placeholderBuilder.build()); + this.messageFormatter.sendMessage(Message.COMMAND__WORLD_CONVERTER__COMPLETE, sender, placeholderBuilder.build()); }); - - return CommandType.SUCCESS; - } - - @Override - public void onDisable() { - if (this.currentConversion != null && !this.currentConversion.isDone()) { - this.currentConversion.cancel(true); - } + return CommandResultType.SUCCESS; } } diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/utils/command/Arguments.java b/Plugin/src/main/java/fr/robie/craftengineconverter/utils/command/Arguments.java deleted file mode 100644 index 887a7b8d..00000000 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/utils/command/Arguments.java +++ /dev/null @@ -1,307 +0,0 @@ -package fr.robie.craftengineconverter.utils.command; - -import fr.robie.craftengineconverter.utils.CraftEngineConverterUtils; -import org.bukkit.Bukkit; -import org.bukkit.Material; -import org.bukkit.OfflinePlayer; -import org.bukkit.World; -import org.bukkit.entity.EntityType; -import org.bukkit.entity.Player; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -import java.util.HashMap; -import java.util.Locale; -import java.util.Map; - -public abstract class Arguments extends CraftEngineConverterUtils { - protected String[] args; - protected Map flags = new HashMap<>(); - protected int parentCount = 0; - - /** - * - * @param index - * @return - */ - protected String argAsString(int index) { - try { - return this.args[index + this.parentCount]; - } catch (Exception e) { - return null; - } - } - - /** - * - * @param index - * @param defaultValue - * @return - */ - protected String argAsString(int index, String defaultValue) { - try { - return this.args[index + this.parentCount]; - } catch (Exception e) { - return defaultValue; - } - } - - - /** - * - * @param index - * @return - */ - protected boolean argAsBoolean(int index) { - return Boolean.valueOf(this.argAsString(index)); - } - - /** - * - * @param index - * @param defaultValue - * @return - */ - protected boolean argAsBoolean(int index, boolean defaultValue) { - try { - return Boolean.valueOf(this.argAsString(index)); - } catch (Exception e) { - return defaultValue; - } - } - - /** - * - * @param index - * @return - */ - protected int argAsInteger(int index) { - return Integer.valueOf(this.argAsString(index)); - } - - /** - * - * @param index - * @param defaultValue - * @return - */ - protected int argAsInteger(int index, int defaultValue) { - try { - return Integer.valueOf(this.argAsString(index)); - } catch (Exception e) { - return defaultValue; - } - } - - /** - * - * @param index - * @return - */ - protected long argAsLong(int index) { - return Long.valueOf(this.argAsString(index)); - } - - /** - * - * @param index - * @param defaultValue - * @return - */ - protected long argAsLong(int index, long defaultValue) { - try { - return Long.valueOf(this.argAsString(index)); - } catch (Exception e) { - return defaultValue; - } - } - - /** - * - * @param index - * @param defaultValue - * @return - */ - protected double argAsDouble(int index, double defaultValue) { - try { - return Double.valueOf(this.argAsString(index).replace(",", ".")); - } catch (Exception e) { - return defaultValue; - } - } - - /** - * - * @param index - * @return - */ - protected double argAsDouble(int index) { - return Double.valueOf(this.argAsString(index).replace(",", ".")); - } - - /** - * - * @param index - * @return - */ - protected Player argAsPlayer(int index) { - return Bukkit.getPlayer(this.argAsString(index)); - } - - /** - * - * @param index - * @return Material - */ - protected Material argAsMaterial(int index) { - try { - return Material.valueOf(this.argAsString(index).toUpperCase(Locale.ROOT)); - } catch (Exception e) { - return null; - } - } - - /** - * - * @param index - * @param defaultValue - * @return - */ - protected Player argAsPlayer(int index, Player defaultValue) { - try { - return Bukkit.getPlayer(this.argAsString(index)); - } catch (Exception e) { - return defaultValue; - } - } - - /** - * - * @param index - * @return - */ - protected OfflinePlayer argAsOfflinePlayer(int index) { - return Bukkit.getOfflinePlayer(this.argAsString(index)); - } - - /** - * - * @param index - * @param defaultValue - * @return - */ - protected OfflinePlayer argAsOfflinePlayer(int index, OfflinePlayer defaultValue) { - try { - return Bukkit.getOfflinePlayer(this.argAsString(index)); - } catch (Exception e) { - return defaultValue; - } - } - - /** - * - * @param index - * @return - */ - protected EntityType argAsEntityType(int index) { - return EntityType.valueOf(this.argAsString(index).toUpperCase(Locale.ROOT)); - } - - /** - * - * @param index - * @param defaultValue - * @return - */ - protected EntityType argAsEntityType(int index, EntityType defaultValue) { - try { - return EntityType.valueOf(this.argAsString(index).toUpperCase(Locale.ROOT)); - } catch (Exception e) { - return defaultValue; - } - } - - /** - * - * @param index - * @return - */ - protected World argAsWorld(int index) { - try { - return Bukkit.getWorld(this.argAsString(index)); - } catch (Exception e) { - return null; - } - } - - /** - * - * @param index - * @return - */ - protected World argAsWorld(int index, World world) { - try { - return Bukkit.getWorld(this.argAsString(index)); - } catch (Exception e) { - return world; - } - } - - protected > T argAsEnum(int index, Class enumClass) { - try { - String s = this.argAsString(index); - if (s == null) { - return null; - } - return Enum.valueOf(enumClass, s.toUpperCase(Locale.ROOT)); - } catch (Exception e) { - return null; - } - } - - protected > T argAsEnum(int index, Class enumClass, T defaultValue) { - try { - String s = this.argAsString(index); - if (s == null) { - return defaultValue; - } - return Enum.valueOf(enumClass, s.toUpperCase(Locale.ROOT)); - } catch (Exception e) { - return defaultValue; - } - } - - protected boolean containFlag(@NotNull String flag) { - return this.flags.containsKey(flag); - } - - @Nullable - protected String getFlagValue(@NotNull String flag) { - Object value = this.flags.get(flag); - if (value != null) { - return String.valueOf(value); - } - return null; - } - - protected Object getFlagObjectValue(@NotNull String flag) { - return this.flags.get(flag); - } - - protected int getFlagValueAsInteger(@NotNull String flag, int defaultValue) { - Object value = this.flags.get(flag); - if (value != null) { - try { - return Integer.parseInt(String.valueOf(value)); - } catch (NumberFormatException e) { - return defaultValue; - } - } - return defaultValue; - } - - protected int getFlagValueAsInteger(@NotNull String flag) { - return this.getFlagValueAsInteger(flag, 0); - } - -} diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/utils/command/CommandManager.java b/Plugin/src/main/java/fr/robie/craftengineconverter/utils/command/CommandManager.java deleted file mode 100644 index 962c54c2..00000000 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/utils/command/CommandManager.java +++ /dev/null @@ -1,356 +0,0 @@ -package fr.robie.craftengineconverter.utils.command; - -import fr.robie.craftengineconverter.CraftEngineConverter; -import fr.robie.craftengineconverter.api.format.Message; - -import fr.robie.craftengineconverter.utils.CraftEngineConverterUtils; -import fr.robie.messageflow.formatter.MessageFormatter; -import fr.robie.messageflow.formatter.Placeholder; -import fr.robie.messageflow.logger.Logger; -import org.bukkit.Bukkit; -import org.bukkit.command.*; -import org.bukkit.entity.Player; -import org.bukkit.plugin.Plugin; - -import java.lang.reflect.Constructor; -import java.lang.reflect.Field; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Locale; -import java.util.function.Consumer; - -public class CommandManager extends CraftEngineConverterUtils implements CommandExecutor, TabCompleter, CommandManagerInt { - private static CommandMap commandMap; - private static Constructor constructor; - - private MessageFormatter messageFormatter; - - static { - try { - Field bukkitCommandMap = Bukkit.getServer().getClass().getDeclaredField("commandMap"); - bukkitCommandMap.setAccessible(true); - commandMap = (CommandMap) bukkitCommandMap.get(Bukkit.getServer()); - constructor = PluginCommand.class.getDeclaredConstructor(String.class, Plugin.class); - constructor.setAccessible(true); - } catch (Exception ignored) { - } - } - - private final CraftEngineConverter plugin; - private final List commands = new ArrayList(); - - /** - * F - * - * @param corePlugin - */ - public CommandManager(CraftEngineConverter corePlugin) { - this.plugin = corePlugin; - } - - /** - * Load all commands by calling their onLoad method recursively. - * This method should be called when the plugin is being loaded. - */ - public void loadCommands() { - this.messageFormatter = this.plugin.getMessageFormatter(); - this.applyToCommands(VCommand::onLoad); - } - - /** - * Enable all commands by calling their onEnable method recursively. - * This method should be called when the plugin is being enabled. - */ - public void enableCommands() { - this.applyToCommands(VCommand::onEnable); - } - - /** - * Disable all commands by calling their onDisable method recursively. - * This method is called when the plugin is being disabled. - */ - public void disableCommands() { - this.applyToCommands(VCommand::onDisable); - } - - - /** - * Apply a consumer action to all registered commands recursively with simple start/end logging. - * The provided action should be safe (exceptions are caught and logged). - * - * @param action action to apply to each VCommand - */ - private void applyToCommands(Consumer action) { - for (VCommand command : this.commands) { - this.applyRecursive(command, action); - } - } - - private void applyRecursive(VCommand command, Consumer action) { - if (command == null) { - return; - } - try { - action.accept(command); - } catch (Exception e) { - Logger.error("Error while applying command action to: " + command.getSyntax() + " - " + e.getMessage()); - } - List children = command.getSubVCommands(); - if (children != null && !children.isEmpty()) { - for (VCommand child : children) { - this.applyRecursive(child, action); - } - } - } - - /** - * Valid commands - */ - @Override - public void validCommands() { - Logger.info("Loading %count% commands", Placeholder.of("count", String.valueOf(this.getUniqueCommand()))); - this.commandChecking(); - Logger.info("Commands loaded successfully"); - } - - /** - * - * @param command - * @return - */ - @Override - public VCommand registerCommand(VCommand command) { - this.commands.add(command); - return command; - } - - @Override - public void registerCommand(String string, VCommand command) { - this.registerCommand(this.plugin, string, command, new ArrayList<>()); - } - - - @Override - public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) { - for (VCommand command : this.commands) { - if (command.getSubCommands().contains(cmd.getName().toLowerCase(Locale.ROOT))) { - if ((args.length == 0 || command.isIgnoreParent()) && command.getParent() == null) { - CommandType type = this.processRequirements(command, sender, args); - if (!type.equals(CommandType.CONTINUE)) { - return true; - } - } - } else if (args.length >= 1 && command.getParent() != null - && this.canExecute(args, cmd.getName().toLowerCase(Locale.ROOT), command)) { - CommandType type = this.processRequirements(command, sender, args); - if (!type.equals(CommandType.CONTINUE)) { - return true; - } - } - } - this.messageFormatter.sendMessage(Message.COMMAND__NO_ARGS, sender); - return true; - } - - /** - * @param args - * @param cmd - * @param command - * @return true if can execute - */ - private boolean canExecute(String[] args, String cmd, VCommand command) { - for (int index = args.length - 1; index > -1; index--) { - if (command.getSubCommands().contains(args[index].toLowerCase(Locale.ROOT))) { - if (command.isIgnoreArgs() - && (command.getParent() == null || this.canExecute(args, cmd, command.getParent(), index - 1))) { - return true; - } - if (index < args.length - 1) { - return false; - } - return this.canExecute(args, cmd, command.getParent(), index - 1); - } - } - return false; - } - - /** - * @param args - * @param cmd - * @param command - * @param index - * @return - */ - private boolean canExecute(String[] args, String cmd, VCommand command, int index) { - if (index < 0 && command.getSubCommands().contains(cmd.toLowerCase(Locale.ROOT))) { - return true; - } else if (index < 0) { - return false; - } else if (command.getSubCommands().contains(args[index].toLowerCase(Locale.ROOT))) { - return this.canExecute(args, cmd, command.getParent(), index - 1); - } - return false; - } - - /** - * Allows you to process an order. First we check if the sender has the - * permission or if the command has a permission. If yes then we execute the - * command otherwise we send the message for the permission - * - * @param command - Object that contains the command - * @param sender - Person who executes the command - * @param strings - Argument of the command - * @return CommandType - Return of the command - */ - private CommandType processRequirements(VCommand command, CommandSender sender, String[] strings) { - - if (!(sender instanceof Player) && !command.isConsoleCanUse()) { - this.messageFormatter.sendMessage(Message.COMMAND__PLAYER_ONLY, sender); - return CommandType.DEFAULT; - } - - if (command.getPermission() == null || this.hasPermission(sender, command.getPermission())) { - - if (command.runAsync) { - super.runAsync(this.plugin, () -> { - CommandType returnType = command.prePerform(this.plugin, sender, strings); - if (returnType == CommandType.SYNTAX_ERROR) { - this.messageFormatter.sendMessage(Message.COMMAND__SYNTAX__ERROR, sender, Placeholder.of("syntax", command.getSyntax())); - } - }); - return CommandType.DEFAULT; - } - - CommandType returnType = command.prePerform(this.plugin, sender, strings); - if (returnType == CommandType.SYNTAX_ERROR) { - this.messageFormatter.sendMessage(Message.COMMAND__SYNTAX__ERROR, sender, Placeholder.of("syntax", command.getSyntax())); - } - return returnType; - } - this.messageFormatter.sendMessage(Message.COMMAND__NO_PERMISSION, sender); - return CommandType.DEFAULT; - } - - public List getCommands() { - return this.commands; - } - - private int getUniqueCommand() { - return (int) this.commands.stream().filter(command -> command.getParent() == null).count(); - } - - /** - * @param command - * @param commandString - * @return - */ - public boolean isValid(VCommand command, String commandString) { - return command.getParent() != null ? this.isValid(command.getParent(), commandString) - : command.getSubCommands().contains(commandString.toLowerCase(Locale.ROOT)); - } - - /** - * Allows you to check if all commands are correct If an command does not - * have - */ - private void commandChecking() { - this.commands.forEach(command -> { - if (command.sameSubCommands()) { - Logger.error(command + " command to an argument similar to its parent command !"); - this.plugin.getServer().getPluginManager().disablePlugin(this.plugin); - } - }); - } - - @Override - public List onTabComplete(CommandSender sender, Command cmd, String str, String[] args) { - - for (VCommand command : this.commands) { - - if (command.getSubCommands().contains(cmd.getName().toLowerCase(Locale.ROOT))) { - if (args.length == 1 && command.getParent() == null) { - return this.proccessTab(sender, command, args); - } - } else { - String[] newArgs = Arrays.copyOf(args, args.length - 1); - if (newArgs.length >= 1 && command.getParent() != null - && this.canExecute(newArgs, cmd.getName().toLowerCase(Locale.ROOT), command)) { - return this.proccessTab(sender, command, args); - } - } - } - - return null; - } - - /** - * Allows to execute the tab completion - * - * @param sender - * @param command - * @param args - * @return - */ - private List proccessTab(CommandSender sender, VCommand command, String[] args) { - - CommandType type = command.getTabCompleter(); - if (type.equals(CommandType.DEFAULT)) { - String startWith = args[args.length - 1]; - - List tabCompleter = new ArrayList<>(); - for (VCommand vCommand : this.commands) { - if ((vCommand.getParent() != null && vCommand.getParent() == command)) { - for (String subCmd : vCommand.getSubCommands()) { - if (vCommand.getPermission() == null || sender.hasPermission(vCommand.getPermission())) { - if (startWith.isEmpty() || subCmd.startsWith(startWith)) { - tabCompleter.add(subCmd); - } - } - } - } - } - return tabCompleter.isEmpty() ? null : tabCompleter; - - } else if (type.equals(CommandType.SUCCESS)) { - return command.toTab(this.plugin, sender, args); - } - - return null; - } - - @Override - public void registerCommand(String command, VCommand vCommand, String... aliases) { - this.registerCommand(this.plugin, command, vCommand, Arrays.asList(aliases)); - } - - /** - * Register spigot command without plugin.yml This method will allow to - * onLoad a command in the spigot without using the plugin.yml This saves - * time and understanding, the plugin.yml file is clearer - * - * @param string - Main command - * @param vCommand - Command object - * @param aliases - Command aliases - */ - public void registerCommand(Plugin plugin, String string, VCommand vCommand, List aliases) { - try { - PluginCommand command = constructor.newInstance(string, this.plugin); - command.setExecutor(this); - command.setTabCompleter(this); - if (aliases != null && !aliases.isEmpty()) { - command.setAliases(aliases); - } - - - this.commands.add(vCommand.addSubCommand(string)); - vCommand.addSubCommand(aliases); - - if (!commandMap.register(command.getName(), plugin.getPluginMeta().getName(), command)) { - Logger.info("Unable to add the command " + vCommand.getSyntax()); - } - } catch (Exception exception) { - Logger.error("Error while registering command " + vCommand.getSyntax(), exception); - } - } -} diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/utils/command/CommandManagerInt.java b/Plugin/src/main/java/fr/robie/craftengineconverter/utils/command/CommandManagerInt.java deleted file mode 100644 index e4279217..00000000 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/utils/command/CommandManagerInt.java +++ /dev/null @@ -1,30 +0,0 @@ -package fr.robie.craftengineconverter.utils.command; - -public interface CommandManagerInt { - /** - * Registers a command - * @param command the command to onLoad - * @return the registered command - */ - VCommand registerCommand(VCommand command); - - /** - * Register a command with a single name - * @param string the command name - * @param command the command to onLoad - */ - void registerCommand(String string, VCommand command); - - /** - * Register a command with aliases - * @param command the command name - * @param vCommand the command to onLoad - * @param aliases the command aliases - */ - void registerCommand(String command, VCommand vCommand, String... aliases); - - /** - * Starts the validation of all registered commands - */ - void validCommands(); -} diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/utils/command/CommandType.java b/Plugin/src/main/java/fr/robie/craftengineconverter/utils/command/CommandType.java deleted file mode 100644 index 409d32e5..00000000 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/utils/command/CommandType.java +++ /dev/null @@ -1,12 +0,0 @@ -package fr.robie.craftengineconverter.utils.command; - - -public enum CommandType { - - SUCCESS, - SYNTAX_ERROR, - EXCEPTION_ERROR, - DEFAULT, - CONTINUE, - -} diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/utils/command/Tab.java b/Plugin/src/main/java/fr/robie/craftengineconverter/utils/command/Tab.java deleted file mode 100644 index dc447b8a..00000000 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/utils/command/Tab.java +++ /dev/null @@ -1,6 +0,0 @@ -package fr.robie.craftengineconverter.utils.command; - -public enum Tab { - START, - CONTAINS, -} diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/utils/command/VCommand.java b/Plugin/src/main/java/fr/robie/craftengineconverter/utils/command/VCommand.java deleted file mode 100644 index e8e3ebae..00000000 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/utils/command/VCommand.java +++ /dev/null @@ -1,835 +0,0 @@ -package fr.robie.craftengineconverter.utils.command; - -import fr.robie.craftengineconverter.CraftEngineConverter; -import fr.robie.craftengineconverter.api.format.Message; - -import fr.robie.craftengineconverter.common.permission.Permission; -import fr.robie.craftengineconverter.utils.collection.CollectionBiConsumer; -import fr.robie.messageflow.formatter.MessageFormatter; -import fr.robie.messageflow.formatter.Placeholder; -import fr.robie.messageflow.logger.Logger; -import org.bukkit.command.CommandSender; -import org.bukkit.entity.Player; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -import java.util.*; -import java.util.stream.Collectors; - -public abstract class VCommand extends Arguments { - record FlagValue(String flag, boolean hasValue, Class type, T defaultValue) { - public T parseValue(String value) { - if (this.type.equals(Boolean.class)) { - return this.type.cast(Boolean.parseBoolean(value)); - } else if (this.type.equals(Integer.class)) { - try { - return this.type.cast(Integer.parseInt(value)); - } catch (NumberFormatException e) { - return this.defaultValue; - } - } else if (this.type.equals(Double.class)) { - try { - return this.type.cast(Double.parseDouble(value)); - } catch (NumberFormatException e) { - return this.defaultValue; - } - } - return this.type.cast(value); - } - } - - protected final CraftEngineConverter plugin; - protected final MessageFormatter messageFormatter; - - /** - * Permission used for the command, if it is a null then everyone can - * execute the command - */ - private String permission; - - /** - * Mother command of this command - */ - protected VCommand parent; - - /** - * Are all sub commands used - */ - private final List subCommands = new ArrayList<>(); - protected List subVCommands = new ArrayList<>(); - - private final List requireArgs = new ArrayList<>(); - private final List optionalArgs = new ArrayList<>(); - private final List> flagsArgs = new ArrayList<>(); - /** - * If this variable is false the command will not be able to use this - * command - */ - private boolean consoleCanUse = true; - - /** - * This variable allows to run the main class of the command even with - * arguments convenient for commands like /ban - */ - private boolean ignoreParent = false; - private boolean ignoreArgs = false; - private boolean extendedArgs = false; - public boolean runAsync = false; - private CommandType tabCompleter = CommandType.DEFAULT; - - /** - * This is the person who executes the command - */ - protected CommandSender sender; - protected @Nullable Player player; // Null if console - - private String syntax; - private String description; - private int argsMinLength; - private int argsMaxLength; - - protected Map tabCompletions = new HashMap<>(); - - /** - * @param plugin - */ - public VCommand(CraftEngineConverter plugin) { - super(); - this.plugin = plugin; - this.messageFormatter = plugin.getMessageFormatter(); - } - - // - // GETTER - // - - public Optional getCompletionAt(int index) { - return Optional.ofNullable(this.tabCompletions.getOrDefault(index, null)); - } - - /** - * Return command permission - * - * @return the permission - */ - public String getPermission() { - return this.permission; - } - - /** - * @return the parent - */ - public VCommand getParent() { - return this.parent; - } - - /** - * @return the subCommand - */ - public List getSubCommands() { - return this.subCommands; - } - - /** - * @return the list of child VCommands - */ - public List getSubVCommands() { - return this.subVCommands; - } - - /** - * @return the consoleCanUse - */ - public boolean isConsoleCanUse() { - return this.consoleCanUse; - } - - /** - * @return the ignoreParent - */ - public boolean isIgnoreParent() { - return this.ignoreParent; - } - - public CommandSender getSender() { - return this.sender; - } - - /** - * @return the argsMinLength - */ - public int getArgsMinLength() { - return this.argsMinLength; - } - - /** - * @return the argsMaxLength - */ - public int getArgsMaxLength() { - return this.argsMaxLength; - } - - /** - * @return the player - */ - public Player getPlayer() { - return this.player; - } - - /** - * Return the generate or custom syntax - * - * @return the syntax - */ - public String getSyntax() { - if (this.syntax == null) { - this.syntax = this.generateDefaultSyntax(""); - } - return this.syntax; - } - - public boolean isIgnoreArgs() { - return this.ignoreArgs; - } - - public String getDescription() { - return this.description == null ? "no description" : this.description; - } - - public CommandType getTabCompleter() { - return this.tabCompleter; - } - - /* - * - */ - protected void setTabCompletor() { - this.tabCompleter = CommandType.SUCCESS; - } - - // - // SETTER - // - - public void setIgnoreArgs(boolean ignoreArgs) { - this.ignoreArgs = ignoreArgs; - } - - public void setIgnoreParent(boolean ignoreParent) { - this.ignoreParent = ignoreParent; - } - - public void setExtendedArgs(boolean extendedArgs) { - this.extendedArgs = extendedArgs; - } - - /** - * @param syntax the syntax to set - */ - protected VCommand setSyntax(String syntax) { - this.syntax = syntax; - return this; - } - - /** - * @param permission the permission to set - */ - protected VCommand setPermission(String permission) { - this.permission = permission; - return this; - } - - /** - * @param permission the permission to set - */ - protected VCommand setPermission(Permission permission) { - this.permission = permission.asPermission(); - return this; - } - - /** - * @param parent the parent to set - */ - protected VCommand setParent(VCommand parent) { - this.parent = parent; - return this; - } - - /** - * @param consoleCanUse the consoleCanUse to set - */ - protected VCommand setConsoleCanUse(boolean consoleCanUse) { - this.consoleCanUse = consoleCanUse; - return this; - } - - protected VCommand onlyPlayers() { - this.consoleCanUse = false; - return this; - } - - /** - * Mettre la description de la commande - * - * @param description - * @return - */ - protected VCommand setDescription(String description) { - this.description = description; - return this; - } - - /* - * Ajouter un argument obligatoire - */ - protected void addRequireArg(String message) { - this.requireArgs.add(message); - this.ignoreParent = this.parent == null; - this.ignoreArgs = true; - } - - /* - * Ajouter un argument obligatoire - */ - protected void addRequireArg(String message, CollectionBiConsumer runnable) { - this.addRequireArg(message); - int index = this.requireArgs.size(); - this.addCompletion(index - 1, runnable); - } - - /** - * Ajouter un argument optionel - * - * @param message - */ - protected void addOptionalArg(String message, CollectionBiConsumer runnable) { - this.addOptionalArg(message); - int index = this.requireArgs.size() + this.optionalArgs.size(); - this.addCompletion(index - 1, runnable); - } - - /** - * Ajouter un argument optionel - * - * @param message - */ - protected void addOptionalArg(String message) { - this.optionalArgs.add(message); - this.ignoreParent = this.parent == null; - this.ignoreArgs = true; - } - - protected void addFlag(@NotNull String flag) { - this.addFlag(flag, false, String.class, null); - } - - protected void addFlag(@NotNull String flag, boolean hasValue) { - this.addFlag(flag, hasValue, String.class, null); - } - - protected void addFlag(@NotNull String flag, @NotNull Class type, @Nullable T defaultValue) { - this.addFlag(flag, true, type, defaultValue); - } - - private void addFlag(@NotNull String flag, boolean hasValue, @NotNull Class type, @Nullable T defaultValue) { - this.flagsArgs.add(new FlagValue<>(flag, hasValue, type, defaultValue)); - this.ignoreParent = this.parent == null; - this.ignoreArgs = true; - this.setTabCompletor(); - } - - /** - * Mettre la description de la commande - * - * @param description - * @return - */ - protected VCommand setDescription(Message description) { - this.description = description.firstLine(); - return this; - } - - /** - * - * @return first command - */ - public String getFirst() { - return this.subCommands.getFirst(); - } - - // - // OTHER - // - - /** - * Adds sub orders - * - * @param subCommand - * @return this - */ - public VCommand addSubCommand(String subCommand) { - this.subCommands.add(subCommand); - return this; - } - - /** - * Adds sub orders - * - * @param command - * @return this - */ - public VCommand addSubCommand(VCommand command) { - command.setParent(this); - this.plugin.getCommandManager().registerCommand(command); - this.subVCommands.add(command); - return this; - } - - /** - * Adds sub orders - * - * @param subCommand - * @return this - */ - public VCommand addSubCommand(String... subCommand) { - this.subCommands.addAll(Arrays.asList(subCommand)); - return this; - } - - /** - * Add a {@link CollectionBiConsumer} to the index for the tab completion - * - * @param index - * @param runnable - */ - public void addCompletion(int index, CollectionBiConsumer runnable) { - this.tabCompletions.put(index, runnable); - this.setTabCompletor(); - } - - /** - * Allows you to generate the syntax of the command manually But you you can - * set it yourself with the setSyntax() - * - * @param syntax - * @return generate syntax - */ - private String generateDefaultSyntax(String syntax) { - boolean update = syntax.isEmpty(); - - StringBuilder syntaxBuilder = new StringBuilder(); - if (update) { - this.appendRequiredArguments(syntaxBuilder); - this.appendOptionalArguments(syntaxBuilder); - this.appendFlags(syntaxBuilder); - syntax = syntaxBuilder.toString().trim(); - } - - String tmpString = this.subCommands.getFirst() + syntax; - return this.parent == null ? "/" + tmpString : this.parent.generateDefaultSyntax(" " + tmpString); - } - - private void appendRequiredArguments(StringBuilder syntaxBuilder) { - this.requireArgs.forEach(arg -> syntaxBuilder.append(" <").append(arg).append(">")); - } - - private void appendOptionalArguments(StringBuilder syntaxBuilder) { - this.optionalArgs.forEach(arg -> syntaxBuilder.append(" [<").append(arg).append(">]")); - } - - private void appendFlags(StringBuilder syntaxBuilder) { - this.flagsArgs.forEach(flag -> { - syntaxBuilder.append(" [").append(flag.flag); - if (flag.hasValue) { - syntaxBuilder.append("=<").append(this.getSimpleTypeName(flag.type)).append(">"); - } - syntaxBuilder.append("]"); - }); - } - - private String getSimpleTypeName(Class type) { - if (type == Boolean.class) { - return "bool"; - } - if (type == Integer.class) { - return "int"; - } - if (type == Double.class) { - return "double"; - } - if (type == String.class) { - return "string"; - } - return type.getSimpleName().toLowerCase(Locale.ROOT); - } - - - /** - * Allows to know the number of parents in a recursive way - * - * @param defaultParent - * @return - */ - private int parentCount(int defaultParent) { - return this.parent == null ? defaultParent : this.parent.parentCount(defaultParent + 1); - } - - /** - * Allows you to manage the arguments and check that the command is valid - * - * @param plugin - * @param commandSender - * @param args - * @return - */ - public CommandType prePerform(CraftEngineConverter plugin, CommandSender commandSender, String[] args) { - - this.parentCount = this.parentCount(0); - - String[] cleanedArgs = this.parseFlags(args); - - this.argsMaxLength = this.requireArgs.size() + this.optionalArgs.size() + this.parentCount; - this.argsMinLength = this.requireArgs.size() + this.parentCount; - - if (this.syntax == null) { - this.syntax = this.generateDefaultSyntax(""); - } - - this.args = cleanedArgs; - - String defaultString = super.argAsString(0); - - if (defaultString != null) { - for (VCommand subCommand : this.subVCommands) { - if (subCommand.getSubCommands().contains(defaultString.toLowerCase(Locale.ROOT))) { - return CommandType.CONTINUE; - } - } - } - - if (!this.ignoreArgs) { - if ((this.argsMinLength != 0 && cleanedArgs.length < this.argsMinLength) || - this.argsMaxLength != 0 && cleanedArgs.length > this.argsMaxLength && !this.extendedArgs) { - return CommandType.SYNTAX_ERROR; - } - } - - this.sender = commandSender; - if (this.sender instanceof Player playerInstance) { - this.player = playerInstance; - } else { - this.player = null; - } - - try { - return this.perform(plugin); - } catch (Exception e) { - Logger.error("An error occurred while executing command: " + this.getSyntax(), e); - return CommandType.SYNTAX_ERROR; - } - } - - private String[] parseFlags(String[] args) { - this.flags.clear(); - List cleanedArgs = new ArrayList<>(); - - for (int i = 0; i < args.length; i++) { - String arg = args[i]; - - boolean isFlag = false; - for (FlagValue flag : this.flagsArgs) { - String flagKey = flag.flag; - if (arg.equals(flagKey)) { - isFlag = true; - - if (flag.hasValue && i + 1 < args.length && !args[i + 1].startsWith("--")) { - Object value; - try { - value = flag.parseValue(args[i + 1]); - } catch (ClassCastException e) { - value = flag.defaultValue; - } - this.flags.put(flagKey, value); - i++; - } else { - this.flags.put(flagKey, "true"); - } - break; - } else if (arg.startsWith(flagKey + "=")) { - isFlag = true; - String value; - if (flag.hasValue) { - value = arg.substring((flag.flag + "=").length()); - } else { - value = "true"; - } - Object parsedValue; - try { - parsedValue = flag.parseValue(value); - } catch (ClassCastException e) { - parsedValue = flag.defaultValue; - } - this.flags.put(flagKey, parsedValue); - break; - } - } - - if (!isFlag) { - cleanedArgs.add(arg); - } - } - - return cleanedArgs.toArray(new String[0]); - } - - /** - * Method that allows you to execute the command - */ - protected abstract CommandType perform(CraftEngineConverter plugin); - - public boolean sameSubCommands() { - if (this.parent == null) { - return false; - } - for (String command : this.subCommands) { - if (this.parent.getSubCommands().contains(command)) { - return true; - } - } - return false; - } - - @Override - public String toString() { - return "VCommand [permission=" + this.permission + ", subCommands=" + this.subCommands + ", consoleCanUse=" - + this.consoleCanUse + ", description=" + this.description + "]"; - } - - /** - * Generate tab completion - * - * @param plugin plugin - * @param sender sender - * @param args arguments - * @return list of completions or null - */ - public List toTab(CraftEngineConverter plugin, CommandSender sender, String[] args) { - - this.parentCount = this.parentCount(0); - - TabParseResult parseResult = this.parseArgsForTab(args); - - int currentIndex = (parseResult.cleanedArgs.size() - this.parentCount) - 1; - String lastArg = args[args.length - 1]; - - Optional optional = this.getCompletionAt(currentIndex); - List completions = optional.map(consumer -> - this.generateList(consumer.accept(sender, args), lastArg) - ).orElse(null); - - List availableFlags = this.getAvailableFlags(parseResult.usedFlags, lastArg); - - return this.combineCompletions(completions, availableFlags, currentIndex); - } - - private TabParseResult parseArgsForTab(String[] args) { - Set usedFlags = new HashSet<>(); - List cleanedArgs = new ArrayList<>(); - - Set flagSet = this.flagsArgs.stream() - .map(f -> f.flag) - .collect(Collectors.toSet()); - - for (int i = 0; i < args.length; i++) { - String arg = args[i]; - - if (flagSet.contains(arg)) { - usedFlags.add(arg); - - FlagValue flagValue = this.findFlag(arg); - if (flagValue != null && flagValue.hasValue && - i + 1 < args.length && !args[i + 1].startsWith("--")) { - i++; - } - } else if (arg.contains("=")) { - String flagPart = arg.substring(0, arg.indexOf('=')); - if (flagSet.contains(flagPart)) { - usedFlags.add(flagPart); - } else { - cleanedArgs.add(arg); - } - } else { - cleanedArgs.add(arg); - } - } - - return new TabParseResult(usedFlags, cleanedArgs); - } - - private FlagValue findFlag(String flag) { - return this.flagsArgs.stream() - .filter(f -> f.flag.equals(flag)) - .findFirst() - .orElse(null); - } - - private List getAvailableFlags(Set usedFlags, String filter) { - if (this.flagsArgs.isEmpty()) { - return Collections.emptyList(); - } - - String lowerFilter = filter.toLowerCase(Locale.ROOT); - - return this.flagsArgs.stream() - .map(f -> f.flag) - .filter(flag -> !usedFlags.contains(flag)) - .filter(flag -> filter.isEmpty() || flag.toLowerCase(Locale.ROOT).startsWith(lowerFilter)) - .collect(Collectors.toList()); - } - - private List combineCompletions(List completions, List flags, int currentIndex) { - boolean canShowFlags = currentIndex >= this.requireArgs.size() && !flags.isEmpty(); - - if (!canShowFlags) { - return completions; - } - - if (completions == null || completions.isEmpty()) { - return flags; - } - - List combined = new ArrayList<>(flags); - combined.addAll(completions); - return combined; - } - - /** - * Classe interne pour stocker les résultats du parsing - */ - private static class TabParseResult { - final Set usedFlags; - final List cleanedArgs; - - TabParseResult(Set usedFlags, List cleanedArgs) { - this.usedFlags = usedFlags; - this.cleanedArgs = cleanedArgs; - } - } - - /** - * Generate list for tab completer - * - * @param startWith - * @param strings - * @return - */ - protected List generateList(String startWith, String... strings) { - return this.generateList(Arrays.asList(strings), startWith); - } - - /** - * Generate list for tab completer - * - * @param startWith - * @param strings - * @return - */ - protected List generateList(Tab tab, String startWith, String... strings) { - return this.generateList(Arrays.asList(strings), startWith, tab); - } - - /** - * Generate list for tab completer - * - * @param defaultList - * @param startWith - * @return - */ - protected List generateList(Collection defaultList, String startWith) { - return this.generateList(defaultList, startWith, Tab.CONTAINS); - } - - /** - * Generate list for tab completer - * - * @param defaultList - * @param startWith - * @param tab - * @return - */ - protected List generateList(Collection defaultList, String startWith, Tab tab) { - List newList = new ArrayList<>(); - for (String str : defaultList) { - if (startWith.isEmpty() - || (tab.equals(Tab.START) ? str.toLowerCase(Locale.ROOT).startsWith(startWith.toLowerCase(Locale.ROOT)) - : str.toLowerCase(Locale.ROOT).contains(startWith.toLowerCase(Locale.ROOT)))) { - newList.add(str); - } - } - return newList.isEmpty() ? null : newList; - } - - /** - * Add list of aliases - * - * @param aliases Command aliases to add - */ - public void addSubCommand(List aliases) { - this.subCommands.addAll(aliases); - } - - /** - * Called when the plugin is being disabled. - * Override this method to perform cleanup tasks such as: - * - Cancelling running tasks - * - Clearing caches - * - Releasing resources - *

- * This method is automatically called recursively for all child commands - * by the CommandManager.disableCommands() method. - */ - protected void onDisable() { - // Override this method in subclasses if needed - } - - /** - * Called when the plugin is being loaded (onLoad phase). - * Override this method to perform early initialization tasks such as: - * - Loading configuration files - * - Initializing variables - * - Setting up dependencies that need to be available before plugin enable - *

- * This method is automatically called recursively for all child commands - * by the CommandManager.loadCommands() method. - */ - protected void onLoad() { - // Override this method in subclasses if needed - } - - /** - * Called when the plugin is being enabled (onEnable phase). - * Override this method to perform startup tasks such as: - * - Starting scheduled tasks - * - Registering event listeners specific to this command - * - Connecting to external services - *

- * This method is automatically called recursively for all child commands - * by the CommandManager.enableCommands() method. - */ - protected void onEnable() { - // Override this method in subclasses if needed - } - - /** - * Allows to send the syntax of the commands - * - */ - public void syntaxMessage() { - this.subVCommands.forEach(command -> { - if (command.getPermission() == null || this.hasPermission(this.sender, command.getPermission())) { - this.messageFormatter.sendMessage(Message.COMMAND__SYNTAX__HELP, this.sender, Placeholder.of("syntax", command.getSyntax(), "description", - command.getDescription())); - } - }); - } -} diff --git a/Plugin/src/main/resources/paper-plugin.yml b/Plugin/src/main/resources/paper-plugin.yml new file mode 100644 index 00000000..ed3db45c --- /dev/null +++ b/Plugin/src/main/resources/paper-plugin.yml @@ -0,0 +1,24 @@ +name: ${project.parent.artifactId} +version: ${plugin.finalVersion} +authors: [ ${plugin.author} ] +description: ${plugin.description} +api-version: ${plugin.apiVersion} +main: ${plugin.mainClass} +bootstrapper: ${plugin.bootstrapper} +loader: ${plugin.loader} +dependencies: + server: + CraftEngine: + load: BEFORE + required: true + join-classpath: true + + packetevents: + load: BEFORE + required: false + join-classpath: true + + PlaceholderAPI: + load: BEFORE + required: false + join-classpath: true \ No newline at end of file diff --git a/Plugin/src/main/resources/plugin.yml b/Plugin/src/main/resources/plugin.yml deleted file mode 100644 index 7c92348f..00000000 --- a/Plugin/src/main/resources/plugin.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: ${project.parent.artifactId} -version: ${plugin.finalVersion} -authors: [ ${plugin.author} ] -description: ${plugin.description} -main: ${plugin.mainClass} -api-version: ${plugin.apiVersion} -softdepend: - - CraftEngine - - packetevents - - PlaceholderAPI -folia-supported: true -libraries: - - org.reflections:reflections:0.10.2 \ No newline at end of file diff --git a/pom.xml b/pom.xml index 809aec59..17b343dc 100644 --- a/pom.xml +++ b/pom.xml @@ -38,6 +38,8 @@ A plugin to convert configurations to CraftEngine format 1.21 fr.robie.craftengineconverter.CraftEngineConverter + fr.robie.craftengineconverter.CraftEngineConverterBootstrapper + fr.robie.craftengineconverter.CraftEngineConverterLoader ${project.version}${dev.suffix} @@ -78,6 +80,12 @@ provided
+ + com.github.1robie.paper-dispatch + paper-dispatch + 1.0.1 + + io.papermc.paper @@ -262,6 +270,12 @@ + + + jitpack.io + https://jitpack.io + + papermc-repo @@ -321,11 +335,5 @@ central-snapshots https://central.sonatype.com/repository/maven-snapshots/ - - - - jitpack.io - https://jitpack.io - From ca32858a487f621b074d013a739d0c4b1285bd5f Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Thu, 9 Jul 2026 13:14:18 +0200 Subject: [PATCH 030/116] fix: disable HTML escaping in Gson configuration + update paper-dispatch version to 1.0.2 --- .../craftengineconverter/api/manager/FileCacheManager.java | 1 + pom.xml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/manager/FileCacheManager.java b/API/src/main/java/fr/robie/craftengineconverter/api/manager/FileCacheManager.java index b00503b2..c0565ed6 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/manager/FileCacheManager.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/manager/FileCacheManager.java @@ -16,6 +16,7 @@ public class FileCacheManager { private static final Gson GSON = new GsonBuilder() .setPrettyPrinting() .serializeNulls() + .disableHtmlEscaping() .create(); private static final FileCache yamlCache = new FileCache<>(100, 30, YamlConfiguration::loadConfiguration); diff --git a/pom.xml b/pom.xml index 17b343dc..c05bc913 100644 --- a/pom.xml +++ b/pom.xml @@ -83,7 +83,7 @@ com.github.1robie.paper-dispatch paper-dispatch - 1.0.1 + 1.0.2 From 60ca973d3476d52e9ed04a1befc92299725fdc2a Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Fri, 24 Jul 2026 14:21:50 +0200 Subject: [PATCH 031/116] chore: update .gitignore to include agent.yaml, reflection/, and concepts/ --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 7d792e1e..f48d9070 100644 --- a/.gitignore +++ b/.gitignore @@ -120,3 +120,6 @@ run/ .gemini/ gha-creds-*.json /GEMINI.md +agent.yaml +reflection/ +concepts/ \ No newline at end of file From 9b0e4da6f1ad3e2781d5713254584c4a83a0685b Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Fri, 24 Jul 2026 14:22:20 +0200 Subject: [PATCH 032/116] feat: enhance BedrockConverter with settings management and pack conversion logic --- .../api/builder/TimerBuilder.java | 4 - .../bedrock/ItemTextureConfiguration.java | 23 +- .../bedrock/ManifestConfiguration.java | 47 +- .../mapping/MappingsConfiguration.java | 21 +- .../mapping/block/BlockDefinition.java | 154 + .../block/BlockMappingConfiguration.java | 113 + .../mapping/item/GroupDefinitionMapping.java | 12 + .../bedrock/mapping/item/ItemMapping.java | 22 +- .../mapping/item/ItemModelItemMapping.java | 3 + .../component/GenericBedrockComponent.java | 59 + .../texture/FlipbookTextureConfiguration.java | 39 + .../bedrock/texture/FlipbookTextureData.java | 50 + .../bedrock/texture/TextureData.java | 6 +- .../ChangeOverTimeBlockBehavior.java | 2 +- .../DirectionalAttachedBlockBehavior.java | 4 +- ...hedHorizontalDirectionalBlockBehavior.java | 4 +- .../block/behaviors/HangingBlockBehavior.java | 4 +- .../behaviors/NearLiquidBlockBehavior.java | 2 +- .../behaviors/OnLiquidBlockBehavior.java | 2 +- .../block/behaviors/SeatBlockBehavior.java | 2 +- .../behaviors/StackableBlockBehavior.java | 2 +- .../behaviors/StrippableBlockBehavior.java | 2 +- .../behaviors/SturdyBaseBlockBehavior.java | 2 +- .../AnchorTypeBlockStateProperty.java | 11 +- .../properties/AxisBlockStateProperty.java | 11 +- .../properties/BooleanBlockStateProperty.java | 5 +- .../DoubleBlockHalfBlockStateProperty.java | 12 +- .../properties/HingeBlockStateProperty.java | 11 +- ...HorizontalDirectionBlockStateProperty.java | 12 +- .../SingleBlockHalfBlockStateProperty.java | 12 +- .../SlabTypeBlockStateProperty.java | 11 +- .../SofaShapeBlockStateProperty.java | 11 +- .../StairsShapeBlockStateProperty.java | 11 +- .../item/data/BlockStateConfiguration.java | 39 +- .../item/models/ModelConfiguration.java | 2 +- .../CompositeModelConfiguration.java | 6 + .../ConditionModelConfiguration.java | 8 + .../model/SimpleModelConfiguration.java | 1 + .../RangeDispatchModelConfiguration.java | 20 + .../select/ComponentSelectConfiguration.java | 5 + .../CustomModelDataSelectConfiguration.java | 4 + .../select/SelectModelConfiguration.java | 15 + .../models/AbstractConditionLoader.java | 9 +- .../api/enums/ItemDisplayType.java | 2 +- .../api/enums/Languages.java | 2 +- .../api/manager/FileCacheManager.java | 1 - .../api/utils/FileUtils.java | 6 +- .../api/utils/MinecraftVersion.java | 12 +- .../api/utils/PluginVersion.java | 12 +- .../common/permission/Permission.java | 4 +- .../common/utils/enums/Billboard.java | 2 +- Plugin/pom.xml | 1 + .../command/CraftEngineConverterCommand.java | 1 + .../CraftEngineConverterCommandBedrock.java | 47 + .../CraftEngineConverterCommandConvert.java | 4 +- ...ConverterCommandWorldConverterRestore.java | 6 +- .../converter/bedrock/BedrockConverter.java | 256 +- .../converter/bedrock/BedrockItemLoader.java | 916 +++- .../converter/bedrock/BedrockSettings.java | 78 + .../converter/bedrock/ConversionContext.java | 471 ++ .../converter/bedrock/LanguageConverter.java | 96 + .../bedrock/animation/AnimationMapper.java | 133 + .../bedrock/animation/BedrockAnimation.java | 59 + .../animation/BedrockAnimationContext.java | 50 + .../animation/BedrockAnimationController.java | 63 + .../animation/BedrockRenderControllers.java | 112 + .../bedrock/attachable/BedrockAttachable.java | 142 + .../attachable/BedrockAttachableContext.java | 119 + .../bedrock/block/BedrockBlockMapper.java | 279 + .../bedrock/geometry/BedrockGeometry.java | 196 + .../bedrock/geometry/GeometryMapper.java | 367 ++ .../bedrock/geometry/JavaBlockModel.java | 141 + .../converter/bedrock/sound/SoundMapper.java | 172 + .../bedrock/texture/CachedTextureInfo.java | 36 + .../bedrock/texture/TexturePipeline.java | 224 + .../converter/nexo/NexoItemConverter.java | 4 +- .../craftengineconverter/utils/Tuple.java | 17 +- Plugin/src/main/resources/paper-plugin.yml | 1 + .../BedrockConverterTest.java | 1 + .../craftengineconverter/MinimalTest.java | 29 + .../configuration/blocks/topaz_ore.yml | 107 + .../configuration/categories.yml | 75 + .../configuration/items/topaz_armor.yml | 216 + .../configuration/items/topaz_tool_weapon.yml | 304 ++ .../configuration/langs/en_us.yml | 130 + .../configuration/langs/fr_fr.yml | 130 + .../configuration/langs/ko_kr.yml | 130 + .../configuration/langs/zh_cn.yml | 130 + .../configuration/langs/zh_hk.yml | 130 + .../configuration/langs/zh_tw.yml | 130 + .../bedrock/items/default_assets/pack.yml | 4 + .../items/default_feature_populator/pack.yml | 10 + .../subpacks/26_1/configuration/features.yml | 370 ++ .../fallback/configuration/features.yml | 380 ++ .../templates/block_settings.yml | 219 + .../configuration/templates/block_states.yml | 2324 +++++++++ .../configuration/templates/events.yml | 77 + .../configuration/templates/loot_tables.yml | 267 + .../configuration/templates/tool_levels.yml | 25 + .../bedrock/items/default_templates/pack.yml | 5 + .../items/internal/configuration/gui.yml | 181 + .../items/internal/configuration/mappings.yml | 4474 +++++++++++++++++ .../internal/configuration/offset_chars.yml | 253 + .../items/internal/configuration/special.yml | 54 + .../configuration/translations/de.yml | 15 + .../configuration/translations/en.yml | 15 + .../configuration/translations/fr_fr.yml | 15 + .../configuration/translations/ko_kr.yml | 15 + .../configuration/translations/zh_cn.yml | 15 + .../configuration/translations/zh_hk.yml | 15 + .../configuration/translations/zh_tw.yml | 15 + .../bedrock/items/internal/pack.yml | 5 + .../legacy_armor/configuration/chainmail.yml | 30 + .../bedrock/items/legacy_armor/pack.yml | 5 + .../items/remove_shulker_head/pack.yml | 5 + .../shaders/core/rendertype_entity_solid.fsh | 29 + .../textures/entity/shulker/shulker_white.png | Bin 0 -> 1122 bytes .../bedrock/items/test_item.yml | 44 - .../assets/default/equipment/flame.json | 1 + .../assets/default/equipment/topaz.json | 1 + .../items/amethyst_standing_torch.json | 1 + .../assets/default/items/amethyst_torch.json | 1 + .../default/items/amethyst_wall_torch.json | 1 + .../assets/default/items/bench.json | 1 + .../assets/default/items/candelabrum.json | 1 + .../default/items/candelabrum_ceiling.json | 1 + .../default/items/candelabrum_ground.json | 1 + .../items/candelabrum_lit_ceiling.json | 1 + .../default/items/candelabrum_lit_ground.json | 1 + .../default/items/candelabrum_lit_wall.json | 1 + .../default/items/candelabrum_wall.json | 1 + .../assets/default/items/cap.json | 1 + .../default/items/chessboard_block.json | 1 + .../assets/default/items/chinese_lantern.json | 1 + .../assets/default/items/copper_coil.json | 1 + .../default/items/deepslate_topaz_ore.json | 1 + .../assets/default/items/drawer_block.json | 1 + .../assets/default/items/drill.json | 1 + .../items/ender_pearl_flower_seeds.json | 1 + .../assets/default/items/fairy_flower.json | 1 + .../assets/default/items/flame_cane.json | 1 + .../assets/default/items/flame_elytra.json | 1 + .../assets/default/items/flower_basket.json | 1 + .../default/items/flower_basket_ceiling.json | 1 + .../default/items/flower_basket_ground.json | 1 + .../default/items/flower_basket_wall.json | 1 + .../assets/default/items/globe.json | 1 + .../assets/default/items/globe_base.json | 1 + .../assets/default/items/globe_earth.json | 1 + .../assets/default/items/gui_head_size_1.json | 1 + .../assets/default/items/gui_head_size_4.json | 1 + .../assets/default/items/gunpowder_block.json | 1 + .../assets/default/items/hami_melon.json | 1 + .../default/items/hami_melon_seeds.json | 1 + .../default/items/hami_melon_slice.json | 1 + .../assets/default/items/magma_fruit.json | 1 + .../assets/default/items/netherite_anvil.json | 1 + .../assets/default/items/palm_button.json | 1 + .../items/palm_button_not_pressed.json | 1 + .../default/items/palm_button_pressed.json | 1 + .../assets/default/items/palm_door.json | 1 + .../assets/default/items/palm_fence.json | 1 + .../assets/default/items/palm_fence_gate.json | 1 + .../assets/default/items/palm_fence_post.json | 1 + .../assets/default/items/palm_fence_side.json | 1 + .../assets/default/items/palm_leaves.json | 1 + .../assets/default/items/palm_log.json | 1 + .../assets/default/items/palm_planks.json | 1 + .../default/items/palm_pressure_plate.json | 1 + .../assets/default/items/palm_sapling.json | 1 + .../assets/default/items/palm_slab.json | 1 + .../assets/default/items/palm_stairs.json | 1 + .../assets/default/items/palm_trapdoor.json | 1 + .../assets/default/items/palm_wood.json | 1 + .../assets/default/items/pebble.json | 1 + .../assets/default/items/reed.json | 1 + .../assets/default/items/safe_block.json | 1 + .../assets/default/items/showcase.json | 1 + .../assets/default/items/sleeper_sofa.json | 1 + .../assets/default/items/sofa.json | 1 + .../assets/default/items/sofa_inner.json | 1 + .../default/items/solid_gunpowder_block.json | 1 + .../default/items/stripped_palm_log.json | 1 + .../default/items/stripped_palm_wood.json | 1 + .../assets/default/items/table_lamp.json | 1 + .../assets/default/items/table_lamp_on.json | 1 + .../default/items/togglable_light_block.json | 1 + .../assets/default/items/topaz.json | 1 + .../assets/default/items/topaz_axe.json | 1 + .../assets/default/items/topaz_boots.json | 1 + .../assets/default/items/topaz_bow.json | 1 + .../default/items/topaz_chestplate.json | 1 + .../assets/default/items/topaz_crossbow.json | 1 + .../assets/default/items/topaz_helmet.json | 1 + .../assets/default/items/topaz_hoe.json | 1 + .../assets/default/items/topaz_leggings.json | 1 + .../assets/default/items/topaz_ore.json | 1 + .../assets/default/items/topaz_pickaxe.json | 1 + .../assets/default/items/topaz_rod.json | 1 + .../assets/default/items/topaz_shovel.json | 1 + .../assets/default/items/topaz_spear.json | 1 + .../assets/default/items/topaz_sword.json | 1 + .../assets/default/items/topaz_trident.json | 1 + .../assets/default/items/wooden_chair.json | 1 + .../default/models/item/amethyst_torch.json | 1 + .../default/models/item/candelabrum.json | 1 + .../models/item/ender_pearl_flower_seeds.json | 1 + .../default/models/item/fairy_flower.json | 1 + .../default/models/item/flame_cane.json | 1 + .../default/models/item/flame_elytra.json | 1 + .../models/item/flame_elytra_broken.json | 1 + .../default/models/item/flower_basket.json | 1 + .../default/models/item/hami_melon_seeds.json | 1 + .../default/models/item/hami_melon_slice.json | 1 + .../default/models/item/magma_fruit.json | 1 + .../assets/default/models/item/palm_door.json | 1 + .../default/models/item/palm_sapling.json | 1 + .../assets/default/models/item/pebble.json | 1 + .../assets/default/models/item/reed.json | 1 + .../models/item/togglable_light_block.json | 1 + .../assets/default/models/item/topaz.json | 1 + .../assets/default/models/item/topaz_axe.json | 1 + .../default/models/item/topaz_boots.json | 1 + .../item/topaz_boots_amethyst_trim.json | 1 + .../models/item/topaz_boots_copper_trim.json | 1 + .../models/item/topaz_boots_diamond_trim.json | 1 + .../models/item/topaz_boots_emerald_trim.json | 1 + .../models/item/topaz_boots_gold_trim.json | 1 + .../models/item/topaz_boots_iron_trim.json | 1 + .../models/item/topaz_boots_lapis_trim.json | 1 + .../item/topaz_boots_netherite_trim.json | 1 + .../models/item/topaz_boots_quartz_trim.json | 1 + .../item/topaz_boots_redstone_trim.json | 1 + .../models/item/topaz_boots_resin_trim.json | 1 + .../assets/default/models/item/topaz_bow.json | 1 + .../models/item/topaz_bow_pulling_0.json | 1 + .../models/item/topaz_bow_pulling_1.json | 1 + .../models/item/topaz_bow_pulling_2.json | 1 + .../default/models/item/topaz_chestplate.json | 1 + .../item/topaz_chestplate_amethyst_trim.json | 1 + .../item/topaz_chestplate_copper_trim.json | 1 + .../item/topaz_chestplate_diamond_trim.json | 1 + .../item/topaz_chestplate_emerald_trim.json | 1 + .../item/topaz_chestplate_gold_trim.json | 1 + .../item/topaz_chestplate_iron_trim.json | 1 + .../item/topaz_chestplate_lapis_trim.json | 1 + .../item/topaz_chestplate_netherite_trim.json | 1 + .../item/topaz_chestplate_quartz_trim.json | 1 + .../item/topaz_chestplate_redstone_trim.json | 1 + .../item/topaz_chestplate_resin_trim.json | 1 + .../default/models/item/topaz_crossbow.json | 1 + .../models/item/topaz_crossbow_arrow.json | 1 + .../models/item/topaz_crossbow_firework.json | 1 + .../models/item/topaz_crossbow_pulling_0.json | 1 + .../models/item/topaz_crossbow_pulling_1.json | 1 + .../models/item/topaz_crossbow_pulling_2.json | 1 + .../default/models/item/topaz_helmet.json | 1 + .../item/topaz_helmet_amethyst_trim.json | 1 + .../models/item/topaz_helmet_copper_trim.json | 1 + .../item/topaz_helmet_diamond_trim.json | 1 + .../item/topaz_helmet_emerald_trim.json | 1 + .../models/item/topaz_helmet_gold_trim.json | 1 + .../models/item/topaz_helmet_iron_trim.json | 1 + .../models/item/topaz_helmet_lapis_trim.json | 1 + .../item/topaz_helmet_netherite_trim.json | 1 + .../models/item/topaz_helmet_quartz_trim.json | 1 + .../item/topaz_helmet_redstone_trim.json | 1 + .../models/item/topaz_helmet_resin_trim.json | 1 + .../assets/default/models/item/topaz_hoe.json | 1 + .../default/models/item/topaz_leggings.json | 1 + .../item/topaz_leggings_amethyst_trim.json | 1 + .../item/topaz_leggings_copper_trim.json | 1 + .../item/topaz_leggings_diamond_trim.json | 1 + .../item/topaz_leggings_emerald_trim.json | 1 + .../models/item/topaz_leggings_gold_trim.json | 1 + .../models/item/topaz_leggings_iron_trim.json | 1 + .../item/topaz_leggings_lapis_trim.json | 1 + .../item/topaz_leggings_netherite_trim.json | 1 + .../item/topaz_leggings_quartz_trim.json | 1 + .../item/topaz_leggings_redstone_trim.json | 1 + .../item/topaz_leggings_resin_trim.json | 1 + .../default/models/item/topaz_pickaxe.json | 1 + .../assets/default/models/item/topaz_rod.json | 1 + .../default/models/item/topaz_rod_cast.json | 1 + .../default/models/item/topaz_shovel.json | 1 + .../default/models/item/topaz_spear.json | 1 + .../models/item/topaz_spear_in_hand.json | 1 + .../default/models/item/topaz_sword.json | 1 + .../assets/internal/items/cooking_info.json | 1 + .../assets/internal/items/exit.json | 1 + .../assets/internal/items/get_item.json | 1 + .../assets/internal/items/next_page_0.json | 1 + .../assets/internal/items/next_page_1.json | 1 + .../internal/items/previous_page_0.json | 1 + .../internal/items/previous_page_1.json | 1 + .../assets/internal/items/return.json | 1 + .../assets/minecraft/blockstates/anvil.json | 1 + .../blockstates/brown_mushroom_block.json | 1 + .../assets/minecraft/blockstates/cactus.json | 1 + .../blockstates/cut_copper_stairs.json | 1 + .../light_weighted_pressure_plate.json | 1 + .../minecraft/blockstates/note_block.json | 1 + .../minecraft/blockstates/oak_door.json | 1 + .../minecraft/blockstates/oak_fence_gate.json | 1 + .../minecraft/blockstates/oak_leaves.json | 1 + .../minecraft/blockstates/oak_sapling.json | 1 + .../minecraft/blockstates/oak_trapdoor.json | 1 + .../blockstates/petrified_oak_slab.json | 1 + .../minecraft/blockstates/sugar_cane.json | 1 + .../minecraft/blockstates/tripwire.json | 1 + .../assets/minecraft/font/default.json | 1 + .../assets/minecraft/font/gui.json | 1 + .../assets/minecraft/font/uniform.json | 1 + .../assets/minecraft/items/arrow.json | 1 + .../assets/minecraft/lang/en_us.json | 1 + .../assets/minecraft/lang/fr_fr.json | 1 + .../assets/minecraft/lang/ko_kr.json | 1 + .../assets/minecraft/lang/zh_cn.json | 1 + .../assets/minecraft/lang/zh_hk.json | 1 + .../assets/minecraft/lang/zh_tw.json | 1 + .../models/block/custom/amethyst_torch.json | 1 + .../block/custom/amethyst_wall_torch.json | 1 + .../models/block/custom/chessboard_block.json | 1 + .../models/block/custom/chinese_lantern.json | 1 + .../models/block/custom/copper_coil.json | 1 + .../models/block/custom/copper_coil_on.json | 1 + .../block/custom/deepslate_topaz_ore.json | 1 + .../models/block/custom/drawer_block.json | 1 + .../custom/ender_pearl_flower_stage_0.json | 1 + .../custom/ender_pearl_flower_stage_1.json | 1 + .../custom/ender_pearl_flower_stage_2.json | 1 + .../models/block/custom/fairy_flower_1.json | 48 + .../models/block/custom/fairy_flower_2.json | 1 + .../models/block/custom/fairy_flower_3.json | 1 + .../models/block/custom/fairy_flower_4.json | 1 + .../models/block/custom/fence_side.json | 29 + .../models/block/custom/flame_cane_1.json | 1 + .../models/block/custom/flame_cane_2.json | 1 + .../models/block/custom/gunpowder_block.json | 1 + .../models/block/custom/hami_melon.json | 1 + .../models/block/custom/large_mushroom.json | 138 + .../block/custom/magma_plant_stage_0.json | 36 + .../block/custom/magma_plant_stage_1.json | 36 + .../block/custom/magma_plant_stage_2.json | 36 + .../block/custom/magma_plant_stage_3.json | 120 + .../models/block/custom/medium_mushroom.json | 73 + .../models/block/custom/netherite_anvil.json | 1 + .../models/block/custom/palm_button.json | 1 + .../block/custom/palm_button_not_pressed.json | 1 + .../block/custom/palm_button_pressed.json | 1 + .../block/custom/palm_door_bottom_left.json | 1 + .../custom/palm_door_bottom_left_open.json | 1 + .../block/custom/palm_door_bottom_right.json | 1 + .../custom/palm_door_bottom_right_open.json | 1 + .../block/custom/palm_door_top_left.json | 1 + .../block/custom/palm_door_top_left_open.json | 1 + .../block/custom/palm_door_top_right.json | 1 + .../custom/palm_door_top_right_open.json | 1 + .../models/block/custom/palm_fence_gate.json | 1 + .../block/custom/palm_fence_gate_open.json | 1 + .../block/custom/palm_fence_gate_wall.json | 1 + .../custom/palm_fence_gate_wall_open.json | 1 + .../block/custom/palm_fence_inventory.json | 1 + .../models/block/custom/palm_fence_post.json | 1 + .../models/block/custom/palm_fence_side.json | 1 + .../models/block/custom/palm_leaves.json | 1 + .../models/block/custom/palm_log.json | 1 + .../block/custom/palm_log_horizontal.json | 1 + .../models/block/custom/palm_planks.json | 1 + .../block/custom/palm_pressure_plate.json | 1 + .../custom/palm_pressure_plate_powered.json | 1 + .../models/block/custom/palm_sapling.json | 1 + .../models/block/custom/palm_slab.json | 1 + .../models/block/custom/palm_slab_top.json | 1 + .../models/block/custom/palm_stairs.json | 1 + .../block/custom/palm_stairs_inner.json | 1 + .../block/custom/palm_stairs_outer.json | 1 + .../block/custom/palm_trapdoor_bottom.json | 1 + .../block/custom/palm_trapdoor_open.json | 1 + .../block/custom/palm_trapdoor_top.json | 1 + .../models/block/custom/palm_wood.json | 1 + .../block/custom/palm_wood_horizontal.json | 1 + .../models/block/custom/pebble_1.json | 34 + .../models/block/custom/pebble_2.json | 47 + .../models/block/custom/pebble_3.json | 47 + .../minecraft/models/block/custom/reed.json | 37 + .../models/block/custom/safe_block.json | 1 + .../models/block/custom/safe_block_open.json | 1 + .../models/block/custom/small_mushroom.json | 61 + .../block/custom/solid_gunpowder_block.json | 1 + .../block/custom/stripped_palm_log.json | 1 + .../custom/stripped_palm_log_horizontal.json | 1 + .../block/custom/stripped_palm_wood.json | 1 + .../custom/stripped_palm_wood_horizontal.json | 1 + .../models/block/custom/topaz_ore.json | 1 + .../assets/minecraft/models/block/empty.json | 1 + .../minecraft/models/item/custom/bench.json | 253 + .../item/custom/candelabrum_ceiling.json | 230 + .../item/custom/candelabrum_ground.json | 191 + .../item/custom/candelabrum_lit_ceiling.json | 230 + .../item/custom/candelabrum_lit_ground.json | 191 + .../item/custom/candelabrum_lit_wall.json | 138 + .../models/item/custom/candelabrum_wall.json | 138 + .../minecraft/models/item/custom/cap.json | 84 + .../minecraft/models/item/custom/drill.json | 1 + .../models/item/custom/drill_selected.json | 1 + .../item/custom/flower_basket_ceiling.json | 284 ++ .../item/custom/flower_basket_ground.json | 206 + .../item/custom/flower_basket_wall.json | 232 + .../minecraft/models/item/custom/globe.json | 164 + .../models/item/custom/globe_base.json | 109 + .../models/item/custom/globe_earth.json | 95 + .../models/item/custom/gui/cooking_info.json | 1 + .../models/item/custom/gui/exit.json | 1 + .../models/item/custom/gui/get_item.json | 1 + .../models/item/custom/gui/next_page_0.json | 1 + .../models/item/custom/gui/next_page_1.json | 1 + .../item/custom/gui/previous_page_0.json | 1 + .../item/custom/gui/previous_page_1.json | 1 + .../models/item/custom/gui/return.json | 1 + .../models/item/custom/gui_head_size_1.json | 1 + .../models/item/custom/gui_head_size_4.json | 1 + .../models/item/custom/showcase.json | 78 + .../models/item/custom/sleeper_sofa.json | 113 + .../minecraft/models/item/custom/sofa.json | 122 + .../models/item/custom/sofa_inner.json | 135 + .../item/custom/solid_gunpowder_block.json | 1 + .../models/item/custom/table_lamp.json | 121 + .../models/item/custom/table_lamp_on.json | 1 + .../models/item/custom/topaz_trident.json | 1 + .../item/custom/topaz_trident_in_hand.json | 107 + .../item/custom/topaz_trident_throwing.json | 109 + .../models/item/custom/wooden_chair.json | 162 + .../minecraft/particles/tinted_leaves.json | 1 + .../shaders/core/rendertype_entity_solid.fsh | 29 + .../assets/minecraft/sounds.json | 677 +++ .../minecraft/sounds/internal/silence.ogg | Bin 0 -> 2380 bytes .../textures/block/custom/amethyst_torch.png | Bin 0 -> 140 bytes .../block/custom/chessboard_block.png | Bin 0 -> 256 bytes .../textures/block/custom/chinese_lantern.png | Bin 0 -> 443 bytes .../block/custom/chinese_lantern.png.mcmeta | 1 + .../block/custom/chinese_lantern_top.png | Bin 0 -> 492 bytes .../custom/chinese_lantern_top.png.mcmeta | 1 + .../textures/block/custom/copper_coil.png | Bin 0 -> 157 bytes .../textures/block/custom/copper_coil_on.png | Bin 0 -> 168 bytes .../block/custom/copper_coil_on_side.png | Bin 0 -> 148 bytes .../block/custom/copper_coil_side.png | Bin 0 -> 137 bytes .../block/custom/deepslate_topaz_ore.png | Bin 0 -> 346 bytes .../custom/deepslate_topaz_ore.png.mcmeta | 1 + .../block/custom/drawer_block_back.png | Bin 0 -> 387 bytes .../block/custom/drawer_block_bottom.png | Bin 0 -> 165 bytes .../block/custom/drawer_block_front.png | Bin 0 -> 411 bytes .../block/custom/drawer_block_side_left.png | Bin 0 -> 427 bytes .../block/custom/drawer_block_side_right.png | Bin 0 -> 431 bytes .../block/custom/drawer_block_top.png | Bin 0 -> 378 bytes .../custom/ender_pearl_flower_stage_0.png | Bin 0 -> 118 bytes .../custom/ender_pearl_flower_stage_1.png | Bin 0 -> 182 bytes .../custom/ender_pearl_flower_stage_2.png | Bin 0 -> 224 bytes .../textures/block/custom/fairy_flower_1.png | Bin 0 -> 262 bytes .../textures/block/custom/fairy_flower_2.png | Bin 0 -> 300 bytes .../textures/block/custom/fairy_flower_3.png | Bin 0 -> 295 bytes .../textures/block/custom/fairy_flower_4.png | Bin 0 -> 305 bytes .../textures/block/custom/flame_cane_1.png | Bin 0 -> 182 bytes .../textures/block/custom/flame_cane_2.png | Bin 0 -> 184 bytes .../textures/block/custom/gunpowder_block.png | Bin 0 -> 202 bytes .../textures/block/custom/hami_melon.png | Bin 0 -> 204 bytes .../block/custom/hami_melon_bottom.png | Bin 0 -> 172 bytes .../textures/block/custom/hami_melon_top.png | Bin 0 -> 195 bytes .../textures/block/custom/magma_plant.png | Bin 0 -> 377 bytes .../block/custom/magma_plant.png.mcmeta | 1 + .../textures/block/custom/mushroom.png | Bin 0 -> 770 bytes .../textures/block/custom/netherite_anvil.png | Bin 0 -> 202 bytes .../block/custom/netherite_anvil_top.png | Bin 0 -> 214 bytes .../textures/block/custom/palm_door.png | Bin 0 -> 139 bytes .../block/custom/palm_door_bottom.png | Bin 0 -> 195 bytes .../textures/block/custom/palm_door_top.png | Bin 0 -> 209 bytes .../textures/block/custom/palm_leaves.png | Bin 0 -> 207 bytes .../textures/block/custom/palm_log.png | Bin 0 -> 163 bytes .../textures/block/custom/palm_log_top.png | Bin 0 -> 203 bytes .../textures/block/custom/palm_planks.png | Bin 0 -> 174 bytes .../textures/block/custom/palm_sapling.png | Bin 0 -> 190 bytes .../textures/block/custom/palm_trapdoor.png | Bin 0 -> 209 bytes .../textures/block/custom/pebble.png | Bin 0 -> 434 bytes .../minecraft/textures/block/custom/reed.png | Bin 0 -> 360 bytes .../block/custom/safe_block_bottom.png | Bin 0 -> 143 bytes .../block/custom/safe_block_front.png | Bin 0 -> 231 bytes .../block/custom/safe_block_front_open.png | Bin 0 -> 221 bytes .../textures/block/custom/safe_block_side.png | Bin 0 -> 287 bytes .../textures/block/custom/safe_block_top.png | Bin 0 -> 168 bytes .../block/custom/solid_gunpowder_block.png | Bin 0 -> 72 bytes .../block/custom/stripped_palm_log.png | Bin 0 -> 184 bytes .../block/custom/stripped_palm_log_top.png | Bin 0 -> 203 bytes .../textures/block/custom/topaz_ore.png | Bin 0 -> 333 bytes .../block/custom/topaz_ore.png.mcmeta | 1 + .../assets/minecraft/textures/block/empty.png | Bin 0 -> 75 bytes .../entity/equipment/humanoid/topaz.png | Bin 0 -> 424 bytes .../equipment/humanoid_leggings/topaz.png | Bin 0 -> 259 bytes .../textures/entity/equipment/wings/flame.png | Bin 0 -> 280 bytes .../textures/entity/shulker/shulker_white.png | Bin 0 -> 1122 bytes .../textures/font/gui/custom/blasting.png | Bin 0 -> 340 bytes .../font/gui/custom/brewing_recipe.png | Bin 0 -> 1515 bytes .../textures/font/gui/custom/campfire.png | Bin 0 -> 352 bytes .../textures/font/gui/custom/category.png | Bin 0 -> 996 bytes .../font/gui/custom/cooking_recipe.png | Bin 0 -> 1274 bytes .../font/gui/custom/crafting_recipe.png | Bin 0 -> 1747 bytes .../textures/font/gui/custom/item_browser.png | Bin 0 -> 1000 bytes .../textures/font/gui/custom/no_recipe.png | Bin 0 -> 994 bytes .../textures/font/gui/custom/smelting.png | Bin 0 -> 349 bytes .../gui/custom/smithing_transform_recipe.png | Bin 0 -> 1283 bytes .../textures/font/gui/custom/smoking.png | Bin 0 -> 348 bytes .../font/gui/custom/stonecutting_recipe.png | Bin 0 -> 1391 bytes .../minecraft/textures/font/image/emojis.png | Bin 0 -> 626 bytes .../textures/font/offset/space_split.png | Bin 0 -> 67 bytes .../gui/sprites/tooltip/topaz_background.png | Bin 0 -> 116 bytes .../tooltip/topaz_background.png.mcmeta | 1 + .../gui/sprites/tooltip/topaz_frame.png | Bin 0 -> 338 bytes .../sprites/tooltip/topaz_frame.png.mcmeta | 1 + .../minecraft/textures/item/custom/bench.png | Bin 0 -> 582 bytes .../textures/item/custom/candelabrum.png | Bin 0 -> 922 bytes .../textures/item/custom/candelabrum_2d.png | Bin 0 -> 315 bytes .../item/custom/candelabrum_flame.png | Bin 0 -> 165 bytes .../item/custom/candelabrum_flame.png.mcmeta | 5 + .../minecraft/textures/item/custom/cap.png | Bin 0 -> 443 bytes .../minecraft/textures/item/custom/drill.png | Bin 0 -> 394 bytes .../textures/item/custom/drill_selected.png | Bin 0 -> 540 bytes .../item/custom/drill_selected.png.mcmeta | 1 + .../item/custom/ender_pearl_flower_seeds.png | Bin 0 -> 164 bytes .../textures/item/custom/fairy_flower.png | Bin 0 -> 201 bytes .../textures/item/custom/flame_cane.png | Bin 0 -> 185 bytes .../textures/item/custom/flame_elytra.png | Bin 0 -> 208 bytes .../item/custom/flame_elytra_broken.png | Bin 0 -> 198 bytes .../textures/item/custom/flower_basket.png | Bin 0 -> 1038 bytes .../textures/item/custom/flower_basket_2d.png | Bin 0 -> 275 bytes .../minecraft/textures/item/custom/globe.png | Bin 0 -> 1119 bytes .../textures/item/custom/gui/cooking_info.png | Bin 0 -> 334 bytes .../item/custom/gui/cooking_info.png.mcmeta | 1 + .../textures/item/custom/gui/exit.png | Bin 0 -> 165 bytes .../textures/item/custom/gui/get_item.png | Bin 0 -> 134 bytes .../textures/item/custom/gui/next_page_0.png | Bin 0 -> 158 bytes .../textures/item/custom/gui/next_page_1.png | Bin 0 -> 154 bytes .../item/custom/gui/previous_page_0.png | Bin 0 -> 158 bytes .../item/custom/gui/previous_page_1.png | Bin 0 -> 155 bytes .../textures/item/custom/gui/return.png | Bin 0 -> 162 bytes .../textures/item/custom/hami_melon_seeds.png | Bin 0 -> 207 bytes .../textures/item/custom/hami_melon_slice.png | Bin 0 -> 203 bytes .../textures/item/custom/magma_fruit.png | Bin 0 -> 227 bytes .../item/custom/magma_fruit.png.mcmeta | 1 + .../minecraft/textures/item/custom/pebble.png | Bin 0 -> 173 bytes .../minecraft/textures/item/custom/reed.png | Bin 0 -> 186 bytes .../textures/item/custom/showcase.png | Bin 0 -> 776 bytes .../minecraft/textures/item/custom/sofa.png | Bin 0 -> 1230 bytes .../textures/item/custom/table_lamp.png | Bin 0 -> 279 bytes .../textures/item/custom/table_lamp_on.png | Bin 0 -> 275 bytes .../minecraft/textures/item/custom/topaz.png | Bin 0 -> 289 bytes .../textures/item/custom/topaz.png.mcmeta | 1 + .../textures/item/custom/topaz_axe.png | Bin 0 -> 240 bytes .../textures/item/custom/topaz_axe.png.mcmeta | 1 + .../textures/item/custom/topaz_boots.png | Bin 0 -> 252 bytes .../item/custom/topaz_boots.png.mcmeta | 1 + .../textures/item/custom/topaz_bow.png | Bin 0 -> 184 bytes .../item/custom/topaz_bow_pulling_0.png | Bin 0 -> 231 bytes .../item/custom/topaz_bow_pulling_1.png | Bin 0 -> 231 bytes .../item/custom/topaz_bow_pulling_2.png | Bin 0 -> 223 bytes .../textures/item/custom/topaz_chestplate.png | Bin 0 -> 528 bytes .../item/custom/topaz_chestplate.png.mcmeta | 1 + .../textures/item/custom/topaz_crossbow.png | Bin 0 -> 304 bytes .../item/custom/topaz_crossbow_arrow.png | Bin 0 -> 341 bytes .../item/custom/topaz_crossbow_firework.png | Bin 0 -> 351 bytes .../item/custom/topaz_crossbow_pulling_0.png | Bin 0 -> 308 bytes .../item/custom/topaz_crossbow_pulling_1.png | Bin 0 -> 315 bytes .../item/custom/topaz_crossbow_pulling_2.png | Bin 0 -> 308 bytes .../textures/item/custom/topaz_helmet.png | Bin 0 -> 234 bytes .../item/custom/topaz_helmet.png.mcmeta | 1 + .../textures/item/custom/topaz_hoe.png | Bin 0 -> 216 bytes .../textures/item/custom/topaz_hoe.png.mcmeta | 1 + .../textures/item/custom/topaz_leggings.png | Bin 0 -> 258 bytes .../item/custom/topaz_leggings.png.mcmeta | 1 + .../textures/item/custom/topaz_pickaxe.png | Bin 0 -> 251 bytes .../item/custom/topaz_pickaxe.png.mcmeta | 1 + .../textures/item/custom/topaz_rod.png | Bin 0 -> 199 bytes .../textures/item/custom/topaz_rod_cast.png | Bin 0 -> 161 bytes .../textures/item/custom/topaz_shovel.png | Bin 0 -> 220 bytes .../item/custom/topaz_shovel.png.mcmeta | 1 + .../textures/item/custom/topaz_spear.png | Bin 0 -> 1081 bytes .../item/custom/topaz_spear_in_hand.png | Bin 0 -> 1167 bytes .../textures/item/custom/topaz_sword.png | Bin 0 -> 291 bytes .../item/custom/topaz_sword.png.mcmeta | 1 + .../textures/item/custom/topaz_trident.png | Bin 0 -> 166 bytes .../textures/item/custom/topaz_trident_3d.png | Bin 0 -> 266 bytes .../textures/item/custom/wooden_chair.png | Bin 0 -> 284 bytes .../minecraft/textures/particle/empty.png | Bin 0 -> 68 bytes .../trims/entity/humanoid/chainmail.png | Bin 0 -> 258 bytes .../entity/humanoid_leggings/chainmail.png | Bin 0 -> 167 bytes .../assets/default/items/gui_head_size_1.json | 1 + .../assets/default/items/gui_head_size_4.json | 1 + .../resource_pack_unprotected/pack.mcmeta | 1 + .../pack/resource_pack_unprotected/pack.png | Bin 0 -> 27402 bytes .../configuration/items/topaz_sword.yml | 7 + .../simple_assets/configuration/pack.yml | 1 + .../textures/item/custom/topaz_sword.png | Bin 0 -> 291 bytes .../item/custom/topaz_sword.png.mcmeta | 1 + .../items/simple_assets/resourcepack/pack.png | Bin 0 -> 27402 bytes 602 files changed, 20108 insertions(+), 355 deletions(-) create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/block/BlockDefinition.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/block/BlockMappingConfiguration.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/component/GenericBedrockComponent.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/texture/FlipbookTextureConfiguration.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/texture/FlipbookTextureData.java create mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/command/CraftEngineConverterCommandBedrock.java create mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockSettings.java create mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/ConversionContext.java create mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/LanguageConverter.java create mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/animation/AnimationMapper.java create mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/animation/BedrockAnimation.java create mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/animation/BedrockAnimationContext.java create mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/animation/BedrockAnimationController.java create mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/animation/BedrockRenderControllers.java create mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/attachable/BedrockAttachable.java create mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/attachable/BedrockAttachableContext.java create mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/block/BedrockBlockMapper.java create mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/geometry/BedrockGeometry.java create mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/geometry/GeometryMapper.java create mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/geometry/JavaBlockModel.java create mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/sound/SoundMapper.java create mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/texture/CachedTextureInfo.java create mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/texture/TexturePipeline.java create mode 100644 Plugin/src/test/java/fr/robie/craftengineconverter/MinimalTest.java create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/configuration/blocks/topaz_ore.yml create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/configuration/categories.yml create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/configuration/items/topaz_armor.yml create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/configuration/items/topaz_tool_weapon.yml create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/configuration/langs/en_us.yml create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/configuration/langs/fr_fr.yml create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/configuration/langs/ko_kr.yml create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/configuration/langs/zh_cn.yml create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/configuration/langs/zh_hk.yml create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/configuration/langs/zh_tw.yml create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/pack.yml create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/default_feature_populator/pack.yml create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/default_feature_populator/subpacks/26_1/configuration/features.yml create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/default_feature_populator/subpacks/fallback/configuration/features.yml create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/default_templates/configuration/templates/block_settings.yml create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/default_templates/configuration/templates/block_states.yml create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/default_templates/configuration/templates/events.yml create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/default_templates/configuration/templates/loot_tables.yml create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/default_templates/configuration/templates/tool_levels.yml create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/default_templates/pack.yml create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/internal/configuration/gui.yml create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/internal/configuration/mappings.yml create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/internal/configuration/offset_chars.yml create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/internal/configuration/special.yml create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/internal/configuration/translations/de.yml create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/internal/configuration/translations/en.yml create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/internal/configuration/translations/fr_fr.yml create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/internal/configuration/translations/ko_kr.yml create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/internal/configuration/translations/zh_cn.yml create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/internal/configuration/translations/zh_hk.yml create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/internal/configuration/translations/zh_tw.yml create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/internal/pack.yml create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/legacy_armor/configuration/chainmail.yml create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/legacy_armor/pack.yml create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/remove_shulker_head/pack.yml create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/remove_shulker_head/resourcepack/assets/minecraft/shaders/core/rendertype_entity_solid.fsh create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/remove_shulker_head/resourcepack/assets/minecraft/textures/entity/shulker/shulker_white.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/test_item.yml create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/equipment/flame.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/equipment/topaz.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/amethyst_standing_torch.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/amethyst_torch.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/amethyst_wall_torch.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/bench.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/candelabrum.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/candelabrum_ceiling.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/candelabrum_ground.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/candelabrum_lit_ceiling.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/candelabrum_lit_ground.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/candelabrum_lit_wall.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/candelabrum_wall.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/cap.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/chessboard_block.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/chinese_lantern.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/copper_coil.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/deepslate_topaz_ore.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/drawer_block.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/drill.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/ender_pearl_flower_seeds.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/fairy_flower.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/flame_cane.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/flame_elytra.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/flower_basket.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/flower_basket_ceiling.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/flower_basket_ground.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/flower_basket_wall.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/globe.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/globe_base.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/globe_earth.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/gui_head_size_1.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/gui_head_size_4.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/gunpowder_block.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/hami_melon.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/hami_melon_seeds.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/hami_melon_slice.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/magma_fruit.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/netherite_anvil.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_button.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_button_not_pressed.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_button_pressed.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_door.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_fence.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_fence_gate.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_fence_post.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_fence_side.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_leaves.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_log.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_planks.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_pressure_plate.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_sapling.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_slab.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_stairs.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_trapdoor.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_wood.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/pebble.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/reed.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/safe_block.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/showcase.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/sleeper_sofa.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/sofa.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/sofa_inner.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/solid_gunpowder_block.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/stripped_palm_log.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/stripped_palm_wood.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/table_lamp.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/table_lamp_on.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/togglable_light_block.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/topaz.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/topaz_axe.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/topaz_boots.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/topaz_bow.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/topaz_chestplate.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/topaz_crossbow.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/topaz_helmet.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/topaz_hoe.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/topaz_leggings.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/topaz_ore.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/topaz_pickaxe.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/topaz_rod.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/topaz_shovel.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/topaz_spear.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/topaz_sword.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/topaz_trident.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/wooden_chair.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/amethyst_torch.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/candelabrum.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/ender_pearl_flower_seeds.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/fairy_flower.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/flame_cane.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/flame_elytra.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/flame_elytra_broken.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/flower_basket.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/hami_melon_seeds.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/hami_melon_slice.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/magma_fruit.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/palm_door.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/palm_sapling.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/pebble.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/reed.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/togglable_light_block.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_axe.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_boots.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_boots_amethyst_trim.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_boots_copper_trim.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_boots_diamond_trim.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_boots_emerald_trim.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_boots_gold_trim.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_boots_iron_trim.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_boots_lapis_trim.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_boots_netherite_trim.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_boots_quartz_trim.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_boots_redstone_trim.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_boots_resin_trim.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_bow.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_bow_pulling_0.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_bow_pulling_1.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_bow_pulling_2.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_chestplate.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_chestplate_amethyst_trim.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_chestplate_copper_trim.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_chestplate_diamond_trim.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_chestplate_emerald_trim.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_chestplate_gold_trim.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_chestplate_iron_trim.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_chestplate_lapis_trim.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_chestplate_netherite_trim.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_chestplate_quartz_trim.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_chestplate_redstone_trim.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_chestplate_resin_trim.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_crossbow.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_crossbow_arrow.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_crossbow_firework.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_crossbow_pulling_0.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_crossbow_pulling_1.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_crossbow_pulling_2.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_helmet.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_helmet_amethyst_trim.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_helmet_copper_trim.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_helmet_diamond_trim.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_helmet_emerald_trim.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_helmet_gold_trim.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_helmet_iron_trim.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_helmet_lapis_trim.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_helmet_netherite_trim.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_helmet_quartz_trim.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_helmet_redstone_trim.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_helmet_resin_trim.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_hoe.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_leggings.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_leggings_amethyst_trim.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_leggings_copper_trim.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_leggings_diamond_trim.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_leggings_emerald_trim.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_leggings_gold_trim.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_leggings_iron_trim.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_leggings_lapis_trim.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_leggings_netherite_trim.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_leggings_quartz_trim.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_leggings_redstone_trim.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_leggings_resin_trim.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_pickaxe.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_rod.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_rod_cast.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_shovel.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_spear.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_spear_in_hand.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_sword.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/internal/items/cooking_info.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/internal/items/exit.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/internal/items/get_item.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/internal/items/next_page_0.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/internal/items/next_page_1.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/internal/items/previous_page_0.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/internal/items/previous_page_1.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/internal/items/return.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/blockstates/anvil.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/blockstates/brown_mushroom_block.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/blockstates/cactus.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/blockstates/cut_copper_stairs.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/blockstates/light_weighted_pressure_plate.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/blockstates/note_block.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/blockstates/oak_door.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/blockstates/oak_fence_gate.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/blockstates/oak_leaves.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/blockstates/oak_sapling.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/blockstates/oak_trapdoor.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/blockstates/petrified_oak_slab.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/blockstates/sugar_cane.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/blockstates/tripwire.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/font/default.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/font/gui.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/font/uniform.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/items/arrow.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/lang/en_us.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/lang/fr_fr.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/lang/ko_kr.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/lang/zh_cn.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/lang/zh_hk.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/lang/zh_tw.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/amethyst_torch.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/amethyst_wall_torch.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/chessboard_block.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/chinese_lantern.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/copper_coil.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/copper_coil_on.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/deepslate_topaz_ore.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/drawer_block.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/ender_pearl_flower_stage_0.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/ender_pearl_flower_stage_1.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/ender_pearl_flower_stage_2.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/fairy_flower_1.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/fairy_flower_2.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/fairy_flower_3.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/fairy_flower_4.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/fence_side.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/flame_cane_1.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/flame_cane_2.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/gunpowder_block.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/hami_melon.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/large_mushroom.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/magma_plant_stage_0.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/magma_plant_stage_1.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/magma_plant_stage_2.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/magma_plant_stage_3.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/medium_mushroom.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/netherite_anvil.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_button.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_button_not_pressed.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_button_pressed.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_door_bottom_left.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_door_bottom_left_open.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_door_bottom_right.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_door_bottom_right_open.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_door_top_left.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_door_top_left_open.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_door_top_right.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_door_top_right_open.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_fence_gate.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_fence_gate_open.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_fence_gate_wall.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_fence_gate_wall_open.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_fence_inventory.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_fence_post.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_fence_side.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_leaves.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_log.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_log_horizontal.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_planks.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_pressure_plate.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_pressure_plate_powered.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_sapling.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_slab.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_slab_top.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_stairs.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_stairs_inner.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_stairs_outer.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_trapdoor_bottom.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_trapdoor_open.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_trapdoor_top.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_wood.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_wood_horizontal.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/pebble_1.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/pebble_2.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/pebble_3.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/reed.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/safe_block.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/safe_block_open.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/small_mushroom.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/solid_gunpowder_block.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/stripped_palm_log.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/stripped_palm_log_horizontal.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/stripped_palm_wood.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/stripped_palm_wood_horizontal.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/topaz_ore.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/empty.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/bench.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/candelabrum_ceiling.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/candelabrum_ground.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/candelabrum_lit_ceiling.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/candelabrum_lit_ground.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/candelabrum_lit_wall.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/candelabrum_wall.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/cap.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/drill.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/drill_selected.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/flower_basket_ceiling.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/flower_basket_ground.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/flower_basket_wall.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/globe.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/globe_base.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/globe_earth.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/gui/cooking_info.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/gui/exit.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/gui/get_item.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/gui/next_page_0.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/gui/next_page_1.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/gui/previous_page_0.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/gui/previous_page_1.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/gui/return.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/gui_head_size_1.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/gui_head_size_4.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/showcase.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/sleeper_sofa.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/sofa.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/sofa_inner.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/solid_gunpowder_block.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/table_lamp.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/table_lamp_on.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/topaz_trident.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/topaz_trident_in_hand.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/topaz_trident_throwing.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/wooden_chair.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/particles/tinted_leaves.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/shaders/core/rendertype_entity_solid.fsh create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/sounds.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/sounds/internal/silence.ogg create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/amethyst_torch.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/chessboard_block.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/chinese_lantern.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/chinese_lantern.png.mcmeta create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/chinese_lantern_top.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/chinese_lantern_top.png.mcmeta create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/copper_coil.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/copper_coil_on.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/copper_coil_on_side.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/copper_coil_side.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/deepslate_topaz_ore.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/deepslate_topaz_ore.png.mcmeta create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/drawer_block_back.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/drawer_block_bottom.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/drawer_block_front.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/drawer_block_side_left.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/drawer_block_side_right.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/drawer_block_top.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/ender_pearl_flower_stage_0.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/ender_pearl_flower_stage_1.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/ender_pearl_flower_stage_2.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/fairy_flower_1.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/fairy_flower_2.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/fairy_flower_3.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/fairy_flower_4.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/flame_cane_1.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/flame_cane_2.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/gunpowder_block.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/hami_melon.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/hami_melon_bottom.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/hami_melon_top.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/magma_plant.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/magma_plant.png.mcmeta create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/mushroom.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/netherite_anvil.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/netherite_anvil_top.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/palm_door.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/palm_door_bottom.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/palm_door_top.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/palm_leaves.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/palm_log.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/palm_log_top.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/palm_planks.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/palm_sapling.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/palm_trapdoor.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/pebble.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/reed.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/safe_block_bottom.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/safe_block_front.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/safe_block_front_open.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/safe_block_side.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/safe_block_top.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/solid_gunpowder_block.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/stripped_palm_log.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/stripped_palm_log_top.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/topaz_ore.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/topaz_ore.png.mcmeta create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/empty.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/entity/equipment/humanoid/topaz.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/entity/equipment/humanoid_leggings/topaz.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/entity/equipment/wings/flame.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/entity/shulker/shulker_white.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/font/gui/custom/blasting.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/font/gui/custom/brewing_recipe.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/font/gui/custom/campfire.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/font/gui/custom/category.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/font/gui/custom/cooking_recipe.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/font/gui/custom/crafting_recipe.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/font/gui/custom/item_browser.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/font/gui/custom/no_recipe.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/font/gui/custom/smelting.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/font/gui/custom/smithing_transform_recipe.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/font/gui/custom/smoking.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/font/gui/custom/stonecutting_recipe.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/font/image/emojis.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/font/offset/space_split.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/gui/sprites/tooltip/topaz_background.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/gui/sprites/tooltip/topaz_background.png.mcmeta create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/gui/sprites/tooltip/topaz_frame.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/gui/sprites/tooltip/topaz_frame.png.mcmeta create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/bench.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/candelabrum.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/candelabrum_2d.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/candelabrum_flame.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/candelabrum_flame.png.mcmeta create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/cap.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/drill.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/drill_selected.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/drill_selected.png.mcmeta create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/ender_pearl_flower_seeds.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/fairy_flower.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/flame_cane.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/flame_elytra.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/flame_elytra_broken.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/flower_basket.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/flower_basket_2d.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/globe.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/gui/cooking_info.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/gui/cooking_info.png.mcmeta create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/gui/exit.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/gui/get_item.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/gui/next_page_0.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/gui/next_page_1.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/gui/previous_page_0.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/gui/previous_page_1.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/gui/return.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/hami_melon_seeds.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/hami_melon_slice.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/magma_fruit.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/magma_fruit.png.mcmeta create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/pebble.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/reed.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/showcase.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/sofa.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/table_lamp.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/table_lamp_on.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz.png.mcmeta create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_axe.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_axe.png.mcmeta create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_boots.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_boots.png.mcmeta create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_bow.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_bow_pulling_0.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_bow_pulling_1.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_bow_pulling_2.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_chestplate.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_chestplate.png.mcmeta create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_crossbow.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_crossbow_arrow.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_crossbow_firework.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_crossbow_pulling_0.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_crossbow_pulling_1.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_crossbow_pulling_2.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_helmet.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_helmet.png.mcmeta create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_hoe.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_hoe.png.mcmeta create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_leggings.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_leggings.png.mcmeta create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_pickaxe.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_pickaxe.png.mcmeta create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_rod.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_rod_cast.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_shovel.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_shovel.png.mcmeta create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_spear.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_spear_in_hand.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_sword.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_sword.png.mcmeta create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_trident.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_trident_3d.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/wooden_chair.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/particle/empty.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/trims/entity/humanoid/chainmail.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/trims/entity/humanoid_leggings/chainmail.png create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/ce_overlay_84/assets/default/items/gui_head_size_1.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/ce_overlay_84/assets/default/items/gui_head_size_4.json create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/pack.mcmeta create mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/pack.png create mode 100644 Plugin/src/test/resources/minimal-test/bedrock/items/simple_assets/configuration/items/topaz_sword.yml create mode 100644 Plugin/src/test/resources/minimal-test/bedrock/items/simple_assets/configuration/pack.yml create mode 100644 Plugin/src/test/resources/minimal-test/bedrock/items/simple_assets/resourcepack/assets/minecraft/textures/item/custom/topaz_sword.png create mode 100644 Plugin/src/test/resources/minimal-test/bedrock/items/simple_assets/resourcepack/assets/minecraft/textures/item/custom/topaz_sword.png.mcmeta create mode 100644 Plugin/src/test/resources/minimal-test/bedrock/items/simple_assets/resourcepack/pack.png diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/builder/TimerBuilder.java b/API/src/main/java/fr/robie/craftengineconverter/api/builder/TimerBuilder.java index 08c4abb8..efbcb413 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/builder/TimerBuilder.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/builder/TimerBuilder.java @@ -69,13 +69,10 @@ public static String formatTime(long milliseconds, TimeUnit maxUnit) { String message = maxUnit.getTimeMessage().firstLine(); - Logger.info("Formatting time: " + milliseconds + " ms with max unit: " + maxUnit.name()); - Logger.info("Calculated values: " + values); Placeholder.Builder placeholderBuilder = new Placeholder.Builder(); for (int i = 0; i < unitsToInclude.size(); i++) { TimeUnit unit = unitsToInclude.get(i); placeholderBuilder.register(unit.name().toLowerCase(Locale.ROOT), unit.getFormat(values.get(i))); - Logger.info("Registered placeholder: " + unit.name().toLowerCase(Locale.ROOT) + " -> " + unit.getFormat(values.get(i))); } Placeholder placeholder = placeholderBuilder.build(); @@ -94,7 +91,6 @@ public static String formatTime(long milliseconds, TimeUnit maxUnit) { */ @Contract(pure = true) public static String formatTimeAuto(long milliseconds) { - Logger.info("Formatting time: " + milliseconds + " ms"); long seconds = milliseconds / 1000L; if (milliseconds < 1000) { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/ItemTextureConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/ItemTextureConfiguration.java index 60353f3f..38ebf336 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/ItemTextureConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/ItemTextureConfiguration.java @@ -3,7 +3,6 @@ import com.google.gson.JsonObject; import fr.robie.craftengineconverter.api.configuration.bedrock.texture.TextureData; import fr.robie.craftengineconverter.api.manager.FileCacheManager; -import fr.robie.messageflow.logger.Logger; import org.jetbrains.annotations.NotNull; import java.nio.file.Path; @@ -13,6 +12,7 @@ public class ItemTextureConfiguration { private String resourcePackName; private String textureName; + private String fileName = "item_texture.json"; private final List textures = new ArrayList<>(); @@ -26,6 +26,15 @@ public ItemTextureConfiguration setTextureName(String textureName) { return this; } + public ItemTextureConfiguration setFileName(String fileName) { + this.fileName = fileName; + return this; + } + + public boolean isEmpty() { + return this.textures.isEmpty(); + } + public ItemTextureConfiguration addTextureData(@NotNull TextureData textureData) { this.textures.add(textureData); return this; @@ -42,17 +51,15 @@ public void save(@NotNull Path directory) { jsonObject.addProperty("texture_name", this.textureName); } - if (!this.textures.isEmpty()) { - JsonObject texturesObject = new JsonObject(); - for (TextureData textureData : this.textures) { + JsonObject texturesObject = new JsonObject(); + for (TextureData textureData : this.textures) { + if (!textureData.getTextures().isEmpty()) { texturesObject.add(textureData.getBedrockIdentifier(), textureData.serialize()); } - jsonObject.add("texture_data", texturesObject); - } else { - Logger.info("No textures added to the item texture configuration, skipping texture_data section."); } + jsonObject.add("texture_data", texturesObject); - FileCacheManager.saveJsonToFile(directory.resolve("item_texture.json"), jsonObject); + FileCacheManager.saveJsonToFile(directory.resolve(this.fileName), jsonObject); } } diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/ManifestConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/ManifestConfiguration.java index dd6171ae..67e43a1b 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/ManifestConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/ManifestConfiguration.java @@ -12,13 +12,13 @@ import java.util.UUID; public class ManifestConfiguration { - private static final int formatVersion = 3; + private static final int formatVersion = 2; private final String packName; private String packDescription; private UUID packUUID; - private String packVersion; - private String minEngineVersion; + private int[] packVersion = {1, 0, 0}; + private int[] minEngineVersion = {1, 21, 0}; private PackScope scope; private UUID resourcePackUUID; @@ -45,15 +45,37 @@ public ManifestConfiguration setPackUUID(UUID packUUID) { } public ManifestConfiguration setPackVersion(String packVersion) { - this.packVersion = packVersion; + this.packVersion = parseVersion(packVersion); + return this; + } + + public ManifestConfiguration setPackVersion(int major, int minor, int patch) { + this.packVersion = new int[]{major, minor, patch}; return this; } public ManifestConfiguration setMinEngineVersion(String minEngineVersion) { - this.minEngineVersion = minEngineVersion; + this.minEngineVersion = parseVersion(minEngineVersion); return this; } + public ManifestConfiguration setMinEngineVersion(int major, int minor, int patch) { + this.minEngineVersion = new int[]{major, minor, patch}; + return this; + } + + private static int[] parseVersion(String version) { + String[] parts = version.split("\\."); + int major = parts.length > 0 ? safeParseInt(parts[0]) : 1; + int minor = parts.length > 1 ? safeParseInt(parts[1]) : 0; + int patch = parts.length > 2 ? safeParseInt(parts[2]) : 0; + return new int[]{major, minor, patch}; + } + + private static int safeParseInt(String s) { + try { return Integer.parseInt(s); } catch (NumberFormatException e) { return 0; } + } + public ManifestConfiguration setScope(PackScope scope) { this.scope = scope; return this; @@ -140,8 +162,8 @@ private JsonObject createHeader() { header.addProperty("description", this.packDescription); } header.addProperty("uuid", (this.packUUID != null ? this.packUUID : UUID.randomUUID()).toString()); - header.addProperty("version", this.packVersion != null ? this.packVersion : "1.0.0"); - header.addProperty("min_engine_version", this.minEngineVersion != null ? this.minEngineVersion : "1.26.10"); + header.add("version", toJsonArray(this.packVersion)); + header.add("min_engine_version", toJsonArray(this.minEngineVersion)); if (this.scope != null) { header.addProperty("scope", this.scope.name().toLowerCase()); } @@ -159,8 +181,11 @@ private JsonArray createModules() { } while (resourceUUID.equals(mainUUID)); } module.addProperty("type", "resources"); + if (this.packDescription != null) { + module.addProperty("description", this.packDescription); + } module.addProperty("uuid", resourceUUID.toString()); - module.addProperty("version", this.resourcePackVersion != null ? this.resourcePackVersion : "1.0.0"); + module.add("version", toJsonArray(this.packVersion)); modules.add(module); return modules; } @@ -221,6 +246,12 @@ public static ManifestConfiguration fromJavaPackFormat(@NotNull JsonObject json) return configuration != null ? configuration : new ManifestConfiguration("Unnamed Pack"); } + private static com.google.gson.JsonArray toJsonArray(int[] values) { + com.google.gson.JsonArray arr = new com.google.gson.JsonArray(); + for (int v : values) arr.add(v); + return arr; + } + public enum PackScope { ANY, GLOBAL, diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/MappingsConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/MappingsConfiguration.java index 12bd62e1..039c4d32 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/MappingsConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/MappingsConfiguration.java @@ -23,6 +23,25 @@ public MappingsConfiguration addItemMapping(@NotNull ItemMapping itemMapping) { return this; } + public List getMappings(@NotNull Material material) { + return this.itemMappings.get(material); + } + + public boolean removeItemMapping(@NotNull Material material, @NotNull ItemMapping mapping) { + List list = this.itemMappings.get(material); + return list != null && list.remove(mapping); + } + + public void replaceItemMapping(@NotNull Material material, @NotNull ItemMapping old, @NotNull ItemMapping replacement) { + List list = this.itemMappings.get(material); + if (list != null) { + int index = list.indexOf(old); + if (index >= 0) { + list.set(index, replacement); + } + } + } + public void saveMappings(@NotNull Path directory) { JsonObject jsonObject = new JsonObject(); @@ -43,7 +62,7 @@ public void saveMappings(@NotNull Path directory) { jsonObject.add("items", itemsObject); - Path mappingsFile = directory.resolve("items_mappings.json"); + Path mappingsFile = directory.resolve("geyser_item_mappings.json"); FileCacheManager.saveJsonToFile(mappingsFile, jsonObject); } } diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/block/BlockDefinition.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/block/BlockDefinition.java new file mode 100644 index 00000000..f1b3c2d9 --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/block/BlockDefinition.java @@ -0,0 +1,154 @@ +package fr.robie.craftengineconverter.api.configuration.bedrock.mapping.block; + +import com.google.gson.JsonArray; +import com.google.gson.JsonObject; +import org.jetbrains.annotations.Nullable; + +import java.util.HashMap; +import java.util.Map; +import java.util.Optional; + +public class BlockDefinition { + private final GeometryWithMaterials geometry; + private final Optional friction; + private final int lightEmission; + private final int lightDampening; + private final boolean placeAir; + private final Transformation transformation; + + public BlockDefinition( + @Nullable GeometryWithMaterials geometry, + Optional friction, int lightEmission, int lightDampening, + boolean placeAir, @Nullable Transformation transformation + ) { + this.geometry = geometry; + this.friction = friction; + this.lightEmission = lightEmission; + this.lightDampening = lightDampening; + this.placeAir = placeAir; + this.transformation = transformation; + } + + public Optional geometry() { return Optional.ofNullable(this.geometry); } + + public JsonObject serialize() { + JsonObject obj = new JsonObject(); + this.geometry().ifPresent(g -> obj.add("geometry", g.serialize())); + this.friction.ifPresent(f -> obj.addProperty("friction", f)); + if (this.lightEmission > 0) obj.addProperty("light_emission", this.lightEmission); + if (this.lightDampening > 0) obj.addProperty("light_dampening", this.lightDampening); + if (!this.placeAir) obj.addProperty("place_air", false); + if (this.transformation != null && !this.transformation.isIdentity()) { + obj.add("transformation", this.transformation.serialize()); + } + return obj; + } + + public static class Builder { + private GeometryWithMaterials geometry; + private Optional friction = Optional.empty(); + private int lightEmission = 0; + private int lightDampening = 15; + private boolean placeAir = true; + private Transformation transformation = Transformation.IDENTITY; + + public Builder withFullBlockGeometry(String texture, String renderMethod) { + MaterialInstances instances = new MaterialInstances.Builder() + .withInstance("*", texture, renderMethod, true, true) + .build(); + this.geometry = new GeometryWithMaterials(new Geometry("minecraft:geometry.full_block"), instances); + return this; + } + + public Builder withCrossGeometry(String texture, String renderMethod) { + MaterialInstances instances = new MaterialInstances.Builder() + .withInstance("*", texture, renderMethod, true, true) + .build(); + this.geometry = new GeometryWithMaterials(new Geometry("minecraft:geometry.cross"), instances); + return this; + } + + public Builder withCustomGeometry(String identifier, MaterialInstances instances) { + this.geometry = new GeometryWithMaterials(new Geometry(identifier), instances); + return this; + } + + public Builder withFriction(float f) { this.friction = Optional.of(f); return this; } + public Builder withLightEmission(int v) { this.lightEmission = v; return this; } + public Builder withLightDampening(int v) { this.lightDampening = v; return this; } + public Builder noPlaceAir() { this.placeAir = false; return this; } + public Builder withTransformation(Transformation t) { this.transformation = t; return this; } + + public BlockDefinition build() { + return new BlockDefinition(this.geometry, this.friction, this.lightEmission, this.lightDampening, this.placeAir, this.transformation); + } + } + + public record GeometryWithMaterials(Geometry geometry, MaterialInstances materialInstances) { + public JsonObject serialize() { + JsonObject obj = new JsonObject(); + obj.add("geometry", this.geometry.serialize()); + obj.add("material_instances", this.materialInstances.serialize()); + return obj; + } + } + + public record Geometry(String identifier, Map visibilityFilter) { + public Geometry(String identifier) { this(identifier, Map.of()); } + public JsonObject serialize() { + JsonObject obj = new JsonObject(); + obj.addProperty("identifier", this.identifier); + if (!this.visibilityFilter.isEmpty()) { + JsonObject vf = new JsonObject(); + for (Map.Entry e : this.visibilityFilter.entrySet()) { + vf.addProperty(e.getKey(), e.getValue()); + } + obj.add("bone_visibility", vf); + } + return obj; + } + } + + public record MaterialInstances(Map instances) { + public JsonObject serialize() { + JsonObject obj = new JsonObject(); + for (Map.Entry e : this.instances.entrySet()) { + obj.add(e.getKey(), e.getValue().serialize()); + } + return obj; + } + + public static class Builder { + private final Map instances = new HashMap<>(); + public Builder withInstance(String key, String texture, String renderMethod, boolean faceDimming, boolean ambientOcclusion) { + this.instances.put(key, new Instance(texture, renderMethod, faceDimming, ambientOcclusion)); + return this; + } + public MaterialInstances build() { return new MaterialInstances(Map.copyOf(this.instances)); } + } + + public record Instance(String texture, String renderMethod, boolean faceDimming, boolean ambientOcclusion) { + public JsonObject serialize() { + JsonObject obj = new JsonObject(); + if (this.texture != null) obj.addProperty("texture", this.texture); + obj.addProperty("render_method", this.renderMethod); + if (!this.faceDimming) obj.addProperty("face_dimming", false); + if (!this.ambientOcclusion) obj.addProperty("ambient_occlusion", false); + return obj; + } + } + } + + public record Transformation(float sx, float sy, float sz, float tx, float ty, float tz, + int rx, int ry, int rz) { + public static final Transformation IDENTITY = new Transformation(1, 1, 1, 0, 0, 0, 0, 0, 0); + public boolean isIdentity() { return this.equals(IDENTITY); } + public JsonObject serialize() { + JsonObject obj = new JsonObject(); + JsonArray scale = new JsonArray(); scale.add(this.sx); scale.add(this.sy); scale.add(this.sz); obj.add("scale", scale); + JsonArray trans = new JsonArray(); trans.add(this.tx); trans.add(this.ty); trans.add(this.tz); obj.add("translation", trans); + JsonArray rot = new JsonArray(); rot.add(this.rx); rot.add(this.ry); rot.add(this.rz); obj.add("rotation", rot); + return obj; + } + } +} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/block/BlockMappingConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/block/BlockMappingConfiguration.java new file mode 100644 index 00000000..5cadb46f --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/block/BlockMappingConfiguration.java @@ -0,0 +1,113 @@ +package fr.robie.craftengineconverter.api.configuration.bedrock.mapping.block; + +import com.google.gson.JsonObject; +import fr.robie.craftengineconverter.api.manager.FileCacheManager; +import org.jetbrains.annotations.NotNull; + +import java.nio.file.Path; +import java.util.LinkedHashMap; +import java.util.Map; + +public class BlockMappingConfiguration { + private final Map blocks = new LinkedHashMap<>(); + + public void mapBlock(@NotNull String javaIdentifier, @NotNull BlockEntry.Builder entry) { + this.mapBlock(javaIdentifier, entry.build()); + } + + public void mapBlock(@NotNull String javaIdentifier, @NotNull BlockEntry entry) { + this.blocks.merge(javaIdentifier, entry, (existing, incoming) -> { + if (existing.onlyOverrideStates() && incoming.onlyOverrideStates()) { + return existing.mergeStateOverrides(incoming); + } + return incoming; + }); + } + + public int size() { + return this.blocks.values().stream() + .mapToInt(e -> (e.base().isPresent() ? 1 : 0) + e.stateOverrides().size()) + .sum(); + } + + public boolean isEmpty() { return this.blocks.isEmpty(); } + + public Map entries() { return this.blocks; } + + public void save(@NotNull Path directory) { + if (this.blocks.isEmpty()) return; + + JsonObject root = new JsonObject(); + root.addProperty("format_version", 1); + + JsonObject blocksObj = new JsonObject(); + for (Map.Entry entry : this.blocks.entrySet()) { + blocksObj.add(entry.getKey(), entry.getValue().serialize()); + } + root.add("blocks", blocksObj); + + FileCacheManager.saveJsonToFile(directory.resolve("geyser_block_mappings.json"), root); + } + + public static class BlockEntry { + private final String name; + private final BlockDefinition base; + private final boolean includeInCreativeInventory; + private final boolean onlyOverrideStates; + private final Map stateOverrides; + + public BlockEntry(String name, BlockDefinition base, boolean includeInCreativeInventory, + boolean onlyOverrideStates, Map stateOverrides) { + this.name = name; + this.base = base; + this.includeInCreativeInventory = includeInCreativeInventory; + this.onlyOverrideStates = onlyOverrideStates; + this.stateOverrides = stateOverrides; + } + + public String name() { return this.name; } + public java.util.Optional base() { return java.util.Optional.ofNullable(this.base); } + public boolean onlyOverrideStates() { return this.onlyOverrideStates; } + public Map stateOverrides() { return this.stateOverrides; } + + public BlockEntry mergeStateOverrides(BlockEntry other) { + Map merged = new LinkedHashMap<>(this.stateOverrides); + merged.putAll(other.stateOverrides); + return new BlockEntry(this.name, this.base, this.includeInCreativeInventory, this.onlyOverrideStates, merged); + } + + public JsonObject serialize() { + JsonObject obj = new JsonObject(); + obj.addProperty("name", this.name); + if (this.base != null) obj.add("base", this.base.serialize()); + if (this.includeInCreativeInventory) obj.addProperty("included_in_creative_inventory", true); + if (this.onlyOverrideStates) obj.addProperty("only_override_states", true); + JsonObject overrides = new JsonObject(); + for (Map.Entry e : this.stateOverrides.entrySet()) { + overrides.add(e.getKey(), e.getValue().serialize()); + } + obj.add("state_overrides", overrides); + return obj; + } + + public static class Builder { + private final String name; + private BlockDefinition base; + private boolean includeInCreativeInventory = false; + private boolean onlyOverrideStates = false; + private final Map stateOverrides = new LinkedHashMap<>(); + + public Builder(String name) { this.name = name; } + public Builder withBase(BlockDefinition base) { this.base = base; return this; } + public Builder includeInCreativeInventory() { this.includeInCreativeInventory = true; return this; } + public Builder onlyOverrideStates() { this.onlyOverrideStates = true; return this; } + public Builder withStateOverride(String state, BlockDefinition override) { + this.stateOverrides.put(state, override); return this; + } + public BlockEntry build() { + return new BlockEntry(this.name, this.base, this.includeInCreativeInventory, this.onlyOverrideStates, + Map.copyOf(this.stateOverrides)); + } + } + } +} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/GroupDefinitionMapping.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/GroupDefinitionMapping.java index 301c338f..f4185d16 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/GroupDefinitionMapping.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/GroupDefinitionMapping.java @@ -18,11 +18,23 @@ public GroupDefinitionMapping(@NotNull Material javaMaterial, @NotNull String be super(javaMaterial, bedrockIdentifier); } + public String getModel() { + return this.model; + } + public GroupDefinitionMapping setModel(@Nullable String model) { this.model = model; return this; } + public List getDefinitions() { + return this.definitions; + } + + public boolean hasDefinitions() { + return !this.definitions.isEmpty(); + } + public GroupDefinitionMapping addDefinition(@NotNull ItemMapping definition) { this.definitions.add(definition); return this; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/ItemMapping.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/ItemMapping.java index 3a87eb97..df93df8c 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/ItemMapping.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/ItemMapping.java @@ -20,7 +20,6 @@ public abstract class ItemMapping { private String displayName; private BedrockOptions bedrockOptions; private final List bedrockPredicates = new ArrayList<>(); - private PredicateStrategy predicateStrategy = PredicateStrategy.AND; private final List bedrockComponents = new ArrayList<>(0); @@ -41,6 +40,10 @@ public ItemMapping setBedrockOptions(BedrockOptions bedrockOptions) { return this; } + public BedrockOptions getBedrockOptions() { + return this.bedrockOptions; + } + public ItemMapping addBedrockComponent(@NotNull BedrockComponent component) { this.bedrockComponents.add(component); return this; @@ -51,11 +54,6 @@ public ItemMapping addBedrockPredicate(BedrockPredicate bedrockPredicate) { return this; } - public ItemMapping setPredicateStrategy(@NotNull PredicateStrategy predicateStrategy) { - this.predicateStrategy = predicateStrategy; - return this; - } - public ItemMapping addTextureData(TextureData textureData) { this.texturesData.add(textureData); return this; @@ -70,6 +68,10 @@ public Material getJavaMaterial() { return this.javaMaterial; } + public String getBedrockIdentifier() { + return this.bedrockIdentifier; + } + public JsonObject serialize() { JsonObject jsonObject = new JsonObject(); jsonObject.addProperty("bedrock_identifier", this.bedrockIdentifier); @@ -97,20 +99,14 @@ public JsonObject serialize() { if (this.bedrockPredicates.size() == 1) { jsonObject.add("predicate", this.bedrockPredicates.getFirst().serialize()); } else { - jsonObject.addProperty("predicate_strategy", this.predicateStrategy.name().toLowerCase()); JsonArray predicateArray = new JsonArray(); for (BedrockPredicate predicate : this.bedrockPredicates) { predicateArray.add(predicate.serialize()); } - jsonObject.add("predicates", predicateArray); + jsonObject.add("predicate", predicateArray); } } return jsonObject; } - - public enum PredicateStrategy { - AND, - OR - } } diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/ItemModelItemMapping.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/ItemModelItemMapping.java index d342ccac..090b664e 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/ItemModelItemMapping.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/ItemModelItemMapping.java @@ -13,6 +13,9 @@ public ItemModelItemMapping(@NotNull Material javaMaterial, @NotNull String bedr this.bedrockModelPath = bedrockModelPath; } + public String getBedrockModelPath() { + return this.bedrockModelPath; + } @Override public JsonObject serialize() { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/component/GenericBedrockComponent.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/component/GenericBedrockComponent.java new file mode 100644 index 00000000..5c0c0a37 --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/component/GenericBedrockComponent.java @@ -0,0 +1,59 @@ +package fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.component; + +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonPrimitive; +import org.jetbrains.annotations.NotNull; + +import java.util.List; +import java.util.Map; + +public class GenericBedrockComponent implements BedrockComponent { + private final String key; + private final JsonElement value; + + public GenericBedrockComponent(String key, Object yamlValue) { + this.key = key; + this.value = toJsonElement(yamlValue); + } + + @Override + public void applyTo(@NotNull JsonObject componentObject) { + componentObject.add(this.key, this.value); + } + + static JsonElement toJsonElement(Object yamlValue) { + if (yamlValue == null) { + return new JsonObject(); + } + if (yamlValue instanceof Map map) { + JsonObject obj = new JsonObject(); + for (Map.Entry entry : map.entrySet()) { + obj.add(String.valueOf(entry.getKey()), toJsonElement(entry.getValue())); + } + return obj; + } + if (yamlValue instanceof List list) { + JsonArray arr = new JsonArray(); + for (Object item : list) { + arr.add(toJsonElement(item)); + } + return arr; + } + if (yamlValue instanceof Number n) { + if (n.doubleValue() == n.longValue()) { + return new JsonPrimitive(n.longValue()); + } + return new JsonPrimitive(n.doubleValue()); + } + if (yamlValue instanceof Boolean b) { + return new JsonPrimitive(b); + } + return new JsonPrimitive(String.valueOf(yamlValue)); + } + + public String getKey() { + return this.key; + } +} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/texture/FlipbookTextureConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/texture/FlipbookTextureConfiguration.java new file mode 100644 index 00000000..a9162a04 --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/texture/FlipbookTextureConfiguration.java @@ -0,0 +1,39 @@ +package fr.robie.craftengineconverter.api.configuration.bedrock.texture; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import fr.robie.messageflow.logger.Logger; +import org.jetbrains.annotations.NotNull; + +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.List; + +public class FlipbookTextureConfiguration { + private final List flipbookTextures = new ArrayList<>(); + + public FlipbookTextureConfiguration addFlipbookTexture(@NotNull FlipbookTextureData data) { + this.flipbookTextures.add(data); + return this; + } + + public boolean isEmpty() { + return this.flipbookTextures.isEmpty(); + } + + private static final Gson GSON = new GsonBuilder().setPrettyPrinting().disableHtmlEscaping().create(); + + public void save(@NotNull Path directory) { + JsonArray array = new JsonArray(); + for (FlipbookTextureData data : this.flipbookTextures) { + array.add(data.serialize()); + } + try (var writer = Files.newBufferedWriter(directory.resolve("flipbook_textures.json"))) { + GSON.toJson(array, writer); + } catch (Exception e) { + Logger.error("Failed to write flipbook_textures.json", e); + } + } +} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/texture/FlipbookTextureData.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/texture/FlipbookTextureData.java new file mode 100644 index 00000000..eae745fc --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/texture/FlipbookTextureData.java @@ -0,0 +1,50 @@ +package fr.robie.craftengineconverter.api.configuration.bedrock.texture; + +import com.google.gson.JsonArray; +import com.google.gson.JsonObject; +import org.jetbrains.annotations.NotNull; + +import java.util.List; + +public class FlipbookTextureData { + private final String atlasTile; + private final String flipbookTexture; + private final int ticksPerFrame; + private final List frames; + private final int replicate; + private final boolean blendFrames; + + public FlipbookTextureData( + @NotNull String atlasTile, + @NotNull String flipbookTexture, + int ticksPerFrame, + @NotNull List frames, + int replicate, + boolean blendFrames + ) { + this.atlasTile = atlasTile; + this.flipbookTexture = flipbookTexture; + this.ticksPerFrame = ticksPerFrame; + this.frames = frames; + this.replicate = replicate; + this.blendFrames = blendFrames; + } + + public String atlasTile() { return this.atlasTile; } + public String flipbookTexture() { return this.flipbookTexture; } + + public JsonObject serialize() { + JsonObject obj = new JsonObject(); + obj.addProperty("atlas_tile", this.atlasTile); + obj.addProperty("flipbook_texture", this.flipbookTexture); + obj.addProperty("ticks_per_frame", this.ticksPerFrame); + JsonArray frameArray = new JsonArray(); + for (int f : this.frames) { + frameArray.add(f); + } + obj.add("frames", frameArray); + obj.addProperty("replicate", this.replicate); + obj.addProperty("blend_frames", this.blendFrames); + return obj; + } +} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/texture/TextureData.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/texture/TextureData.java index 0e32bf2c..23e63eca 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/texture/TextureData.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/texture/TextureData.java @@ -22,7 +22,11 @@ public TextureData addTexture(@NotNull String texture) { } public String getBedrockIdentifier() { - return this.bedrockIdentifier; + return this.bedrockIdentifier.replace(":", "."); + } + + public List getTextures() { + return this.textures; } public JsonObject serialize() { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/behaviors/ChangeOverTimeBlockBehavior.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/behaviors/ChangeOverTimeBlockBehavior.java index d079f09e..46d5f7a5 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/behaviors/ChangeOverTimeBlockBehavior.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/behaviors/ChangeOverTimeBlockBehavior.java @@ -10,7 +10,7 @@ public class ChangeOverTimeBlockBehavior implements BlockBehavior { private Double changeSpeed; private String nextBlock; - private List excludedProperties; + private final List excludedProperties; public ChangeOverTimeBlockBehavior() { this.excludedProperties = new ArrayList<>(); diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/behaviors/DirectionalAttachedBlockBehavior.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/behaviors/DirectionalAttachedBlockBehavior.java index 5fa9b2fc..e3340001 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/behaviors/DirectionalAttachedBlockBehavior.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/behaviors/DirectionalAttachedBlockBehavior.java @@ -9,8 +9,8 @@ public class DirectionalAttachedBlockBehavior implements BlockBehavior { private Boolean blacklist; - private List attachedBlocks; - private List attachedBlockTags; + private final List attachedBlocks; + private final List attachedBlockTags; public DirectionalAttachedBlockBehavior() { this.attachedBlocks = new ArrayList<>(); diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/behaviors/FaceAttachedHorizontalDirectionalBlockBehavior.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/behaviors/FaceAttachedHorizontalDirectionalBlockBehavior.java index 7eb8ce17..640ed0b7 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/behaviors/FaceAttachedHorizontalDirectionalBlockBehavior.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/behaviors/FaceAttachedHorizontalDirectionalBlockBehavior.java @@ -9,8 +9,8 @@ public class FaceAttachedHorizontalDirectionalBlockBehavior implements BlockBehavior { private Boolean blacklist; - private List attachedBlocks; - private List attachedBlockTags; + private final List attachedBlocks; + private final List attachedBlockTags; public FaceAttachedHorizontalDirectionalBlockBehavior() { this.attachedBlocks = new ArrayList<>(); diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/behaviors/HangingBlockBehavior.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/behaviors/HangingBlockBehavior.java index 7e6da7f0..424e9795 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/behaviors/HangingBlockBehavior.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/behaviors/HangingBlockBehavior.java @@ -10,8 +10,8 @@ public class HangingBlockBehavior implements BlockBehavior { private Boolean stackable; private Boolean blacklist; - private List aboveBlockTags; - private List aboveBlocks; + private final List aboveBlockTags; + private final List aboveBlocks; private Integer delay; public HangingBlockBehavior() { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/behaviors/NearLiquidBlockBehavior.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/behaviors/NearLiquidBlockBehavior.java index a732e13b..9bd94473 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/behaviors/NearLiquidBlockBehavior.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/behaviors/NearLiquidBlockBehavior.java @@ -10,7 +10,7 @@ public class NearLiquidBlockBehavior implements BlockBehavior { private String liquidType; private Boolean stackable; - private List positions; + private final List positions; public NearLiquidBlockBehavior() { this.positions = new ArrayList<>(); diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/behaviors/OnLiquidBlockBehavior.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/behaviors/OnLiquidBlockBehavior.java index 6b0fc2d6..0dcf6bca 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/behaviors/OnLiquidBlockBehavior.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/behaviors/OnLiquidBlockBehavior.java @@ -9,7 +9,7 @@ public class OnLiquidBlockBehavior implements BlockBehavior { private Boolean stackable; - private List liquidType; + private final List liquidType; public OnLiquidBlockBehavior() { this.liquidType = new ArrayList<>(); diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/behaviors/SeatBlockBehavior.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/behaviors/SeatBlockBehavior.java index ada5afb5..493fe56c 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/behaviors/SeatBlockBehavior.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/behaviors/SeatBlockBehavior.java @@ -8,7 +8,7 @@ import java.util.Map; public class SeatBlockBehavior implements BlockBehavior { - private List seats; + private final List seats; public SeatBlockBehavior() { this.seats = new ArrayList<>(); diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/behaviors/StackableBlockBehavior.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/behaviors/StackableBlockBehavior.java index d97893db..4bb5335c 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/behaviors/StackableBlockBehavior.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/behaviors/StackableBlockBehavior.java @@ -9,7 +9,7 @@ public class StackableBlockBehavior implements BlockBehavior { private String property; - private List items; + private final List items; public StackableBlockBehavior() { this.items = new ArrayList<>(); diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/behaviors/StrippableBlockBehavior.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/behaviors/StrippableBlockBehavior.java index 0e231414..2499bbf2 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/behaviors/StrippableBlockBehavior.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/behaviors/StrippableBlockBehavior.java @@ -9,7 +9,7 @@ public class StrippableBlockBehavior implements BlockBehavior { private String stripped; - private List excludedProperties; + private final List excludedProperties; public StrippableBlockBehavior() { this.excludedProperties = new ArrayList<>(); diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/behaviors/SturdyBaseBlockBehavior.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/behaviors/SturdyBaseBlockBehavior.java index c3951d3b..9cb277dd 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/behaviors/SturdyBaseBlockBehavior.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/behaviors/SturdyBaseBlockBehavior.java @@ -9,7 +9,7 @@ public class SturdyBaseBlockBehavior implements BlockBehavior { private String direction; - private List supportTypes; + private final List supportTypes; public SturdyBaseBlockBehavior() { this.supportTypes = new ArrayList<>(); diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/AnchorTypeBlockStateProperty.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/AnchorTypeBlockStateProperty.java index 413ab85f..090501d3 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/AnchorTypeBlockStateProperty.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/AnchorTypeBlockStateProperty.java @@ -4,14 +4,10 @@ import fr.robie.yamllibrary.ConfigurationSection; import net.momirealms.craftengine.core.block.property.type.AnchorType; import org.jetbrains.annotations.NotNull; -import org.jspecify.annotations.NonNull; import java.util.Locale; -public class AnchorTypeBlockStateProperty implements BlockStateProperty { - private final String name; - private final AnchorType value; - +public record AnchorTypeBlockStateProperty(String name, AnchorType value) implements BlockStateProperty { public AnchorTypeBlockStateProperty(@NotNull String name, @NotNull AnchorType value) { this.name = name; this.value = value; @@ -22,11 +18,6 @@ public AnchorTypeBlockStateProperty(@NotNull String name, @NotNull AnchorType va return this.name; } - @Override - public @NonNull AnchorType value() { - return this.value; - } - @Override public void serialize(@NotNull ConfigurationSection propertiesSection) { ConfigurationSection section = propertiesSection.createSection(this.name); diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/AxisBlockStateProperty.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/AxisBlockStateProperty.java index 58518690..b0109575 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/AxisBlockStateProperty.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/AxisBlockStateProperty.java @@ -4,14 +4,10 @@ import fr.robie.yamllibrary.ConfigurationSection; import net.momirealms.craftengine.core.util.Direction; import org.jetbrains.annotations.NotNull; -import org.jspecify.annotations.NonNull; import java.util.Locale; -public class AxisBlockStateProperty implements BlockStateProperty { - private final String name; - private final Direction.Axis value; - +public record AxisBlockStateProperty(String name, Direction.Axis value) implements BlockStateProperty { public AxisBlockStateProperty(@NotNull String name, @NotNull Direction.Axis value) { this.name = name; this.value = value; @@ -22,11 +18,6 @@ public AxisBlockStateProperty(@NotNull String name, @NotNull Direction.Axis valu return this.name; } - @Override - public Direction.@NonNull Axis value() { - return this.value; - } - @Override public void serialize(@NotNull ConfigurationSection propertiesSection) { ConfigurationSection section = propertiesSection.createSection(this.name); diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/BooleanBlockStateProperty.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/BooleanBlockStateProperty.java index 5353c51b..0dd58217 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/BooleanBlockStateProperty.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/BooleanBlockStateProperty.java @@ -4,10 +4,7 @@ import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; -public class BooleanBlockStateProperty implements BlockStateProperty { - private final String name; - private final Boolean value; - +public record BooleanBlockStateProperty(String name, Boolean value) implements BlockStateProperty { public BooleanBlockStateProperty(@NotNull String name, Boolean value) { this.name = name; this.value = value; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/DoubleBlockHalfBlockStateProperty.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/DoubleBlockHalfBlockStateProperty.java index 05b781bf..5e63e663 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/DoubleBlockHalfBlockStateProperty.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/DoubleBlockHalfBlockStateProperty.java @@ -4,14 +4,11 @@ import fr.robie.yamllibrary.ConfigurationSection; import net.momirealms.craftengine.core.block.property.type.DoubleBlockHalf; import org.jetbrains.annotations.NotNull; -import org.jspecify.annotations.NonNull; import java.util.Locale; -public class DoubleBlockHalfBlockStateProperty implements BlockStateProperty { - private final String name; - private final DoubleBlockHalf value; - +public record DoubleBlockHalfBlockStateProperty(String name, + DoubleBlockHalf value) implements BlockStateProperty { public DoubleBlockHalfBlockStateProperty(@NotNull String name, @NotNull DoubleBlockHalf value) { this.name = name; this.value = value; @@ -22,11 +19,6 @@ public DoubleBlockHalfBlockStateProperty(@NotNull String name, @NotNull DoubleBl return this.name; } - @Override - public @NonNull DoubleBlockHalf value() { - return this.value; - } - @Override public void serialize(@NotNull ConfigurationSection propertiesSection) { ConfigurationSection section = propertiesSection.createSection(this.name); diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/HingeBlockStateProperty.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/HingeBlockStateProperty.java index 4fd138cb..05511472 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/HingeBlockStateProperty.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/HingeBlockStateProperty.java @@ -4,14 +4,10 @@ import fr.robie.yamllibrary.ConfigurationSection; import org.bukkit.block.data.type.Door; import org.jetbrains.annotations.NotNull; -import org.jspecify.annotations.NonNull; import java.util.Locale; -public class HingeBlockStateProperty implements BlockStateProperty { - private final String name; - private final Door.Hinge value; - +public record HingeBlockStateProperty(String name, Door.Hinge value) implements BlockStateProperty { public HingeBlockStateProperty(@NotNull String name, @NotNull Door.Hinge value) { this.name = name; this.value = value; @@ -22,11 +18,6 @@ public HingeBlockStateProperty(@NotNull String name, @NotNull Door.Hinge value) return this.name; } - @Override - public Door.@NonNull Hinge value() { - return this.value; - } - @Override public void serialize(@NotNull ConfigurationSection propertiesSection) { ConfigurationSection section = propertiesSection.createSection(this.name); diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/HorizontalDirectionBlockStateProperty.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/HorizontalDirectionBlockStateProperty.java index ecb4bb00..911e81da 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/HorizontalDirectionBlockStateProperty.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/HorizontalDirectionBlockStateProperty.java @@ -4,14 +4,11 @@ import fr.robie.craftengineconverter.api.configuration.utils.HorizontalDirection; import fr.robie.yamllibrary.ConfigurationSection; import org.jetbrains.annotations.NotNull; -import org.jspecify.annotations.NonNull; import java.util.Locale; -public class HorizontalDirectionBlockStateProperty implements BlockStateProperty { - private final String name; - private final HorizontalDirection value; - +public record HorizontalDirectionBlockStateProperty(String name, + HorizontalDirection value) implements BlockStateProperty { public HorizontalDirectionBlockStateProperty(@NotNull String name, @NotNull HorizontalDirection value) { this.name = name; this.value = value; @@ -22,11 +19,6 @@ public HorizontalDirectionBlockStateProperty(@NotNull String name, @NotNull Hori return this.name; } - @Override - public @NonNull HorizontalDirection value() { - return this.value; - } - @Override public void serialize(@NotNull ConfigurationSection propertiesSection) { ConfigurationSection section = propertiesSection.createSection(this.name); diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/SingleBlockHalfBlockStateProperty.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/SingleBlockHalfBlockStateProperty.java index d31cd54a..aff20d2e 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/SingleBlockHalfBlockStateProperty.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/SingleBlockHalfBlockStateProperty.java @@ -4,14 +4,11 @@ import fr.robie.yamllibrary.ConfigurationSection; import net.momirealms.craftengine.core.block.property.type.SingleBlockHalf; import org.jetbrains.annotations.NotNull; -import org.jspecify.annotations.NonNull; import java.util.Locale; -public class SingleBlockHalfBlockStateProperty implements BlockStateProperty { - private final String name; - private final SingleBlockHalf value; - +public record SingleBlockHalfBlockStateProperty(String name, + SingleBlockHalf value) implements BlockStateProperty { public SingleBlockHalfBlockStateProperty(@NotNull String name, @NotNull SingleBlockHalf value) { this.name = name; this.value = value; @@ -22,11 +19,6 @@ public SingleBlockHalfBlockStateProperty(@NotNull String name, @NotNull SingleBl return this.name; } - @Override - public @NonNull SingleBlockHalf value() { - return this.value; - } - @Override public void serialize(@NotNull ConfigurationSection propertiesSection) { ConfigurationSection section = propertiesSection.createSection(this.name); diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/SlabTypeBlockStateProperty.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/SlabTypeBlockStateProperty.java index 7c328f31..1e0811b8 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/SlabTypeBlockStateProperty.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/SlabTypeBlockStateProperty.java @@ -4,14 +4,10 @@ import fr.robie.yamllibrary.ConfigurationSection; import net.momirealms.craftengine.core.block.property.type.SlabType; import org.jetbrains.annotations.NotNull; -import org.jspecify.annotations.NonNull; import java.util.Locale; -public class SlabTypeBlockStateProperty implements BlockStateProperty { - private final String name; - private final SlabType value; - +public record SlabTypeBlockStateProperty(String name, SlabType value) implements BlockStateProperty { public SlabTypeBlockStateProperty(@NotNull String name, @NotNull SlabType value) { this.name = name; this.value = value; @@ -22,11 +18,6 @@ public SlabTypeBlockStateProperty(@NotNull String name, @NotNull SlabType value) return this.name; } - @Override - public @NonNull SlabType value() { - return this.value; - } - @Override public void serialize(@NotNull ConfigurationSection propertiesSection) { ConfigurationSection section = propertiesSection.createSection(this.name); diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/SofaShapeBlockStateProperty.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/SofaShapeBlockStateProperty.java index 68697271..a5c93bdb 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/SofaShapeBlockStateProperty.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/SofaShapeBlockStateProperty.java @@ -4,14 +4,10 @@ import fr.robie.yamllibrary.ConfigurationSection; import net.momirealms.craftengine.core.block.property.type.SofaShape; import org.jetbrains.annotations.NotNull; -import org.jspecify.annotations.NonNull; import java.util.Locale; -public class SofaShapeBlockStateProperty implements BlockStateProperty { - private final String name; - private final SofaShape value; - +public record SofaShapeBlockStateProperty(String name, SofaShape value) implements BlockStateProperty { public SofaShapeBlockStateProperty(@NotNull String name, @NotNull SofaShape value) { this.name = name; this.value = value; @@ -22,11 +18,6 @@ public SofaShapeBlockStateProperty(@NotNull String name, @NotNull SofaShape valu return this.name; } - @Override - public @NonNull SofaShape value() { - return this.value; - } - @Override public void serialize(@NotNull ConfigurationSection propertiesSection) { ConfigurationSection section = propertiesSection.createSection(this.name); diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/StairsShapeBlockStateProperty.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/StairsShapeBlockStateProperty.java index b88f0b0a..76247418 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/StairsShapeBlockStateProperty.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/states/properties/StairsShapeBlockStateProperty.java @@ -4,14 +4,10 @@ import fr.robie.yamllibrary.ConfigurationSection; import net.momirealms.craftengine.core.block.property.type.StairsShape; import org.jetbrains.annotations.NotNull; -import org.jspecify.annotations.NonNull; import java.util.Locale; -public class StairsShapeBlockStateProperty implements BlockStateProperty { - private final String name; - private final StairsShape value; - +public record StairsShapeBlockStateProperty(String name, StairsShape value) implements BlockStateProperty { public StairsShapeBlockStateProperty(@NotNull String name, @NotNull StairsShape value) { this.name = name; this.value = value; @@ -22,11 +18,6 @@ public StairsShapeBlockStateProperty(@NotNull String name, @NotNull StairsShape return this.name; } - @Override - public @NonNull StairsShape value() { - return this.value; - } - @Override public void serialize(@NotNull ConfigurationSection propertiesSection) { ConfigurationSection section = propertiesSection.createSection(this.name); diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/BlockStateConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/BlockStateConfiguration.java index 286c50f1..b225d1fb 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/BlockStateConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/BlockStateConfiguration.java @@ -25,37 +25,22 @@ public interface BlockStateEntry { void serialize(ConfigurationSection dataSection); } - public static class CraftEngineBlockStateEntry implements BlockStateEntry { - private final String blockState; - - public CraftEngineBlockStateEntry(String blockState) { - this.blockState = blockState; - } - - public String getBlockState() { - return this.blockState; - } + public record CraftEngineBlockStateEntry(String blockState) implements BlockStateEntry { @Override - public void serialize(ConfigurationSection dataSection) { - dataSection.set("block-state", this.blockState); + public void serialize(ConfigurationSection dataSection) { + dataSection.set("block-state", this.blockState); + } } - } - public static class VanillaBlockStateEntry implements BlockStateEntry { - private final Map blockStateProperties; + public record VanillaBlockStateEntry(Map blockStateProperties) implements BlockStateEntry { + public VanillaBlockStateEntry(@NotNull Map blockStateProperties) { + this.blockStateProperties = blockStateProperties; + } - public VanillaBlockStateEntry(@NotNull Map blockStateProperties) { - this.blockStateProperties = blockStateProperties; + @Override + public void serialize(ConfigurationSection dataSection) { + dataSection.createSection("block-state", this.blockStateProperties); + } } - - public Map getBlockStateProperties() { - return this.blockStateProperties; - } - - @Override - public void serialize(ConfigurationSection dataSection) { - dataSection.createSection("block-state", this.blockStateProperties); - } - } } diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/ModelConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/ModelConfiguration.java index a4bb367c..5013d155 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/ModelConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/ModelConfiguration.java @@ -10,7 +10,7 @@ public interface ModelConfiguration extends SectionSerializable { @Override void serialize(@NotNull ConfigurationSection section); - + @Contract("!null -> !null; null -> null") default @Nullable String namespaced(String path) { return this.namespaced(path, "minecraft"); diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/composite/CompositeModelConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/composite/CompositeModelConfiguration.java index c96ff731..e4dd4b55 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/composite/CompositeModelConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/composite/CompositeModelConfiguration.java @@ -6,12 +6,18 @@ import org.jetbrains.annotations.NotNull; import java.util.ArrayList; +import java.util.Collections; import java.util.List; import java.util.Objects; public class CompositeModelConfiguration implements ModelConfiguration { private final List models = new ArrayList<>(); + @NotNull + public List getModels() { + return Collections.unmodifiableList(this.models); + } + public CompositeModelConfiguration(@NotNull List models) { this.models.addAll(models); } diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/condition/ConditionModelConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/condition/ConditionModelConfiguration.java index 62e5ba8f..d63efc4a 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/condition/ConditionModelConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/condition/ConditionModelConfiguration.java @@ -83,4 +83,12 @@ private BedrockPredicate toBedrockPredicate(ModelConfiguration condition, boolea } return null; } + + public boolean isConditionSupported() { + String propertyName = this.property.contains(":") ? this.property.split(":")[1] : this.property; + return switch (propertyName.toLowerCase(java.util.Locale.ROOT)) { + case "broken", "damaged", "fishing_rod/cast", "custom_model_data", "has_component" -> true; + default -> false; + }; + } } diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/model/SimpleModelConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/model/SimpleModelConfiguration.java index 95ae772e..5c4fba56 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/model/SimpleModelConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/model/SimpleModelConfiguration.java @@ -1,5 +1,6 @@ package fr.robie.craftengineconverter.api.configuration.item.models.model; +import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.ItemMapping; import fr.robie.craftengineconverter.api.configuration.item.models.ModelConfiguration; import fr.robie.craftengineconverter.api.configuration.item.models.tints.TintConfiguration; import fr.robie.craftengineconverter.api.utils.ConfigurationSerializationUtils; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/range_dispatch/RangeDispatchModelConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/range_dispatch/RangeDispatchModelConfiguration.java index 08d2f369..aa9b26a6 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/range_dispatch/RangeDispatchModelConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/range_dispatch/RangeDispatchModelConfiguration.java @@ -18,6 +18,26 @@ public RangeDispatchModelConfiguration(@NotNull String property) { this.property = this.namespaced(property); } + @NotNull + public String getProperty() { + return this.property; + } + + @Nullable + public Float getScale() { + return this.scale; + } + + @NotNull + public List getEntries() { + return this.entries; + } + + @Nullable + public ModelConfiguration getFallback() { + return this.fallback; + } + public void setScale(@Nullable Float scale) { this.scale = scale; } diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/select/ComponentSelectConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/select/ComponentSelectConfiguration.java index 24c540c5..c65ccd72 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/select/ComponentSelectConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/select/ComponentSelectConfiguration.java @@ -13,6 +13,11 @@ public ComponentSelectConfiguration(@NotNull String component) { this.component = this.namespaced(Objects.requireNonNull(component, "component cannot be null")); } + @NotNull + public String getComponent() { + return this.component; + } + @Override public void serialize(@NotNull ConfigurationSection section) { super.serialize(section); diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/select/CustomModelDataSelectConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/select/CustomModelDataSelectConfiguration.java index 2a8f23c3..da1777d1 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/select/CustomModelDataSelectConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/select/CustomModelDataSelectConfiguration.java @@ -11,6 +11,10 @@ public CustomModelDataSelectConfiguration(int index) { this.index = index; } + public int getIndex() { + return this.index; + } + @Override public void serialize(@NotNull ConfigurationSection section) { super.serialize(section); diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/select/SelectModelConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/select/SelectModelConfiguration.java index 9e753cf3..c8a72cf8 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/select/SelectModelConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/select/SelectModelConfiguration.java @@ -17,6 +17,21 @@ public SelectModelConfiguration(@NotNull String property) { this.property = this.namespaced(property); } + @Nullable + public ModelConfiguration getFallback() { + return this.fallback; + } + + @NotNull + public String getProperty() { + return this.property; + } + + @NotNull + public List getCases() { + return this.cases; + } + public void setFallback(@Nullable ModelConfiguration fallback) { this.fallback = fallback; } diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/AbstractConditionLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/AbstractConditionLoader.java index b3c1c5f4..32baa311 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/AbstractConditionLoader.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/AbstractConditionLoader.java @@ -7,7 +7,12 @@ public abstract class AbstractConditionLoader implements ModelConfigurationLoader { protected void loadBranches(ConditionModelConfiguration config, ConfigurationSection section) { - config.setOnTrue(ModelConfigurationRegistry.load(section.getConfigurationSection("on-true"))); - config.setOnFalse(ModelConfigurationRegistry.load(section.getConfigurationSection("on-false"))); + ConfigurationSection trueSection = section.getConfigurationSection("on-true"); + if (trueSection == null) trueSection = section.getConfigurationSection("on_true"); + config.setOnTrue(ModelConfigurationRegistry.load(trueSection)); + + ConfigurationSection falseSection = section.getConfigurationSection("on-false"); + if (falseSection == null) falseSection = section.getConfigurationSection("on_false"); + config.setOnFalse(ModelConfigurationRegistry.load(falseSection)); } } \ No newline at end of file diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/enums/ItemDisplayType.java b/API/src/main/java/fr/robie/craftengineconverter/api/enums/ItemDisplayType.java index 6484373f..6cc67727 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/enums/ItemDisplayType.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/enums/ItemDisplayType.java @@ -9,5 +9,5 @@ public enum ItemDisplayType { HEAD, GUI, GROUND, - FIXED; + FIXED } diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/enums/Languages.java b/API/src/main/java/fr/robie/craftengineconverter/api/enums/Languages.java index f281bcb9..3129ea81 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/enums/Languages.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/enums/Languages.java @@ -3,6 +3,6 @@ public enum Languages { EN, FR, - DE; + DE } diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/manager/FileCacheManager.java b/API/src/main/java/fr/robie/craftengineconverter/api/manager/FileCacheManager.java index c0565ed6..f36425a1 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/manager/FileCacheManager.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/manager/FileCacheManager.java @@ -15,7 +15,6 @@ public class FileCacheManager { private static final Gson GSON = new GsonBuilder() .setPrettyPrinting() - .serializeNulls() .disableHtmlEscaping() .create(); diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/utils/FileUtils.java b/API/src/main/java/fr/robie/craftengineconverter/api/utils/FileUtils.java index ca989959..3d20c737 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/utils/FileUtils.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/utils/FileUtils.java @@ -82,6 +82,11 @@ public static boolean isYmlFile(@NotNull File file) { return extension.equalsIgnoreCase("yml") || extension.equalsIgnoreCase("yaml"); } + public static boolean isJsonFile(File file) { + String extension = getFileExtension(file); + return extension.equalsIgnoreCase("json"); + } + public static void copyFile(@NotNull File source, @NotNull File destination) { try { mkdirs(destination.getParentFile()); @@ -94,5 +99,4 @@ public static void copyFile(@NotNull File source, @NotNull File destination) { Logger.error(Message.ERROR__FILE__COPY_EXCEPTION, Placeholder.of("file", destination.getName(), "message", e.getMessage())); } } - } diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/utils/MinecraftVersion.java b/API/src/main/java/fr/robie/craftengineconverter/api/utils/MinecraftVersion.java index 7c0d65cc..edbb8a2c 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/utils/MinecraftVersion.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/utils/MinecraftVersion.java @@ -60,22 +60,22 @@ public static MinecraftVersion parse(@Nullable String rawVersion) { * Returns {@code true} if this value is greater than or equal to {@code other}. */ public boolean isAtLeast(MinecraftVersion other) { - return compareTo(other) >= 0; + return this.compareTo(other) >= 0; } /** * Returns {@code true} if this value is less than or equal to {@code other}. */ public boolean isAtMost(MinecraftVersion other) { - return compareTo(other) <= 0; + return this.compareTo(other) <= 0; } public boolean isBefore(MinecraftVersion other) { - return compareTo(other) < 0; + return this.compareTo(other) < 0; } public boolean isAfter(MinecraftVersion other) { - return compareTo(other) > 0; + return this.compareTo(other) > 0; } public int getMajor() { @@ -110,11 +110,11 @@ public boolean equals(Object obj) { @Override public int hashCode() { - return 31 * (31 * major + minor) + patch; + return 31 * (31 * this.major + this.minor) + this.patch; } @Override public String toString() { - return major + "." + minor + (patch != 0 ? "." + patch : ""); + return this.major + "." + this.minor + (this.patch != 0 ? "." + this.patch : ""); } } diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/utils/PluginVersion.java b/API/src/main/java/fr/robie/craftengineconverter/api/utils/PluginVersion.java index 9e430fab..a7893940 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/utils/PluginVersion.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/utils/PluginVersion.java @@ -62,9 +62,9 @@ public int compareTo(@NotNull PluginVersion other) { return 0; } - public boolean isNewerThan(@NotNull PluginVersion other) { return compareTo(other) > 0; } - public boolean isOlderThan(@NotNull PluginVersion other) { return compareTo(other) < 0; } - public boolean isSameAs(@NotNull PluginVersion other) { return compareTo(other) == 0; } + public boolean isNewerThan(@NotNull PluginVersion other) { return this.compareTo(other) > 0; } + public boolean isOlderThan(@NotNull PluginVersion other) { return this.compareTo(other) < 0; } + public boolean isSameAs(@NotNull PluginVersion other) { return this.compareTo(other) == 0; } @Override public boolean equals(Object obj) { @@ -75,15 +75,15 @@ public boolean equals(Object obj) { @Override public int hashCode() { - return Arrays.hashCode(segments); + return Arrays.hashCode(this.segments); } @Override public String toString() { StringBuilder builder = new StringBuilder(); - for (int i = 0; i < segments.length; i++) { + for (int i = 0; i < this.segments.length; i++) { if (i > 0) builder.append('.'); - builder.append(segments[i]); + builder.append(this.segments[i]); } return builder.toString(); } diff --git a/Common/src/main/java/fr/robie/craftengineconverter/common/permission/Permission.java b/Common/src/main/java/fr/robie/craftengineconverter/common/permission/Permission.java index a42397e1..313016e8 100644 --- a/Common/src/main/java/fr/robie/craftengineconverter/common/permission/Permission.java +++ b/Common/src/main/java/fr/robie/craftengineconverter/common/permission/Permission.java @@ -16,7 +16,9 @@ public enum Permission { NEXO_FURNITURE_INTERACT_CONVERSION("Allows the user to convert Nexo furniture on interaction"), ITEMSADDER_BLOCK_INTERACT_CONVERSION("Allows the user to convert ItemsAdder blocks on interaction"), - ITEMSADDER_FURNITURE_INTERACT_CONVERSION("Allows the user to convert ItemsAdder furniture on interaction"); + ITEMSADDER_FURNITURE_INTERACT_CONVERSION("Allows the user to convert ItemsAdder furniture on interaction"), + + COMMAND_BEDROCK_CONVERT("Allows the user to run the Bedrock Edition resource pack conversion"); private final String description; private final String[] args; diff --git a/Common/src/main/java/fr/robie/craftengineconverter/common/utils/enums/Billboard.java b/Common/src/main/java/fr/robie/craftengineconverter/common/utils/enums/Billboard.java index 5608d14b..0f239c9f 100644 --- a/Common/src/main/java/fr/robie/craftengineconverter/common/utils/enums/Billboard.java +++ b/Common/src/main/java/fr/robie/craftengineconverter/common/utils/enums/Billboard.java @@ -4,5 +4,5 @@ public enum Billboard { FIXED, VERTICAL, HORIZONTAL, - CENTER; + CENTER } diff --git a/Plugin/pom.xml b/Plugin/pom.xml index 103b0fdd..c057507c 100644 --- a/Plugin/pom.xml +++ b/Plugin/pom.xml @@ -36,6 +36,7 @@ fr.maxlego08.sarah:sarah com.github.1robie.MessageFlow:message-flow fr.robie:yamllibrary + com.github.1robie.paper-dispatch:paper-dispatch diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/command/CraftEngineConverterCommand.java b/Plugin/src/main/java/fr/robie/craftengineconverter/command/CraftEngineConverterCommand.java index 6def2a6e..e35b6f43 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/command/CraftEngineConverterCommand.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/command/CraftEngineConverterCommand.java @@ -16,6 +16,7 @@ public CraftEngineConverterCommand(CraftEngineConverter craftEngineConverter) { this.addSubCommand(new CraftEngineConverterCommandConvert(craftEngineConverter)); this.addSubCommand(new CraftEngineConverterCommandClearFilesCache(craftEngineConverter)); this.addSubCommand(new CraftEngineConverterCommandWorldConverter(craftEngineConverter)); + this.addSubCommand(new CraftEngineConverterCommandBedrock(craftEngineConverter)); } @Override diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/command/CraftEngineConverterCommandBedrock.java b/Plugin/src/main/java/fr/robie/craftengineconverter/command/CraftEngineConverterCommandBedrock.java new file mode 100644 index 00000000..9a3e4477 --- /dev/null +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/command/CraftEngineConverterCommandBedrock.java @@ -0,0 +1,47 @@ +package fr.robie.craftengineconverter.command; + +import fr.robie.craftengineconverter.CraftEngineConverter; +import fr.robie.craftengineconverter.api.builder.TimerBuilder; +import fr.robie.craftengineconverter.common.permission.Permission; +import fr.robie.craftengineconverter.converter.bedrock.BedrockConverter; +import fr.robie.messageflow.logger.Logger; +import fr.robie.paperdispatch.command.CommandDispatch; +import fr.robie.paperdispatch.command.CommandResultType; +import fr.robie.paperdispatch.command.SubCommand; +import fr.robie.yamllibrary.file.YamlConfiguration; +import org.bukkit.command.CommandSender; +import org.jetbrains.annotations.NotNull; + +import java.io.File; + +public class CraftEngineConverterCommandBedrock extends SubCommand { + + public CraftEngineConverterCommandBedrock(CraftEngineConverter plugin) { + super(plugin, "bedrock", "be"); + this.setPermission(Permission.COMMAND_BEDROCK_CONVERT.asPermission()); + } + + @Override + protected @NotNull CommandResultType perform(@NotNull CommandDispatch commandDispatch) { + CommandSender sender = commandDispatch.getSender(); + try { + long startTime = System.currentTimeMillis(); + BedrockConverter converter = new BedrockConverter(this.plugin.getDataFolder()); + + File configFile = new File(this.plugin.getDataFolder(), "config.yml"); + if (configFile.exists()) { + YamlConfiguration config = YamlConfiguration.loadConfiguration(configFile); + converter.loadSettingsFromConfig(config); + } + + converter.convert(); + long endTime = System.currentTimeMillis(); + sender.sendMessage("§aBedrock conversion completed in " + TimerBuilder.formatTimeAuto(endTime - startTime)); + return CommandResultType.SUCCESS; + } catch (Exception e) { + Logger.error("An error occurred during Bedrock conversion.", e); + sender.sendMessage("§cAn error occurred during Bedrock conversion. Check console for details."); + return CommandResultType.FAILURE; + } + } +} diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/command/CraftEngineConverterCommandConvert.java b/Plugin/src/main/java/fr/robie/craftengineconverter/command/CraftEngineConverterCommandConvert.java index 93158e36..4294e5e9 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/command/CraftEngineConverterCommandConvert.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/command/CraftEngineConverterCommandConvert.java @@ -81,7 +81,7 @@ private void disableAllConversions() { Optional optionalPlugin = commandDispatch.getOptionalArgument("plugin", String.class); if (optionalPlugin.isPresent()) { String targetPlugin = optionalPlugin.get(); - Optional optionalConverter = plugin.getConverter(targetPlugin); + Optional optionalConverter = this.plugin.getConverter(targetPlugin); if (optionalConverter.isPresent()) { long startTime = System.currentTimeMillis(); this.messageFormatter.sendMessage(Message.COMMAND__CONVERTER__START__SINGLE, sender, Placeholder.of("plugin", targetPlugin)); @@ -99,7 +99,7 @@ private void disableAllConversions() { } else { long startTime = System.currentTimeMillis(); this.messageFormatter.sendMessage(Message.COMMAND__CONVERTER__START__ALL,sender); - Collection converters = plugin.getConverters(); + Collection converters = this.plugin.getConverters(); AtomicInteger counter = new AtomicInteger(converters.size()); for (Converter converter : converters) { CompletableFuture voidCompletableFuture = converter.convert(converterOption, Optional.ofNullable(commandDispatch.getPlayer()), commandDispatch.hasFlag("dryrun"), threads); diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/command/CraftEngineConverterCommandWorldConverterRestore.java b/Plugin/src/main/java/fr/robie/craftengineconverter/command/CraftEngineConverterCommandWorldConverterRestore.java index 3f03ba31..baaa38f9 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/command/CraftEngineConverterCommandWorldConverterRestore.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/command/CraftEngineConverterCommandWorldConverterRestore.java @@ -121,7 +121,7 @@ private void restoreBlock(Location location, BlockHistory history) { final List batch = allHistory.subList(i, end); final long tickDelay = i / BATCH_SIZE; - plugin.getFoliaCompatibilityManager().runLater(() -> { + this.plugin.getFoliaCompatibilityManager().runLater(() -> { for (BlockHistory history : batch) { totalBlockCount.incrementAndGet(); @@ -160,7 +160,7 @@ private void restoreBlock(Location location, BlockHistory history) { final List batch = allEntityHistory.subList(i, end); final long tickDelay = (allHistory.size() / BATCH_SIZE) + (i / BATCH_SIZE); - plugin.getFoliaCompatibilityManager().runLater(() -> { + this.plugin.getFoliaCompatibilityManager().runLater(() -> { for (EntityHistory entityHistory : batch) { totalEntityCount.incrementAndGet(); @@ -195,7 +195,7 @@ private void restoreBlock(Location location, BlockHistory history) { long totalDelayTicks = (long) Math.ceil((double) (allHistory.size() + allEntityHistory.size()) / BATCH_SIZE); - plugin.getFoliaCompatibilityManager().runLater(() -> { + this.plugin.getFoliaCompatibilityManager().runLater(() -> { long endTime = System.currentTimeMillis(); diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockConverter.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockConverter.java index 4fbe8bf8..3c5340c2 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockConverter.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockConverter.java @@ -1,9 +1,6 @@ package fr.robie.craftengineconverter.converter.bedrock; -import fr.robie.craftengineconverter.api.configuration.bedrock.ItemTextureConfiguration; import fr.robie.craftengineconverter.api.configuration.bedrock.ManifestConfiguration; -import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.MappingsConfiguration; -import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.ItemMapping; import fr.robie.craftengineconverter.api.manager.FileCacheManager; import fr.robie.craftengineconverter.api.utils.FileUtils; import fr.robie.messageflow.logger.Logger; @@ -12,16 +9,38 @@ import org.jetbrains.annotations.NotNull; import java.io.File; +import java.nio.file.Files; +import java.nio.file.Path; + public class BedrockConverter { private final File pluginFolder; + private BedrockSettings settings; public BedrockConverter(File pluginFolder) { this.pluginFolder = pluginFolder; + this.settings = new BedrockSettings(pluginFolder); + } + + public BedrockConverter withSettings(BedrockSettings settings) { + this.settings = settings; + return this; + } + + public BedrockConverter loadSettingsFromConfig(YamlConfiguration config) { + ConfigurationSection bedrockSection = config.getConfigurationSection("bedrock"); + if (bedrockSection != null) { + this.settings = BedrockSettings.fromConfig(this.pluginFolder, bedrockSection); + } + return this; + } + + public BedrockSettings settings() { + return this.settings; } public void convert() { - File outputFolder = new File(this.pluginFolder, "bedrock-converted/Geyser-Spigot"); + File outputFolder = this.settings.outputFolder(); if (outputFolder.exists()) { FileUtils.deleteDirectory(outputFolder); @@ -41,111 +60,230 @@ public void convert() { return; } - File craftEngineConverterPack = new File(packs, "CraftEngineConverterPack"); - if (!FileUtils.mkdirs(craftEngineConverterPack)) { + File packOut = new File(packs, this.settings.outputPackName()); + if (!FileUtils.mkdirs(packOut)) { return; } - File textures = new File(craftEngineConverterPack, "textures"); + File textures = new File(packOut, "textures"); if (!FileUtils.mkdirs(textures)) { return; } - this.convertItemMappingsFolder(new File(this.pluginFolder, "bedrock/items"), textures, customMappings); + ConversionContext ctx = new ConversionContext(customMappings.toPath(), textures.toPath(), packOut.toPath()); + + boolean isPrimaryPack = true; + for (File packFolder : this.settings.allPackFolders()) { + this.convertPack(packFolder, packOut, ctx, isPrimaryPack); + isPrimaryPack = false; + } + + this.convertItems(this.settings.itemsFolder(), ctx); + for (File extra : this.settings.extraItemsFolders()) { + this.convertItems(extra, ctx); + } + + ctx.convertBlocks(); + ctx.saveAll(); + this.createMcPack(packOut, outputFolder); + } + + private void createMcPack(File packFolder, File outputFolder) { + File mcpackFile = new File(outputFolder, this.settings.outputPackName() + ".mcpack"); + try { + java.util.zip.ZipOutputStream zos = new java.util.zip.ZipOutputStream(new java.io.FileOutputStream(mcpackFile)); + java.nio.file.Path packPath = packFolder.toPath(); + try (java.util.stream.Stream paths = java.nio.file.Files.walk(packPath)) { + paths.filter(p -> !java.nio.file.Files.isDirectory(p)).forEach(p -> { + String entryName = packPath.relativize(p).toString().replace('\\', '/'); + try { + zos.putNextEntry(new java.util.zip.ZipEntry(entryName)); + java.nio.file.Files.copy(p, zos); + zos.closeEntry(); + } catch (Exception e) { + Logger.error("Failed to add " + entryName + " to mcpack", e); + } + }); + } + zos.close(); + Logger.info("Created: " + mcpackFile.getAbsolutePath()); + } catch (Exception e) { + Logger.error("Failed to create .mcpack file", e); + } } - private void convertItemMappingsFolder(@NotNull File inputFolder, @NotNull File texturesFolder, @NotNull File itemMappingsOutputFolder) { + private void convertItems(@NotNull File inputFolder, @NotNull ConversionContext ctx) { if (!inputFolder.exists() || !inputFolder.isDirectory()) { - Logger.info("Input folder does not exist or is not a directory: " + inputFolder.getAbsolutePath()); + Logger.info("Items folder does not exist or is not a directory: " + inputFolder.getAbsolutePath()); return; } - File[] listed = inputFolder.listFiles(); - if (listed == null) { - Logger.info("No files found in input folder: " + inputFolder.getAbsolutePath()); - return; + this.convertItemsRecursive(inputFolder, ctx); + } + + private void convertItemsRecursive(@NotNull File folder, @NotNull ConversionContext ctx) { + File[] listed = folder.listFiles(); + if (listed == null) return; + + for (File file : listed) { + if (file.isDirectory()) { + String name = file.getName().toLowerCase(); + if (name.equals("resourcepack") || name.equals("resource_pack") || name.equals("resoucepack")) { + this.convertPackDirectory(file, ctx.packDir().toFile(), ctx, false); + } else { + this.convertItemsRecursive(file, ctx); + } + } else if (file.isFile() && FileUtils.isYmlFile(file)) { + FileCacheManager.getYamlCache().getEntryFile(file.toPath()).ifPresent(yamlFileCacheEntry -> { + YamlConfiguration yamlConfiguration = yamlFileCacheEntry.getData(); + ConfigurationSection items = yamlConfiguration.getConfigurationSection("items"); + if (items != null) { + for (String itemId : items.getKeys(false)) { + ConfigurationSection itemSection = items.getConfigurationSection(itemId); + if (itemSection != null) { + BedrockItemLoader itemLoader = new BedrockItemLoader(itemId, itemSection, ctx); + ctx.acceptMapping(itemLoader.load()); + } + } + } + }); + } } + } - if (!FileUtils.mkdirs(texturesFolder)) { - Logger.info("Failed to create output folder: " + texturesFolder.getAbsolutePath()); + private void convertPack(@NotNull File inputFile, @NotNull File outputPackFolder, @NotNull ConversionContext ctx, boolean isPrimary) { + if (!inputFile.exists()) { + Logger.info("Pack input does not exist: " + inputFile.getAbsolutePath()); return; } - MappingsConfiguration mappingsConfiguration = new MappingsConfiguration(); - ItemTextureConfiguration itemTextureConfiguration = new ItemTextureConfiguration(); + if (inputFile.isFile() && this.isZipFile(inputFile)) { + File extractDir = new File(inputFile.getParentFile(), ".cec_" + inputFile.getName()); + if (!extractDir.exists()) { + if (this.extractZipTo(inputFile, extractDir) == null) return; + } + this.convertPackDirectory(extractDir, outputPackFolder, ctx, isPrimary); + } else if (inputFile.isDirectory()) { + this.convertPackDirectory(inputFile, outputPackFolder, ctx, isPrimary); + } else { + Logger.info("Unsupported pack input: " + inputFile.getAbsolutePath()); + } + } + + private boolean isZipFile(File file) { + String name = file.getName().toLowerCase(); + return name.endsWith(".zip") || name.endsWith(".mcpack") || name.endsWith(".mcaddon"); + } - for (File file : listed) { - if (file.isFile() && FileUtils.isYmlFile(file)) { - YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(file); - ConfigurationSection items = yamlConfiguration.getConfigurationSection("items"); - if (items != null) { - for (String itemId : items.getKeys(false)) { - ConfigurationSection itemSection = items.getConfigurationSection(itemId); - if (itemSection != null) { - BedrockItemLoader itemLoader = new BedrockItemLoader(itemId, itemSection); - - ItemMapping load = itemLoader.load(); - if (load != null) { - mappingsConfiguration.addItemMapping(load); - - load.getTexturesData().forEach(itemTextureConfiguration::addTextureData); + private File extractZipTo(File zipFile, File targetDir) { + try { + targetDir.mkdirs(); + try (java.util.zip.ZipInputStream zis = new java.util.zip.ZipInputStream(new java.io.FileInputStream(zipFile))) { + java.util.zip.ZipEntry entry; + byte[] buffer = new byte[8192]; + while ((entry = zis.getNextEntry()) != null) { + File outFile = new File(targetDir, entry.getName()); + if (entry.isDirectory()) { + outFile.mkdirs(); + } else { + outFile.getParentFile().mkdirs(); + try (java.io.FileOutputStream fos = new java.io.FileOutputStream(outFile)) { + int len; + while ((len = zis.read(buffer)) > 0) { + fos.write(buffer, 0, len); } } } + zis.closeEntry(); } } + Logger.info("Extracted " + zipFile.getName() + " to " + targetDir.getAbsolutePath()); + return targetDir; + } catch (Exception e) { + Logger.error("Failed to extract zip: " + zipFile.getAbsolutePath(), e); + return null; } - - mappingsConfiguration.saveMappings(itemMappingsOutputFolder.toPath()); - itemTextureConfiguration.save(texturesFolder.toPath()); } + private void convertPackDirectory(@NotNull File inputFolder, @NotNull File outputPackFolder, @NotNull ConversionContext ctx, boolean isPrimary) { + if (!inputFolder.isDirectory()) return; - private void convertPack(File inputFolder, File outputPackFolder) { - // if zip xxx + Path assetsPath = inputFolder.toPath().resolve("assets"); + if (Files.isDirectory(assetsPath)) { + ctx.withJavaAssetsDir(assetsPath); + } else if (ctx.javaAssetsDir() == null) { + ctx.withJavaAssetsDir(inputFolder.toPath()); + } File[] listed = inputFolder.listFiles(); - if (listed == null) { - return; - } + if (listed == null) return; + + java.util.concurrent.atomic.AtomicBoolean hasManifest = new java.util.concurrent.atomic.AtomicBoolean(false); for (var file : listed) { String fileName = file.getName(); if (file.isDirectory()) { if (fileName.equalsIgnoreCase("assets")) { - File[] subFiles = file.listFiles(); - if (subFiles != null) { - for (var namespacedFile : subFiles) { - if (namespacedFile.isDirectory()) { - File[] folderType = namespacedFile.listFiles(); - if (folderType != null) { - for (var typeFile : folderType) { - if (typeFile.isDirectory()) { - String typeName = typeFile.getName(); - switch (typeName) { - case "textures", "models" -> - FileUtils.copyDirectory(typeFile, new File(outputPackFolder, typeName)); - } - } - } - } +// this.copyAssetsRecursive(file, outputPackFolder); + File[] files = file.listFiles(); + if (files != null) { + for (File namespaceFile : files) { + if (namespaceFile.isDirectory()) { + String namespace = namespaceFile.getName(); + this.convertNamespaceAssets(namespaceFile, namespace, ctx); } } } } + } else if (this.isZipFile(file)) { + File extractDir = new File(inputFolder, ".cec_" + file.getName()); + if (!extractDir.exists()) { + this.extractZipTo(file, extractDir); + } + if (extractDir.exists()) { + this.convertPackDirectory(extractDir, outputPackFolder, ctx, false); + } } else { String fileNameWithoutExtension = FileUtils.getFileNameWithoutExtension(file); String extension = FileUtils.getFileExtension(file); if (fileNameWithoutExtension.equalsIgnoreCase("pack")) { - File dest = new File(outputPackFolder, "pack_icon" + extension); + File dest = new File(outputPackFolder, "pack_icon." + extension); FileUtils.copyFile(file, dest); } else if (fileName.equalsIgnoreCase("pack.mcmeta")) { FileCacheManager.getJsonCache().getEntryFile(file.toPath()).ifPresent(jsonObjectFileCacheEntry -> { ManifestConfiguration configuration = ManifestConfiguration.fromJavaPackFormat(jsonObjectFileCacheEntry.getData()); - configuration.saveManifest(outputPackFolder.toPath()); + ctx.withManifest(configuration); + hasManifest.set(true); }); } } } + + if (!hasManifest.get()) { + Logger.info("No pack.mcmeta found in input pack, using default manifest"); + } + } + + private void convertNamespaceAssets(File namespaceDir, String namespace, ConversionContext ctx) { + File[] listed = namespaceDir.listFiles(); + if (listed == null) return; + + for (var file : listed) { + if (file.isDirectory()) { + + } else if (file.isFile()) { + if (FileUtils.isJsonFile(file)) { + String fileNameWithoutExtension = FileUtils.getFileNameWithoutExtension(file); + switch (fileNameWithoutExtension) { + case "sounds" -> ctx.convertSoundDefinitions(file, namespace); + default -> { + // Other JSON files can be handled here if needed + } + } + } + } + } } + + } diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockItemLoader.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockItemLoader.java index 3c5e3001..b51ddf46 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockItemLoader.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockItemLoader.java @@ -1,62 +1,85 @@ package fr.robie.craftengineconverter.converter.bedrock; +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonObject; import fr.robie.craftengineconverter.api.configuration.Configuration; import fr.robie.craftengineconverter.api.configuration.ConfigurationKey; import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.GroupDefinitionMapping; import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.ItemMapping; import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.ItemModelItemMapping; import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.LegacyItemMapping; +import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.component.GenericBedrockComponent; +import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.option.BedrockOptions; +import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate.BedrockPredicate; +import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate.condition.HasComponentPredicate; +import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate.match.ChargeTypePredicate; +import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate.range_dispatch.BundleFullnessPredicate; +import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate.range_dispatch.CountPredicate; +import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate.range_dispatch.DamagePredicate; import fr.robie.craftengineconverter.api.configuration.bedrock.texture.TextureData; import fr.robie.craftengineconverter.api.configuration.item.models.ModelConfiguration; +import fr.robie.craftengineconverter.api.configuration.item.models.composite.CompositeModelConfiguration; import fr.robie.craftengineconverter.api.configuration.item.models.condition.ConditionModelConfiguration; import fr.robie.craftengineconverter.api.configuration.item.models.model.GenerationConfiguration; import fr.robie.craftengineconverter.api.configuration.item.models.model.SimpleModelConfiguration; +import fr.robie.craftengineconverter.api.configuration.item.models.range_dispatch.RangeDispatchModelConfiguration; +import fr.robie.craftengineconverter.api.configuration.item.models.select.ChargeTypeSelectConfiguration; +import fr.robie.craftengineconverter.api.configuration.item.models.select.ComponentSelectConfiguration; +import fr.robie.craftengineconverter.api.configuration.item.models.select.CustomModelDataSelectConfiguration; +import fr.robie.craftengineconverter.api.configuration.item.models.select.SelectModelConfiguration; import fr.robie.craftengineconverter.api.configuration.loader.models.ModelConfigurationRegistry; -import fr.robie.yamllibrary.ConfigurationSection; +import fr.robie.craftengineconverter.converter.bedrock.animation.AnimationMapper; +import fr.robie.craftengineconverter.converter.bedrock.animation.BedrockAnimationContext; +import fr.robie.craftengineconverter.converter.bedrock.animation.BedrockRenderControllers; +import fr.robie.craftengineconverter.converter.bedrock.attachable.BedrockAttachableContext; +import fr.robie.craftengineconverter.converter.bedrock.geometry.BedrockGeometry; +import fr.robie.craftengineconverter.converter.bedrock.geometry.GeometryMapper; +import fr.robie.craftengineconverter.converter.bedrock.texture.CachedTextureInfo; import fr.robie.messageflow.logger.Logger; +import fr.robie.yamllibrary.ConfigurationSection; import org.bukkit.Material; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; -import java.util.List; +import java.awt.image.BufferedImage; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.*; public class BedrockItemLoader { private final String itemId; private final ConfigurationSection itemSection; + private final ConversionContext context; + private final HashSet processedModels = new HashSet<>(); + private final java.util.ArrayList processedModelPaths = new java.util.ArrayList<>(); + private final java.util.HashMap animationContexts = new java.util.HashMap<>(); - public BedrockItemLoader(@NotNull String itemId, @NotNull ConfigurationSection itemSection) { + public BedrockItemLoader(@NotNull String itemId, @NotNull ConfigurationSection itemSection, @NotNull ConversionContext context) { this.itemId = itemId; this.itemSection = itemSection; + this.context = context; } - public ItemMapping load() { - ItemMapping itemMapping; Material material = this.getMaterial(); ModelConfiguration modelConfiguration = ModelConfigurationRegistry.load(this.itemSection.getConfigurationSection("model")); - if (modelConfiguration instanceof ConditionModelConfiguration conditionModelConfiguration) { - GroupDefinitionMapping groupDefinitionMapping = new GroupDefinitionMapping(material, this.itemId); - - ItemModelItemMapping onFalse = new ItemModelItemMapping(material, this.itemId, null); - ItemModelItemMapping onTrue = new ItemModelItemMapping(material, this.itemId + "_" + conditionModelConfiguration.getProperty(), null); - - onTrue.addBedrockPredicate(conditionModelConfiguration.getOnTruePredicate()); - onFalse.addBedrockPredicate(conditionModelConfiguration.getOnFalsePredicate()); - - this.convertItem(onTrue); - this.convertItem(onFalse); - - groupDefinitionMapping.addDefinition(onTrue); - groupDefinitionMapping.addDefinition(onFalse); - - this.addTextureDataIfSimpleModel(conditionModelConfiguration.getOnFalse(), groupDefinitionMapping, this.itemId + "_false"); - this.addTextureDataIfSimpleModel(conditionModelConfiguration.getOnTrue(), groupDefinitionMapping, this.itemId + "_true"); + if (modelConfiguration != null) { + GroupDefinitionMapping rootGroup = new GroupDefinitionMapping(material, this.itemId); + if (this.itemSection.isString("item-model")) { + rootGroup.setModel(this.itemSection.getString("item-model")); + } - return groupDefinitionMapping; + List predicateStack = new ArrayList<>(); + this.buildDefinitions(rootGroup, modelConfiguration, material, this.itemId, predicateStack); + this.collectTextureData(modelConfiguration, rootGroup, this.itemId); + this.convertItem(rootGroup); + return rootGroup; } if (this.itemSection.isString("item-model")) { - itemMapping = new ItemModelItemMapping( + return new ItemModelItemMapping( material, this.itemId, this.itemSection.getString("item-model") @@ -70,47 +93,863 @@ public ItemMapping load() { floats = this.itemSection.getFloatList("data.components.minecraft:custom_model_data"); } if (!floats.isEmpty()) { - itemMapping = new LegacyItemMapping( + return new LegacyItemMapping( material, this.itemId, floats.getFirst() ); - } else { - return null; } } + // Fallback for items with texture/textures but no model section + if (this.itemSection.isString("texture")) { + String texturePath = this.itemSection.getString("texture"); + ItemModelItemMapping mapping = new ItemModelItemMapping(material, this.itemId, this.itemId); + // Extract material display transforms for accurate tool/item positioning + this.extractMaterialDisplayTransforms(material, this.itemId); + // Register pipeline artifacts first (this resolves texture, detects animation, adds artifacts) + this.registerPipelineArtifacts(texturePath, this.itemId, this.isToolMaterial(material)); + // Add TextureData to the mapping for Geyser icon resolution + String resolvedPath = this.resolveTexturePath(texturePath); + if (this.context.texturePipeline().isAnimated(texturePath)) { + String frameBasePath = this.context.texturePipeline().getFrameBaseTexturePath(texturePath); + TextureData td = new TextureData(this.itemId); + td.addTexture(frameBasePath + "_0"); + mapping.addTextureData(td); + } else if (resolvedPath != null) { + TextureData td = new TextureData(this.itemId); + td.addTexture(resolvedPath); + mapping.addTextureData(td); + } + this.convertItem(mapping); + return mapping; + } + + if (this.itemSection.isList("textures")) { + List texturePaths = this.itemSection.getStringList("textures"); + ItemModelItemMapping mapping = new ItemModelItemMapping(material, this.itemId, this.itemId); + this.extractMaterialDisplayTransforms(material, this.itemId); + for (String tex : texturePaths) { + this.registerPipelineArtifacts(tex, this.itemId, this.isToolMaterial(material)); + } + if (!this.context.texturePipeline().isAnimated(texturePaths.getFirst())) { + TextureData td = new TextureData(this.itemId); + for (String tex : texturePaths) { + String resolvedPath = this.resolveTexturePath(tex); + if (resolvedPath != null) { + td.addTexture(resolvedPath); + } + } + if (!td.getTextures().isEmpty()) { + mapping.addTextureData(td); + } + } + this.convertItem(mapping); + return mapping; + } + + return null; + } + + private void buildDefinitions(@NotNull GroupDefinitionMapping group, @Nullable ModelConfiguration modelConfiguration, Material material, String textureId, List predicateStack) { + switch (modelConfiguration) { + case null -> { + } + case ConditionModelConfiguration condition -> + this.traverseCondition(group, condition, material, textureId, predicateStack); + case SelectModelConfiguration select -> + this.traverseSelect(group, select, material, textureId, predicateStack); + case RangeDispatchModelConfiguration range -> + this.traverseRange(group, range, material, textureId, predicateStack); + case CompositeModelConfiguration composite -> + this.traverseComposite(group, composite, material, textureId, predicateStack); + default -> { + ItemModelItemMapping definition = new ItemModelItemMapping(material, textureId, textureId); + for (BedrockPredicate pred : predicateStack) { + definition.addBedrockPredicate(pred); + } + group.addDefinition(definition); + } + } + + } + + private void traverseCondition(@NotNull GroupDefinitionMapping group, @NotNull ConditionModelConfiguration condition, Material material, String baseTextureId, List predicateStack) { + if (!condition.isConditionSupported()) { + Logger.warn("Unsupported condition property '" + condition.getProperty() + "' for item " + material + " - condition branches will be processed without predicates"); + } + String propertySuffix = "_" + condition.getProperty().replace(":", "_"); + + ModelConfiguration onFalse = condition.getOnFalse(); + if (onFalse != null) { + BedrockPredicate falsePredicate = condition.getOnFalsePredicate(); + List falseStack = new ArrayList<>(predicateStack); + if (falsePredicate != null) { + falseStack.add(falsePredicate); + } + this.buildDefinitions(group, onFalse, material, baseTextureId, falseStack); + } + + ModelConfiguration onTrue = condition.getOnTrue(); + String trueTextureId = baseTextureId + propertySuffix; + if (onTrue != null) { + BedrockPredicate truePredicate = condition.getOnTruePredicate(); + List trueStack = new ArrayList<>(predicateStack); + if (truePredicate != null) { + trueStack.add(truePredicate); + } + this.buildDefinitions(group, onTrue, material, trueTextureId, trueStack); + } + } + + private void traverseSelect(@NotNull GroupDefinitionMapping group, @NotNull SelectModelConfiguration select, Material material, String baseTextureId, List predicateStack) { + for (SelectModelConfiguration.Case caseEntry : select.getCases()) { + String caseValue = this.caseValueToString(caseEntry.when()); + String caseTextureId = baseTextureId + "_" + this.sanitizeTextureSuffix(caseValue); + BedrockPredicate casePredicate = this.createSelectPredicate(select, caseEntry); + + List caseStack = new ArrayList<>(predicateStack); + if (casePredicate != null) { + caseStack.add(casePredicate); + } + this.buildDefinitions(group, caseEntry.model(), material, caseTextureId, caseStack); + } + + if (select.getFallback() != null) { + this.buildDefinitions(group, select.getFallback(), material, baseTextureId, predicateStack); + } + } + + private void traverseRange(@NotNull GroupDefinitionMapping group, @NotNull RangeDispatchModelConfiguration range, Material material, String baseTextureId, List predicateStack) { + Float scale = range.getScale(); + + for (RangeDispatchModelConfiguration.Entry entry : range.getEntries()) { + String entryTextureId = baseTextureId + "_" + (long) entry.threshold(); + BedrockPredicate entryPredicate = this.createRangePredicate(range, entry, scale); + + List entryStack = new ArrayList<>(predicateStack); + if (entryPredicate != null) { + entryStack.add(entryPredicate); + } + this.buildDefinitions(group, entry.model(), material, entryTextureId, entryStack); + } + + if (range.getFallback() != null) { + this.buildDefinitions(group, range.getFallback(), material, baseTextureId, predicateStack); + } + } + + private void traverseComposite(@NotNull GroupDefinitionMapping group, @NotNull CompositeModelConfiguration composite, Material material, String baseTextureId, List predicateStack) { + int index = 0; + for (ModelConfiguration child : composite.getModels()) { + String childTextureId = baseTextureId + "_" + index; + this.buildDefinitions(group, child, material, childTextureId, predicateStack); + index++; + } + } + + @Nullable + private BedrockPredicate createSelectPredicate(@NotNull SelectModelConfiguration select, SelectModelConfiguration.Case caseEntry) { + if (select instanceof CustomModelDataSelectConfiguration cmdSelect) { + String value = caseEntry.when().toString(); + return new fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate.match.CustomModelDataPredicate(cmdSelect.getIndex(), value); + } + if (select instanceof ChargeTypeSelectConfiguration) { + Object when = caseEntry.when(); + if (when instanceof fr.robie.craftengineconverter.api.configuration.item.models.range_dispatch.ChargeType chargeType) { + return new ChargeTypePredicate(chargeType); + } + } + if (select instanceof ComponentSelectConfiguration componentSelect) { + String value = caseEntry.when().toString(); + return new HasComponentPredicate(componentSelect.getComponent(), true); + } + return null; + } + + @Nullable + private BedrockPredicate createRangePredicate(@NotNull RangeDispatchModelConfiguration range, RangeDispatchModelConfiguration.Entry entry, @Nullable Float scale) { + String property = range.getProperty(); + if (property.contains(":")) { + property = property.substring(property.indexOf(':') + 1); + } + + switch (property) { + case "damage": + return new DamagePredicate(entry.threshold(), scale, null); + case "count": + return new CountPredicate(entry.threshold(), scale, null); + case "bundle_fullness": + return new BundleFullnessPredicate(entry.threshold(), scale); + case "custom_model_data": + return new fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate.range_dispatch.CustomModelDataPredicate(entry.threshold(), scale); + } + return null; + } + + private String caseValueToString(Object when) { + if (when instanceof Enum enumValue) { + return enumValue.name().toLowerCase(Locale.ROOT); + } + return when.toString(); + } - return itemMapping; + private String sanitizeTextureSuffix(String value) { + return value.replace(":", "_").replace("/", "_").replace(" ", "_"); + } + + private void collectTextureData(ModelConfiguration modelConfiguration, GroupDefinitionMapping rootGroup, String textureId) { + this.collectTextureData(modelConfiguration, rootGroup, textureId, null); + } + + private void collectTextureData(ModelConfiguration modelConfiguration, GroupDefinitionMapping rootGroup, String textureId, Material material) { + if (modelConfiguration == null) return; + + this.addTextureDataIfSimpleModel(modelConfiguration, rootGroup, textureId, material); + + if (modelConfiguration instanceof ConditionModelConfiguration condition) { + String propertySuffix = "_" + condition.getProperty().replace(":", "_"); + this.collectTextureData(condition.getOnFalse(), rootGroup, textureId, material); + this.collectTextureData(condition.getOnTrue(), rootGroup, textureId + propertySuffix, material); + } else if (modelConfiguration instanceof SelectModelConfiguration select) { + for (SelectModelConfiguration.Case caseEntry : select.getCases()) { + String caseValue = this.caseValueToString(caseEntry.when()); + String caseTextureId = textureId + "_" + this.sanitizeTextureSuffix(caseValue); + this.collectTextureData(caseEntry.model(), rootGroup, caseTextureId, material); + } + if (select.getFallback() != null) { + this.collectTextureData(select.getFallback(), rootGroup, textureId, material); + } + } else if (modelConfiguration instanceof RangeDispatchModelConfiguration range) { + for (RangeDispatchModelConfiguration.Entry entry : range.getEntries()) { + String entryTextureId = textureId + "_" + (long) entry.threshold(); + this.collectTextureData(entry.model(), rootGroup, entryTextureId, material); + } + if (range.getFallback() != null) { + this.collectTextureData(range.getFallback(), rootGroup, textureId, material); + } + } else if (modelConfiguration instanceof CompositeModelConfiguration composite) { + int index = 0; + for (ModelConfiguration child : composite.getModels()) { + String childTextureId = textureId + "_" + index; + this.collectTextureData(child, rootGroup, childTextureId, material); + index++; + } + } } + private static final java.util.Set SUPPORTED_COMPONENTS = java.util.Set.of( + "minecraft:max_damage", "max_damage", + "minecraft:max_stack_size", "max_stack_size", + "minecraft:food", "food", + "minecraft:enchantable", "enchantable", + "minecraft:enchantment_glint_override", "enchantment_glint_override", + "minecraft:use_cooldown", "use_cooldown", + "minecraft:attack_range", "attack_range", + "minecraft:consumable", "consumable", + "minecraft:equippable", "equippable", + "minecraft:kinetic_weapon", "kinetic_weapon", + "minecraft:piercing_weapon", "piercing_weapon", + "minecraft:swing_animation", "swing_animation", + "minecraft:use_effects", "use_effects", + "minecraft:damage", "damage", +// "minecraft:durability", "durability", + "minecraft:hand_equipped", "hand_equipped", + "minecraft:wearable", "wearable", + "minecraft:digger", "digger", + "minecraft:use_modifiers", "use_modifiers", + "minecraft:use_animation", "use_animation", + "minecraft:repairable", "repairable", + "minecraft:glint", "glint", + "minecraft:allow_off_hand", "allow_off_hand", + "minecraft:rarity", "rarity" + ); + private void convertItem(ItemMapping itemMapping) { - String itemName = this.itemSection.getString("data.item-name", this.itemSection.getString("data.custom-name")); + String itemName = this.itemSection.getString("data.item-name"); + if (itemName == null) itemName = this.itemSection.getString("data.item_name"); + if (itemName == null) itemName = this.itemSection.getString("data.custom-name"); if (itemName != null) { - itemMapping.setDisplayName(itemName); + String stripped = this.stripFormatting(itemName); + if (stripped != null) { + itemMapping.setDisplayName(stripped); + } } + Material material = itemMapping.getJavaMaterial(); + + BedrockOptions options = new BedrockOptions(); + + if (this.isToolMaterial(material)) { + options.setDisplayHandheld(true); + } + + if (!options.serialize().isEmpty()) { + itemMapping.setBedrockOptions(options); + } + + this.convertDirectProperties(itemMapping, material); + this.collectComponentData(itemMapping); + this.detectBlockItem(itemMapping); + this.detectArmorItem(itemMapping, material); + } + + public boolean isBlockItem() { + ConfigurationSection behaviorSection = this.itemSection.getConfigurationSection("behavior"); + if (behaviorSection == null) return false; + String type = behaviorSection.getString("type"); + return "block_item".equals(type) || "furniture_item".equals(type); + } + + @Nullable + private void convertDirectProperties(ItemMapping mapping, Material material) { + if (this.itemSection.isInt("data.max_damage")) { + int maxDamage = this.itemSection.getInt("data.max_damage"); + mapping.addBedrockComponent(new GenericBedrockComponent("minecraft:max_damage", maxDamage)); + mapping.addBedrockComponent(new GenericBedrockComponent("minecraft:max_stack_size", 1)); + } + + if (this.itemSection.isString("data.attack_damage")) { + float damage = (float) this.itemSection.getDouble("data.attack_damage"); + mapping.addBedrockComponent(new GenericBedrockComponent("minecraft:damage", (int) damage)); + } + } + + private void detectBlockItem(ItemMapping mapping) { + ConfigurationSection behaviorSection = this.itemSection.getConfigurationSection("behavior"); + if (behaviorSection == null) return; + + String type = behaviorSection.getString("type"); + if ("block_item".equals(type)) { +// mapping.addBedrockComponent(new GenericBedrockComponent("minecraft:block_placer", +// java.util.Map.of("block", mapping.getBedrockIdentifier()))); + // Also register textures as terrain textures for block items + this.registerExistingTexturesAsTerrain(mapping); + } else if ("furniture_item".equals(type)) { + String blockedBy = behaviorSection.getString("settings.item"); + if (blockedBy == null) blockedBy = mapping.getBedrockIdentifier(); +// mapping.addBedrockComponent(new GenericBedrockComponent("minecraft:block_placer", +// java.util.Map.of("block", blockedBy))); + } + } + + private void registerExistingTexturesAsTerrain(ItemMapping mapping) { + if (this.context.javaAssetsDir() == null) return; + for (String modelPath : this.processedModelPaths) { + this.context.registerTextureDataAsTerrain(modelPath, this.itemId); + } + } + + private void detectArmorItem(ItemMapping mapping, Material material) { + if (!this.isArmorMaterial(material)) return; + + String slotName = this.armorSlotForMaterial(material); + if (slotName == null) return; + + java.util.Map wearable = new java.util.LinkedHashMap<>(); + wearable.put("slot", slotName); + if (material.name().contains("LEATHER")) { + wearable.put("protection", 1); + } + mapping.addBedrockComponent(new GenericBedrockComponent("minecraft:wearable", wearable)); + + String equipmentTexturePath = this.findEquipmentTexture(mapping); + if (equipmentTexturePath != null) { + String safeId = mapping.getBedrockIdentifier().replace(":", "."); + BedrockAttachableContext armorAttachable = BedrockAttachableContext.createArmor( + mapping.getBedrockIdentifier(), equipmentTexturePath); + this.context.registerAttachable(safeId, armorAttachable); + } + } + + @Nullable + private String findEquipmentTexture(ItemMapping mapping) { + for (TextureData td : mapping.getTexturesData()) { + for (String tex : td.getTextures()) { + if (tex.startsWith("textures/")) { + return tex; + } + } + } + return null; + } + + private void collectComponentData(ItemMapping itemMapping) { + ConfigurationSection componentsSection = this.itemSection.getConfigurationSection("data.components"); + if (componentsSection == null) return; + + for (String key : componentsSection.getKeys(false)) { + if (!SUPPORTED_COMPONENTS.contains(key)) continue; + + Object value = componentsSection.get(key); + if (value != null) { + itemMapping.addBedrockComponent(new GenericBedrockComponent(key, value)); + } + } + } + + private boolean isToolMaterial(Material material) { + if (material == null) return false; + String name = material.name(); + return name.contains("_PICKAXE") || name.contains("_AXE") || name.contains("_SHOVEL") + || name.contains("_HOE") || name.contains("_SWORD") || name.contains("TRIDENT") + || name.contains("FISHING_ROD") || name.contains("FLINT_AND_STEEL") + || name.contains("SHEARS") || name.contains("SHIELD") + || name.contains("BOW") || name.contains("CROSSBOW"); + } + + private boolean isArmorMaterial(Material material) { + if (material == null) return false; + String name = material.name(); + return name.contains("_HELMET") || name.contains("_CHESTPLATE") + || name.contains("_LEGGINGS") || name.contains("_BOOTS") + || name.equals("ELYTRA") || name.contains("_HORSE_ARMOR") + || name.contains("TURTLE_HELMET"); + } + + @Nullable + private String armorSlotForMaterial(Material material) { + if (material == null) return null; + String name = material.name(); + if (name.contains("_HELMET") || name.contains("TURTLE_HELMET") || name.contains("SKULL")) return "head"; + if (name.contains("_CHESTPLATE") || name.equals("ELYTRA")) return "chest"; + if (name.contains("_LEGGINGS")) return "legs"; + if (name.contains("_BOOTS")) return "feet"; + return null; + } + + @Nullable + private String determineCreativeCategory(Material material) { + if (material == null) return null; + String name = material.name(); + if (this.isToolMaterial(material)) return "equipment"; + if (this.isArmorMaterial(material)) return "equipment"; + if (name.contains("_ORE") || name.contains("BLOCK") || name.contains("STONE") + || name.contains("DIRT") || name.contains("WOOD") || name.contains("PLANK") + || name.contains("COBBLESTONE") || name.contains("SAND")) return "construction"; + if (name.contains("_HELMET") || name.contains("_CHESTPLATE") + || name.contains("_LEGGINGS") || name.contains("_BOOTS")) return "equipment"; + return "items"; + } + + private String stripFormatting(String input) { + if (input == null) return null; + java.util.regex.Matcher langMatcher = java.util.regex.Pattern.compile("]+)>").matcher(input); + if (langMatcher.find()) { + return langMatcher.group(1); + } + String stripped = input.replaceAll("<[^>]+>", "").replaceAll("§[0-9a-fklmnor]", "").trim(); + return stripped.isEmpty() ? null : stripped; } - /** - * Adds TextureData to the groupDefinitionMapping if the modelConfiguration is a SimpleModelConfiguration with a GenerationConfiguration. - * - * @param modelConfiguration the model configuration (can be null) - * @param groupDefinitionMapping the group definition mapping to add to - * @param textureId the texture id to use for toTextureData - */ private void addTextureDataIfSimpleModel(ModelConfiguration modelConfiguration, GroupDefinitionMapping groupDefinitionMapping, String textureId) { + this.addTextureDataIfSimpleModel(modelConfiguration, groupDefinitionMapping, textureId, null); + } + + private void addTextureDataIfSimpleModel(ModelConfiguration modelConfiguration, GroupDefinitionMapping groupDefinitionMapping, String textureId, Material mat) { if (modelConfiguration instanceof SimpleModelConfiguration simpleModelConfiguration) { GenerationConfiguration generation = simpleModelConfiguration.getGeneration(); + boolean hasGenerationTexture = false; if (generation != null) { TextureData textureData = generation.toTextureData(textureId); if (textureData != null) { groupDefinitionMapping.addTextureData(textureData); + hasGenerationTexture = !textureData.getTextures().isEmpty(); + } + this.handleGenerationDisplayTransforms(textureId); + } + String modelPath = simpleModelConfiguration.getModel(); + if (modelPath != null) { + if (!hasGenerationTexture) { + String texturePath = this.modelPathToTexturePath(modelPath); + if (texturePath != null) { + TextureData textureData = new TextureData(textureId); + textureData.addTexture(texturePath); + groupDefinitionMapping.addTextureData(textureData); + } + } + this.registerPipelineArtifacts(modelPath, textureId, this.isToolMaterial(mat)); + } + } + } + + private void handleGenerationDisplayTransforms(String textureId) { + this.extractDisplayTransformsFromSection(this.itemSection, textureId); + } + + private void extractDisplayTransformsFromSection(ConfigurationSection section, String textureId) { + ConfigurationSection modelSection = section.getConfigurationSection("model"); + if (modelSection == null) return; + ConfigurationSection generationSection = modelSection.getConfigurationSection("generation"); + if (generationSection == null) return; + ConfigurationSection displaySection = generationSection.getConfigurationSection("display"); + if (displaySection == null) return; + + float[] fpRot = {0, 0, 0}, fpPos = {0, 0, 0}, fpScale = {1, 1, 1}; + float[] tpRot = {0, 0, 0}, tpPos = {0, 0, 0}, tpScale = {1, 1, 1}; + float[] headRot = {0, 0, 0}, headPos = {0, 0, 0}, headScale = {1, 1, 1}; + boolean hasAnyTransform = false; + + for (String viewKey : displaySection.getKeys(false)) { + ConfigurationSection view = displaySection.getConfigurationSection(viewKey); + if (view == null) continue; + + float[] rot = this.extractFloatArray(view, "rotation", 3); + float[] pos = this.extractFloatArray(view, "translation", 3); + float[] scale = this.extractFloatArray(view, "scale", 3, 1.0f); + + switch (viewKey) { + case "firstperson_righthand": + case "firstperson_lefthand": + fpRot = rot; fpPos = pos; fpScale = scale; + hasAnyTransform = true; + break; + case "thirdperson_righthand": + case "thirdperson_lefthand": + tpRot = rot; tpPos = pos; tpScale = scale; + hasAnyTransform = true; + break; + case "head": + case "fixed": + headRot = rot; headPos = pos; headScale = scale; + hasAnyTransform = true; + break; + } + } + + if (!hasAnyTransform) return; + + BedrockAnimationContext animCtx = AnimationMapper.mapDisplayTransforms( + textureId, "bone", + fpRot, fpPos, fpScale, + tpRot, tpPos, tpScale, + headRot, headPos, headScale + ); + + animCtx.animation().ifPresent(anim -> { + this.context.registerAnimation(textureId.replace(":", "."), anim); + }); + + if (!animCtx.isEmpty()) { + this.animationContexts.put(textureId, animCtx); + } + } + + private void extractMaterialDisplayTransforms(Material material, String textureId) { + if (this.context.javaAssetsDir() == null) return; + + String materialName = material.name().toLowerCase(Locale.ROOT); + Path modelFile = this.context.javaAssetsDir().resolve("minecraft/models/item/" + materialName + ".json"); + if (!Files.exists(modelFile)) { + // Try alternate non-vanilla namespace + modelFile = this.context.javaAssetsDir().resolve(materialName.contains(":") ? materialName.replace(":", "/models/item/") : "minecraft/models/item/" + materialName + ".json"); + if (!Files.exists(modelFile)) return; + } + + try { + Gson gson = new Gson(); + JsonObject model = gson.fromJson(Files.newBufferedReader(modelFile), JsonObject.class); + if (model == null) return; + + // Resolve parent model (one level deep) + if (model.has("parent") && !model.has("display")) { + String parent = model.get("parent").getAsString(); + String parentPath = parent.replace(":", "/models/") + ".json"; + Path parentFile = this.context.javaAssetsDir().resolve(parentPath); + if (Files.exists(parentFile)) { + JsonObject parentModel = gson.fromJson(Files.newBufferedReader(parentFile), JsonObject.class); + if (parentModel != null && parentModel.has("display")) { + model = parentModel; + } + } + } + + JsonObject display = model.getAsJsonObject("display"); + if (display == null) return; + + float[] fpRot = {0, 0, 0}, fpPos = {0, 0, 0}, fpScale = {1, 1, 1}; + float[] tpRot = {0, 0, 0}, tpPos = {0, 0, 0}, tpScale = {1, 1, 1}; + float[] headRot = {0, 0, 0}, headPos = {0, 0, 0}, headScale = {1, 1, 1}; + boolean hasAnyTransform = false; + + for (String viewKey : display.keySet()) { + JsonObject view = display.getAsJsonObject(viewKey); + if (view == null) continue; + + float[] rot = this.readJsonFloatArray(view, "rotation", 3); + float[] pos = this.readJsonFloatArray(view, "translation", 3); + float[] scale = this.readJsonFloatArray(view, "scale", 3, 1.0f); + + switch (viewKey) { + case "firstperson_righthand": + case "firstperson_lefthand": + fpRot = rot; fpPos = pos; fpScale = scale; + hasAnyTransform = true; + break; + case "thirdperson_righthand": + case "thirdperson_lefthand": + tpRot = rot; tpPos = pos; tpScale = scale; + hasAnyTransform = true; + break; + case "head": + case "fixed": + headRot = rot; headPos = pos; headScale = scale; + hasAnyTransform = true; + break; } } + + if (!hasAnyTransform) return; + + BedrockAnimationContext animCtx = AnimationMapper.mapDisplayTransforms( + textureId, "bone", + fpRot, fpPos, fpScale, + tpRot, tpPos, tpScale, + headRot, headPos, headScale + ); + + animCtx.animation().ifPresent(anim -> { + this.context.registerAnimation(textureId.replace(":", "."), anim); + }); + + if (!animCtx.isEmpty()) { + this.animationContexts.put(textureId, animCtx); + } + } catch (Exception e) { + Logger.warn("Could not read display transforms from material model " + materialName); + } + } + + private float[] readJsonFloatArray(JsonObject obj, String key, int size) { + return this.readJsonFloatArray(obj, key, size, 0.0f); + } + + private float[] readJsonFloatArray(JsonObject obj, String key, int size, float defaultValue) { + JsonArray arr = obj.getAsJsonArray(key); + if (arr == null || arr.size() < size) { + float[] result = new float[size]; + java.util.Arrays.fill(result, defaultValue); + return result; + } + float[] result = new float[size]; + for (int i = 0; i < size && i < arr.size(); i++) { + result[i] = arr.get(i).getAsFloat(); + } + return result; + } + + private float[] extractFloatArray(ConfigurationSection section, String key, int size) { + return this.extractFloatArray(section, key, size, 0.0f); + } + + private float[] extractFloatArray(ConfigurationSection section, String key, int size, float defaultValue) { + List list = section.getFloatList(key); + if (list == null || list.size() < size) { + float[] result = new float[size]; + java.util.Arrays.fill(result, defaultValue); + return result; + } + float[] result = new float[size]; + for (int i = 0; i < size && i < list.size(); i++) { + result[i] = list.get(i) != null ? list.get(i) : defaultValue; + } + return result; + } + + private void registerPipelineArtifacts(String modelPath, String textureId) { + this.registerPipelineArtifacts(modelPath, textureId, false); + } + + private void registerPipelineArtifacts(String modelPath, String textureId, boolean isTool) { + if (!this.processedModels.add(textureId)) return; + if (this.context.javaAssetsDir() == null) return; + + this.processedModelPaths.add(modelPath); + + // Resolve texture first to populate the animation cache + Optional resolved = this.context.texturePipeline().resolveTexture(modelPath, textureId, this.context.javaAssetsDir()); + + if (resolved.isPresent() && resolved.get().animation().isPresent()) { + this.registerAnimatedItemArtifacts(modelPath, textureId, resolved.get(), isTool); + } else { + this.registerStaticItemArtifacts(modelPath, textureId, isTool); + } + } + + private void registerAnimatedItemArtifacts(String modelPath, String textureId, CachedTextureInfo info, boolean isTool) { + CachedTextureInfo.AnimationInfo anim = info.animation().get(); + int frameCount = anim.totalFrameCount(); + int frameW = anim.frameWidth(); + int frameH = anim.frameHeight(); + + // Extract frame PNGs from spritesheet + this.context.texturePipeline().extractAnimationFrames(info, this.context.texturesDir()); + + String frameBasePath = this.context.texturePipeline().getFrameBaseTexturePath(modelPath); + + // Create geometry for the item (use safeKey so geometry identifier matches attachable). + // Use frame 0's actual pixels so the extrusion follows that frame's silhouette. + String safeKey = textureId.replace(":", ".").replace("/", "_"); + BedrockGeometry geo = this.loadFirstFrame(info) + .map(image -> GeometryMapper.createFlatItemGeometry(safeKey, image)) + .orElseGet(() -> GeometryMapper.createFlatItemGeometry(safeKey, frameW, frameH)); + this.context.collectedGeometry().put(textureId, geo); + + // Create single render controller with all frame textures in an array + // The first texture (frame_0) is shown by default. + BedrockRenderControllers rc = BedrockRenderControllers.animated(textureId, frameCount); + this.context.registerRenderController("controller.render." + safeKey, rc); + + // Create animated attachable referencing the single render controller + BedrockAttachableContext attachCtx = BedrockAttachableContext.createAnimated( + textureId, frameCount, frameBasePath); + + // Add positioning animations to ensure the item is visible + BedrockAnimationContext animCtx = this.animationContexts.get(textureId); + if (animCtx == null || animCtx.isEmpty()) { + animCtx = isTool + ? AnimationMapper.createToolAnimations(textureId, "bone") + : AnimationMapper.createDefaultAnimations(textureId, "bone"); + animCtx.animation().ifPresent(a -> + this.context.registerAnimation(textureId.replace(":", "."), a) + ); + } + final BedrockAnimationContext finalCtx = animCtx; + attachCtx.attachable().ifPresent(att -> { + att.withAnimation("third_person", finalCtx.thirdPersonAnimation()); + att.withAnimation("first_person", finalCtx.firstPersonAnimation()); + att.withAnimation("head", finalCtx.headAnimation()); + att.withScript("animate", java.util.List.of( + java.util.Map.of("first_person", "context.is_first_person == 1.0 && (context.item_slot == 'main_hand' || context.item_slot == 'off_hand')"), + java.util.Map.of("third_person", "context.is_first_person == 0.0 && (context.item_slot == 'main_hand' || context.item_slot == 'off_hand')"), + java.util.Map.of("head", "context.is_first_person == 0.0 && context.item_slot == 'head'") + )); + }); + + this.context.registerAttachable(textureId, attachCtx); + } + + private void registerStaticItemArtifacts(String modelPath, String textureId, boolean isTool) { + this.context.copyTexture(modelPath, textureId); + this.context.registerGeometry(modelPath, textureId, 16, 16); + + boolean hasGeometry = this.context.collectedGeometry().containsKey(textureId); + + // Create default flat geometry when no Java model file exists (texture-only items) + if (!hasGeometry) { + String safeKey = textureId.replace(":", ".").replace("/", "_"); + BedrockGeometry fallbackGeo = this.loadStaticTexture(modelPath, textureId) + .map(image -> GeometryMapper.createFlatItemGeometry(safeKey, image)) + .orElseGet(() -> GeometryMapper.createFlatItemGeometry(safeKey, 16, 16)); + this.context.collectedGeometry().put(textureId, fallbackGeo); + hasGeometry = true; + } + + BedrockAnimationContext animCtx = this.animationContexts.get(textureId); + + String defaultTexture = this.resolveTexturePath(modelPath); + + BedrockAttachableContext attachable; + + if (animCtx != null && !animCtx.isEmpty()) { + attachable = BedrockAttachableContext.createWithAnimations(textureId, hasGeometry, false, animCtx, defaultTexture); + } else { + // Create default positioning animations so the item renders at a visible position + BedrockAnimationContext defaultCtx = isTool + ? AnimationMapper.createToolAnimations(textureId, "bone") + : AnimationMapper.createDefaultAnimations(textureId, "bone"); + defaultCtx.animation().ifPresent(anim -> + this.context.registerAnimation(textureId.replace(":", "."), anim) + ); + attachable = BedrockAttachableContext.createWithAnimations(textureId, hasGeometry, false, defaultCtx, defaultTexture); + } + + // Register per-item render controller for this static item + String safeKey = textureId.replace(":", ".").replace("/", "_"); + BedrockRenderControllers perItemRc = new BedrockRenderControllers() + .withController("controller.render." + safeKey, BedrockRenderControllers.staticController("default")); + this.context.registerRenderController("controller.render." + safeKey, perItemRc); + + // Override attachable to use per-item RC instead of the shared item_default + attachable.attachable().ifPresent(att -> att.withRenderController("controller.render." + safeKey)); + + this.context.registerAttachable(textureId, attachable); + } + + /** + * Reads the full-resolution frame directly out of the animation info's source spritesheet + * (the same crop logic {@link TexturePipeline#extractAnimationFrames} uses to write frame + * files to disk), so the geometry is generated from frame 0's actual pixels without depending + * on output-directory naming. + */ + @NotNull + private Optional loadFirstFrame(@NotNull CachedTextureInfo info) { + try { + BufferedImage sheet = javax.imageio.ImageIO.read(info.sourcePath().toFile()); + if (sheet == null) return Optional.empty(); + if (info.animation().isEmpty()) return Optional.of(sheet); + + CachedTextureInfo.AnimationInfo anim = info.animation().get(); + int frameW = anim.frameWidth(); + int frameH = anim.frameHeight(); + int cols = Math.max(1, sheet.getWidth() / frameW); + int frameIndex = anim.frames().isEmpty() ? 0 : anim.frames().get(0).index(); + int sx = (frameIndex % cols) * frameW; + int sy = (frameIndex / cols) * frameH; + + BufferedImage frame = new BufferedImage(frameW, frameH, BufferedImage.TYPE_INT_ARGB); + frame.getGraphics().drawImage(sheet, 0, 0, frameW, frameH, sx, sy, sx + frameW, sy + frameH, null); + return Optional.of(frame); + } catch (java.io.IOException e) { + Logger.warn("Failed to read texture " + info.sourcePath() + " for pixel-based item geometry: " + e.getMessage()); + return Optional.empty(); } } + /** + * Resolves (via the same cache {@link ConversionContext#copyTexture} already populated) and + * reads the source PNG for a non-animated item texture. + */ + @NotNull + private Optional loadStaticTexture(@NotNull String modelPath, @NotNull String textureId) { + if (this.context.javaAssetsDir() == null) return Optional.empty(); + return this.context.texturePipeline().resolveTexture(modelPath, textureId, this.context.javaAssetsDir()) + .flatMap(info -> { + try { + return Optional.ofNullable(javax.imageio.ImageIO.read(info.sourcePath().toFile())); + } catch (java.io.IOException e) { + Logger.warn("Failed to read texture " + info.sourcePath() + " for pixel-based item geometry: " + e.getMessage()); + return Optional.empty(); + } + }); + } + + @Nullable + private String resolveTexturePath(@NotNull String texturePath) { + String path = texturePath; + if (path.contains(":")) { + path = path.substring(path.indexOf(':') + 1); + } + if (path.endsWith(".png")) { + path = path.substring(0, path.length() - 4); + } + return "textures/" + path; + } + + @Nullable + private String modelPathToTexturePath(@NotNull String modelPath) { + String path = modelPath; + if (path.contains(":")) { + path = path.substring(path.indexOf(':') + 1); + } + if (path.endsWith(".json")) { + path = path.substring(0, path.length() - 5); + } + if (path.endsWith(".png")) { + path = path.substring(0, path.length() - 4); + } + return "textures/" + path; + } private Material getMaterial() { String material = this.itemSection.getString("material"); @@ -122,5 +961,4 @@ private Material getMaterial() { } return Configuration.get(ConfigurationKey.DEFAULT_MATERIAL); } - -} +} \ No newline at end of file diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockSettings.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockSettings.java new file mode 100644 index 00000000..b4c6c2ec --- /dev/null +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockSettings.java @@ -0,0 +1,78 @@ +package fr.robie.craftengineconverter.converter.bedrock; + +import fr.robie.yamllibrary.ConfigurationSection; + +import java.io.File; +import java.util.ArrayList; +import java.util.List; + +public class BedrockSettings { + private File itemsFolder; + private File inputPackFolder; + private File outputFolder; + private String outputPackName; + private final List extraItemsFolders = new ArrayList<>(); + private final List extraPackFolders = new ArrayList<>(); + + public BedrockSettings(File pluginFolder) { + this.itemsFolder = new File(pluginFolder, "bedrock/items"); + this.inputPackFolder = new File(pluginFolder, "bedrock/pack"); + this.outputFolder = new File(pluginFolder, "bedrock-converted/Geyser-Spigot"); + this.outputPackName = "CraftEngineConverterPack"; + } + + public File itemsFolder() { return this.itemsFolder; } + public BedrockSettings itemsFolder(File f) { this.itemsFolder = f; return this; } + + public File inputPackFolder() { return this.inputPackFolder; } + public BedrockSettings inputPackFolder(File f) { this.inputPackFolder = f; return this; } + + public File outputFolder() { return this.outputFolder; } + public BedrockSettings outputFolder(File f) { this.outputFolder = f; return this; } + + public String outputPackName() { return this.outputPackName; } + public BedrockSettings outputPackName(String n) { this.outputPackName = n; return this; } + + public List extraItemsFolders() { return this.extraItemsFolders; } + public List extraPackFolders() { return this.extraPackFolders; } + + public List allPackFolders() { + List all = new ArrayList<>(); + all.add(this.inputPackFolder); + all.addAll(this.extraPackFolders); + return all; + } + + public static BedrockSettings fromConfig(File pluginFolder, ConfigurationSection bedrockSection) { + BedrockSettings s = new BedrockSettings(pluginFolder); + if (bedrockSection == null) return s; + + String items = bedrockSection.getString("items-folder"); + if (items != null) s.itemsFolder(new File(pluginFolder, items)); + + String pack = bedrockSection.getString("input-pack-folder"); + if (pack != null) s.inputPackFolder(new File(pluginFolder, pack)); + + String output = bedrockSection.getString("output-folder"); + if (output != null) s.outputFolder(new File(pluginFolder, output)); + + String packName = bedrockSection.getString("output-pack-name"); + if (packName != null) s.outputPackName(packName); + + readFileList(bedrockSection, "extra-items-folders", s.extraItemsFolders, pluginFolder); + readFileList(bedrockSection, "extra-pack-folders", s.extraPackFolders, pluginFolder); + + return s; + } + + private static void readFileList(ConfigurationSection section, String key, List target, File base) { + Object raw = section.get(key); + if (raw instanceof List list) { + for (Object item : list) { + if (item instanceof String path) { + target.add(new File(base, path)); + } + } + } + } +} diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/ConversionContext.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/ConversionContext.java new file mode 100644 index 00000000..2af828b6 --- /dev/null +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/ConversionContext.java @@ -0,0 +1,471 @@ +package fr.robie.craftengineconverter.converter.bedrock; + +import com.google.gson.JsonObject; +import fr.robie.craftengineconverter.api.configuration.bedrock.ItemTextureConfiguration; +import fr.robie.craftengineconverter.api.configuration.bedrock.ManifestConfiguration; +import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.MappingsConfiguration; +import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.block.BlockMappingConfiguration; +import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.GroupDefinitionMapping; +import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.ItemMapping; +import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.ItemModelItemMapping; +import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.option.BedrockOptions; +import fr.robie.craftengineconverter.api.configuration.bedrock.texture.FlipbookTextureConfiguration; +import fr.robie.craftengineconverter.api.configuration.bedrock.texture.TextureData; +import fr.robie.craftengineconverter.api.manager.FileCacheManager; +import fr.robie.craftengineconverter.converter.bedrock.animation.BedrockAnimation; +import fr.robie.craftengineconverter.converter.bedrock.animation.BedrockAnimationController; +import fr.robie.craftengineconverter.converter.bedrock.animation.BedrockRenderControllers; +import fr.robie.craftengineconverter.converter.bedrock.attachable.BedrockAttachableContext; +import fr.robie.craftengineconverter.converter.bedrock.block.BedrockBlockMapper; +import fr.robie.craftengineconverter.converter.bedrock.geometry.BedrockGeometry; +import fr.robie.craftengineconverter.converter.bedrock.geometry.GeometryMapper; +import fr.robie.craftengineconverter.converter.bedrock.geometry.JavaBlockModel; +import fr.robie.craftengineconverter.converter.bedrock.sound.SoundMapper; +import fr.robie.craftengineconverter.converter.bedrock.texture.CachedTextureInfo; +import fr.robie.craftengineconverter.converter.bedrock.texture.TexturePipeline; +import org.bukkit.Material; + +import java.io.File; +import java.nio.file.Path; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; + +public class ConversionContext { + private final MappingsConfiguration mappings = new MappingsConfiguration(); + private final ItemTextureConfiguration texturesConfig = new ItemTextureConfiguration(); + private final ItemTextureConfiguration terrainTexturesConfig = new ItemTextureConfiguration(); + private final FlipbookTextureConfiguration flipbookConfig = new FlipbookTextureConfiguration(); + private final BlockMappingConfiguration blockMappings = new BlockMappingConfiguration(); + private final TexturePipeline texturePipeline = new TexturePipeline(); + private final Map collectedGeometry = new HashMap<>(); + private final Map collectedAttachables = new HashMap<>(); + private final Map renderControllers = new HashMap<>(); + private final Map animations = new HashMap<>(); + private final Map animationControllers = new HashMap<>(); + private final SoundMapper soundMapper = new SoundMapper(); + private ManifestConfiguration manifest; + private final Path customMappingsDir; + private final Path texturesDir; + private final Path packDir; + private Path javaAssetsDir; + + public ConversionContext(Path customMappingsDir, Path texturesDir, Path packDir) { + this.customMappingsDir = customMappingsDir; + this.texturesDir = texturesDir; + this.packDir = packDir; + this.manifest = new ManifestConfiguration("CraftEngineConverter Pack") + .setPackDescription("Generated by CraftEngineConverter") + .setPackUUID(java.util.UUID.randomUUID()) + .setPackVersion(1, 0, 0) + .setMinEngineVersion(1, 21, 0); + this.texturesConfig.setResourcePackName("CraftEngineConverter") + .setTextureName("atlas.items"); + this.terrainTexturesConfig.setResourcePackName("CraftEngineConverter") + .setTextureName("atlas.terrain") + .setFileName("terrain_texture.json"); + } + + public ConversionContext withJavaAssetsDir(Path javaAssetsDir) { + this.javaAssetsDir = javaAssetsDir; + return this; + } + + public ConversionContext withManifest(ManifestConfiguration manifest) { + if (manifest != null) this.manifest = manifest; + return this; + } + + public ManifestConfiguration getManifest() { + return this.manifest; + } + + public MappingsConfiguration mappings() { + return this.mappings; + } + + public ItemTextureConfiguration textures() { + return this.texturesConfig; + } + + public ItemTextureConfiguration terrainTextures() { + return this.terrainTexturesConfig; + } + + public TexturePipeline texturePipeline() { + return this.texturePipeline; + } + + public Path customMappingsDir() { + return this.customMappingsDir; + } + + public Path texturesDir() { + return this.texturesDir; + } + + public Path packDir() { + return this.packDir; + } + + public Path javaAssetsDir() { + return this.javaAssetsDir; + } + + public Map collectedGeometry() { + return this.collectedGeometry; + } + + public Map collectedAttachables() { + return this.collectedAttachables; + } + + public void acceptMapping(ItemMapping mapping) { + if (mapping == null) return; + + if (mapping instanceof GroupDefinitionMapping newGroup && newGroup.getModel() != null) { + String model = newGroup.getModel(); + Material mat = mapping.getJavaMaterial(); + List existing = this.mappings.getMappings(mat); + if (existing != null) { + for (ItemMapping existingMapping : existing) { + if (existingMapping instanceof GroupDefinitionMapping existingGroup + && model.equals(existingGroup.getModel()) + && existingMapping != mapping) { + for (ItemMapping def : newGroup.getDefinitions()) { + existingGroup.addDefinition(def); + } + return; + } + } + } + } else if (mapping instanceof ItemModelItemMapping single && single.getBedrockModelPath() != null) { + String model = single.getBedrockModelPath(); + Material mat = mapping.getJavaMaterial(); + List existing = this.mappings.getMappings(mat); + if (existing != null) { + for (ItemMapping existingMapping : existing) { + if (existingMapping instanceof GroupDefinitionMapping existingGroup + && model.equals(existingGroup.getModel())) { + existingGroup.addDefinition(single); + return; + } + } + for (ItemMapping existingMapping : existing) { + if (existingMapping instanceof ItemModelItemMapping existingSingle + && existingSingle != mapping + && model.equals(existingSingle.getBedrockModelPath())) { + GroupDefinitionMapping group = new GroupDefinitionMapping(mat, existingSingle.getBedrockIdentifier()); + group.setModel(model); + group.addDefinition(existingSingle); + group.addDefinition(single); + this.mappings.replaceItemMapping(mat, existingMapping, group); + return; + } + } + } + } + + this.mappings.addItemMapping(mapping); + + if (!mapping.getTexturesData().isEmpty()) { + TextureData firstTd = mapping.getTexturesData().getFirst(); + if (!firstTd.getTextures().isEmpty()) { + String firstTex = firstTd.getTextures().getFirst(); + String iconTex; + if (firstTex.matches(".*_\\d+$")) { + iconTex = firstTex.replaceAll("_\\d+$", "_icon"); + } else { + iconTex = firstTex + "_icon"; + } + + String iconId = mapping.getBedrockIdentifier() + "_icon"; + TextureData iconTd = new TextureData(iconId); + iconTd.addTexture(iconTex); + this.texturesConfig.addTextureData(iconTd); + + try { + Path srcPng = this.texturesDir.resolve(firstTex.substring("textures/".length()) + ".png"); + Path dstPng = this.texturesDir.resolve(iconTex.substring("textures/".length()) + ".png"); + java.nio.file.Files.createDirectories(dstPng.getParent()); + java.nio.file.Files.copy(srcPng, dstPng, java.nio.file.StandardCopyOption.REPLACE_EXISTING); + } catch (Exception e) { + fr.robie.messageflow.logger.Logger.warn("Could not copy icon texture: " + e.getMessage()); + } + + BedrockOptions opts = mapping.getBedrockOptions(); + if (opts == null) { + opts = new BedrockOptions(); + } + opts.setIcon(iconTd.getBedrockIdentifier()); + mapping.setBedrockOptions(opts); + } + } + } + + public void registerRenderController(String key, BedrockRenderControllers rc) { + if (!rc.isEmpty()) { + this.renderControllers.put(key, rc); + } + } + + public void registerAnimation(String key, BedrockAnimation anim) { + if (!anim.isEmpty()) { + this.animations.put(key, anim); + } + } + + public void registerAnimationController(String key, BedrockAnimationController ac) { + if (!ac.isEmpty()) { + this.animationControllers.put(key, ac); + } + } + + public void registerAttachable(String bedrockKey, BedrockAttachableContext ctx) { + if (!ctx.isEmpty()) { + this.collectedAttachables.put(bedrockKey, ctx); + } + } + + public BlockMappingConfiguration blockMappings() { + return this.blockMappings; + } + + public void convertSoundDefinitions(File javaSoundsJson, String namespace) { + if (this.javaAssetsDir == null) return; + fr.robie.craftengineconverter.api.manager.FileCacheManager.getJsonCache() + .getData(javaSoundsJson.toPath()) + .ifPresent(root -> this.soundMapper.addFromJavaSounds( + root, namespace, this.javaAssetsDir, this.packDir.resolve("sounds"))); + } + + public void convertBlocks() { + if (this.javaAssetsDir == null) return; + BedrockBlockMapper mapper = new BedrockBlockMapper(this.javaAssetsDir); + mapper.mapAllBlocks(); + BlockMappingConfiguration result = mapper.result(); + if (!result.isEmpty()) { + for (var entry : result.entries().entrySet()) { + this.blockMappings.mapBlock(entry.getKey(), entry.getValue()); + } + fr.robie.messageflow.logger.Logger.info("Mapped " + result.size() + " block states"); + } + } + + public void registerTextureData(String modelPath, String bedrockKey) { + this.registerTextureDataInternal(modelPath, bedrockKey, this.texturesConfig); + } + + public void copyTexture(String modelPath, String bedrockKey) { + if (this.javaAssetsDir == null) return; + Optional resolved = this.texturePipeline.resolveTexture(modelPath, bedrockKey, this.javaAssetsDir); + if (resolved.isEmpty()) { + resolved = this.tryResolveTextureFromModel(modelPath, bedrockKey); + } + resolved.ifPresent(info -> this.texturePipeline.copyTexture(info, this.texturesDir)); + } + + public void registerTextureDataAsTerrain(String modelPath, String bedrockKey) { + this.registerTextureDataInternal(modelPath, bedrockKey, this.terrainTexturesConfig); + } + + private void registerTextureDataInternal(String modelPath, String bedrockKey, ItemTextureConfiguration targetConfig) { + if (this.javaAssetsDir == null) return; + Optional resolved = this.texturePipeline.resolveTexture(modelPath, bedrockKey, this.javaAssetsDir); + if (resolved.isEmpty()) { + resolved = this.tryResolveTextureFromModel(modelPath, bedrockKey); + } + resolved.ifPresent(info -> { + this.texturePipeline.copyTexture(info, this.texturesDir); + TextureData td = this.texturePipeline.toTextureData(info); + targetConfig.addTextureData(td); + }); + } + + private Optional tryResolveTextureFromModel(String modelPath, String bedrockKey) { + try { + String[] parts = modelPath.split(":", 2); + String ns = parts.length > 1 ? parts[0] : "minecraft"; + String path = parts.length > 1 ? parts[1] : parts[0]; + Path modelFile = this.javaAssetsDir.resolve(ns + "/models/" + path + ".json"); + if (!modelFile.toFile().exists()) return Optional.empty(); + + JavaBlockModel model = JavaBlockModel.load(modelFile); + this.resolveParentTextures(model, new java.util.HashSet<>()); + + for (var tex : model.textures().values()) { + if (tex.startsWith("#") || tex.startsWith("minecraft:")) continue; + String fallbackModelPath = ns + ":" + tex; + Optional result = this.texturePipeline.resolveTexture(fallbackModelPath, bedrockKey, this.javaAssetsDir); + if (result.isPresent()) return result; + } + } catch (Exception e) { + fr.robie.messageflow.logger.Logger.warn("Failed to resolve texture from model for " + modelPath); + } + return Optional.empty(); + } + + private void resolveParentTextures(JavaBlockModel model, java.util.Set visited) { + if (model.parent().isEmpty() || !visited.add(model.parent().get())) return; + String parentPath = model.parent().get(); + String[] pParts = parentPath.split(":", 2); + String pNs = pParts.length > 1 ? pParts[0] : "minecraft"; + String pPath = pParts.length > 1 ? pParts[1] : pParts[0]; + Path parentFile = this.javaAssetsDir.resolve(pNs + "/models/" + pPath + ".json"); + if (!parentFile.toFile().exists()) return; + + try { + JavaBlockModel parent = JavaBlockModel.load(parentFile); + this.resolveParentTextures(parent, visited); + // Inherit unresolved textures from parent + for (var entry : parent.textures().entrySet()) { + if (!model.textures().containsKey(entry.getKey())) { + String val = entry.getValue(); + if (val.startsWith("#") && model.textures().containsKey(val.substring(1))) { + model.textures().put(entry.getKey(), model.textures().get(val.substring(1))); + } else { + model.textures().put(entry.getKey(), val); + } + } + } + } catch (Exception ignored) {} + } + + public void registerGeometry(String modelPath, String bedrockKey, int texW, int texH) { + if (this.javaAssetsDir == null) return; + String[] parts = modelPath.split(":", 2); + String namespace = parts.length > 1 ? parts[0] : "minecraft"; + String path = parts.length > 1 ? parts[1] : parts[0]; + Path modelFile = this.javaAssetsDir.resolve(namespace + "/models/" + path + ".json"); + if (!modelFile.toFile().exists()) return; + + try { + JavaBlockModel javaModel = JavaBlockModel.load(modelFile); + GeometryMapper mapper = new GeometryMapper(); + String safeKey = bedrockKey.replace(":", ".").replace("/", "_"); + BedrockGeometry geo = mapper.mapGeometry(safeKey, javaModel, texW, texH); + this.collectedGeometry.put(bedrockKey, geo); + } catch (Exception e) { + fr.robie.messageflow.logger.Logger.error("Failed to map geometry for " + modelPath, e); + } + } + + public void saveAll() { + this.mappings.saveMappings(this.customMappingsDir); + this.texturesConfig.save(this.texturesDir); + if (!this.terrainTexturesConfig.isEmpty()) { + this.terrainTexturesConfig.save(this.texturesDir); + } + if (!this.flipbookConfig.isEmpty()) { + this.flipbookConfig.save(this.texturesDir); + } + this.blockMappings.save(this.customMappingsDir); + + if (!this.soundMapper.isEmpty()) { + try { + Path soundDefPath = this.packDir.resolve("sounds/sound_definitions.json"); + java.nio.file.Files.createDirectories(soundDefPath.getParent()); + fr.robie.craftengineconverter.api.manager.FileCacheManager.saveJsonToFile(soundDefPath, this.soundMapper.serialize()); + fr.robie.messageflow.logger.Logger.info("Saved " + this.soundMapper.size() + " sound definitions"); + } catch (Exception e) { + fr.robie.messageflow.logger.Logger.error("Failed to save sound definitions", e); + } + } + + if (this.manifest != null) { + this.manifest.saveManifest(this.packDir); + } + + Path geoDir = this.packDir.resolve("models/entity"); + for (Map.Entry entry : this.collectedGeometry.entrySet()) { + try { + java.nio.file.Files.createDirectories(geoDir); + JsonObject json = entry.getValue().serialize(); + String fileName = "geometry." + entry.getKey().replace(":", ".") + ".geo.json"; + Path outPath = geoDir.resolve(fileName); + FileCacheManager.saveJsonToFile(outPath, json); + } catch (Exception e) { + fr.robie.messageflow.logger.Logger.error("Failed to save geometry for " + entry.getKey(), e); + } + } + + Path animDir = this.packDir.resolve("animations"); + for (Map.Entry entry : this.animations.entrySet()) { + if (!entry.getValue().isEmpty()) { + try { + java.nio.file.Files.createDirectories(animDir); + JsonObject json = entry.getValue().serialize(); + String fileName = entry.getKey().replace(":", ".").replace("/", "_") + ".animation.json"; + Path outPath = animDir.resolve(fileName); + FileCacheManager.saveJsonToFile(outPath, json); + } catch (Exception e) { + fr.robie.messageflow.logger.Logger.error("Failed to save animation for " + entry.getKey(), e); + } + } + } + + Path acDir = this.packDir.resolve("animation_controllers"); + for (Map.Entry entry : this.animationControllers.entrySet()) { + if (!entry.getValue().isEmpty()) { + try { + java.nio.file.Files.createDirectories(acDir); + JsonObject json = entry.getValue().serialize(); + String fileName = entry.getKey().replace(":", ".").replace("/", "_") + ".animation_controllers.json"; + Path outPath = acDir.resolve(fileName); + FileCacheManager.saveJsonToFile(outPath, json); + } catch (Exception e) { + fr.robie.messageflow.logger.Logger.error("Failed to save animation controller for " + entry.getKey(), e); + } + } + } + + Path rcDir = this.packDir.resolve("render_controllers"); + for (Map.Entry entry : this.renderControllers.entrySet()) { + if (!entry.getValue().isEmpty()) { + try { + java.nio.file.Files.createDirectories(rcDir); + JsonObject json = entry.getValue().serialize(); + String fileName = entry.getKey().replace(":", ".").replace("/", "_") + ".render_controllers.json"; + Path outPath = rcDir.resolve(fileName); + FileCacheManager.saveJsonToFile(outPath, json); + } catch (Exception e) { + fr.robie.messageflow.logger.Logger.error("Failed to save render controllers for " + entry.getKey(), e); + } + } + } + + Path attachDir = this.packDir.resolve("attachables"); + for (Map.Entry entry : this.collectedAttachables.entrySet()) { + if (entry.getValue() instanceof BedrockAttachableContext actx) { + actx.attachable().ifPresent(att -> { + try { + java.nio.file.Files.createDirectories(attachDir); + JsonObject json = att.serialize(); + String fileName = entry.getKey().replace(":", ".").replace("/", "_") + ".json"; + Path outPath = attachDir.resolve(fileName); + FileCacheManager.saveJsonToFile(outPath, json); + } catch (Exception e) { + fr.robie.messageflow.logger.Logger.error("Failed to save attachable for " + entry.getKey(), e); + } + }); + } + } + } + + private static void writeDefaultPackIcon(java.nio.file.Path dest) throws java.io.IOException { + java.awt.image.BufferedImage img = new java.awt.image.BufferedImage(256, 256, java.awt.image.BufferedImage.TYPE_INT_ARGB); + java.awt.Graphics2D g = img.createGraphics(); + g.setColor(new java.awt.Color(66, 135, 245)); + g.fillRect(0, 0, 256, 256); + g.setColor(java.awt.Color.WHITE); + g.setFont(g.getFont().deriveFont(java.awt.Font.BOLD, 48)); + String label = "CEC"; + java.awt.FontMetrics fm = g.getFontMetrics(); + int x = (256 - fm.stringWidth(label)) / 2; + int y = ((256 - fm.getHeight()) / 2) + fm.getAscent(); + g.drawString(label, x, y); + g.dispose(); + javax.imageio.ImageIO.write(img, "PNG", dest.toFile()); + } +} diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/LanguageConverter.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/LanguageConverter.java new file mode 100644 index 00000000..9bc86602 --- /dev/null +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/LanguageConverter.java @@ -0,0 +1,96 @@ +package fr.robie.craftengineconverter.converter.bedrock; + +import com.google.gson.Gson; +import fr.robie.messageflow.logger.Logger; + +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.HashMap; +import java.util.Map; +import java.util.stream.Stream; + +public final class LanguageConverter { + + private static final Gson GSON = new Gson(); + + private LanguageConverter() {} + + public static void convertLanguages(Path javaAssetsDir, Path packDir) { + if (javaAssetsDir == null || !Files.isDirectory(javaAssetsDir)) return; + + Path langDir = packDir.resolve("texts"); + Map> combined = new HashMap<>(); + + try (Stream namespaceDirs = Files.list(javaAssetsDir)) { + namespaceDirs.filter(Files::isDirectory).forEach(ns -> { + Path langFolder = ns.resolve("lang"); + if (!Files.isDirectory(langFolder)) return; + try (Stream langFiles = Files.list(langFolder)) { + langFiles.filter(f -> f.toString().endsWith(".json")).forEach(jsonFile -> { + String locale = toLocale(jsonFile); + Map entries = readLanguageFile(jsonFile); + combined.merge(locale, entries, (a, b) -> { a.putAll(b); return a; }); + }); + } catch (IOException e) { + Logger.error("Failed to list lang files in " + langFolder, e); + } + }); + } catch (IOException e) { + Logger.error("Failed to list namespace directories in " + javaAssetsDir, e); + } + + if (combined.isEmpty()) return; + + try { + Files.createDirectories(langDir); + } catch (IOException e) { + Logger.error("Failed to create texts directory", e); + return; + } + + for (Map.Entry> entry : combined.entrySet()) { + String locale = entry.getKey(); + Map entries = entry.getValue(); + Path outFile = langDir.resolve(locale + ".lang"); + try { + StringBuilder sb = new StringBuilder(); + for (Map.Entry langEntry : entries.entrySet()) { + String value = langEntry.getValue().replace("\n", "\\n").replace("\r", "\\r"); + sb.append(langEntry.getKey()).append('=').append(value).append('\n'); + } + Files.writeString(outFile, sb.toString(), StandardCharsets.UTF_8); + Logger.info("Exported language " + locale + " with " + entries.size() + " keys"); + } catch (IOException e) { + Logger.error("Failed to write language file " + outFile, e); + } + } + } + + private static String toLocale(Path jsonFile) { + String name = jsonFile.getFileName().toString(); + if (name.endsWith(".json")) name = name.substring(0, name.length() - 5); + return name; + } + + @SuppressWarnings("unchecked") + private static Map readLanguageFile(Path path) { + try { + String content = Files.readString(path, StandardCharsets.UTF_8); + Object parsed = GSON.fromJson(content, Object.class); + if (parsed instanceof Map raw) { + Map result = new HashMap<>(); + for (Map.Entry e : raw.entrySet()) { + String key = e.getKey() != null ? e.getKey().toString() : null; + String value = e.getValue() != null ? e.getValue().toString() : null; + if (key != null && value != null) result.put(key, value); + } + return result; + } + } catch (Exception e) { + Logger.error("Failed to read language file " + path, e); + } + return new HashMap<>(); + } +} diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/animation/AnimationMapper.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/animation/AnimationMapper.java new file mode 100644 index 00000000..76aa4fc1 --- /dev/null +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/animation/AnimationMapper.java @@ -0,0 +1,133 @@ +package fr.robie.craftengineconverter.converter.bedrock.animation; + +public class AnimationMapper { + private static final float[] TOOL_FP_POS = {0f, 8f, 12f}; + private static final float[] TOOL_FP_ROT = {25.7519f, 13.8142f, 188.2874f}; + private static final float[] TOOL_FP_SCALE = {1f, 1f, 1f}; + + private static final float[] TOOL_TP_POS = {-0.0f, 13.0f, -6.0f}; + private static final float[] TOOL_TP_ROT = {90.0f, -55.0f + 90f, 90.0f}; + private static final float[] TOOL_TP_SCALE = {0.85f, 0.85f, 0.85f}; + + private static final float[] TOOL_H_POS = {0.0f, 28.515f, 4.585f}; + private static final float[] TOOL_H_ROT = {-0.0f, -180.0f, 0.0f}; + private static final float[] TOOL_H_SCALE = {0.655f, 0.655f, 0.655f}; + + public static BedrockAnimationContext mapDisplayTransforms(String identifier, String bone, + float[] firstPersonRot, float[] firstPersonPos, float[] firstPersonScale, + float[] thirdPersonRot, float[] thirdPersonPos, float[] thirdPersonScale, + float[] headRot, float[] headPos, float[] headScale) { + float[] fpRot = convertFirstPersonRotation(firstPersonRot); + float[] fpPos = convertFirstPersonPosition(firstPersonPos); + float[] fpScale = firstPersonScale; + + float[] tpRot = convertThirdPersonRotation(thirdPersonRot); + float[] tpPos = convertThirdPersonPosition(thirdPersonPos); + float[] tpScale = thirdPersonScale; + + float[] hRot = convertHeadRotation(headRot); + float[] hPos = convertHeadPosition(headPos); + float[] hScale = headScale; + + String safeId = identifier.replace(":", ".").replace("/", "_"); + + BedrockAnimation anim = new BedrockAnimation() + .withAnimation("animation." + safeId + ".hold_first_person", BedrockAnimation.boneAnimation(fpPos, fpRot, fpScale)) + .withAnimation("animation." + safeId + ".hold_third_person", BedrockAnimation.boneAnimation(tpPos, tpRot, tpScale)) + .withAnimation("animation." + safeId + ".head", BedrockAnimation.boneAnimation(hPos, hRot, hScale)); + + return new BedrockAnimationContext( + anim, + "animation." + safeId + ".hold_first_person", + "animation." + safeId + ".hold_third_person", + "animation." + safeId + ".head" + ); + } + + public static BedrockAnimationContext createDefaultAnimations(String identifier, String bone) { + return createAnimations(identifier, bone, + new float[]{-3.2f, 13.63f, 1.13f}, + new float[]{-180.0f, -25.0f, 0.0f}, + new float[]{0.68f, 0.68f, 0.68f}, + new float[]{-0.0f, 13.0f, -4.0f}, + new float[]{90.0f, -55.0f, 90.0f}, + new float[]{0.85f, 0.85f, 0.85f}, + new float[]{0.0f, 28.515f, 4.585f}, + new float[]{-0.0f, -180.0f, 0.0f}, + new float[]{0.655f, 0.655f, 0.655f}); + } + + public static BedrockAnimationContext createToolAnimations(String identifier, String bone) { + return createAnimations(identifier, bone, + TOOL_FP_POS, TOOL_FP_ROT, TOOL_FP_SCALE, + TOOL_TP_POS, TOOL_TP_ROT, TOOL_TP_SCALE, + TOOL_H_POS, TOOL_H_ROT, TOOL_H_SCALE); + } + + private static BedrockAnimationContext createAnimations(String identifier, String bone, + float[] fpPos, float[] fpRot, float[] fpScale, + float[] tpPos, float[] tpRot, float[] tpScale, + float[] hPos, float[] hRot, float[] hScale) { + String safeId = identifier.replace(":", ".").replace("/", "_"); + + BedrockAnimation anim = new BedrockAnimation() + .withAnimation("animation." + safeId + ".hold_first_person", BedrockAnimation.boneAnimation(fpPos, fpRot, fpScale)) + .withAnimation("animation." + safeId + ".hold_third_person", BedrockAnimation.boneAnimation(tpPos, tpRot, tpScale)) + .withAnimation("animation." + safeId + ".head", BedrockAnimation.boneAnimation(hPos, hRot, hScale)); + + return new BedrockAnimationContext( + anim, + "animation." + safeId + ".hold_first_person", + "animation." + safeId + ".hold_third_person", + "animation." + safeId + ".head" + ); + } + + static float[] convertFirstPersonRotation(float[] javaRot) { + return new float[]{ + -90.0F + javaRot[1], + -javaRot[2], + javaRot[0] + }; + } + + static float[] convertFirstPersonPosition(float[] javaTrans) { + return new float[]{ + -javaTrans[1] / 0.0625F, + 12.5F + javaTrans[2] / 0.0625F, + javaTrans[0] / 0.0625F + }; + } + + static float[] convertThirdPersonRotation(float[] javaRot) { + return new float[]{ + 90.0F, + -javaRot[2], + -javaRot[1] + }; + } + + static float[] convertThirdPersonPosition(float[] javaTrans) { + return new float[]{ + -javaTrans[0] / 0.0625F, + 12.5F + javaTrans[2] / 0.0625F, + -javaTrans[1] / 0.0625F + }; + } + + static float[] convertHeadRotation(float[] javaRot) { + return new float[]{ + -javaRot[0], + -javaRot[1], + javaRot[2] + }; + } + + static float[] convertHeadPosition(float[] javaTrans) { + return new float[]{ + -javaTrans[0] / 0.0625F * 0.655F, + 20.0F + javaTrans[1] / 0.0625F * 0.655F, + javaTrans[2] / 0.0625F * 0.655F + }; + } +} diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/animation/BedrockAnimation.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/animation/BedrockAnimation.java new file mode 100644 index 00000000..8dd5cae6 --- /dev/null +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/animation/BedrockAnimation.java @@ -0,0 +1,59 @@ +package fr.robie.craftengineconverter.converter.bedrock.animation; + +import com.google.gson.JsonArray; +import com.google.gson.JsonObject; + +import java.util.LinkedHashMap; +import java.util.Map; + +public class BedrockAnimation { + private final Map animations = new LinkedHashMap<>(); + + public BedrockAnimation withAnimation(String name, JsonObject anim) { + this.animations.put(name, anim); + return this; + } + + public JsonObject serialize() { + JsonObject root = new JsonObject(); + root.addProperty("format_version", "1.8.0"); + JsonObject anims = new JsonObject(); + for (Map.Entry e : this.animations.entrySet()) { + anims.add(e.getKey(), e.getValue()); + } + root.add("animations", anims); + return root; + } + + public boolean isEmpty() { + return this.animations.isEmpty(); + } + + public static JsonObject boneAnimation(float[] pos, float[] rot, float[] scale) { + JsonObject anim = new JsonObject(); + anim.addProperty("loop", true); + + JsonObject bone = new JsonObject(); + JsonObject boneAnim = new JsonObject(); + + if (pos[0] != 0 || pos[1] != 0 || pos[2] != 0) { + boneAnim.add("position", toJsonArray(pos[0], pos[1], pos[2])); + } + if (rot[0] != 0 || rot[1] != 0 || rot[2] != 0) { + boneAnim.add("rotation", toJsonArray(rot[0], rot[1], rot[2])); + } + if (scale[0] != 1 || scale[1] != 1 || scale[2] != 1) { + boneAnim.add("scale", toJsonArray(scale[0], scale[1], scale[2])); + } + + bone.add("bone", boneAnim); + anim.add("bones", bone); + return anim; + } + + private static JsonArray toJsonArray(float... values) { + JsonArray arr = new JsonArray(); + for (float v : values) arr.add(v); + return arr; + } +} diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/animation/BedrockAnimationContext.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/animation/BedrockAnimationContext.java new file mode 100644 index 00000000..e7b4b5d7 --- /dev/null +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/animation/BedrockAnimationContext.java @@ -0,0 +1,50 @@ +package fr.robie.craftengineconverter.converter.bedrock.animation; + +import java.util.Optional; + +public class BedrockAnimationContext { + private final Optional animation; + private final String firstPersonAnimation; + private final String thirdPersonAnimation; + private final String headAnimation; + + public BedrockAnimationContext(BedrockAnimation animation, String firstPerson, String thirdPerson, String head) { + this.animation = Optional.of(animation); + this.firstPersonAnimation = firstPerson; + this.thirdPersonAnimation = thirdPerson; + this.headAnimation = head; + } + + public static final BedrockAnimationContext EMPTY = new BedrockAnimationContext(); + + private BedrockAnimationContext() { + this.animation = Optional.empty(); + this.firstPersonAnimation = null; + this.thirdPersonAnimation = null; + this.headAnimation = null; + } + + public Optional animation() { + return this.animation; + } + + public String firstPersonAnimation() { + return this.firstPersonAnimation; + } + + public String thirdPersonAnimation() { + return this.thirdPersonAnimation; + } + + public String headAnimation() { + return this.headAnimation; + } + + public boolean isEmpty() { + return this.animation.isEmpty(); + } + + public static BedrockAnimationContext empty() { + return EMPTY; + } +} diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/animation/BedrockAnimationController.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/animation/BedrockAnimationController.java new file mode 100644 index 00000000..edc4d558 --- /dev/null +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/animation/BedrockAnimationController.java @@ -0,0 +1,63 @@ +package fr.robie.craftengineconverter.converter.bedrock.animation; + +import com.google.gson.JsonArray; +import com.google.gson.JsonObject; + +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +public class BedrockAnimationController { + private final Map controllers = new LinkedHashMap<>(); + + public BedrockAnimationController withController(String name, JsonObject controller) { + this.controllers.put(name, controller); + return this; + } + + public JsonObject serialize() { + JsonObject root = new JsonObject(); + root.addProperty("format_version", "1.10.0"); + JsonObject ctrl = new JsonObject(); + for (Map.Entry e : this.controllers.entrySet()) { + ctrl.add(e.getKey(), e.getValue()); + } + root.add("animation_controllers", ctrl); + return root; + } + + public boolean isEmpty() { + return this.controllers.isEmpty(); + } + + public static BedrockAnimationController animatedFrameCycle( + String identifier, int frameCount, List frameTimes, int defaultTickTime) { + String safeName = identifier.replace(":", ".").replace("/", "_"); + String controllerName = "controller.animation." + safeName + "_frame_cycle"; + + JsonObject controller = new JsonObject(); + controller.addProperty("initial_state", "frame_0"); + + JsonObject states = new JsonObject(); + for (int i = 0; i < frameCount; i++) { + float seconds = (i < frameTimes.size() ? frameTimes.get(i) : defaultTickTime) * 0.05f; + + JsonObject state = new JsonObject(); + JsonArray rcs = new JsonArray(); + rcs.add("controller.render." + safeName + "_frame_" + i); + state.add("render_controllers", rcs); + + int nextState = (i + 1) % frameCount; + JsonArray transitions = new JsonArray(); + JsonObject transition = new JsonObject(); + transition.addProperty("frame_" + nextState, "query.anim_time >= " + seconds); + transitions.add(transition); + state.add("transitions", transitions); + + states.add("frame_" + i, state); + } + + controller.add("states", states); + return new BedrockAnimationController().withController(controllerName, controller); + } +} \ No newline at end of file diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/animation/BedrockRenderControllers.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/animation/BedrockRenderControllers.java new file mode 100644 index 00000000..aeb7bb77 --- /dev/null +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/animation/BedrockRenderControllers.java @@ -0,0 +1,112 @@ +package fr.robie.craftengineconverter.converter.bedrock.animation; + +import com.google.gson.JsonArray; +import com.google.gson.JsonObject; + +import java.util.LinkedHashMap; +import java.util.Map; + +public class BedrockRenderControllers { + private final Map controllers = new LinkedHashMap<>(); + + public BedrockRenderControllers withController(String name, JsonObject controller) { + this.controllers.put(name, controller); + return this; + } + + public JsonObject serialize() { + JsonObject root = new JsonObject(); + root.addProperty("format_version", "1.8.0"); + JsonObject ctrl = new JsonObject(); + for (Map.Entry e : this.controllers.entrySet()) { + ctrl.add(e.getKey(), e.getValue()); + } + root.add("render_controllers", ctrl); + return root; + } + + public boolean isEmpty() { + return this.controllers.isEmpty(); + } + + public static JsonObject itemDefaultController() { + JsonObject c = new JsonObject(); + JsonArray tex = new JsonArray(); + tex.add("Texture.default"); + tex.add("Texture.enchanted"); + c.add("textures", tex); + JsonArray mats = new JsonArray(); + JsonObject mat = new JsonObject(); + mat.addProperty("*", "variable.is_enchanted ? Material.enchanted : Material.default"); + mats.add(mat); + c.add("materials", mats); + c.addProperty("geometry", "Geometry.default"); + return c; + } + + public static JsonObject animatedController(int frameCount, String texturePrefix, int entriesPerFrame) { + JsonObject c = new JsonObject(); + + int totalEntries = frameCount * entriesPerFrame; + + JsonObject arrays = new JsonObject(); + JsonObject textureArrays = new JsonObject(); + JsonArray framesArray = new JsonArray(); + for (int i = 0; i < frameCount; i++) { + for (int j = 0; j < entriesPerFrame; j++) { + framesArray.add("Texture." + texturePrefix + "_" + i); + } + } + textureArrays.add("Array.frames", framesArray); + arrays.add("textures", textureArrays); + c.add("arrays", arrays); + + JsonArray tex = new JsonArray(); + tex.add("Array.frames[math.mod(math.floor(q.life_time * 20.0), " + totalEntries + ")]"); + tex.add("Texture.enchanted"); + c.add("textures", tex); + + JsonArray mats = new JsonArray(); + JsonObject mat = new JsonObject(); + mat.addProperty("*", "variable.is_enchanted ? Material.enchanted : Material.default"); + mats.add(mat); + c.add("materials", mats); + c.addProperty("geometry", "Geometry.default"); + return c; + } + + public static JsonObject singleFrameController(int frameIndex) { + return staticController("frame_" + frameIndex); + } + + public static JsonObject staticController(String textureName) { + JsonObject c = new JsonObject(); + JsonArray tex = new JsonArray(); + tex.add("Texture." + textureName); + tex.add("Texture.enchanted"); + c.add("textures", tex); + JsonArray mats = new JsonArray(); + JsonObject mat = new JsonObject(); + mat.addProperty("*", "variable.is_enchanted ? Material.enchanted : Material.default"); + mats.add(mat); + c.add("materials", mats); + c.addProperty("geometry", "Geometry.default"); + return c; + } + + public static BedrockRenderControllers itemDefault() { + return new BedrockRenderControllers().withController("controller.render.item_default", itemDefaultController()); + } + + public static BedrockRenderControllers animated(String identifier, int frameCount) { + return animated(identifier, frameCount, 10); + } + + public static BedrockRenderControllers animated(String identifier, int frameCount, int entriesPerFrame) { + String safeName = identifier.replace(":", ".").replace("/", "_"); + return new BedrockRenderControllers().withController( + "controller.render." + safeName, + animatedController(frameCount, "frame", entriesPerFrame) + ); + } +} diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/attachable/BedrockAttachable.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/attachable/BedrockAttachable.java new file mode 100644 index 00000000..6aa5b508 --- /dev/null +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/attachable/BedrockAttachable.java @@ -0,0 +1,142 @@ +package fr.robie.craftengineconverter.converter.bedrock.attachable; + +import com.google.gson.JsonArray; +import com.google.gson.JsonObject; + +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +public class BedrockAttachable { + private final String identifier; + private final Map materials = new LinkedHashMap<>(); + private final Map textures = new LinkedHashMap<>(); + private final Map geometries = new LinkedHashMap<>(); + private final Map animations = new LinkedHashMap<>(); + private final Map scripts = new LinkedHashMap<>(); + private final List renderControllers = new ArrayList<>(); + + public BedrockAttachable(String identifier) { + this.identifier = identifier; + } + + public BedrockAttachable withMaterial(String slot, String material) { + this.materials.put(slot, material); return this; + } + + public BedrockAttachable withTexture(String slot, String texture) { + this.textures.put(slot, texture); return this; + } + + public BedrockAttachable withGeometry(String slot, String geometry) { + this.geometries.put(slot, geometry); return this; + } + + public BedrockAttachable withAnimation(String key, String animation) { + this.animations.put(key, animation); return this; + } + + public BedrockAttachable withScript(String key, Object script) { + this.scripts.put(key, script); return this; + } + + public BedrockAttachable withRenderController(String controller) { + this.renderControllers.add(controller); return this; + } + + public JsonObject serialize() { + JsonObject root = new JsonObject(); + root.addProperty("format_version", "1.21.0"); + + JsonObject attachable = new JsonObject(); + + JsonObject desc = new JsonObject(); + desc.addProperty("identifier", this.identifier); + + JsonObject mats = new JsonObject(); + for (Map.Entry e : this.materials.entrySet()) { + mats.addProperty(e.getKey(), e.getValue()); + } + desc.add("materials", mats); + + JsonObject tex = new JsonObject(); + for (Map.Entry e : this.textures.entrySet()) { + tex.addProperty(e.getKey(), e.getValue()); + } + desc.add("textures", tex); + + JsonObject geo = new JsonObject(); + for (Map.Entry e : this.geometries.entrySet()) { + geo.addProperty(e.getKey(), e.getValue()); + } + desc.add("geometry", geo); + + if (!this.animations.isEmpty()) { + JsonObject anim = new JsonObject(); + for (Map.Entry e : this.animations.entrySet()) { + anim.addProperty(e.getKey(), e.getValue()); + } + desc.add("animations", anim); + } + + if (!this.scripts.isEmpty()) { + JsonObject scr = new JsonObject(); + for (Map.Entry e : this.scripts.entrySet()) { + if (e.getValue() instanceof List) { + JsonArray arr = new JsonArray(); + for (Object item : (List) e.getValue()) { + if (item instanceof Map) { + JsonObject cond = new JsonObject(); + for (Map.Entry condEntry : ((Map) item).entrySet()) { + cond.addProperty(condEntry.getKey().toString(), condEntry.getValue().toString()); + } + arr.add(cond); + } else { + arr.add(item.toString()); + } + } + scr.add(e.getKey(), arr); + } else { + scr.addProperty(e.getKey(), e.getValue().toString()); + } + } + desc.add("scripts", scr); + } + + if (!this.renderControllers.isEmpty()) { + JsonArray rc = new JsonArray(); + for (String r : this.renderControllers) rc.add(r); + desc.add("render_controllers", rc); + } + + attachable.add("description", desc); + root.add("minecraft:attachable", attachable); + return root; + } + + public static BedrockAttachable equipment(String identifier) { + BedrockAttachable a = new BedrockAttachable(identifier); + a.withMaterial("default", "armor"); + a.withMaterial("enchanted", "armor_enchanted"); + a.withTexture("enchanted", "textures/misc/enchanted_actor_glint"); + a.withRenderController("controller.armor"); + return a; + } + + public static BedrockAttachable geometry(String identifier, String geometryId) { + return geometry(identifier, geometryId, null); + } + + public static BedrockAttachable geometry(String identifier, String geometryId, String defaultTexture) { + BedrockAttachable a = new BedrockAttachable(identifier); + a.withMaterial("default", "entity_alphatest"); + a.withMaterial("enchanted", "entity_alphatest_glint"); + if (defaultTexture != null) { + a.withTexture("default", defaultTexture); + } + a.withTexture("enchanted", "textures/misc/enchanted_item_glint"); + a.withGeometry("default", geometryId); + return a; + } +} diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/attachable/BedrockAttachableContext.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/attachable/BedrockAttachableContext.java new file mode 100644 index 00000000..c69ca5ab --- /dev/null +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/attachable/BedrockAttachableContext.java @@ -0,0 +1,119 @@ +package fr.robie.craftengineconverter.converter.bedrock.attachable; + +import fr.robie.craftengineconverter.converter.bedrock.animation.BedrockAnimationContext; + +import java.util.List; +import java.util.Map; +import java.util.Optional; + +public record BedrockAttachableContext(Optional attachable, Optional equipmentTexture) { + public static final BedrockAttachableContext EMPTY = new BedrockAttachableContext(Optional.empty(), Optional.empty()); + + public BedrockAttachableContext(BedrockAttachable attachable) { + this(Optional.of(attachable), Optional.empty()); + } + + public boolean isEmpty() { + return this.attachable.isEmpty(); + } + + public static BedrockAttachableContext create(String identifier, boolean hasGeometry, boolean hasAnimatedTexture) { + return create(identifier, hasGeometry, hasAnimatedTexture, null); + } + + public static BedrockAttachableContext create(String identifier, boolean hasGeometry, boolean hasAnimatedTexture, String defaultTexture) { + if (!hasGeometry && !hasAnimatedTexture) { + return EMPTY; + } + + String safeId = identifier.replace(":", ".").replace("/", "_"); + String geometryId = "geometry." + safeId; + + if (hasAnimatedTexture) { + String rcName = "controller.render." + safeId; + BedrockAttachable att = BedrockAttachable.geometry(identifier, geometryId, defaultTexture); + att.withRenderController(rcName); + return new BedrockAttachableContext(att); + } + + return new BedrockAttachableContext(BedrockAttachable.geometry(identifier, geometryId, defaultTexture)); + } + + public static BedrockAttachableContext createWithAnimations(String identifier, boolean hasGeometry, boolean hasAnimatedTexture, BedrockAnimationContext animCtx) { + return createWithAnimations(identifier, hasGeometry, hasAnimatedTexture, animCtx, null); + } + + public static BedrockAttachableContext createWithAnimations(String identifier, boolean hasGeometry, boolean hasAnimatedTexture, BedrockAnimationContext animCtx, String defaultTexture) { + BedrockAttachableContext ctx = create(identifier, hasGeometry, hasAnimatedTexture, defaultTexture); + if (!animCtx.isEmpty()) { + ctx.attachable().ifPresent(att -> { + att.withAnimation("third_person", animCtx.thirdPersonAnimation()); + att.withAnimation("first_person", animCtx.firstPersonAnimation()); + att.withAnimation("head", animCtx.headAnimation()); + att.withScript("animate", List.of( + Map.of("first_person", "context.is_first_person == 1.0 && (context.item_slot == 'main_hand' || context.item_slot == 'off_hand')"), + Map.of("third_person", "context.is_first_person == 0.0 && (context.item_slot == 'main_hand' || context.item_slot == 'off_hand')"), + Map.of("head", "context.is_first_person == 0.0 && context.item_slot == 'head'") + )); + }); + } + return ctx; + } + + public static BedrockAttachableContext createWithAnimatedTexture(String identifier, String renderControllerName) { + return createWithAnimatedTexture(identifier, renderControllerName, null); + } + + public static BedrockAttachableContext createWithAnimatedTexture(String identifier, String renderControllerName, String defaultTexture) { + String safeId = identifier.replace(":", ".").replace("/", "_"); + String geometryId = "geometry." + safeId; + + BedrockAttachable att = BedrockAttachable.geometry(identifier, geometryId, defaultTexture); + att.withRenderController(renderControllerName); + return new BedrockAttachableContext(att); + } + + public static BedrockAttachableContext createAnimated(String identifier, int frameCount, String baseTexturePath) { + String safeId = identifier.replace(":", ".").replace("/", "_"); + String geometryId = "geometry." + safeId; + + BedrockAttachable att = new BedrockAttachable(identifier); + att.withMaterial("default", "entity_alphatest"); + att.withMaterial("enchanted", "entity_alphatest_glint"); + att.withGeometry("default", geometryId); + + for (int i = 0; i < frameCount; i++) { + att.withTexture("frame_" + i, baseTexturePath + "_" + i); + } + att.withTexture("enchanted", "textures/misc/enchanted_item_glint"); + + att.withRenderController("controller.render." + safeId); + + return new BedrockAttachableContext(att); + } + + public static BedrockAttachableContext createAnimatedWithCustomRC(String identifier, int frameCount, String baseTexturePath, String rcName) { + String safeId = identifier.replace(":", ".").replace("/", "_"); + String geometryId = "geometry." + safeId; + + BedrockAttachable att = new BedrockAttachable(identifier); + att.withMaterial("default", "entity_alphatest"); + att.withMaterial("enchanted", "entity_alphatest_glint"); + att.withGeometry("default", geometryId); + + for (int i = 0; i < frameCount; i++) { + att.withTexture("frame_" + i, baseTexturePath + "_" + i); + } + att.withTexture("enchanted", "textures/misc/enchanted_item_glint"); + + att.withRenderController(rcName); + + return new BedrockAttachableContext(att); + } + + public static BedrockAttachableContext createArmor(String identifier, String equipmentTexturePath) { + BedrockAttachable att = BedrockAttachable.equipment(identifier); + att.withTexture("default", equipmentTexturePath); + return new BedrockAttachableContext(Optional.of(att), Optional.of(equipmentTexturePath)); + } +} diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/block/BedrockBlockMapper.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/block/BedrockBlockMapper.java new file mode 100644 index 00000000..903db630 --- /dev/null +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/block/BedrockBlockMapper.java @@ -0,0 +1,279 @@ +package fr.robie.craftengineconverter.converter.bedrock.block; + +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.block.BlockDefinition; +import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.block.BlockMappingConfiguration; +import fr.robie.craftengineconverter.converter.bedrock.geometry.JavaBlockModel; +import fr.robie.messageflow.logger.Logger; + +import java.io.IOException; +import java.io.Reader; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.HashMap; +import java.util.Map; +import java.util.stream.Stream; + +public class BedrockBlockMapper { + private final Path javaAssetsDir; + private final Map modelCache = new HashMap<>(); + private final Map textureResolutionCache = new HashMap<>(); + private final Map pendingBlocks = new HashMap<>(); + private final BlockMappingConfiguration output = new BlockMappingConfiguration(); + + public BedrockBlockMapper(Path javaAssetsDir) { + this.javaAssetsDir = javaAssetsDir; + } + + public void mapAllBlocks() { + Path blockstatesDir = this.javaAssetsDir.resolve("minecraft/blockstates"); + if (!Files.isDirectory(blockstatesDir)) { + blockstatesDir = this.findBlockstatesDir(); + if (blockstatesDir == null) return; + } + + try (Stream files = Files.list(blockstatesDir)) { + files.filter(f -> f.toString().endsWith(".json")).forEach(this::mapBlockstate); + } catch (IOException e) { + Logger.error("Failed to list blockstates", e); + } + + for (Map.Entry entry : this.pendingBlocks.entrySet()) { + this.output.mapBlock(entry.getKey(), entry.getValue().build()); + } + } + + private Path findBlockstatesDir() { + if (!Files.isDirectory(this.javaAssetsDir)) return null; + try (Stream nsDirs = Files.list(this.javaAssetsDir)) { + return nsDirs.filter(Files::isDirectory) + .map(ns -> ns.resolve("blockstates")) + .filter(Files::isDirectory) + .findFirst() + .orElse(null); + } catch (IOException e) { + return null; + } + } + + private void mapBlockstate(Path blockstateFile) { + String fileName = blockstateFile.getFileName().toString(); + String blockName = fileName.substring(0, fileName.length() - 5); + String bedrockName = "minecraft:" + blockName; + + try (Reader reader = Files.newBufferedReader(blockstateFile)) { + JsonObject root = com.google.gson.JsonParser.parseReader(reader).getAsJsonObject(); + + if (root.has("variants")) { + this.mapVariants(blockstateFile, blockName, bedrockName, root.getAsJsonObject("variants")); + } else if (root.has("multipart")) { + this.mapMultipart(blockstateFile, blockName, bedrockName, root.getAsJsonArray("multipart")); + } + } catch (Exception e) { + Logger.error("Failed to parse blockstate: " + blockstateFile, e); + } + } + + private void mapVariants(Path blockstateFile, String blockName, String bedrockName, JsonObject variants) { + BlockMappingConfiguration.BlockEntry.Builder entryBuilder = new BlockMappingConfiguration.BlockEntry.Builder(bedrockName); + boolean hasMultipleStates = variants.keySet().size() > 1; + + for (String stateKey : variants.keySet()) { + JsonElement varEntry = variants.get(stateKey); + BlockDefinition def = this.resolveVariantToDefinition(varEntry, blockName); + if (def == null) continue; + + if (hasMultipleStates) { + entryBuilder.onlyOverrideStates().withStateOverride(stateKey, def); + } else { + entryBuilder.withBase(def); + } + } + + this.pendingBlocks.put(bedrockName, entryBuilder); + } + + private void mapMultipart(Path blockstateFile, String blockName, String bedrockName, JsonArray multipart) { + BlockMappingConfiguration.BlockEntry.Builder entryBuilder = new BlockMappingConfiguration.BlockEntry.Builder(bedrockName); + // For multipart, use the first case's model as a base definition + for (JsonElement partElem : multipart) { + JsonObject part = partElem.getAsJsonObject(); + if (part.has("apply")) { + JsonElement apply = part.get("apply"); + BlockDefinition def = this.resolveVariantToDefinition(apply, blockName); + if (def != null) { + entryBuilder.withBase(def); + break; + } + } + } + this.pendingBlocks.put(bedrockName, entryBuilder); + } + + private BlockDefinition resolveVariantToDefinition(JsonElement varEntry, String blockName) { + String modelPath; + int rotX = 0, rotY = 0; + boolean uvLock = false; + + if (varEntry.isJsonArray()) { + JsonArray arr = varEntry.getAsJsonArray(); + if (arr.isEmpty()) return null; + JsonObject first = arr.get(0).getAsJsonObject(); + modelPath = first.get("model").getAsString(); + if (first.has("x")) rotX = first.get("x").getAsInt(); + if (first.has("y")) rotY = first.get("y").getAsInt(); + if (first.has("uvlock")) uvLock = first.get("uvlock").getAsBoolean(); + } else { + JsonObject obj = varEntry.getAsJsonObject(); + modelPath = obj.get("model").getAsString(); + if (obj.has("x")) rotX = obj.get("x").getAsInt(); + if (obj.has("y")) rotY = obj.get("y").getAsInt(); + if (obj.has("uvlock")) uvLock = obj.get("uvlock").getAsBoolean(); + } + + return this.resolveModelToDefinition(modelPath, blockName, rotX, rotY); + } + + private BlockDefinition resolveModelToDefinition(String modelPath, String blockName, int rotX, int rotY) { + try { + JavaBlockModel model = this.loadModel(modelPath); + if (model == null) return null; + + BlockDefinition.Builder builder = new BlockDefinition.Builder() + .withTransformation(new BlockDefinition.Transformation(1, 1, 1, 0, 0, 0, rotX, rotY, 0)); + + String resolvedTexture = this.resolveTexture(model, "all"); + if (resolvedTexture == null) resolvedTexture = this.resolveTexture(model, "particle"); + if (resolvedTexture == null) resolvedTexture = this.resolveTexture(model, "top"); + if (resolvedTexture == null) resolvedTexture = blockName; + + if (this.isFullBlock(model)) { + builder.withFullBlockGeometry(resolvedTexture, "opaque"); + } else if (this.isCrossModel(model)) { + builder.withCrossGeometry(resolvedTexture, "blend"); + } else if (model.elements().isEmpty()) { + builder.withFullBlockGeometry(resolvedTexture, "opaque"); + } else { + builder.withCrossGeometry(resolvedTexture, "blend"); + } + + return builder.build(); + } catch (Exception e) { + Logger.warn("Failed to resolve model " + modelPath + " for block " + blockName); + return null; + } + } + + private JavaBlockModel loadModel(String modelPath) { + if (this.modelCache.containsKey(modelPath)) { + return this.modelCache.get(modelPath); + } + + String[] parts = modelPath.split(":", 2); + String ns = parts[0]; + String path = parts.length > 1 ? parts[1] : parts[0]; + Path modelFile = this.javaAssetsDir.resolve(ns + "/models/" + path + ".json"); + if (!Files.exists(modelFile)) { + this.modelCache.put(modelPath, null); + return null; + } + + try { + JavaBlockModel model = JavaBlockModel.load(modelFile); + this.resolveParent(model); + this.modelCache.put(modelPath, model); + return model; + } catch (IOException e) { + this.modelCache.put(modelPath, null); + return null; + } + } + + private void resolveParent(JavaBlockModel model) { + if (model.parent().isEmpty()) return; + String parentPath = model.parent().get(); + if (this.modelCache.containsKey(parentPath)) { + JavaBlockModel parent = this.modelCache.get(parentPath); + if (parent == null) return; + this.inheritModel(model, parent); + return; + } + + String[] parts = parentPath.split(":", 2); + String ns = parts[0]; + String path = parts.length > 1 ? parts[1] : parts[0]; + Path parentFile = this.javaAssetsDir.resolve(ns + "/models/" + path + ".json"); + if (!Files.exists(parentFile)) { + this.modelCache.put(parentPath, null); + return; + } + + try { + JavaBlockModel parent = JavaBlockModel.load(parentFile); + this.resolveParent(parent); + this.inheritModel(model, parent); + this.modelCache.put(parentPath, parent); + } catch (IOException e) { + this.modelCache.put(parentPath, null); + } + } + + private void inheritModel(JavaBlockModel child, JavaBlockModel parent) { + for (Map.Entry tex : parent.textures().entrySet()) { + String childTex = child.textures().get(tex.getKey()); + if (childTex == null || childTex.startsWith("#")) { + if (childTex == null) { + child.textures().put(tex.getKey(), tex.getValue()); + } else { + String resolved = this.resolveVariableReference(child, tex.getValue()); + if (resolved != null) { + child.textures().put(tex.getKey(), resolved); + } else { + child.textures().put(tex.getKey(), tex.getValue()); + } + } + } + } + if (child.elements().isEmpty() && !parent.elements().isEmpty()) { + for (var el : parent.elements()) child.addElement(el); + } + } + + private String resolveTexture(JavaBlockModel model, String key) { + if (key == null) return null; + if (key.startsWith("#")) { + String varName = key.substring(1); + String tex = model.textures().get(varName); + if (tex == null) return null; + return this.resolveTexture(model, tex); + } + if (key.contains(":")) { + return key.replace("minecraft:", "minecraft/").replace(":", "/"); + } + return "minecraft/" + key; + } + + private String resolveVariableReference(JavaBlockModel model, String value) { + if (value == null) return null; + if (value.startsWith("#")) { + String resolved = model.textures().get(value.substring(1)); + if (resolved != null && !resolved.startsWith("#")) return resolved; + } + return value.startsWith("#") ? null : value; + } + + private boolean isFullBlock(JavaBlockModel model) { + if (model.elements().size() != 1) return false; + var el = model.elements().getFirst(); + return el.fromX() == 0 && el.fromY() == 0 && el.fromZ() == 0 + && el.toX() == 16 && el.toY() == 16 && el.toZ() == 16; + } + + private boolean isCrossModel(JavaBlockModel model) { + return model.elements().size() == 2; + } + + public BlockMappingConfiguration result() { return this.output; } +} diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/geometry/BedrockGeometry.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/geometry/BedrockGeometry.java new file mode 100644 index 00000000..7c348ffa --- /dev/null +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/geometry/BedrockGeometry.java @@ -0,0 +1,196 @@ +package fr.robie.craftengineconverter.converter.bedrock.geometry; + +import com.google.gson.JsonArray; +import com.google.gson.JsonObject; + +import java.util.*; + +public class BedrockGeometry { + private final String identifier; + private final List bones = new ArrayList<>(); + private Optional visibleBoundsWidth = Optional.empty(); + private Optional visibleBoundsHeight = Optional.empty(); + private float[] visibleBoundsOffset = new float[]{0, 0.75f, 0}; + private Optional textureWidth = Optional.empty(); + private Optional textureHeight = Optional.empty(); + private final Map display = new LinkedHashMap<>(); + + public BedrockGeometry(String identifier) { + this.identifier = "geometry." + identifier; + } + + public BedrockGeometry withVisibleBoundsWidth(float w) { this.visibleBoundsWidth = Optional.of(w); return this; } + public BedrockGeometry withVisibleBoundsHeight(float h) { this.visibleBoundsHeight = Optional.of(h); return this; } + public BedrockGeometry withVisibleBoundsOffset(float x, float y, float z) { this.visibleBoundsOffset = new float[]{x, y, z}; return this; } + public BedrockGeometry withTextureWidth(int w) { this.textureWidth = Optional.of(w); return this; } + public BedrockGeometry withTextureHeight(int h) { this.textureHeight = Optional.of(h); return this; } + + public BedrockGeometry withDisplay(String context, float rx, float ry, float rz, + float tx, float ty, float tz, + float sx, float sy, float sz) { + this.display.put(context, new DisplayTransform(rx, ry, rz, tx, ty, tz, sx, sy, sz)); + return this; + } + + public Bone addBone(String name) { + Bone bone = new Bone(name); + this.bones.add(bone); + return bone; + } + + public JsonObject serialize() { + JsonObject root = new JsonObject(); + root.addProperty("format_version", "1.21.0"); + + JsonArray geoArray = new JsonArray(); + JsonObject geo = new JsonObject(); + + JsonObject desc = new JsonObject(); + desc.addProperty("identifier", this.identifier); + this.visibleBoundsWidth.ifPresent(v -> desc.addProperty("visible_bounds_width", v)); + this.visibleBoundsHeight.ifPresent(v -> desc.addProperty("visible_bounds_height", v)); + desc.add("visible_bounds_offset", toJsonArray(this.visibleBoundsOffset[0], this.visibleBoundsOffset[1], this.visibleBoundsOffset[2])); + this.textureWidth.ifPresent(v -> desc.addProperty("texture_width", v)); + this.textureHeight.ifPresent(v -> desc.addProperty("texture_height", v)); + geo.add("description", desc); + + if (!this.display.isEmpty()) { + JsonObject displayObj = new JsonObject(); + for (Map.Entry entry : this.display.entrySet()) { + displayObj.add(entry.getKey(), entry.getValue().serialize()); + } + geo.add("display", displayObj); + } + + JsonArray bonesArray = new JsonArray(); + for (Bone bone : this.bones) { + bonesArray.add(bone.serialize()); + } + geo.add("bones", bonesArray); + + geoArray.add(geo); + root.add("minecraft:geometry", geoArray); + return root; + } + + public static class Bone { + private final String name; + private final List cubes = new ArrayList<>(); + private Optional binding = Optional.empty(); + private float[] pivot = new float[]{0, 0, 0}; + private float[] rotation = new float[]{0, 0, 0}; + + public Bone(String name) { this.name = name; } + public Bone withBinding(String b) { this.binding = Optional.of(b); return this; } + public Bone withPivot(float x, float y, float z) { this.pivot = new float[]{x, y, z}; return this; } + public Bone withRotation(float x, float y, float z) { this.rotation = new float[]{x, y, z}; return this; } + + public Cube addCube(float ox, float oy, float oz, float sx, float sy, float sz) { + Cube c = new Cube(ox, oy, oz, sx, sy, sz); + this.cubes.add(c); + return c; + } + + private JsonObject serialize() { + JsonObject obj = new JsonObject(); + obj.addProperty("name", this.name); + obj.add("pivot", toJsonArray(this.pivot[0], this.pivot[1], this.pivot[2])); + if (this.rotation[0] != 0 || this.rotation[1] != 0 || this.rotation[2] != 0) { + obj.add("rotation", toJsonArray(this.rotation[0], this.rotation[1], this.rotation[2])); + } + this.binding.ifPresent(b -> obj.addProperty("binding", b)); + + JsonArray cubesArray = new JsonArray(); + for (Cube cube : this.cubes) { + cubesArray.add(cube.serialize()); + } + obj.add("cubes", cubesArray); + return obj; + } + } + + public static class Cube { + private final float[] origin; + private final float[] size; + private float[] rotation = new float[]{0, 0, 0}; + private float[] pivot = new float[]{0, 0, 0}; + private final Map faces = new LinkedHashMap<>(); + + public Cube(float ox, float oy, float oz, float sx, float sy, float sz) { + this.origin = new float[]{ox, oy, oz}; + this.size = new float[]{sx, sy, sz}; + } + + public Cube withRotation(float x, float y, float z) { this.rotation = new float[]{x, y, z}; return this; } + public Cube withPivot(float x, float y, float z) { this.pivot = new float[]{x, y, z}; return this; } + + public Cube withFace(String direction, float u, float v, float us, float vs) { + this.faces.put(direction, new Face(u, v, us, vs, null)); + return this; + } + + public Cube withFace(String direction, float u, float v, float us, float vs, String materialInstance) { + this.faces.put(direction, new Face(u, v, us, vs, materialInstance)); + return this; + } + + private JsonObject serialize() { + JsonObject obj = new JsonObject(); + obj.add("origin", toJsonArray(this.origin[0], this.origin[1], this.origin[2])); + obj.add("size", toJsonArray(this.size[0], this.size[1], this.size[2])); + if (this.rotation[0] != 0 || this.rotation[1] != 0 || this.rotation[2] != 0) { + obj.add("rotation", toJsonArray(this.rotation[0], this.rotation[1], this.rotation[2])); + } + if (this.pivot[0] != 0 || this.pivot[1] != 0 || this.pivot[2] != 0) { + obj.add("pivot", toJsonArray(this.pivot[0], this.pivot[1], this.pivot[2])); + } + + JsonObject uv = new JsonObject(); + for (Map.Entry entry : this.faces.entrySet()) { + Face f = entry.getValue(); + JsonObject faceObj = new JsonObject(); + faceObj.add("uv", toJsonArray(f.u, f.v)); + faceObj.add("uv_size", toJsonArray(f.us, f.vs)); + if (f.materialInstance != null) { + faceObj.addProperty("material_instance", f.materialInstance); + } + uv.add(entry.getKey(), faceObj); + } + if (!this.faces.isEmpty()) { + obj.add("uv", uv); + } + return obj; + } + } + + private record Face(float u, float v, float us, float vs, String materialInstance) { + } + + private static JsonArray toJsonArray(float... values) { + JsonArray arr = new JsonArray(); + for (float v : values) arr.add(v); + return arr; + } + + public static class DisplayTransform { + final float[] rotation; + final float[] translation; + final float[] scale; + + public DisplayTransform(float rx, float ry, float rz, + float tx, float ty, float tz, + float sx, float sy, float sz) { + this.rotation = new float[]{rx, ry, rz}; + this.translation = new float[]{tx, ty, tz}; + this.scale = new float[]{sx, sy, sz}; + } + + private JsonObject serialize() { + JsonObject obj = new JsonObject(); + obj.add("rotation", toJsonArray(this.rotation[0], this.rotation[1], this.rotation[2])); + obj.add("translation", toJsonArray(this.translation[0], this.translation[1], this.translation[2])); + obj.add("scale", toJsonArray(this.scale[0], this.scale[1], this.scale[2])); + return obj; + } + } +} diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/geometry/GeometryMapper.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/geometry/GeometryMapper.java new file mode 100644 index 00000000..47e3af15 --- /dev/null +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/geometry/GeometryMapper.java @@ -0,0 +1,367 @@ +package fr.robie.craftengineconverter.converter.bedrock.geometry; + +import java.awt.image.BufferedImage; +import java.util.ArrayList; +import java.util.List; + +public class GeometryMapper { + private static final float[] CENTRE_OFFSET = {8.0F, 0.0F, 8.0F}; + + public BedrockGeometry mapGeometry(String identifier, JavaBlockModel model, int textureWidth, int textureHeight) { + BedrockGeometry geo = new BedrockGeometry(identifier) + .withVisibleBoundsWidth(4.0F) + .withVisibleBoundsHeight(4.0F) + .withVisibleBoundsOffset(0.0F, 0.75F, 0.0F) + .withTextureWidth(textureWidth) + .withTextureHeight(textureHeight); + + BedrockGeometry.Bone bone = geo.addBone("bone") + .withBinding("q.item_slot_to_bone_name(context.item_slot)"); + + for (JavaBlockModel.Element element : model.elements()) { + this.mapElement(element, bone, textureWidth, textureHeight); + } + + return geo; + } + + private void mapElement(JavaBlockModel.Element element, BedrockGeometry.Bone bone, int texW, int texH) { + float fromX = element.fromX(); + float fromY = element.fromY(); + float fromZ = element.fromZ(); + float toX = element.toX(); + float toY = element.toY(); + float toZ = element.toZ(); + + float[] from = {fromX, fromY, fromZ}; + float[] to = {toX, toY, toZ}; + + float[] origin = { + Math.min(from[0], to[0]) - CENTRE_OFFSET[0], + Math.min(from[1], to[1]) - CENTRE_OFFSET[1], + Math.min(from[2], to[2]) - CENTRE_OFFSET[2] + }; + float[] size = { + Math.abs(to[0] - from[0]), + Math.abs(to[1] - from[1]), + Math.abs(to[2] - from[2]) + }; + + origin[0] = -(origin[0] + size[0]); + + BedrockGeometry.Cube cube = bone.addCube(origin[0], origin[1], origin[2], size[0], size[1], size[2]); + + for (JavaBlockModel.Face face : element.faces()) { + this.mapFace(face, cube, texW, texH, from, to); + } + + element.rotation().ifPresent(rot -> { + float[] rotOrigin = { + rot.ox() / 0.0625F - CENTRE_OFFSET[0], + rot.oy() / 0.0625F - CENTRE_OFFSET[1], + rot.oz() / 0.0625F - CENTRE_OFFSET[2] + }; + rotOrigin[0] = -rotOrigin[0]; + cube.withPivot(rotOrigin[0], rotOrigin[1], rotOrigin[2]); + + float bedrockAngle = switch (rot.axis()) { + case "x" -> -rot.angle(); + case "y" -> rot.angle(); + case "z" -> rot.angle(); + default -> rot.angle(); + }; + float[] rotVec = switch (rot.axis()) { + case "x" -> new float[]{bedrockAngle, 0, 0}; + case "y" -> new float[]{0, bedrockAngle, 0}; + case "z" -> new float[]{0, 0, bedrockAngle}; + default -> new float[]{0, 0, 0}; + }; + cube.withRotation(rotVec[0], rotVec[1], rotVec[2]); + }); + } + + private void mapFace(JavaBlockModel.Face face, BedrockGeometry.Cube cube, int texW, int texH, + float[] from, float[] to) { + String dir = face.direction(); + float u0 = face.u0(); + float v0 = face.v0(); + float u1 = face.u1(); + float v1 = face.v1(); + + boolean isUpOrDown = dir.equals("up") || dir.equals("down"); + + float uvOriginU, uvOriginV, uvSizeU, uvSizeV; + + if (isUpOrDown) { + uvOriginU = u1; + uvOriginV = v1; + uvSizeU = u0 - u1; + uvSizeV = v0 - v1; + } else { + uvOriginU = u0; + uvOriginV = v0; + uvSizeU = u1 - u0; + uvSizeV = v1 - v0; + } + + float widthMul = (float) texW / 16.0F; + float heightMul = (float) texH / 16.0F; + uvOriginU *= widthMul; + uvOriginV *= heightMul; + uvSizeU *= widthMul; + uvSizeV *= heightMul; + + cube.withFace(dir, uvOriginU, uvOriginV, uvSizeU, uvSizeV); + } + + public static String getMeaningfulMaterialInstanceName(String face, String texture, int elementIndex) { + return texture + "_" + face + "_" + elementIndex; + } + + /** + * @deprecated kept only as a fallback for callers that cannot supply the source image + * (e.g. the texture file failed to load). Produces the old zero-depth flat plane. + * Prefer {@link #createFlatItemGeometry(String, BufferedImage)}. + */ + @Deprecated + public static BedrockGeometry createFlatItemGeometry(String identifier, int textureWidth, int textureHeight) { + BedrockGeometry geo = new BedrockGeometry(identifier) + .withVisibleBoundsWidth(4.0F) + .withVisibleBoundsHeight(4.0F) + .withVisibleBoundsOffset(0.0F, 0.75F, 0.0F) + .withTextureWidth(textureWidth) + .withTextureHeight(textureHeight); + + BedrockGeometry.Bone bone = geo.addBone("bone") + .withBinding("q.item_slot_to_bone_name(context.item_slot)") + .withPivot(0, 8.0F, -0.25F); + + BedrockGeometry.Cube cube = bone.addCube(-8.0F, 0, -0.5F, 16.0F, 16.0F, 0); + + cube.withFace("north", textureWidth, 0, -textureWidth, textureHeight, "#layer0_north_0"); + cube.withFace("south", 0, 0, textureWidth, textureHeight, "#layer0_south_0"); + + return geo; + } + + /** + * Builds a flat-item geometry that is extruded to a depth of 1 model unit, following the + * exact silhouette of the texture's alpha channel instead of a single zero-depth plane. + *

+ * The algorithm: + *

    + *
  1. reads every pixel of {@code texture} and classifies it opaque/transparent;
  2. + *
  3. merges the opaque pixels into the smallest practical set of axis-aligned rectangles + * (front/back "slabs"), each extruded to depth 1 and textured with the exact matching + * sub-region of the source image (mirrored on the north face, matching the previous + * convention);
  4. + *
  5. traces the outer silhouette of the opaque mask and emits thin boundary walls + * (up/down/east/west) only where a slab edge is actually exposed to air, merging + * consecutive exposed pixels along each edge into single quads.
  6. + *
+ * No transparent pixel is ever made solid, and internal borders between two touching slabs + * are never given a wall face, since they aren't visible. + */ + public static BedrockGeometry createFlatItemGeometry(String identifier, BufferedImage texture) { + int texW = texture.getWidth(); + int texH = texture.getHeight(); + + BedrockGeometry geo = new BedrockGeometry(identifier) + .withVisibleBoundsWidth(4.0F) + .withVisibleBoundsHeight(4.0F) + .withVisibleBoundsOffset(0.0F, 0.75F, 0.0F) + .withTextureWidth(texW) + .withTextureHeight(texH); + + BedrockGeometry.Bone bone = geo.addBone("bone") + .withBinding("q.item_slot_to_bone_name(context.item_slot)") + .withPivot(0, 8.0F, -0.25F); + + boolean[][] opaque = new boolean[texH][texW]; + for (int y = 0; y < texH; y++) { + for (int x = 0; x < texW; x++) { + opaque[y][x] = ((texture.getRGB(x, y) >>> 24) & 0xFF) != 0; + } + } + + float unitX = 16.0F / texW; + float unitY = 16.0F / texH; + float depth = 1.0F; + float zOrigin = -depth / 2.0F; + + // 1) Front/back slabs: cover the opaque mask with the fewest practical rectangles. + for (int[] rect : mergeOpaqueRegions(opaque, texW, texH)) { + int x0 = rect[0], y0 = rect[1], x1 = rect[2], y1 = rect[3]; + + float originX = -8.0F + x0 * unitX; + float sizeX = (x1 - x0) * unitX; + float originY = 16.0F - y1 * unitY; + float sizeY = (y1 - y0) * unitY; + + BedrockGeometry.Cube cube = bone.addCube(originX, originY, zOrigin, sizeX, sizeY, depth); + + cube.withFace("south", x1, y0, -(x1 - x0), y1 - y0, "#layer0_south_0"); + cube.withFace("north", x0, y0, x1 - x0, y1 - y0, "#layer0_north_0"); + } + + // 2) Boundary walls: thin quads along the silhouette give the extrusion its sides. + addBoundaryWalls(bone, opaque, texW, texH, unitX, unitY, zOrigin, depth); + + return geo; + } + + /** + * Greedily covers every {@code true} cell of {@code opaque} with axis-aligned rectangles: + * for each uncovered opaque cell (scanned top-to-bottom, left-to-right) it grows as wide as + * possible, then as tall as possible while every cell in that width remains opaque and + * uncovered, marks the covered cells, and repeats. Returns rectangles as + * {@code {x0, y0, x1, y1}} (x1/y1 exclusive, in pixel coordinates). + */ + private static List mergeOpaqueRegions(boolean[][] opaque, int w, int h) { + boolean[][] covered = new boolean[h][w]; + List rects = new ArrayList<>(); + + for (int y = 0; y < h; y++) { + for (int x = 0; x < w; x++) { + if (!opaque[y][x] || covered[y][x]) continue; + + int x1 = x + 1; + while (x1 < w && opaque[y][x1] && !covered[y][x1]) x1++; + + int y1 = y + 1; + outer: + while (y1 < h) { + for (int xx = x; xx < x1; xx++) { + if (!opaque[y1][xx] || covered[y1][xx]) break outer; + } + y1++; + } + + for (int yy = y; yy < y1; yy++) { + for (int xx = x; xx < x1; xx++) { + covered[yy][xx] = true; + } + } + rects.add(new int[]{x, y, x1, y1}); + } + } + return rects; + } + + /** + * Walks the four boundary directions of the alpha mask and emits one thin wall cuboid per + * maximal run of exposed edge pixels (a pixel edge is "exposed" when its neighbour in that + * direction is transparent or outside the texture). Edges shared between two opaque pixels + * are internal and never get a wall. + */ + private static void addBoundaryWalls(BedrockGeometry.Bone bone, boolean[][] opaque, int texW, int texH, + float unitX, float unitY, float zOrigin, float depth) { + // UP walls: top edge of the shape, merged along each row. + for (int y = 0; y < texH; y++) { + int runStart = -1; + for (int x = 0; x <= texW; x++) { + boolean exposed = x < texW && opaque[y][x] && (y == 0 || !opaque[y - 1][x]); + if (exposed && runStart == -1) { + runStart = x; + } else if (!exposed && runStart != -1) { + addWallCube(bone, "up", runStart, x, y, y, unitX, unitY, zOrigin, depth); + runStart = -1; + } + } + } + + // DOWN walls: bottom edge of the shape, merged along each row. + for (int y = 0; y < texH; y++) { + int runStart = -1; + for (int x = 0; x <= texW; x++) { + boolean exposed = x < texW && opaque[y][x] && (y == texH - 1 || !opaque[y + 1][x]); + if (exposed && runStart == -1) { + runStart = x; + } else if (!exposed && runStart != -1) { + addWallCube(bone, "down", runStart, x, y, y, unitX, unitY, zOrigin, depth); + runStart = -1; + } + } + } + + // WEST walls: left edge of the shape, merged along each column. + for (int x = 0; x < texW; x++) { + int runStart = -1; + for (int y = 0; y <= texH; y++) { + boolean exposed = y < texH && opaque[y][x] && (x == 0 || !opaque[y][x - 1]); + if (exposed && runStart == -1) { + runStart = y; + } else if (!exposed && runStart != -1) { + addWallCube(bone, "west", x, x, runStart, y, unitX, unitY, zOrigin, depth); + runStart = -1; + } + } + } + + // EAST walls: right edge of the shape, merged along each column. + for (int x = 0; x < texW; x++) { + int runStart = -1; + for (int y = 0; y <= texH; y++) { + boolean exposed = y < texH && opaque[y][x] && (x == texW - 1 || !opaque[y][x + 1]); + if (exposed && runStart == -1) { + runStart = y; + } else if (!exposed && runStart != -1) { + addWallCube(bone, "east", x, x, runStart, y, unitX, unitY, zOrigin, depth); + runStart = -1; + } + } + } + } + + /** + * Adds a single zero-thickness (in the in-plane axis) wall cuboid for one merged boundary + * run and gives it just the one face it exists for. For "up"/"down" the run is horizontal + * ({@code x0..x1} at fixed row {@code y0==y1}); for "west"/"east" the run is vertical + * ({@code y0..y1} at fixed column {@code x0==x1}). The UV samples the one row/column of + * source pixels the wall sits against, stretched across the depth - the same trick used for + * block-side shading from a single top-down texture. + */ + private static void addWallCube(BedrockGeometry.Bone bone, String direction, + int x0, int x1, int y0, int y1, + float unitX, float unitY, float zOrigin, float depth) { + float originX, originY, sizeX, sizeY; + float uvU, uvV, uvSizeU, uvSizeV; + + switch (direction) { + case "up" -> { + originX = -8.0F + x0 * unitX; + sizeX = (x1 - x0) * unitX; + originY = 16.0F - y0 * unitY; // top edge of row y0 + sizeY = 0.0F; + uvU = x0; uvV = y0; uvSizeU = (x1 - x0); uvSizeV = 1; + } + case "down" -> { + originX = -8.0F + x0 * unitX; + sizeX = (x1 - x0) * unitX; + originY = 16.0F - (y0 + 1) * unitY; // bottom edge of row y0 + sizeY = 0.0F; + uvU = x0; uvV = y0; uvSizeU = (x1 - x0); uvSizeV = 1; + } + case "west" -> { + originX = -8.0F + x0 * unitX; // left edge of column x0 + sizeX = 0.0F; + originY = 16.0F - y1 * unitY; + sizeY = (y1 - y0) * unitY; + uvU = x0; uvV = y0; uvSizeU = 1; uvSizeV = (y1 - y0); + } + case "east" -> { + originX = -8.0F + (x0 + 1) * unitX; // right edge of column x0 + sizeX = 0.0F; + originY = 16.0F - y1 * unitY; + sizeY = (y1 - y0) * unitY; + uvU = x0; uvV = y0; uvSizeU = 1; uvSizeV = (y1 - y0); + } + default -> { + return; + } + } + + BedrockGeometry.Cube wall = bone.addCube(originX, originY, zOrigin, sizeX, sizeY, depth); + wall.withFace(direction, uvU, uvV, uvSizeU, uvSizeV, "#layer0_south_0"); + } +} \ No newline at end of file diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/geometry/JavaBlockModel.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/geometry/JavaBlockModel.java new file mode 100644 index 00000000..06c3e629 --- /dev/null +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/geometry/JavaBlockModel.java @@ -0,0 +1,141 @@ +package fr.robie.craftengineconverter.converter.bedrock.geometry; + +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; + +import java.io.IOException; +import java.io.Reader; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.*; + +public class JavaBlockModel { + private final String parent; + private final boolean ambientOcclusion; + private final Map textures = new HashMap<>(); + private final List elements = new ArrayList<>(); + + public JavaBlockModel(String parent, boolean ambientOcclusion) { + this.parent = parent; + this.ambientOcclusion = ambientOcclusion; + } + + public Optional parent() { return Optional.ofNullable(this.parent); } + public boolean ambientOcclusion() { return this.ambientOcclusion; } + public Map textures() { return this.textures; } + public List elements() { return this.elements; } + + public void addTexture(String key, String value) { + this.textures.put(key, value); } + public void addElement(Element element) { + this.elements.add(element); } + + public static JavaBlockModel load(Path path) throws IOException { + try (Reader reader = Files.newBufferedReader(path)) { + JsonObject json = JsonParser.parseReader(reader).getAsJsonObject(); + return parse(json); + } + } + + public static JavaBlockModel parse(JsonObject json) { + String parent = json.has("parent") ? json.get("parent").getAsString() : null; + boolean ao = !json.has("ambientocclusion") || json.get("ambientocclusion").getAsBoolean(); + + JavaBlockModel model = new JavaBlockModel(parent, ao); + + if (json.has("textures")) { + JsonObject tex = json.getAsJsonObject("textures"); + for (String key : tex.keySet()) { + model.addTexture(key, tex.get(key).getAsString()); + } + } + + if (json.has("elements")) { + for (JsonElement el : json.getAsJsonArray("elements")) { + model.addElement(parseElement(el.getAsJsonObject())); + } + } + + return model; + } + + private static Element parseElement(JsonObject json) { + JsonArray from = json.getAsJsonArray("from"); + JsonArray to = json.getAsJsonArray("to"); + + Element element = new Element( + from.get(0).getAsFloat(), from.get(1).getAsFloat(), from.get(2).getAsFloat(), + to.get(0).getAsFloat(), to.get(1).getAsFloat(), to.get(2).getAsFloat() + ); + + if (json.has("rotation")) { + JsonObject rot = json.getAsJsonObject("rotation"); + float[] origin = {0, 0, 0}; + if (rot.has("origin")) { + JsonArray org = rot.getAsJsonArray("origin"); + origin[0] = org.get(0).getAsFloat(); + origin[1] = org.get(1).getAsFloat(); + origin[2] = org.get(2).getAsFloat(); + } + float angle = rot.get("angle").getAsFloat(); + String axis = rot.get("axis").getAsString(); + boolean rescale = rot.has("rescale") && rot.get("rescale").getAsBoolean(); + element.setRotation(origin[0], origin[1], origin[2], angle, axis, rescale); + } + + if (json.has("faces")) { + JsonObject faces = json.getAsJsonObject("faces"); + for (String dir : faces.keySet()) { + JsonObject face = faces.getAsJsonObject(dir); + String texture = face.get("texture").getAsString(); + float[] uv = {0, 0, 16, 16}; + if (face.has("uv")) { + JsonArray uvArr = face.getAsJsonArray("uv"); + uv[0] = uvArr.get(0).getAsFloat(); + uv[1] = uvArr.get(1).getAsFloat(); + uv[2] = uvArr.get(2).getAsFloat(); + uv[3] = uvArr.get(3).getAsFloat(); + } + int rotation = face.has("rotation") ? face.get("rotation").getAsInt() : 0; + element.addFace(dir, texture, uv[0], uv[1], uv[2], uv[3], rotation); + } + } + + return element; + } + + public static class Element { + private final float fromX, fromY, fromZ; + private final float toX, toY, toZ; + private final List faces = new ArrayList<>(); + private Optional rotation = Optional.empty(); + + public Element(float fromX, float fromY, float fromZ, float toX, float toY, float toZ) { + this.fromX = fromX; this.fromY = fromY; this.fromZ = fromZ; + this.toX = toX; this.toY = toY; this.toZ = toZ; + } + + public void setRotation(float ox, float oy, float oz, float angle, String axis, boolean rescale) { + this.rotation = Optional.of(new ElementRotation(ox, oy, oz, angle, axis, rescale)); + } + + public void addFace(String direction, String texture, float u0, float v0, float u1, float v1, int rotation) { + this.faces.add(new Face(direction, texture, u0, v0, u1, v1, rotation)); + } + + public float fromX() { return this.fromX; } + public float fromY() { return this.fromY; } + public float fromZ() { return this.fromZ; } + public float toX() { return this.toX; } + public float toY() { return this.toY; } + public float toZ() { return this.toZ; } + public List faces() { return this.faces; } + public Optional rotation() { return this.rotation; } + + public record ElementRotation(float ox, float oy, float oz, float angle, String axis, boolean rescale) {} + } + + public record Face(String direction, String texture, float u0, float v0, float u1, float v1, int rotation) {} +} diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/sound/SoundMapper.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/sound/SoundMapper.java new file mode 100644 index 00000000..7ce67711 --- /dev/null +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/sound/SoundMapper.java @@ -0,0 +1,172 @@ +package fr.robie.craftengineconverter.converter.bedrock.sound; + +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import fr.robie.craftengineconverter.api.utils.FileUtils; +import fr.robie.messageflow.logger.Logger; + +import java.io.File; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.Locale; +import java.util.Map; +import java.util.Set; + +public final class SoundMapper { + + private static final String FORMAT_VERSION = "1.20.20"; + private static final String[] AUDIO_EXTENSIONS = {".ogg", ".wav", ".fsb"}; + + private enum SoundCategory { + BLOCK, + BOTTLE, + BUCKET, + HOSTILE, + MUSIC, + NEUTRAL, + PLAYER, + RECORD, + UI, + WEATHER; + + private static SoundCategory fromString(String value) { + if (value == null) return NEUTRAL; + try { + return SoundCategory.valueOf(value.toUpperCase(Locale.ROOT)); + } catch (IllegalArgumentException e) { + return NEUTRAL; + } + } + + String bedrockId() { + return this.name().toLowerCase(Locale.ROOT); + } + } + + private final Map soundDefinitions = new LinkedHashMap<>(); + private final Set copiedPaths = new HashSet<>(); + + /** + * Parses one Java namespace's sounds.json root object and accumulates entries. + * Entries from multiple namespaces / pack layers are merged rather than clobbered. + */ + public void addFromJavaSounds(JsonObject javaSoundsRoot, String namespace, + Path javaAssetsDir, Path outputSoundsDir) { + for (String javaKey : javaSoundsRoot.keySet()) { + JsonElement entry = javaSoundsRoot.get(javaKey); + if (!entry.isJsonObject()) continue; + JsonObject event = entry.getAsJsonObject(); + + String bedrockKey = "minecraft".equals(namespace) ? javaKey : namespace + "." + javaKey; + + String rawCategory = event.has("category") ? event.get("category").getAsString() : null; + SoundCategory category = SoundCategory.fromString(rawCategory); + + JsonArray bedrockSounds = new JsonArray(); + if (event.has("sounds")) { + JsonElement soundsElem = event.get("sounds"); + if (soundsElem.isJsonArray()) { + for (JsonElement soundElem : soundsElem.getAsJsonArray()) { + JsonObject bedrockSound = this.toBedrockSound(soundElem); + bedrockSounds.add(bedrockSound); + this.copyAudioFile(bedrockSound, namespace, javaAssetsDir, outputSoundsDir); + } + } else { + JsonObject bedrockSound = this.toBedrockSound(soundsElem); + bedrockSounds.add(bedrockSound); + this.copyAudioFile(bedrockSound, namespace, javaAssetsDir, outputSoundsDir); + } + } + + if (this.soundDefinitions.containsKey(bedrockKey)) { + JsonObject existing = this.soundDefinitions.get(bedrockKey); + JsonArray existingSounds = existing.getAsJsonArray("sounds"); + for (JsonElement s : bedrockSounds) { + existingSounds.add(s); + } + } else { + JsonObject bedrockEvent = new JsonObject(); + bedrockEvent.addProperty("category", category.bedrockId()); + bedrockEvent.add("sounds", bedrockSounds); + this.soundDefinitions.put(bedrockKey, bedrockEvent); + } + } + } + + private JsonObject toBedrockSound(JsonElement soundElem) { + JsonObject result = new JsonObject(); + if (soundElem.isJsonObject()) { + JsonObject javaSound = soundElem.getAsJsonObject(); + String name = javaSound.has("name") ? javaSound.get("name").getAsString() : ""; + result.addProperty("name", normalizeSoundPath(name)); + if (javaSound.has("volume")) result.addProperty("volume", javaSound.get("volume").getAsFloat()); + if (javaSound.has("pitch")) result.addProperty("pitch", javaSound.get("pitch").getAsFloat()); + if (javaSound.has("weight")) result.addProperty("weight", javaSound.get("weight").getAsInt()); + if (javaSound.has("stream")) result.addProperty("stream", javaSound.get("stream").getAsBoolean()); + } else { + result.addProperty("name", normalizeSoundPath(soundElem.getAsString())); + } + return result; + } + + private static String normalizeSoundPath(String name) { + if (!name.startsWith("sounds/")) { + return "sounds/" + name; + } + return name; + } + + private void copyAudioFile(JsonObject bedrockSound, String namespace, + Path javaAssetsDir, Path outputSoundsDir) { + if (!bedrockSound.has("name")) return; + String bedrockPath = bedrockSound.get("name").getAsString(); + // bedrockPath is like "sounds/foo/bar" — strip the leading "sounds/" to get the relative path + String relativePath = bedrockPath.startsWith("sounds/") ? bedrockPath.substring("sounds/".length()) : bedrockPath; + + if (this.copiedPaths.contains(relativePath)) return; + + for (String ext : AUDIO_EXTENSIONS) { + // Try in the namespace-specific folder first, then directly under assets dir + Path[] candidates = { + javaAssetsDir.resolve(namespace).resolve("sounds").resolve(relativePath + ext), + javaAssetsDir.resolve("sounds").resolve(relativePath + ext) + }; + for (Path source : candidates) { + if (Files.exists(source)) { + Path dest = outputSoundsDir.resolve(relativePath + ext); + try { + Files.createDirectories(dest.getParent()); + FileUtils.copyFile(source.toFile(), dest.toFile()); + this.copiedPaths.add(relativePath); + } catch (Exception e) { + Logger.warn("Failed to copy sound file " + source + ": " + e.getMessage()); + } + return; + } + } + } + Logger.warn("Sound file not found for: " + relativePath + " (namespace=" + namespace + ")"); + } + + public boolean isEmpty() { + return this.soundDefinitions.isEmpty(); + } + + public int size() { + return this.soundDefinitions.size(); + } + + public JsonObject serialize() { + JsonObject root = new JsonObject(); + root.addProperty("format_version", FORMAT_VERSION); + JsonObject definitions = new JsonObject(); + for (Map.Entry entry : this.soundDefinitions.entrySet()) { + definitions.add(entry.getKey(), entry.getValue()); + } + root.add("sound_definitions", definitions); + return root; + } +} diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/texture/CachedTextureInfo.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/texture/CachedTextureInfo.java new file mode 100644 index 00000000..1285409d --- /dev/null +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/texture/CachedTextureInfo.java @@ -0,0 +1,36 @@ +package fr.robie.craftengineconverter.converter.bedrock.texture; + +import java.nio.file.Path; +import java.util.List; +import java.util.Optional; + +public record CachedTextureInfo(Path sourcePath, String bedrockTextureKey, String bedrockTexturePath, + Optional animation) { + public CachedTextureInfo(Path sourcePath, String bedrockTextureKey, String bedrockTexturePath) { + this(sourcePath, bedrockTextureKey, bedrockTexturePath, Optional.empty()); + } + + public String bedrockTextureDir() { + String p = this.bedrockTexturePath; + if (p.endsWith(".png")) { + p = p.substring(0, p.length() - 4); + } + return p; + } + + public record AnimationInfo(List frames, int frameWidth, int frameHeight, int frameRowCount) { + public int totalFrameCount() { + return this.frames.size(); + } + + public int defaultTickTime() { + if (this.frames.isEmpty()) { + return 1; + } + return this.frames.getFirst().time(); + } + } + + public record FrameInfo(int index, int time) { + } +} diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/texture/TexturePipeline.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/texture/TexturePipeline.java new file mode 100644 index 00000000..1a2371a1 --- /dev/null +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/texture/TexturePipeline.java @@ -0,0 +1,224 @@ +package fr.robie.craftengineconverter.converter.bedrock.texture; + +import fr.robie.craftengineconverter.api.configuration.bedrock.texture.TextureData; +import fr.robie.messageflow.logger.Logger; + +import javax.imageio.ImageIO; +import java.awt.image.BufferedImage; +import java.io.IOException; +import java.io.InputStream; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.StandardCopyOption; +import java.util.*; + +public class TexturePipeline { + private final Map textureCache = new HashMap<>(); + private final List processedTextures = new ArrayList<>(); + + public Optional resolveTexture(String modelPath, String bedrockKey, Path javaAssetsDir) { + String cacheKey = modelPath; + CachedTextureInfo cached = this.textureCache.get(cacheKey); + if (cached != null) { + return Optional.of(cached); + } + + String textureFilePath = this.modelPathToTexturePath(modelPath); + String namespace = this.extractNamespace(modelPath); + Path sourceFile = javaAssetsDir.resolve(namespace + "/textures/" + textureFilePath + ".png"); + if (!Files.exists(sourceFile)) { + Logger.warn("Texture not found: " + sourceFile.toAbsolutePath()); + return Optional.empty(); + } + + Optional animation = this.detectAnimation(sourceFile); + String bedrockTexturePath = "textures/" + textureFilePath; + + CachedTextureInfo info = new CachedTextureInfo(sourceFile, bedrockKey, bedrockTexturePath, animation); + this.textureCache.put(cacheKey, info); + this.processedTextures.add(info); + return Optional.of(info); + } + + public boolean copyTexture(CachedTextureInfo info, Path outputTexturesDir) { + try { + Path targetPath = outputTexturesDir.resolve(info.bedrockTexturePath().replace("textures/", "") + ".png"); + Files.createDirectories(targetPath.getParent()); + Files.copy(info.sourcePath(), targetPath, StandardCopyOption.REPLACE_EXISTING); + return true; + } catch (IOException e) { + Logger.error("Failed to copy texture: " + info.sourcePath(), e); + return false; + } + } + + public boolean extractAnimationFrames(CachedTextureInfo info, Path outputTexturesDir) { + try { + BufferedImage sheet = ImageIO.read(info.sourcePath().toFile()); + CachedTextureInfo.AnimationInfo anim = info.animation().get(); + int frameW = anim.frameWidth(); + int frameH = anim.frameHeight(); + int cols = sheet.getWidth() / frameW; + + String baseName = info.bedrockTexturePath().replace("textures/", ""); + String baseNoExt = baseName.endsWith(".png") ? baseName.substring(0, baseName.length() - 4) : baseName; + + // Extract individual frame files + for (int i = 0; i < anim.totalFrameCount(); i++) { + CachedTextureInfo.FrameInfo frameInfo = anim.frames().get(i); + int sx = (frameInfo.index() % cols) * frameW; + int sy = (frameInfo.index() / cols) * frameH; + + BufferedImage frame = new BufferedImage(frameW, frameH, BufferedImage.TYPE_INT_ARGB); + frame.getGraphics().drawImage(sheet, 0, 0, frameW, frameH, sx, sy, sx + frameW, sy + frameH, null); + + Path framePath = outputTexturesDir.resolve(baseNoExt + "_" + i + ".png"); + Files.createDirectories(framePath.getParent()); + ImageIO.write(frame, "PNG", framePath.toFile()); + } + + Logger.info("Extracted " + anim.totalFrameCount() + " animation frames for " + baseName); + return true; + } catch (IOException e) { + Logger.error("Failed to extract animation frames: " + info.sourcePath(), e); + return false; + } + } + + public TextureData toTextureData(CachedTextureInfo info) { + TextureData data = new TextureData(info.bedrockTextureKey()); + data.addTexture(info.bedrockTexturePath()); + return data; + } + + public List processedTextures() { + return this.processedTextures; + } + + private Optional detectAnimation(Path pngPath) { + Path mcmetaPath = pngPath.resolveSibling(pngPath.getFileName().toString() + ".mcmeta"); + if (!Files.exists(mcmetaPath)) { + return Optional.empty(); + } + + try (InputStream is = Files.newInputStream(mcmetaPath)) { + com.google.gson.JsonObject meta = com.google.gson.JsonParser.parseReader(new java.io.InputStreamReader(is)).getAsJsonObject(); + if (!meta.has("animation")) { + return Optional.empty(); + } + + com.google.gson.JsonObject anim = meta.getAsJsonObject("animation"); + + BufferedImage sheet = ImageIO.read(pngPath.toFile()); + int sheetW = sheet.getWidth(); + int sheetH = sheet.getHeight(); + + int frameW = sheetW; + int frameH = sheetH; + if (anim.has("width") && anim.has("height")) { + frameW = anim.get("width").getAsInt(); + frameH = anim.get("height").getAsInt(); + } else if (anim.has("height") && !anim.has("width")) { + frameH = anim.get("height").getAsInt(); + frameW = sheetW; + } else if (anim.has("width") && !anim.has("height")) { + frameW = anim.get("width").getAsInt(); + frameH = sheetH; + } else { + frameH = frameW; + } + + int cols = sheetW / frameW; + int rows = sheetH / frameH; + int totalFrames = cols * rows; + + int defaultFrameTime = anim.has("frametime") ? anim.get("frametime").getAsInt() : 1; + + List frames = new ArrayList<>(); + if (anim.has("frames")) { + com.google.gson.JsonArray frameArray = anim.getAsJsonArray("frames"); + for (int i = 0; i < frameArray.size(); i++) { + if (frameArray.get(i).isJsonObject()) { + com.google.gson.JsonObject fObj = frameArray.get(i).getAsJsonObject(); + int idx = fObj.get("index").getAsInt(); + int time = fObj.has("time") ? fObj.get("time").getAsInt() : defaultFrameTime; + frames.add(new CachedTextureInfo.FrameInfo(idx, time)); + } else { + frames.add(new CachedTextureInfo.FrameInfo(frameArray.get(i).getAsInt(), defaultFrameTime)); + } + } + } else { + for (int i = 0; i < totalFrames; i++) { + frames.add(new CachedTextureInfo.FrameInfo(i, defaultFrameTime)); + } + } + + return Optional.of(new CachedTextureInfo.AnimationInfo(frames, frameW, frameH, cols)); + } catch (IOException e) { + Logger.warn("Failed to parse animation metadata: " + mcmetaPath); + return Optional.empty(); + } + } + + public boolean isAnimated(String modelPath) { + CachedTextureInfo cached = this.textureCache.get(modelPath); + return cached != null && cached.animation().isPresent(); + } + + public Optional getFrameCount(String modelPath) { + CachedTextureInfo cached = this.textureCache.get(modelPath); + if (cached != null && cached.animation().isPresent()) { + return Optional.of(cached.animation().get().totalFrameCount()); + } + return Optional.empty(); + } + + public Optional> getFrameTimes(String modelPath) { + CachedTextureInfo cached = this.textureCache.get(modelPath); + if (cached != null && cached.animation().isPresent()) { + return Optional.of(cached.animation().get().frames().stream() + .map(CachedTextureInfo.FrameInfo::time) + .toList()); + } + return Optional.empty(); + } + + public int getDefaultTickTime(String modelPath) { + CachedTextureInfo cached = this.textureCache.get(modelPath); + if (cached != null && cached.animation().isPresent()) { + return cached.animation().get().defaultTickTime(); + } + return 1; + } + + public String getFrameBaseTexturePath(String modelPath) { + CachedTextureInfo cached = this.textureCache.get(modelPath); + if (cached == null) return ""; + String path = cached.bedrockTexturePath(); + if (path.endsWith(".png")) { + path = path.substring(0, path.length() - 4); + } + return path; + } + + private String extractNamespace(String modelPath) { + if (modelPath.contains(":")) { + return modelPath.substring(0, modelPath.indexOf(':')); + } + return "minecraft"; + } + + private String modelPathToTexturePath(String modelPath) { + String path = modelPath; + if (path.contains(":")) { + path = path.substring(path.indexOf(':') + 1); + } + if (path.endsWith(".json")) { + path = path.substring(0, path.length() - 5); + } + if (path.endsWith(".png")) { + path = path.substring(0, path.length() - 4); + } + return path; + } +} diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoItemConverter.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoItemConverter.java index 91d1b39d..e125b2fc 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoItemConverter.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoItemConverter.java @@ -1153,7 +1153,7 @@ private void convertModelWithoutParent(ConfigurationSection packSection) { Map> converterTextures = new HashMap<>(); for (var layer : layerTypeTuple.getValue()) { - String originalKey = layer.getFirst(); + String originalKey = layer.first(); String mobTexture = customArmorSection.getString(originalKey); String namespacedTexture = this.namespaced(mobTexture); @@ -1161,7 +1161,7 @@ private void convertModelWithoutParent(ConfigurationSection packSection) { String[] split = namespacedTexture.split(":", 2); String namespace = split[0]; String path = split[1]; - String equipmentFolder = layer.getSecond().replace("-", "_"); + String equipmentFolder = layer.second().replace("-", "_"); // For layer1 and layer2 (humanoid/humanoid-leggings) if (originalKey.equals("layer1") || originalKey.equals("layer2")) { diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/utils/Tuple.java b/Plugin/src/main/java/fr/robie/craftengineconverter/utils/Tuple.java index 694ef033..e562cb7a 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/utils/Tuple.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/utils/Tuple.java @@ -1,21 +1,6 @@ package fr.robie.craftengineconverter.utils; -public class Tuple { - public final T first; - public final T second; - - public Tuple(T first, T second) { - this.first = first; - this.second = second; - } - - public T getFirst() { - return this.first; - } - - public T getSecond() { - return this.second; - } +public record Tuple(T first, T second) { public static Tuple of(T first, T second) { return new Tuple<>(first, second); diff --git a/Plugin/src/main/resources/paper-plugin.yml b/Plugin/src/main/resources/paper-plugin.yml index ed3db45c..6b9811b7 100644 --- a/Plugin/src/main/resources/paper-plugin.yml +++ b/Plugin/src/main/resources/paper-plugin.yml @@ -6,6 +6,7 @@ api-version: ${plugin.apiVersion} main: ${plugin.mainClass} bootstrapper: ${plugin.bootstrapper} loader: ${plugin.loader} +folia-supported: true dependencies: server: CraftEngine: diff --git a/Plugin/src/test/java/fr/robie/craftengineconverter/BedrockConverterTest.java b/Plugin/src/test/java/fr/robie/craftengineconverter/BedrockConverterTest.java index de68e43a..26cd3171 100644 --- a/Plugin/src/test/java/fr/robie/craftengineconverter/BedrockConverterTest.java +++ b/Plugin/src/test/java/fr/robie/craftengineconverter/BedrockConverterTest.java @@ -34,3 +34,4 @@ void testConvertCreatesMappings() throws Exception { converter.convert(); } } + diff --git a/Plugin/src/test/java/fr/robie/craftengineconverter/MinimalTest.java b/Plugin/src/test/java/fr/robie/craftengineconverter/MinimalTest.java new file mode 100644 index 00000000..e9af35de --- /dev/null +++ b/Plugin/src/test/java/fr/robie/craftengineconverter/MinimalTest.java @@ -0,0 +1,29 @@ +package fr.robie.craftengineconverter; + +import fr.robie.craftengineconverter.common.CraftEngineConverterPlugin; +import fr.robie.craftengineconverter.converter.bedrock.BedrockConverter; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +import java.io.File; + +public class MinimalTest { + + @BeforeAll + static void setup() { + ClassLoader classLoader = CraftEngineConverterPlugin.class.getClassLoader(); + RegistryHelper registryHelper = new RegistryHelper(classLoader); + registryHelper.loadRegistries(); + } + + @Test + void testSingleSword() throws Exception { + var resource = this.getClass() + .getClassLoader() + .getResource("minimal-test"); + assert resource != null; + File file = new File(resource.toURI()); + BedrockConverter converter = new BedrockConverter(file); + converter.convert(); + } +} diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/configuration/blocks/topaz_ore.yml b/Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/configuration/blocks/topaz_ore.yml new file mode 100644 index 00000000..1d3e8664 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/configuration/blocks/topaz_ore.yml @@ -0,0 +1,107 @@ +items: + default:topaz_ore: + data: + item_name: + model: minecraft:block/custom/topaz_ore + behavior: + type: block_item + block: default:topaz_ore + default:deepslate_topaz_ore: + data: + item_name: + model: minecraft:block/custom/deepslate_topaz_ore + behavior: + type: block_item + block: default:deepslate_topaz_ore + default:topaz: + settings: + dye_color: 255,140,0 + anvil_repair_item: + - target: + - '#default:topaz_tools' + percent: 0.25 + data: + item_name: <#FF8C00> + texture: minecraft:item/custom/topaz +blocks: + default:topaz_ore: + behavior: + type: drop_experience_block + amount: 3~7 + condition: + type: enchantment + predicate: minecraft:silk_touch<=0 + loot: + template: default:loot_table/ore + arguments: + ore_drop: default:topaz + ore_block: default:topaz_ore + settings: + template: default:settings/ore + arguments: + break_power: 2 + state: + auto_state: solid + # minecraft:block/cube_all + texture: minecraft:block/custom/topaz_ore + default:deepslate_topaz_ore: + behavior: + type: drop_experience_block + amount: 3~7 + condition: + type: enchantment + predicate: minecraft:silk_touch<=0 + loot: + template: default:loot_table/ore + arguments: + ore_drop: default:topaz + ore_block: default:deepslate_topaz_ore + settings: + template: default:settings/deepslate_ore + arguments: + break_power: 2 + state: + auto_state: solid + # minecraft:block/cube_all + texture: minecraft:block/custom/deepslate_topaz_ore +recipes: + default:topaz_from_smelting_topaz_ore: + type: smelting + experience: 1.0 + category: misc + group: topaz + time: 200 + ingredient: default:topaz_ore + result: + id: default:topaz + count: 1 + default:topaz_from_smelting_deepslate_topaz_ore: + type: smelting + experience: 1.0 + category: misc + group: topaz + time: 200 + ingredient: default:deepslate_topaz_ore + result: + id: default:topaz + count: 1 + default:topaz_from_blasting_topaz_ore: + type: blasting + experience: 1.0 + category: misc + group: topaz + time: 100 + ingredient: default:topaz_ore + result: + id: default:topaz + count: 1 + default:topaz_from_blasting_deepslate_topaz_ore: + type: blasting + experience: 1.0 + category: misc + group: topaz + time: 100 + ingredient: default:deepslate_topaz_ore + result: + id: default:topaz + count: 1 \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/configuration/categories.yml b/Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/configuration/categories.yml new file mode 100644 index 00000000..49b8fd75 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/configuration/categories.yml @@ -0,0 +1,75 @@ +# https://xiao-momi.github.io/craft-engine-wiki/configuration/category +categories: + default:default: + priority: 1 + name: + lore: + - + icon: default:topaz + list: + - '#default:palm_tree' + - '#default:topaz' + - '#default:misc' + default:topaz: + name: <#FF8C00> + hidden: true + icon: default:topaz + list: + - default:topaz + - default:topaz_ore + - default:deepslate_topaz_ore + - default:topaz_axe + - default:topaz_pickaxe + - default:topaz_hoe + - default:topaz_shovel + - default:topaz_sword + - default:topaz_bow + - default:topaz_crossbow + - default:topaz_rod + - default:topaz_trident + - default:topaz_spear + - default:topaz_helmet + - default:topaz_chestplate + - default:topaz_leggings + - default:topaz_boots + default:misc: + name: + hidden: true + icon: default:chinese_lantern + list: + - default:chinese_lantern + - default:netherite_anvil + - default:fairy_flower + - default:reed + - default:flame_cane + - default:gunpowder_block + - default:solid_gunpowder_block + - default:ender_pearl_flower_seeds + - default:gui_head_size_1 + - default:gui_head_size_4 + - minecraft:air + - default:copper_coil + - default:flame_elytra + - default:cap + - default:pebble + - default:chessboard_block + - default:safe_block + - default:sleeper_sofa + - minecraft:air + - minecraft:air + - default:sofa + - default:table_lamp + - default:bench + - default:wooden_chair + - default:flower_basket + - default:amethyst_torch + - default:hami_melon_seeds + - default:hami_melon_slice + - default:hami_melon + - default:magma_fruit + - default:globe + - default:drill + - default:showcase + - default:togglable_light_block + - default:drawer_block + - default:candelabrum \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/configuration/items/topaz_armor.yml b/Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/configuration/items/topaz_armor.yml new file mode 100644 index 00000000..29fa4e66 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/configuration/items/topaz_armor.yml @@ -0,0 +1,216 @@ +items: + default:topaz_helmet: + template: + - default:armor/topaz + arguments: + equipment_part: helmet + equipment_slot: head + equipment_material: topaz + overrides: + data: + item_name: <#FF8C00> + tooltip_style: minecraft:topaz + default:topaz_chestplate: + template: + - default:armor/topaz + arguments: + equipment_part: chestplate + equipment_slot: chest + equipment_material: topaz + overrides: + data: + item_name: <#FF8C00> + tooltip_style: minecraft:topaz + default:topaz_leggings: + template: + - default:armor/topaz + arguments: + equipment_part: leggings + equipment_slot: legs + equipment_material: topaz + overrides: + data: + item_name: <#FF8C00> + tooltip_style: minecraft:topaz + default:topaz_boots: + template: + - default:armor/topaz + arguments: + equipment_part: boots + equipment_slot: feet + equipment_material: topaz + overrides: + data: + item_name: <#FF8C00> + tooltip_style: minecraft:topaz +equipments: + $$>=1.21.2: + default:topaz: + type: component + humanoid: minecraft:entity/equipment/humanoid/topaz + humanoid_leggings: minecraft:entity/equipment/humanoid_leggings/topaz + $$<1.21.2: + default:topaz: + type: trim + humanoid: minecraft:entity/equipment/humanoid/topaz + humanoid_leggings: minecraft:entity/equipment/humanoid_leggings/topaz +recipes: + default:topaz_helmet: + type: shaped + category: equipment + pattern: + - AAA + - A A + ingredients: + A: default:topaz + result: + id: default:topaz_helmet + count: 1 + default:topaz_chestplate: + type: shaped + category: equipment + pattern: + - A A + - AAA + - AAA + ingredients: + A: default:topaz + result: + id: default:topaz_chestplate + count: 1 + default:topaz_leggings: + type: shaped + category: equipment + pattern: + - AAA + - A A + - A A + ingredients: + A: default:topaz + result: + id: default:topaz_leggings + count: 1 + default:topaz_boots: + type: shaped + category: equipment + pattern: + - A A + - A A + ingredients: + A: default:topaz + result: + id: default:topaz_boots + count: 1 +templates: + default:armor/topaz: + material: chainmail_${equipment_part} + settings: + tags: + - default:${equipment_material}_tools + - minecraft:trimmable_armor + equipment: + asset_id: ${__NAMESPACE__}:${equipment_material} + $$>=1.21.2: + slot: ${equipment_slot} + model: + template: default:model/armor_trim + arguments: + equipment_texture: minecraft:item/custom/${equipment_material}_${equipment_part} + default:model/armor_trim: + type: minecraft:select + property: minecraft:trim_material + fallback: + path: ${__NAMESPACE__}:item/${equipment_material}_${equipment_part} + generation: + parent: minecraft:item/generated + textures: + layer0: ${equipment_texture} + cases: + - when: minecraft:quartz + model: + path: ${__NAMESPACE__}:item/${equipment_material}_${equipment_part}_quartz_trim + generation: + parent: minecraft:item/generated + textures: + layer0: ${equipment_texture} + layer1: minecraft:trims/items/${equipment_part}_trim_quartz + - when: minecraft:iron + model: + path: ${__NAMESPACE__}:item/${equipment_material}_${equipment_part}_iron_trim + generation: + parent: minecraft:item/generated + textures: + layer0: ${equipment_texture} + layer1: minecraft:trims/items/${equipment_part}_trim_iron + - when: minecraft:netherite + model: + path: ${__NAMESPACE__}:item/${equipment_material}_${equipment_part}_netherite_trim + generation: + parent: minecraft:item/generated + textures: + layer0: ${equipment_texture} + layer1: minecraft:trims/items/${equipment_part}_trim_netherite + - when: minecraft:redstone + model: + path: ${__NAMESPACE__}:item/${equipment_material}_${equipment_part}_redstone_trim + generation: + parent: minecraft:item/generated + textures: + layer0: ${equipment_texture} + layer1: minecraft:trims/items/${equipment_part}_trim_redstone + - when: minecraft:copper + model: + path: ${__NAMESPACE__}:item/${equipment_material}_${equipment_part}_copper_trim + generation: + parent: minecraft:item/generated + textures: + layer0: ${equipment_texture} + layer1: minecraft:trims/items/${equipment_part}_trim_copper + - when: minecraft:gold + model: + path: ${__NAMESPACE__}:item/${equipment_material}_${equipment_part}_gold_trim + generation: + parent: minecraft:item/generated + textures: + layer0: ${equipment_texture} + layer1: minecraft:trims/items/${equipment_part}_trim_gold + - when: minecraft:emerald + model: + path: ${__NAMESPACE__}:item/${equipment_material}_${equipment_part}_emerald_trim + generation: + parent: minecraft:item/generated + textures: + layer0: ${equipment_texture} + layer1: minecraft:trims/items/${equipment_part}_trim_emerald + - when: minecraft:diamond + model: + path: ${__NAMESPACE__}:item/${equipment_material}_${equipment_part}_diamond_trim + generation: + parent: minecraft:item/generated + textures: + layer0: ${equipment_texture} + layer1: minecraft:trims/items/${equipment_part}_trim_diamond + - when: minecraft:lapis + model: + path: ${__NAMESPACE__}:item/${equipment_material}_${equipment_part}_lapis_trim + generation: + parent: minecraft:item/generated + textures: + layer0: ${equipment_texture} + layer1: minecraft:trims/items/${equipment_part}_trim_lapis + - when: minecraft:amethyst + model: + path: ${__NAMESPACE__}:item/${equipment_material}_${equipment_part}_amethyst_trim + generation: + parent: minecraft:item/generated + textures: + layer0: ${equipment_texture} + layer1: minecraft:trims/items/${equipment_part}_trim_amethyst + - when: minecraft:resin + model: + path: ${__NAMESPACE__}:item/${equipment_material}_${equipment_part}_resin_trim + generation: + parent: minecraft:item/generated + textures: + layer0: ${equipment_texture} + layer1: minecraft:trims/items/${equipment_part}_trim_resin \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/configuration/items/topaz_tool_weapon.yml b/Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/configuration/items/topaz_tool_weapon.yml new file mode 100644 index 00000000..f9cb5963 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/configuration/items/topaz_tool_weapon.yml @@ -0,0 +1,304 @@ +items: + default:topaz_rod: + material: fishing_rod + settings: + tags: + - default:topaz_tools + data: + item_name: <#FF8C00> + tooltip_style: minecraft:topaz + textures: + - minecraft:item/custom/topaz_rod + - minecraft:item/custom/topaz_rod_cast + default:topaz_bow: + material: bow + settings: + tags: + - default:topaz_tools + data: + item_name: <#FF8C00> + tooltip_style: minecraft:topaz + textures: + - minecraft:item/custom/topaz_bow + - minecraft:item/custom/topaz_bow_pulling_0 + - minecraft:item/custom/topaz_bow_pulling_1 + - minecraft:item/custom/topaz_bow_pulling_2 + default:topaz_crossbow: + material: crossbow + settings: + tags: + - default:topaz_tools + data: + item_name: <#FF8C00> + tooltip_style: minecraft:topaz + textures: + - minecraft:item/custom/topaz_crossbow + - minecraft:item/custom/topaz_crossbow_pulling_0 + - minecraft:item/custom/topaz_crossbow_pulling_1 + - minecraft:item/custom/topaz_crossbow_pulling_2 + - minecraft:item/custom/topaz_crossbow_arrow + - minecraft:item/custom/topaz_crossbow_firework + default:topaz_pickaxe: + material: golden_pickaxe + settings: + tags: + - default:topaz_tools + data: + item_name: <#FF8C00> + tooltip_style: minecraft:topaz + max_damage: 64 + texture: minecraft:item/custom/topaz_pickaxe + default:topaz_axe: + material: golden_axe + settings: + tags: + - default:topaz_tools + data: + item_name: <#FF8C00> + tooltip_style: minecraft:topaz + max_damage: 64 + texture: minecraft:item/custom/topaz_axe + default:topaz_hoe: + material: golden_hoe + settings: + tags: + - default:topaz_tools + data: + item_name: <#FF8C00> + tooltip_style: minecraft:topaz + max_damage: 64 + texture: minecraft:item/custom/topaz_hoe + default:topaz_shovel: + material: golden_shovel + settings: + tags: ["default:topaz_tools"] + data: + item_name: <#FF8C00> + tooltip_style: minecraft:topaz + max_damage: 64 + texture: minecraft:item/custom/topaz_shovel + default:topaz_sword: + material: golden_sword + settings: + tags: ["default:topaz_tools"] + data: + item_name: <#FF8C00> + tooltip_style: minecraft:topaz + max_damage: 64 + texture: minecraft:item/custom/topaz_sword + $$>=1.21.4#topaz_trident: + default:topaz_trident: + material: trident + settings: + projectile: + display: + item: default:topaz_trident + translation: 0,0,0 + rotation: 1,1,1,1 + display_transform: NONE + scale: 0.5 + sounds: + throw: minecraft:item.trident.throw + hit_entity: minecraft:item.trident.hit + hit_block: minecraft:item.trident.hit_ground + tags: + - default:topaz_tools + data: + item_name: <#FF8C00> + tooltip_style: minecraft:topaz + max_damage: 300 + model: + type: minecraft:select + property: minecraft:display_context + cases: + - when: + - gui + - ground + - fixed + - on_shelf + model: + type: minecraft:model + path: minecraft:item/custom/topaz_trident + generation: + parent: minecraft:item/generated + textures: + layer0: minecraft:item/custom/topaz_trident + fallback: + type: minecraft:condition + property: minecraft:using_item + on_true: + type: minecraft:model + path: minecraft:item/custom/topaz_trident_throwing + on_false: + type: minecraft:model + path: minecraft:item/custom/topaz_trident_in_hand + legacy_model: + path: minecraft:item/custom/topaz_trident_in_hand + overrides: + - path: minecraft:item/custom/topaz_trident_throwing + predicate: + throwing: 1 + $$1.20.1~1.21.3#topaz_trident: + default:topaz_trident: + material: trident + client_bound_material: + $$1.20.1~1.21.1: bow + $$1.21.2~1.21.3: honey_bottle + data: + item_name: <#FF8C00> + components: + minecraft:max_damage: 300 + $$>=1.21.2: + client_bound_data: + components: + minecraft:consumable: + consume_seconds: 128000 + animation: spear + settings: + projectile: + display: + item: default:topaz_trident + translation: 0,0,0 + rotation: 1,1,1,1 + display_transform: NONE + scale: 0.5 + sounds: + throw: minecraft:item.trident.throw + hit_entity: minecraft:item.trident.hit + hit_block: minecraft:item.trident.hit_ground + tags: + - default:topaz_tools + model: + type: minecraft:condition + property: minecraft:using_item + on_true: + type: minecraft:model + path: minecraft:item/custom/topaz_trident_throwing + on_false: + type: minecraft:model + path: minecraft:item/custom/topaz_trident_in_hand + $$>=1.21.11#topaz_spear: + default:topaz_spear: + material: golden_spear + swap_animation_scale: 1.95 + textures: + - minecraft:item/custom/topaz_spear + - minecraft:item/custom/topaz_spear_in_hand + settings: + tags: ["default:topaz_tools"] + data: + item_name: <#FF8C00> + tooltip_style: minecraft:topaz + max_damage: 192 +recipes: + default:topaz_shovel: + type: shaped + category: equipment + pattern: + - A + - B + - B + ingredients: + A: default:topaz + B: minecraft:stick + result: + id: default:topaz_shovel + count: 1 + default:topaz_axe: + type: shaped + category: equipment + pattern: + - 'AA' + - 'AB' + - ' B' + ingredients: + A: default:topaz + B: minecraft:stick + result: + id: default:topaz_axe + count: 1 + default:topaz_sword: + type: shaped + category: equipment + pattern: + - A + - A + - B + ingredients: + A: default:topaz + B: minecraft:stick + result: + id: default:topaz_sword + count: 1 + default:topaz_hoe: + type: shaped + category: equipment + pattern: + - 'AA' + - ' B' + - ' B' + ingredients: + A: default:topaz + B: minecraft:stick + result: + id: default:topaz_hoe + count: 1 + default:topaz_pickaxe: + type: shaped + category: equipment + pattern: + - 'AAA' + - ' B ' + - ' B ' + ingredients: + A: default:topaz + B: minecraft:stick + result: + id: default:topaz_pickaxe + count: 1 + default:topaz_bow: + type: smithing_transform + base: minecraft:bow + addition: default:topaz + template_type: default:topaz + result: + id: default:topaz_bow + count: 1 + default:topaz_crossbow: + type: smithing_transform + base: minecraft:crossbow + addition: default:topaz + template_type: default:topaz + result: + id: default:topaz_crossbow + count: 1 + default:topaz_rod: + type: smithing_transform + base: minecraft:fishing_rod + addition: default:topaz + template_type: default:topaz + result: + id: default:topaz_rod + count: 1 + default:topaz_trident: + type: smithing_transform + base: minecraft:trident + addition: default:topaz + template_type: default:topaz + result: + id: default:topaz_trident + count: 1 + $$>=1.21.11#topaz_spear: + default:topaz_spear: + type: shaped + category: equipment + pattern: + - ' A' + - ' B ' + - 'B ' + ingredients: + A: default:topaz + B: minecraft:stick + result: + id: default:topaz_spear + count: 1 \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/configuration/langs/en_us.yml b/Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/configuration/langs/en_us.yml new file mode 100644 index 00000000..1c7d5f01 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/configuration/langs/en_us.yml @@ -0,0 +1,130 @@ +# All the configurations below use a localization system implemented based on the client-side resource pack. +# https://xiao-momi.github.io/craft-engine-wiki/configuration/lang +lang#items: + en_us: + item.default.chinese_lantern: Chinese Lantern + item.default.fairy_flower: Fairy Flower + item.default.reed: Reed + item.default.flame_cane: Flame Cane + item.default.ender_pearl_flower_seeds: Ender Pearl Flower Seeds + item.default.bench: Bench + item.default.table_lamp: Table Lamp + item.default.wooden_chair: Wooden Chair + item.default.topaz_rod: Topaz Rod + item.default.topaz_bow: Topaz Bow + item.default.topaz_crossbow: Topaz Crossbow + item.default.topaz_pickaxe: Topaz Pickaxe + item.default.topaz_axe: Topaz Axe + item.default.topaz_hoe: Topaz Hoe + item.default.topaz_shovel: Topaz Shovel + item.default.topaz_sword: Topaz Sword + item.default.topaz_helmet: Topaz Helmet + item.default.topaz_chestplate: Topaz Chestplate + item.default.topaz_leggings: Topaz Leggings + item.default.topaz_boots: Topaz Boots + item.default.topaz_trident: Topaz Trident + item.default.topaz_spear: Topaz Spear + item.default.topaz_ore: Topaz Ore + item.default.deepslate_topaz_ore: Deepslate Topaz Ore + item.default.topaz: Topaz + item.default.palm_log: Palm Log + item.default.stripped_palm_log: Stripped Palm Log + item.default.palm_wood: Palm Wood + item.default.stripped_palm_wood: Stripped Palm Wood + item.default.palm_planks: Palm Planks + item.default.palm_sapling: Palm Sapling + item.default.palm_leaves: Palm Leaves + item.default.palm_trapdoor: Palm Trapdoor + item.default.palm_door: Palm Door + item.default.palm_fence_gate: Palm Fence Gate + item.default.palm_slab: Palm Slab + item.default.palm_stairs: Palm Stairs + item.default.palm_pressure_plate: Palm Pressure Plate + item.default.palm_button: Palm Button + item.default.palm_fence: Palm Fence + item.default.netherite_anvil: Netherite Anvil + item.default.gunpowder_block: GunPowder Block + item.default.solid_gunpowder_block: Solid GunPowder Block + item.default.copper_coil: Copper Coil + item.default.flame_elytra: Flame Elytra + item.default.pebble: Pebble + item.default.cap: Cap + item.default.flower_basket: Flower Basket + item.default.chessboard_block: Chessboard Block + item.default.safe_block: Safe Block + item.default.sofa: Sofa + item.default.amethyst_torch: Amethyst Torch + item.default.hami_melon_slice: Hami Melon Slice + item.default.hami_melon: Hami Melon + item.default.hami_melon_seeds: Hami Melon Seeds + item.default.magma_fruit: Magma Fruit + item.default.globe: Globe + item.default.drill: Drill + item.default.togglable_light_block: Togglable Light Block + item.default.showcase: Showcase + item.default.drawer_block: Drawer Block + item.default.candelabrum: Candelabrum +# Providing translations for blocks is particularly effective for plugins that retrieve server-side block translation keys. +lang#blocks: + en_us: + block_name:default:chinese_lantern: Chinese Lantern + block_name:default:netherite_anvil: Netherite Anvil + block_name:default:topaz_ore: Topaz Ore + block_name:default:deepslate_topaz_ore: Deepslate Topaz Ore + block_name:default:palm_log: Palm Log + block_name:default:stripped_palm_log: Stripped Palm Log + block_name:default:palm_wood: Palm Wood + block_name:default:stripped_palm_wood: Stripped Palm Wood + block_name:default:palm_planks: Palm Planks + block_name:default:palm_sapling: Palm Sapling + block_name:default:palm_leaves: Palm Leaves + block_name:default:palm_trapdoor: Palm Trapdoor + block_name:default:palm_door: Palm Door + block_name:default:palm_fence_gate: Palm Fence Gate + block_name:default:palm_slab: Palm Slab + block_name:default:palm_stairs: Palm Stairs + block_name:default:palm_button: Palm Button + block_name:default:palm_fence: Palm Fence + block_name:default:fairy_flower: Fairy Flower + block_name:default:reed: Reed + block_name:default:flame_cane: Flame Cane + block_name:default:ender_pearl_flower: Ender Pearl Flower + block_name:default:gunpowder_block: GunPowder Block + block_name:default:solid_gunpowder_block: Solid GunPowder Block + block_name:default:copper_coil: Copper Coil + block_name:default:chessboard_block: Chessboard Block + block_name:default:safe_block: Safe Block + block_name:default:sleeper_sofa: Sofa + block_name:default:sofa: Sofa + block_name:default:amethyst_torch: Amethyst Torch + block_name:default:amethyst_wall_torch: Amethyst Torch + block_name:default:hami_melon: Hami Melon + block_name:default:hami_melon_stem: Hami Melon Stem + block_name:default:attached_hami_melon_stem: Hami Melon Stem + block_name:default:magma_plant: Magma Plant + block_name:default:togglable_light_block: Togglable Light Block + block_name:default:drawer_block: Drawer Block +# Translations for furniture are typically designed for the API. +# If you are using a plugin that supports displaying furniture names, you will most likely need to configure the translations for the furniture. +lang#furniture: + en_us: + furniture.default.bench: Bench + furniture.default.flower_basket: Flower Basket + furniture.default.globe: Globe + furniture.default.wooden_chair: Wooden Chair + furniture.default.showcase: Showcase + furniture.default.candelabrum: Candelabrum +# The term "translation" here specifically refers to localization on the server-side. +# This means that the content you write will not be directly included in the client-side resource pack. +# The server will translate the keys you set and then send the already-localized text to the client. +# https://xiao-momi.github.io/craft-engine-wiki/configuration/i18n +translations#categories: + en_us: + category.default.name: Default Assets + category.default.lore: Contains the default configuration of CraftEngine + category.palm_tree: Palm Tree + category.topaz: Topaz + category.misc: Misc +translations#emoji: + en_us: + emoji.tip: Use '' to send the '' emoji \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/configuration/langs/fr_fr.yml b/Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/configuration/langs/fr_fr.yml new file mode 100644 index 00000000..943a0786 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/configuration/langs/fr_fr.yml @@ -0,0 +1,130 @@ +# Toutes les configurations ci-dessous utilisent un système de localisation implémenté basé sur le pack de ressources côté client. +# https://xiao-momi.github.io/craft-engine-wiki/configuration/lang +lang#items: + fr_fr: + item.default.chinese_lantern: Lanterne Chinoise + item.default.fairy_flower: Fleur Fée + item.default.reed: Roseau + item.default.flame_cane: Canne de Flamme + item.default.ender_pearl_flower_seeds: Graines de Fleur de Perle du Néant + item.default.bench: Banc + item.default.table_lamp: Lampe de Table + item.default.wooden_chair: Chaise en Bois + item.default.topaz_rod: Canne à Topaze + item.default.topaz_bow: Arc en Topaze + item.default.topaz_crossbow: Arbalète en Topaze + item.default.topaz_pickaxe: Pioche en Topaze + item.default.topaz_axe: Hache en Topaze + item.default.topaz_hoe: Houe en Topaze + item.default.topaz_shovel: Pelle en Topaze + item.default.topaz_sword: Épée en Topaze + item.default.topaz_helmet: Casque en Topaze + item.default.topaz_chestplate: Plastron en Topaze + item.default.topaz_leggings: Jambières en Topaze + item.default.topaz_boots: Bottes en Topaze + item.default.topaz_trident: Trident en Topaze + item.default.topaz_spear: Lance en Topaze + item.default.topaz_ore: Minerai de Topaze + item.default.deepslate_topaz_ore: Minerai de Topaze en Schiste Sombre + item.default.topaz: Topaze + item.default.palm_log: Bois de Palmier + item.default.stripped_palm_log: Bois de Palmier Écorcé + item.default.palm_wood: Bois de Palmier + item.default.stripped_palm_wood: Bois de Palmier Écorcé + item.default.palm_planks: Planches de Palmier + item.default.palm_sapling: Pousse de Palmier + item.default.palm_leaves: Feuilles de Palmier + item.default.palm_trapdoor: Trappe en Palmier + item.default.palm_door: Porte en Palmier + item.default.palm_fence_gate: Portail de Barrière en Palmier + item.default.palm_slab: Dalle en Palmier + item.default.palm_stairs: Escalier en Palmier + item.default.palm_pressure_plate: Plaque de Pression en Palmier + item.default.palm_button: Bouton en Palmier + item.default.palm_fence: Barrière en Palmier + item.default.netherite_anvil: Enclume en Netherite + item.default.gunpowder_block: Bloc de Poudre à Canon + item.default.solid_gunpowder_block: Bloc de Poudre à Canon Solide + item.default.copper_coil: Bobine de Cuivre + item.default.flame_elytra: Élytres de Flamme + item.default.pebble: Caillou + item.default.cap: Casquette + item.default.flower_basket: Panier de Fleurs + item.default.chessboard_block: Bloc Damier + item.default.safe_block: Coffre-Fort + item.default.sofa: Canapé + item.default.amethyst_torch: Torche en Améthyste + item.default.hami_melon_slice: Tranche de Melon de Hami + item.default.hami_melon: Melon de Hami + item.default.hami_melon_seeds: Graines de Melon de Hami + item.default.magma_fruit: Fruit de Magma + item.default.globe: Globe + item.default.drill: La perceuse + item.default.togglable_light_block: Bloc de lumière réglable + item.default.showcase: Vitrine + item.default.drawer_block: Bloc de tiroir + item.default.candelabrum: Candélabre +# Fournir des traductions pour les blocs est particulièrement efficace pour les plugins qui récupèrent les clés de traduction des blocs côté serveur. +lang#blocks: + fr_fr: + block_name:default:chinese_lantern: Lanterne Chinoise + block_name:default:netherite_anvil: Enclume en Netherite + block_name:default:topaz_ore: Minerai de Topaze + block_name:default:deepslate_topaz_ore: Minerai de Topaze en Schiste Sombre + block_name:default:palm_log: Bois de Palmier + block_name:default:stripped_palm_log: Bois de Palmier Écorcé + block_name:default:palm_wood: Bois de Palmier + block_name:default:stripped_palm_wood: Bois de Palmier Écorcé + block_name:default:palm_planks: Planches de Palmier + block_name:default:palm_sapling: Pousse de Palmier + block_name:default:palm_leaves: Feuilles de Palmier + block_name:default:palm_trapdoor: Trappe en Palmier + block_name:default:palm_door: Porte en Palmier + block_name:default:palm_fence_gate: Portail de Barrière en Palmier + block_name:default:palm_slab: Dalle en Palmier + block_name:default:palm_stairs: Escalier en Palmier + block_name:default:palm_button: Bouton en Palmier + block_name:default:palm_fence: Barrière en Palmier + block_name:default:fairy_flower: Fleur Fée + block_name:default:reed: Roseau + block_name:default:flame_cane: Canne de Flamme + block_name:default:ender_pearl_flower: Fleur de Perle du Néant + block_name:default:gunpowder_block: Bloc de Poudre à Canon + block_name:default:solid_gunpowder_block: Bloc de Poudre à Canon Solide + block_name:default:copper_coil: Bobine de Cuivre + block_name:default:chessboard_block: Bloc Damier + block_name:default:safe_block: Coffre-Fort + block_name:default:sleeper_sofa: Canapé + block_name:default:sofa: Canapé + block_name:default:amethyst_torch: Torche en Améthyste + block_name:default:amethyst_wall_torch: Torche en Améthyste + block_name:default:hami_melon: Melon de Hami + block_name:default:hami_melon_stem: Tige de Melon de Hami + block_name:default:attached_hami_melon_stem: Tige de Melon de Hami + block_name:default:magma_plant: Plante de Magma + block_name:default:togglable_light_block: Bloc de lumière réglable + block_name:default:drawer_block: Bloc de tiroir +# Les traductions pour les meubles sont généralement conçues pour l'API. +# Si vous utilisez un plugin qui prend en charge l'affichage des noms de meubles, vous devrez très probablement configurer les traductions pour les meubles. +lang#furniture: + fr_fr: + furniture.default.bench: Banc + furniture.default.flower_basket: Panier de fleurs + furniture.default.globe: Globe + furniture.default.wooden_chair: Chaise en bois + furniture.default.showcase: Vitrine + furniture.default.candelabrum: Candélabre +# Le terme "translation" fait ici spécifiquement référence à la localisation côté serveur. +# Cela signifie que le contenu que vous écrivez ne sera pas directement inclus dans le pack de ressources côté client. +# Le serveur traduira les clés que vous définissez, puis enverra le texte déjà localisé au client. +# https://xiao-momi.github.io/craft-engine-wiki/configuration/i18n +translations#categories: + fr_fr: + category.default.name: Ressources par Défaut + category.default.lore: Contient la configuration par défaut de CraftEngine + category.palm_tree: Palmier + category.topaz: Topaze + category.misc: Divers +translations#emoji: + fr_fr: + emoji.tip: Utilisez '' pour envoyer l'emoji '' diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/configuration/langs/ko_kr.yml b/Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/configuration/langs/ko_kr.yml new file mode 100644 index 00000000..f41c4b90 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/configuration/langs/ko_kr.yml @@ -0,0 +1,130 @@ +# 아래의 모든 설정은 클라이언트 측 리소스팩을 기반으로 구현된 로컬라이제이션 시스템을 사용합니다. +# https://xiao-momi.github.io/craft-engine-wiki/configuration/lang +lang#items: + ko_kr: + item.default.chinese_lantern: 중국식 등불 + item.default.fairy_flower: 요정 꽃 + item.default.reed: 갈대 + item.default.flame_cane: 화염 지팡이 + item.default.ender_pearl_flower_seeds: 엔더 진주 꽃 씨앗 + item.default.bench: 벤치 + item.default.table_lamp: 테이블 램프 + item.default.wooden_chair: 나무 의자 + item.default.topaz_rod: 토파즈 지팡이 + item.default.topaz_bow: 토파즈 활 + item.default.topaz_crossbow: 토파즈 석궁 + item.default.topaz_pickaxe: 토파즈 곡괭이 + item.default.topaz_axe: 토파즈 도끼 + item.default.topaz_hoe: 토파즈 괭이 + item.default.topaz_shovel: 토파즈 삽 + item.default.topaz_sword: 토파즈 검 + item.default.topaz_helmet: 토파즈 투구 + item.default.topaz_chestplate: 토파즈 흉갑 + item.default.topaz_leggings: 토파즈 다리보호구 + item.default.topaz_boots: 토파즈 부츠 + item.default.topaz_trident: 토파즈 삼지창 + item.default.topaz_spear: 토파즈 창 + item.default.topaz_ore: 토파즈 원석 + item.default.deepslate_topaz_ore: 심층암 토파즈 원석 + item.default.topaz: 토파즈 + item.default.palm_log: 야자나무 원목 + item.default.stripped_palm_log: 껍질 벗긴 야자나무 원목 + item.default.palm_wood: 야자나무 + item.default.stripped_palm_wood: 껍질 벗긴 야자나무 + item.default.palm_planks: 야자나무 판자 + item.default.palm_sapling: 야자나무 묘목 + item.default.palm_leaves: 야자나무 잎 + item.default.palm_trapdoor: 야자나무 다락문 + item.default.palm_door: 야자나무 문 + item.default.palm_fence_gate: 야자나무 울타리 문 + item.default.palm_slab: 야자나무 반 블록 + item.default.palm_stairs: 야자나무 계단 + item.default.palm_pressure_plate: 야자나무 압력판 + item.default.palm_button: 야자나무 버튼 + item.default.palm_fence: 야자나무 울타리 + item.default.netherite_anvil: 네더라이트 모루 + item.default.gunpowder_block: 화약 블록 + item.default.solid_gunpowder_block: 압축 화약 블록 + item.default.copper_coil: 구리 코일 + item.default.flame_elytra: 불꽃 겉날개 + item.default.pebble: 조약돌 + item.default.cap: 모자 + item.default.flower_basket: 꽃바구니 + item.default.chessboard_block: 체스판 블록 + item.default.safe_block: 금고 + item.default.sofa: 소파 + item.default.amethyst_torch: 자수정 횃불 + item.default.hami_melon_slice: 하미 멜론 조각 + item.default.hami_melon: 하미 멜론 + item.default.hami_melon_seeds: 하미 멜론 씨앗 + item.default.magma_fruit: 마그마 과일 + item.default.globe: 지구본 + item.default.drill: 드릴 + item.default.togglable_light_block: 빛 조절 블록 + item.default.showcase: 전시대 + item.default.drawer_block: 서랍 + item.default.candelabrum: 촛대 +# 블록 번역 제공은 서버 측 블록 번역 키를 가져오는 플러그인에서 특히 효과적입니다. +lang#blocks: + ko_kr: + block_name:default:chinese_lantern: 중국식 등불 + block_name:default:netherite_anvil: 네더라이트 모루 + block_name:default:topaz_ore: 토파즈 원석 + block_name:default:deepslate_topaz_ore: 심층암 토파즈 원석 + block_name:default:palm_log: 아자나무 원목 + block_name:default:stripped_palm_log: 껍질 벗긴 야자나무 원목 + block_name:default:palm_wood: 야자나무 + block_name:default:stripped_palm_wood: 껍질 벗긴 야자나무 + block_name:default:palm_planks: 야자나무 판자 + block_name:default:palm_sapling: 야자나무 묘목 + block_name:default:palm_leaves: 야자나무 잎 + block_name:default:palm_trapdoor: 야자나무 다락문 + block_name:default:palm_door: 야자나무 문 + block_name:default:palm_fence_gate: 야자나무 울타리 문 + block_name:default:palm_slab: 야자나무 반 블록 + block_name:default:palm_stairs: 야자나무 계단 + block_name:default:palm_button: 야자나무 버튼 + block_name:default:palm_fence: 야자나무 울타리 + block_name:default:fairy_flower: 요정 꽃 + block_name:default:reed: 갈대 + block_name:default:flame_cane: 화염 지팡이 + block_name:default:ender_pearl_flower: 엔더 진주 꽃 + block_name:default:gunpowder_block: 화약 블록 + block_name:default:solid_gunpowder_block: 압축 화약 블록 + block_name:default:copper_coil: 구리 코일 + block_name:default:chessboard_block: 체스판 블록 + block_name:default:safe_block: 금고 + block_name:default:sleeper_sofa: 소파 + block_name:default:sofa: 소파 + block_name:default:amethyst_torch: 자수정 횃불 + block_name:default:amethyst_wall_torch: 자수정 횃불 + block_name:default:hami_melon: 하미 멜론 + block_name:default:hami_melon_stem: 하미 멜론 줄기 + block_name:default:attached_hami_melon_stem: 하미 멜론 줄기 + block_name:default:magma_plant: 마그마 식물 + block_name:default:togglable_light_block: 빛 조절 블록 + block_name:default:drawer_block: 서랍 +# 가구 번역은 일반적으로 API 용도로 설계됩니다. +# 가구 이름 표시를 지원하는 플러그인을 사용하는 경우, 가구 번역을 별도로 설정해야 할 가능성이 높습니다. +lang#furniture: + ko_kr: + furniture.default.bench: 벤치 + furniture.default.flower_basket: 꽃바구니 + furniture.default.globe: 지구본 + furniture.default.wooden_chair: 나무 의자 + furniture.default.showcase: 전시대 + furniture.default.candelabrum: 촛대 +# 여기서 "번역(translation)"이라는 용어는 서버 측 로컬라이제이션을 의미합니다. +# 즉, 사용자가 작성한 내용이 클라이언트 측 리소스팩에 직접 포함되지 않습니다. +# 서버가 사용자가 설정한 키를 번역한 후, 이미 로컬라이즈된 텍스트를 클라이언트로 전송합니다. +# https://xiao-momi.github.io/craft-engine-wiki/configuration/i18n +translations#categories: + ko_kr: + category.default.name: 기본 에셋 + category.default.lore: CraftEngine의 기본 설정을 포함합니다 + category.palm_tree: 야자나무 + category.topaz: 토파즈 + category.misc: 기타 +translations#emoji: + ko_kr: + emoji.tip: "'' 입력 시 '' 이모지가 표시됩니다" \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/configuration/langs/zh_cn.yml b/Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/configuration/langs/zh_cn.yml new file mode 100644 index 00000000..81f63ceb --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/configuration/langs/zh_cn.yml @@ -0,0 +1,130 @@ +# 以下所有配置均采用基于客户端资源包实现的本地化系统 +# https://ce.gtemc.cn/zh-Hans/configuration/lang +lang#items: + zh_cn: + item.default.chinese_lantern: 灯笼 + item.default.fairy_flower: 仙灵花 + item.default.reed: 芦苇 + item.default.flame_cane: 烈焰甘蔗 + item.default.ender_pearl_flower_seeds: 末影珍珠花种子 + item.default.bench: 长椅 + item.default.table_lamp: 台灯 + item.default.wooden_chair: 木椅 + item.default.topaz_rod: 黄玉钓竿 + item.default.topaz_bow: 黄玉弓 + item.default.topaz_crossbow: 黄玉弩 + item.default.topaz_pickaxe: 黄玉镐 + item.default.topaz_axe: 黄玉斧 + item.default.topaz_hoe: 黄玉锄 + item.default.topaz_shovel: 黄玉锹 + item.default.topaz_sword: 黄玉剑 + item.default.topaz_helmet: 黄玉头盔 + item.default.topaz_chestplate: 黄玉胸甲 + item.default.topaz_leggings: 黄玉护腿 + item.default.topaz_boots: 黄玉靴子 + item.default.topaz_trident: 黄玉三叉戟 + item.default.topaz_spear: 黄玉矛 + item.default.topaz_ore: 黄玉矿石 + item.default.deepslate_topaz_ore: 深层黄玉矿石 + item.default.topaz: 黄玉 + item.default.palm_log: 棕榈原木 + item.default.stripped_palm_log: 去皮棕榈原木 + item.default.palm_wood: 棕榈木 + item.default.stripped_palm_wood: 去皮棕榈木 + item.default.palm_planks: 棕榈木板 + item.default.palm_sapling: 棕榈树苗 + item.default.palm_leaves: 棕榈树叶 + item.default.palm_trapdoor: 棕榈木活板门 + item.default.palm_door: 棕榈木门 + item.default.palm_fence_gate: 棕榈木栅栏门 + item.default.palm_slab: 棕榈木台阶 + item.default.palm_stairs: 棕榈木楼梯 + item.default.palm_pressure_plate: 棕榈木压力板 + item.default.palm_button: 棕榈木按钮 + item.default.palm_fence: 棕榈木栅栏 + item.default.netherite_anvil: 下界合金砧 + item.default.gunpowder_block: 火药粉末 + item.default.solid_gunpowder_block: 凝固火药块 + item.default.copper_coil: 铜线圈 + item.default.flame_elytra: 烈焰鞘翅 + item.default.pebble: 石子 + item.default.cap: 鸭舌帽 + item.default.flower_basket: 花篮 + item.default.chessboard_block: 棋盘方块 + item.default.safe_block: 保险柜 + item.default.sofa: 沙发 + item.default.amethyst_torch: 紫水晶火把 + item.default.hami_melon_slice: 哈密瓜片 + item.default.hami_melon: 哈密瓜 + item.default.hami_melon_seeds: 哈密瓜种子 + item.default.magma_fruit: 岩浆果实 + item.default.globe: 地球仪 + item.default.drill: 钻头 + item.default.togglable_light_block: 可调节光源方块 + item.default.showcase: 物品展示柜 + item.default.drawer_block: 抽屉方块 + item.default.candelabrum: 烛台 +# 为方块提供翻译,对于那些需要获取服务端方块本地化键名的插件来说尤其有效 +lang#blocks: + zh_cn: + block_name:default:chinese_lantern: 灯笼 + block_name:default:netherite_anvil: 下界合金砧 + block_name:default:topaz_ore: 黄玉矿石 + block_name:default:deepslate_topaz_ore: 深层黄玉矿石 + block_name:default:palm_log: 棕榈原木 + block_name:default:stripped_palm_log: 去皮棕榈原木 + block_name:default:palm_wood: 棕榈木 + block_name:default:stripped_palm_wood: 去皮棕榈木 + block_name:default:palm_planks: 棕榈木板 + block_name:default:palm_sapling: 棕榈树苗 + block_name:default:palm_leaves: 棕榈树叶 + block_name:default:palm_trapdoor: 棕榈木活板门 + block_name:default:palm_door: 棕榈木门 + block_name:default:palm_fence_gate: 棕榈木栅栏门 + block_name:default:palm_slab: 棕榈木台阶 + block_name:default:palm_stairs: 棕榈木楼梯 + block_name:default:palm_button: 棕榈木按钮 + block_name:default:palm_fence: 棕榈木栅栏 + block_name:default:fairy_flower: 仙灵花 + block_name:default:reed: 芦苇 + block_name:default:flame_cane: 烈焰甘蔗 + block_name:default:ender_pearl_flower: 末影珍珠花 + block_name:default:gunpowder_block: 火药粉末 + block_name:default:solid_gunpowder_block: 凝固火药块 + block_name:default:copper_coil: 铜线圈 + block_name:default:chessboard_block: 棋盘方块 + block_name:default:safe_block: 保险柜 + block_name:default:sleeper_sofa: 沙发 + block_name:default:sofa: 沙发 + block_name:default:amethyst_torch: 紫水晶火把 + block_name:default:amethyst_wall_torch: 紫水晶火把 + block_name:default:hami_melon: 哈密瓜 + block_name:default:hami_melon_stem: 哈密瓜茎 + block_name:default:attached_hami_melon_stem: 哈密瓜茎 + block_name:default:magma_plant: 岩浆植物 + block_name:default:togglable_light_block: 可调节光源方块 + block_name:default:drawer_block: 抽屉方块 +# 家具相关的翻译通常是为 API 设计的 +# 如果你使用的插件支持显示家具名称,那么你很可能需要配置这些家具的翻译 +lang#furniture: + zh_cn: + furniture.default.bench: 长椅 + furniture.default.flower_basket: 花篮 + furniture.default.globe: 地球仪 + furniture.default.wooden_chair: 木椅 + furniture.default.showcase: 物品展示柜 + furniture.default.candelabrum: 烛台 +# 此处的 "translation" 特指服务端的本地化 +# 这意味着您编写的内容不会直接包含在客户端资源包中 +# 服务端会对您设置的键名进行翻译,然后将已本地化的文本发送给客户端 +# https://ce.gtemc.cn/zh-Hans/configuration/i18n +translations#categories: + zh_cn: + category.default.name: 默认资产 + category.default.lore: 包含了CraftEngine的默认配置 + category.palm_tree: 棕榈树 + category.topaz: 黄玉 + category.misc: 杂项 +translations#emoji: + zh_cn: + emoji.tip: 使用''来发送表情'' diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/configuration/langs/zh_hk.yml b/Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/configuration/langs/zh_hk.yml new file mode 100644 index 00000000..44ced476 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/configuration/langs/zh_hk.yml @@ -0,0 +1,130 @@ +# 以下所有配置均採用基於客户端資源包實現的本地化系統 +# https://ce.gtemc.cn/zh-Hans/configuration/lang +lang#items: + zh_hk: + item.default.chinese_lantern: 燈籠 + item.default.fairy_flower: 仙靈花 + item.default.reed: 蘆葦 + item.default.flame_cane: 烈焰蔗 + item.default.ender_pearl_flower_seeds: 終界珍珠花種子 + item.default.bench: 長椅 + item.default.table_lamp: 枱燈 + item.default.wooden_chair: 木椅 + item.default.topaz_rod: 黃玉魚竿 + item.default.topaz_bow: 黃玉弓 + item.default.topaz_crossbow: 黃玉弩 + item.default.topaz_pickaxe: 黃玉鎬 + item.default.topaz_axe: 黃玉斧頭 + item.default.topaz_hoe: 黃玉鋤頭 + item.default.topaz_shovel: 黃玉鏟 + item.default.topaz_sword: 黃玉劍 + item.default.topaz_helmet: 黃玉頭盔 + item.default.topaz_chestplate: 黃玉胸甲 + item.default.topaz_leggings: 黃玉護腳 + item.default.topaz_boots: 黃玉靴 + item.default.topaz_trident: 黃玉三叉戟 + item.default.topaz_spear: 黃玉矛 + item.default.topaz_ore: 黃玉礦石 + item.default.deepslate_topaz_ore: 深層黃玉礦石 + item.default.topaz: 黃玉 + item.default.palm_log: 棕櫚原木 + item.default.stripped_palm_log: 剝皮棕櫚原木 + item.default.palm_wood: 棕櫚木 + item.default.stripped_palm_wood: 剝皮棕櫚木 + item.default.palm_planks: 棕櫚木板 + item.default.palm_sapling: 棕櫚樹苗 + item.default.palm_leaves: 棕櫚樹葉 + item.default.palm_trapdoor: 棕櫚木地板門 + item.default.palm_door: 棕櫚木門 + item.default.palm_fence_gate: 棕櫚木閘門 + item.default.palm_slab: 棕櫚木半磚 + item.default.palm_stairs: 棕櫚木樓梯 + item.default.palm_pressure_plate: 棕櫚木壓力板 + item.default.palm_button: 棕櫚木按鈕 + item.default.palm_fence: 棕櫚木欄杆 + item.default.netherite_anvil: 地獄合金砧 + item.default.gunpowder_block: 火藥粉末 + item.default.solid_gunpowder_block: 凝固火藥塊 + item.default.copper_coil: 銅線圈 + item.default.flame_elytra: 烈焰鞘翅 + item.default.pebble: 石子 + item.default.cap: 鴨舌帽 + item.default.flower_basket: 花籃 + item.default.chessboard_block: 棋盤方塊 + item.default.safe_block: 保險櫃 + item.default.sofa: 沙發 + item.default.amethyst_torch: 紫水晶火炬 + item.default.hami_melon_slice: 哈密瓜片 + item.default.hami_melon: 哈密瓜 + item.default.hami_melon_seeds: 哈密瓜種子 + item.default.magma_fruit: 岩漿果實 + item.default.globe: 地球儀 + item.default.drill: 鑽頭 + item.default.togglable_light_block: 可調節光 + item.default.showcase: 物品展示櫃 + item.default.drawer_block: 抽屜方塊 + item.default.candelabrum: 燭台 +# 為方塊提供翻譯,對於那些需要獲取伺服端方塊本地化鍵名的插件來説尤其有效 +lang#blocks: + zh_hk: + block_name:default:chinese_lantern: 燈籠 + block_name:default:netherite_anvil: 地獄合金砧 + block_name:default:topaz_ore: 黃玉礦石 + block_name:default:deepslate_topaz_ore: 深層黃玉礦石 + block_name:default:palm_log: 棕櫚原木 + block_name:default:stripped_palm_log: 剝皮棕櫚原木 + block_name:default:palm_wood: 棕櫚木 + block_name:default:stripped_palm_wood: 剝皮棕櫚木 + block_name:default:palm_planks: 棕櫚木板 + block_name:default:palm_sapling: 棕櫚樹苗 + block_name:default:palm_leaves: 棕櫚樹葉 + block_name:default:palm_trapdoor: 棕櫚木地板門 + block_name:default:palm_door: 棕櫚木門 + block_name:default:palm_fence_gate: 棕櫚木閘門 + block_name:default:palm_slab: 棕櫚木半磚 + block_name:default:palm_stairs: 棕櫚木樓梯 + block_name:default:palm_button: 棕櫚木按鈕 + block_name:default:palm_fence: 棕櫚木欄杆 + block_name:default:fairy_flower: 仙靈花 + block_name:default:reed: 蘆葦 + block_name:default:flame_cane: 烈焰蔗 + block_name:default:ender_pearl_flower: 終界珍珠花 + block_name:default:gunpowder_block: 火藥粉末 + block_name:default:solid_gunpowder_block: 凝固火藥塊 + block_name:default:copper_coil: 銅線圈 + block_name:default:chessboard_block: 棋盤方塊 + block_name:default:safe_block: 保險櫃 + block_name:default:sleeper_sofa: 沙發 + block_name:default:sofa: 沙發 + block_name:default:amethyst_torch: 紫水晶火炬 + block_name:default:amethyst_wall_torch: 紫水晶火炬 + block_name:default:hami_melon: 哈密瓜 + block_name:default:hami_melon_stem: 哈密瓜莖 + block_name:default:attached_hami_melon_stem: 哈密瓜莖 + block_name:default:magma_plant: 岩漿植物 + block_name:default:togglable_light_block: 可調節光 + block_name:default:drawer_block: 抽屜方塊 +# 傢俱相關的翻譯通常是為 API 設計的 +# 如果你使用的插件支持顯示傢俱名稱,那麼你很可能需要配置這些傢俱的翻譯 +lang#furniture: + zh_hk: + furniture.default.bench: 長椅 + furniture.default.flower_basket: 花籃 + furniture.default.globe: 地球儀 + furniture.default.wooden_chair: 木椅 + furniture.default.showcase: 物品展示櫃 + furniture.default.candelabrum: 燭台 +# 此處的 "translation" 特指伺服端的本地化 +# 這意味着您編寫的內容不會直接包含在客户端資源包中 +# 伺服端會對您設置的鍵名進行翻譯,然後將已本地化的文本傳送給客户端 +# https://ce.gtemc.cn/zh-Hans/configuration/i18n +translations#categories: + zh_hk: + category.default.name: 預設資產 + category.default.lore: 包含了CraftEngine的預設配置 + category.palm_tree: 棕櫚樹 + category.topaz: 黃玉 + category.misc: 雜項 +translations#emoji: + zh_hk: + emoji.tip: 使用''來傳送表情'' diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/configuration/langs/zh_tw.yml b/Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/configuration/langs/zh_tw.yml new file mode 100644 index 00000000..c0c1ff4d --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/configuration/langs/zh_tw.yml @@ -0,0 +1,130 @@ +# 以下所有配置均採用基於客戶端資源包實現的本地化系統 +# https://ce.gtemc.cn/zh-Hans/configuration/lang +lang#items: + zh_tw: + item.default.chinese_lantern: 燈籠 + item.default.fairy_flower: 仙靈花 + item.default.reed: 蘆葦 + item.default.flame_cane: 烈焰甘蔗 + item.default.ender_pearl_flower_seeds: 終界珍珠花種子 + item.default.bench: 長椅 + item.default.table_lamp: 檯燈 + item.default.wooden_chair: 木椅 + item.default.topaz_rod: 黃玉釣竿 + item.default.topaz_bow: 黃玉弓 + item.default.topaz_crossbow: 黃玉弩 + item.default.topaz_pickaxe: 黃玉鎬 + item.default.topaz_axe: 黃玉斧 + item.default.topaz_hoe: 黃玉鋤 + item.default.topaz_shovel: 黃玉鏟 + item.default.topaz_sword: 黃玉劍 + item.default.topaz_helmet: 黃玉頭盔 + item.default.topaz_chestplate: 黃玉胸甲 + item.default.topaz_leggings: 黃玉護腿 + item.default.topaz_boots: 黃玉靴子 + item.default.topaz_trident: 黃玉三叉戟 + item.default.topaz_spear: 黃玉矛 + item.default.topaz_ore: 黃玉礦石 + item.default.deepslate_topaz_ore: 深板岩黃玉礦石 + item.default.topaz: 黃玉 + item.default.palm_log: 棕櫚原木 + item.default.stripped_palm_log: 剝皮棕櫚原木 + item.default.palm_wood: 棕櫚木塊 + item.default.stripped_palm_wood: 剝皮棕櫚木塊 + item.default.palm_planks: 棕櫚木材 + item.default.palm_sapling: 棕櫚樹苗 + item.default.palm_leaves: 棕櫚樹葉 + item.default.palm_trapdoor: 棕櫚木地板門 + item.default.palm_door: 棕櫚木門 + item.default.palm_fence_gate: 棕櫚木柵欄門 + item.default.palm_slab: 棕櫚木半磚 + item.default.palm_stairs: 棕櫚木階梯 + item.default.palm_pressure_plate: 棕櫚木壓力板 + item.default.palm_button: 棕櫚木按鈕 + item.default.palm_fence: 棕櫚木柵欄 + item.default.netherite_anvil: 獄髓砧 + item.default.gunpowder_block: 火藥粉末 + item.default.solid_gunpowder_block: 凝固火藥塊 + item.default.copper_coil: 銅線圈 + item.default.flame_elytra: 烈焰鞘翅 + item.default.pebble: 石子 + item.default.cap: 鴨舌帽 + item.default.flower_basket: 花籃 + item.default.chessboard_block: 棋盤方塊 + item.default.safe_block: 保險櫃 + item.default.sofa: 沙發 + item.default.amethyst_torch: 紫水晶火把 + item.default.hami_melon_slice: 哈密瓜片 + item.default.hami_melon: 哈密瓜 + item.default.hami_melon_seeds: 哈密瓜種子 + item.default.magma_fruit: 岩漿果實 + item.default.globe: 地球儀 + item.default.drill: 鑽頭 + item.default.togglable_light_block: 可調節光源 + item.default.showcase: 物品展示櫃 + item.default.drawer_block: 抽屜方塊 + item.default.candelabrum: 燭臺 +# 為方塊提供翻譯,對於那些需要獲取伺服端方塊本地化鍵名的插件來說尤其有效 +lang#blocks: + zh_tw: + block_name:default:chinese_lantern: 燈籠 + block_name:default:netherite_anvil: 獄髓砧 + block_name:default:topaz_ore: 黃玉礦石 + block_name:default:deepslate_topaz_ore: 深層黃玉礦石 + block_name:default:palm_log: 棕櫚原木 + block_name:default:stripped_palm_log: 剝皮棕櫚原木 + block_name:default:palm_wood: 棕櫚木塊 + block_name:default:stripped_palm_wood: 剝皮棕櫚木塊 + block_name:default:palm_planks: 棕櫚木材 + block_name:default:palm_sapling: 棕櫚樹苗 + block_name:default:palm_leaves: 棕櫚樹葉 + block_name:default:palm_trapdoor: 棕櫚木地板門 + block_name:default:palm_door: 棕櫚木門 + block_name:default:palm_fence_gate: 棕櫚木柵欄門 + block_name:default:palm_slab: 棕櫚木半磚 + block_name:default:palm_stairs: 棕櫚木階梯 + block_name:default:palm_button: 棕櫚木按鈕 + block_name:default:palm_fence: 棕櫚木柵欄 + block_name:default:fairy_flower: 仙靈花 + block_name:default:reed: 蘆葦 + block_name:default:flame_cane: 烈焰甘蔗 + block_name:default:ender_pearl_flower: 終界珍珠花 + block_name:default:gunpowder_block: 火藥粉末 + block_name:default:solid_gunpowder_block: 凝固火藥塊 + block_name:default:copper_coil: 銅線圈 + block_name:default:chessboard_block: 棋盤方塊 + block_name:default:safe_block: 保險櫃 + block_name:default:sleeper_sofa: 沙發 + block_name:default:sofa: 沙發 + block_name:default:amethyst_torch: 紫水晶火把 + block_name:default:amethyst_wall_torch: 紫水晶火把 + block_name:default:hami_melon: 哈密瓜 + block_name:default:hami_melon_stem: 哈密瓜莖 + block_name:default:attached_hami_melon_stem: 哈密瓜莖 + block_name:default:magma_plant: 岩漿植物 + block_name:default:togglable_light_block: 可調節光源 + block_name:default:drawer_block: 抽屜方塊 +# 傢俱相關的翻譯通常是為 API 設計的 +# 如果你使用的插件支援顯示傢俱名稱,那麼你很可能需要配置這些傢俱的翻譯 +lang#furniture: + zh_tw: + furniture.default.bench: 長椅 + furniture.default.flower_basket: 花籃 + furniture.default.globe: 地球儀 + furniture.default.wooden_chair: 木椅 + furniture.default.showcase: 物品展示櫃 + furniture.default.candelabrum: 燭臺 +# 此處的 "translation" 特指伺服端的本地化 +# 這意味著您編寫的內容不會直接包含在客戶端資源包中 +# 伺服端會對您設定的鍵名進行翻譯,然後將已本地化的文本傳送給客戶端 +# https://ce.gtemc.cn/zh-Hans/configuration/i18n +translations#categories: + zh_tw: + category.default.name: 預設資產 + category.default.lore: 包含了CraftEngine的預設配置 + category.palm_tree: 棕櫚樹 + category.topaz: 黃玉 + category.misc: 雜項 +translations#emoji: + zh_tw: + emoji.tip: 使用''來傳送表情'' diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/pack.yml b/Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/pack.yml new file mode 100644 index 00000000..367d809e --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/pack.yml @@ -0,0 +1,4 @@ +author: XiaoMoMi +version: 1.0 +description: Default Assets for CraftEngine +namespace: default \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/items/default_feature_populator/pack.yml b/Plugin/src/test/resources/bedrock-folder/bedrock/items/default_feature_populator/pack.yml new file mode 100644 index 00000000..194bfa2c --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/items/default_feature_populator/pack.yml @@ -0,0 +1,10 @@ +author: XiaoMoMi +version: 1.0 +description: Default Feature Populator for CraftEngine +namespace: default +enable: false +subpacks: + $$>=26.1: + 26_1: true + $$fallback: + fallback: true \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/items/default_feature_populator/subpacks/26_1/configuration/features.yml b/Plugin/src/test/resources/bedrock-folder/bedrock/items/default_feature_populator/subpacks/26_1/configuration/features.yml new file mode 100644 index 00000000..4927494a --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/items/default_feature_populator/subpacks/26_1/configuration/features.yml @@ -0,0 +1,370 @@ +placed_features: + default:ender_pearl_flower: + dimension_type: + - minecraft:the_end + feature: + type: 'minecraft:simple_block' + config: + to_place: + type: 'minecraft:rule_based_state_provider' + rules: + - if_true: + type: 'minecraft:all_of' + predicates: + - type: 'minecraft:matching_blocks' + blocks: 'minecraft:air' + - type: 'minecraft:matching_blocks' + blocks: 'minecraft:end_stone' + offset: + - 0 + - -1 + - 0 + then: + type: 'minecraft:weighted_state_provider' + entries: + - weight: 4 + data: + Name: 'default:ender_pearl_flower' + Properties: + age: '0' + - weight: 2 + data: + Name: 'default:ender_pearl_flower' + Properties: + age: '1' + - weight: 1 + data: + Name: 'default:ender_pearl_flower' + Properties: + age: '2' + placement: + - type: 'minecraft:in_square' + - type: 'minecraft:rarity_filter' + chance: 24 + - type: 'minecraft:height_range' + height: + type: 'minecraft:uniform' + min_inclusive: + absolute: 50 + max_inclusive: + absolute: 70 + - type: 'minecraft:count' + count: 96 + - type: 'minecraft:random_offset' + xz_spread: + type: 'minecraft:trapezoid' + max: 7 + min: -7 + plateau: 0 + y_spread: + type: 'minecraft:trapezoid' + max: 3 + min: -3 + plateau: 0 + default:fairy_flower: + dimension_type: + - minecraft:overworld + feature: + type: 'minecraft:simple_block' + config: + to_place: + type: 'minecraft:rule_based_state_provider' + rules: + - if_true: + type: 'minecraft:all_of' + predicates: + - type: 'minecraft:replaceable' + - type: 'minecraft:matching_fluids' + fluids: 'minecraft:empty' + - type: 'minecraft:matching_blocks' + offset: + - 0 + - -1 + - 0 + blocks: 'minecraft:grass_block' + then: + type: 'minecraft:simple_state_provider' + state: + Name: 'default:fairy_flower' + placement: + - type: 'minecraft:rarity_filter' + chance: 100 + - type: 'minecraft:in_square' + - type: 'minecraft:heightmap' + heightmap: MOTION_BLOCKING + - type: 'minecraft:count' + count: 64 + - type: 'minecraft:random_offset' + xz_spread: + type: 'minecraft:trapezoid' + max: 7 + min: -7 + plateau: 0 + y_spread: + type: 'minecraft:trapezoid' + max: 3 + min: -3 + plateau: 0 + default:flame_cane: + dimension_type: + - minecraft:the_nether + feature: + type: 'minecraft:block_column' + config: + allowed_placement: + type: 'minecraft:matching_block_tag' + tag: 'minecraft:air' + direction: up + layers: + - height: + type: 'minecraft:biased_to_bottom' + max_inclusive: 4 + min_inclusive: 2 + provider: + type: 'minecraft:simple_state_provider' + state: + Name: 'default:flame_cane' + Properties: + age: '0' + prioritize_tip: false + placement: + - type: 'minecraft:rarity_filter' + chance: 6 + - type: 'minecraft:in_square' + - type: 'minecraft:height_range' + height: + absolute: 32 + - type: 'minecraft:count' + count: 20 + - type: 'minecraft:random_offset' + xz_spread: + type: 'minecraft:trapezoid' + max: 4 + min: -4 + plateau: 0 + y_spread: + type: 'minecraft:trapezoid' + max: 0 + min: 0 + plateau: 0 + default:hami_melon: + dimension_type: + - minecraft:overworld + feature: + type: 'minecraft:simple_block' + config: + to_place: + type: 'minecraft:rule_based_state_provider' + rules: + - if_true: + type: 'minecraft:all_of' + predicates: + - type: 'minecraft:matching_blocks' + blocks: 'minecraft:air' + - type: 'minecraft:matching_blocks' + offset: + - 0 + - -1 + - 0 + blocks: 'minecraft:grass_block' + then: + type: 'minecraft:simple_state_provider' + state: + Name: 'default:hami_melon' + placement: + - type: 'minecraft:rarity_filter' + chance: 300 + - type: 'minecraft:in_square' + - type: 'minecraft:heightmap' + heightmap: MOTION_BLOCKING + - type: 'minecraft:count' + count: 75 + - type: 'minecraft:random_offset' + xz_spread: + type: 'minecraft:trapezoid' + max: 7 + min: -7 + plateau: 0 + y_spread: + type: 'minecraft:trapezoid' + max: 3 + min: -3 + plateau: 0 + default:magma_plant: + dimension_type: + - minecraft:the_nether + feature: + type: 'minecraft:simple_block' + config: + to_place: + type: 'minecraft:rule_based_state_provider' + rules: + - if_true: + type: 'minecraft:all_of' + predicates: + - type: 'minecraft:replaceable' + - type: 'minecraft:matching_fluids' + fluids: 'minecraft:empty' + - type: 'minecraft:matching_fluids' + offset: + - 0 + - -1 + - 0 + fluids: '#minecraft:lava' + then: + type: 'minecraft:weighted_state_provider' + entries: + - weight: 7 + data: + Name: 'default:magma_plant' + Properties: + age: '0' + - weight: 5 + data: + Name: 'default:magma_plant' + Properties: + age: '1' + - weight: 2 + data: + Name: 'default:magma_plant' + Properties: + age: '2' + - weight: 1 + data: + Name: 'default:magma_plant' + Properties: + age: '3' + placement: + - type: 'minecraft:in_square' + - type: 'minecraft:random_offset' + xz_spread: 5 + y_spread: 1 + - type: 'minecraft:height_range' + height: + type: 'minecraft:uniform' + min_inclusive: + absolute: 10 + max_inclusive: + absolute: 100 + - type: 'minecraft:count' + count: 32 + - type: 'minecraft:random_offset' + xz_spread: + type: 'minecraft:trapezoid' + max: 7 + min: -7 + plateau: 0 + y_spread: + type: 'minecraft:trapezoid' + max: 1 + min: -1 + plateau: 0 + default:palm_tree: + biome: + - minecraft:beach + dimension_type: + - minecraft:overworld + feature: default:palm_tree + placement: + - type: 'minecraft:rarity_filter' + chance: 7 + - type: 'minecraft:count' + count: + type: 'minecraft:weighted_list' + distribution: + - weight: 10 + data: 1 + - weight: 3 + data: 2 + - weight: 1 + data: 3 + - type: 'minecraft:in_square' + - type: 'minecraft:heightmap' + heightmap: WORLD_SURFACE + - type: 'minecraft:block_predicate_filter' + predicate: + type: 'minecraft:matching_blocks' + blocks: 'minecraft:air' + - type: 'minecraft:block_predicate_filter' + predicate: + type: 'minecraft:matching_blocks' + blocks: 'minecraft:sand' + offset: [ 0,-1,0 ] + - type: 'minecraft:biome' + default:reed: + biome: + - minecraft:river + dimension_type: + - minecraft:overworld + feature: + type: 'minecraft:simple_block' + config: + to_place: + type: 'minecraft:rule_based_state_provider' + rules: + - if_true: + type: 'minecraft:all_of' + predicates: + - type: 'minecraft:replaceable' + - type: 'minecraft:matching_fluids' + fluids: 'minecraft:empty' + - type: 'minecraft:matching_fluids' + offset: + - 0 + - -1 + - 0 + fluids: '#minecraft:water' + then: + type: 'minecraft:simple_state_provider' + state: + Name: 'default:reed' + placement: + - type: 'minecraft:rarity_filter' + chance: 48 + - type: 'minecraft:in_square' + - type: 'minecraft:heightmap' + heightmap: WORLD_SURFACE + - type: 'minecraft:biome' + - type: 'minecraft:count' + count: 96 + - type: 'minecraft:random_offset' + xz_spread: + type: 'minecraft:trapezoid' + max: 7 + min: -7 + plateau: 0 + y_spread: + type: 'minecraft:trapezoid' + max: 1 + min: -1 + plateau: 0 + default:topaz_ore: + dimension_type: + - minecraft:overworld + feature: + type: minecraft:ore + config: + discard_chance_on_air_exposure: 0.0 + size: 10 + targets: + - state: + Name: default:topaz_ore + target: + predicate_type: minecraft:tag_match + tag: minecraft:stone_ore_replaceables + - state: + Name: default:deepslate_topaz_ore + target: + predicate_type: minecraft:tag_match + tag: minecraft:deepslate_ore_replaceables + placement: + - type: minecraft:count + count: 4 + - type: minecraft:in_square + - type: minecraft:height_range + height: + type: minecraft:uniform + max_inclusive: + absolute: 112 + min_inclusive: + absolute: -32 \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/items/default_feature_populator/subpacks/fallback/configuration/features.yml b/Plugin/src/test/resources/bedrock-folder/bedrock/items/default_feature_populator/subpacks/fallback/configuration/features.yml new file mode 100644 index 00000000..c64e03dc --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/items/default_feature_populator/subpacks/fallback/configuration/features.yml @@ -0,0 +1,380 @@ +placed_features: + default:ender_pearl_flower: + dimension_type: + - minecraft:the_end + feature: + type: 'minecraft:random_patch' + config: + feature: + feature: + type: 'minecraft:simple_block' + config: + to_place: + type: 'minecraft:weighted_state_provider' + entries: + - weight: 4 + data: + Name: 'default:ender_pearl_flower' + Properties: + age: '0' + - weight: 2 + data: + Name: 'default:ender_pearl_flower' + Properties: + age: '1' + - weight: 1 + data: + Name: 'default:ender_pearl_flower' + Properties: + age: '2' + placement: + - type: 'minecraft:block_predicate_filter' + predicate: + type: 'minecraft:all_of' + predicates: + - type: 'minecraft:matching_blocks' + blocks: 'minecraft:air' + - type: 'minecraft:matching_blocks' + blocks: 'minecraft:end_stone' + offset: + - 0 + - -1 + - 0 + tries: 96 + xz_spread: 7 + y_spread: 3 + placement: + - type: 'minecraft:in_square' + - type: 'minecraft:rarity_filter' + chance: 24 + - type: 'minecraft:height_range' + height: + type: 'minecraft:uniform' + min_inclusive: + absolute: 50 + max_inclusive: + absolute: 70 + default:fairy_flower: + dimension_type: + - minecraft:overworld + feature: + type: 'minecraft:random_patch' + config: + feature: + feature: + type: 'minecraft:simple_block' + config: + to_place: + type: 'minecraft:simple_state_provider' + state: + Name: 'default:fairy_flower' + placement: + - type: 'minecraft:block_predicate_filter' + predicate: + type: 'minecraft:all_of' + predicates: + - type: 'minecraft:replaceable' + - type: 'minecraft:matching_fluids' + fluids: 'minecraft:empty' + - type: 'minecraft:matching_blocks' + blocks: 'minecraft:grass_block' + offset: + - 0 + - -1 + - 0 + tries: 64 + xz_spread: 7 + y_spread: 3 + placement: + - type: 'minecraft:rarity_filter' + chance: 100 + - type: 'minecraft:in_square' + - type: 'minecraft:heightmap' + heightmap: MOTION_BLOCKING + default:flame_cane: + dimension_type: + - minecraft:the_nether + feature: + type: 'minecraft:random_patch' + config: + feature: + feature: + type: 'minecraft:block_column' + config: + allowed_placement: + type: 'minecraft:matching_blocks' + blocks: 'minecraft:air' + direction: up + layers: + - height: + type: 'minecraft:biased_to_bottom' + $$<1.20.5: + value: + max_inclusive: 4 + min_inclusive: 2 + $$>=1.20.5: + max_inclusive: 4 + min_inclusive: 2 + provider: + type: 'minecraft:simple_state_provider' + state: + Name: 'default:flame_cane' + Properties: + age: '0' + prioritize_tip: false + placement: + - type: 'minecraft:block_predicate_filter' + predicate: + type: 'minecraft:all_of' + predicates: + - type: 'minecraft:matching_blocks' + blocks: 'minecraft:air' + - type: 'minecraft:would_survive' + state: + Name: 'default:flame_cane' + Properties: + age: '0' + - type: 'minecraft:any_of' + predicates: + - type: 'minecraft:matching_fluids' + fluids: + - 'minecraft:lava' + - 'minecraft:flowing_lava' + offset: + - 1 + - -1 + - 0 + - type: 'minecraft:matching_fluids' + fluids: + - 'minecraft:lava' + - 'minecraft:flowing_lava' + offset: + - -1 + - -1 + - 0 + - type: 'minecraft:matching_fluids' + fluids: + - 'minecraft:lava' + - 'minecraft:flowing_lava' + offset: + - 0 + - -1 + - 1 + - type: 'minecraft:matching_fluids' + fluids: + - 'minecraft:lava' + - 'minecraft:flowing_lava' + offset: + - 0 + - -1 + - -1 + tries: 20 + xz_spread: 4 + y_spread: 0 + placement: + - type: 'minecraft:rarity_filter' + chance: 6 + - type: 'minecraft:in_square' + - type: 'minecraft:height_range' + height: + absolute: 32 + default:hami_melon: + dimension_type: + - minecraft:overworld + feature: + type: 'minecraft:random_patch' + config: + feature: + feature: + type: 'minecraft:simple_block' + config: + to_place: + type: 'craftengine:simple_state_provider' + state: + Name: 'default:hami_melon' + placement: + - type: 'minecraft:block_predicate_filter' + predicate: + type: 'minecraft:all_of' + predicates: + - type: 'minecraft:matching_blocks' + blocks: "minecraft:air" + - type: 'minecraft:matching_blocks' + blocks: 'minecraft:grass_block' + offset: + - 0 + - -1 + - 0 + tries: 75 + xz_spread: 7 + y_spread: 3 + placement: + - type: 'minecraft:rarity_filter' + chance: 300 + - type: 'minecraft:in_square' + - type: 'minecraft:heightmap' + heightmap: MOTION_BLOCKING + default:magma_plant: + dimension_type: + - minecraft:the_nether + feature: + type: 'minecraft:random_patch' + config: + feature: + feature: + type: 'minecraft:simple_block' + config: + to_place: + type: 'minecraft:weighted_state_provider' + entries: + - weight: 7 + data: + Name: 'default:magma_plant' + Properties: + age: 0 + - weight: 5 + data: + Name: 'default:magma_plant' + Properties: + age: 1 + - weight: 2 + data: + Name: 'default:magma_plant' + Properties: + age: 2 + - weight: 1 + data: + Name: 'default:magma_plant' + Properties: + age: 3 + placement: + - type: 'minecraft:block_predicate_filter' + predicate: + type: 'minecraft:all_of' + predicates: + - type: 'minecraft:replaceable' + - type: 'minecraft:matching_fluids' + fluids: 'minecraft:empty' + - type: 'minecraft:matching_fluids' + fluids: '#minecraft:lava' + offset: + - 0 + - -1 + - 0 + tries: 32 + xz_spread: 7 + y_spread: 1 + placement: + - type: 'minecraft:in_square' + - type: 'minecraft:random_offset' + xz_spread: 5 + y_spread: 1 + - type: 'minecraft:height_range' + height: + type: 'minecraft:uniform' + min_inclusive: + absolute: 10 + max_inclusive: + absolute: 100 + default:palm_tree: + biome: + - minecraft:beach + dimension_type: + - minecraft:overworld + feature: default:palm_tree + placement: + - type: 'minecraft:rarity_filter' + chance: 7 + - type: 'minecraft:count' + count: + type: 'minecraft:weighted_list' + distribution: + - weight: 10 + data: 1 + - weight: 3 + data: 2 + - weight: 1 + data: 3 + - type: 'minecraft:in_square' + - type: 'minecraft:heightmap' + heightmap: WORLD_SURFACE + - type: 'minecraft:block_predicate_filter' + predicate: + type: 'minecraft:matching_blocks' + blocks: 'minecraft:air' + - type: 'minecraft:block_predicate_filter' + predicate: + type: 'minecraft:matching_blocks' + blocks: 'minecraft:sand' + offset: [ 0,-1,0 ] + - type: 'minecraft:biome' + default:reed: + biome: + - minecraft:river + dimension_type: + - minecraft:overworld + feature: + type: 'minecraft:random_patch' + config: + feature: + feature: + type: 'minecraft:simple_block' + config: + to_place: + type: 'craftengine:simple_state_provider' + state: + Name: 'default:reed' + placement: + - type: 'minecraft:block_predicate_filter' + predicate: + type: 'minecraft:all_of' + predicates: + - type: 'minecraft:replaceable' + - type: 'minecraft:matching_fluids' + fluids: 'minecraft:empty' + - type: 'minecraft:matching_fluids' + fluids: '#minecraft:water' + offset: + - 0 + - -1 + - 0 + tries: 96 + xz_spread: 7 + y_spread: 1 + placement: + - type: 'minecraft:rarity_filter' + chance: 48 + - type: 'minecraft:in_square' + - type: 'minecraft:heightmap' + heightmap: WORLD_SURFACE + - type: 'minecraft:biome' + default:topaz_ore: + dimension_type: + - minecraft:overworld + feature: + type: minecraft:ore + config: + discard_chance_on_air_exposure: 0.0 + size: 10 + targets: + - state: + Name: default:topaz_ore + target: + predicate_type: minecraft:tag_match + tag: minecraft:stone_ore_replaceables + - state: + Name: default:deepslate_topaz_ore + target: + predicate_type: minecraft:tag_match + tag: minecraft:deepslate_ore_replaceables + placement: + - type: minecraft:count + count: 4 + - type: minecraft:in_square + - type: minecraft:height_range + height: + type: minecraft:uniform + max_inclusive: + absolute: 112 + min_inclusive: + absolute: -32 \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/items/default_templates/configuration/templates/block_settings.yml b/Plugin/src/test/resources/bedrock-folder/bedrock/items/default_templates/configuration/templates/block_settings.yml new file mode 100644 index 00000000..40439804 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/items/default_templates/configuration/templates/block_settings.yml @@ -0,0 +1,219 @@ +templates#settings: + default:settings/solid_1x1x1: + is_suffocating: true + replaceable: false + is_view_blocking: true + is_redstone_conductor: true + can_occlude: true + default:settings/transparent_1x1x1: + is_suffocating: false + replaceable: false + is_view_blocking: false + is_redstone_conductor: false + can_occlude: false + default:settings/sapling: + burnable: false + template: + - default:hardness/none + - default:sound/grass + overrides: + push_reaction: destroy + map_color: plant + tags: + - minecraft:mineable/axe + - minecraft:saplings + - minecraft:sword_efficient + default:settings/leaves: + template: + - default:sound/grass + - default:burn_data/leaves + - default:hardness/leaves + - default:settings/transparent_1x1x1 + overrides: + hardness: 0.2 + resistance: 0.2 + push_reaction: destroy + instrument: harp + map_color: plant + tags: + - minecraft:mineable/hoe + - minecraft:sword_efficient + - minecraft:leaves + - minecraft:replaceable_by_trees + default:settings/wood: + template: + - default:sound/wood + - default:burn_data/wood + - default:hardness/wood + overrides: + instrument: bass + tags: + - minecraft:mineable/axe + - minecraft:logs_that_burn + - minecraft:logs + - minecraft:completes_find_tree_tutorial + map_color: wood + default:settings/planks: + template: + - default:sound/wood + - default:burn_data/planks + - default:hardness/planks + - default:settings/solid_1x1x1 + overrides: + instrument: bass + tags: ["minecraft:mineable/axe"] + map_color: wood + default:settings/ore: + template: + - default:sound/stone + - default:settings/solid_1x1x1 + overrides: + hardness: 3.0 + resistance: 3.0 + instrument: basedrum + map_color: stone + tags: ["minecraft:mineable/pickaxe"] + correct_tools::template: default:pickaxe_power/level_${break_power} + default:settings/deepslate_ore: + template: + - default:sound/deepslate + - default:settings/solid_1x1x1 + - default:hardness/deepslate + overrides: + hardness: 4.5 + resistance: 3.0 + instrument: basedrum + map_color: deepslate + tags: ["minecraft:mineable/pickaxe"] + correct_tools::template: default:pickaxe_power/level_${break_power} + +templates#hardness: + default:hardness/none: + hardness: 0 + resistance: 0 + default:hardness/leaves: + hardness: 0.2 + resistance: 0.2 + default:hardness/glass: + hardness: 0.3 + resistance: 0.3 + default:hardness/stone: + hardness: 1.5 + resistance: 6.0 + default:hardness/deepslate: + hardness: 3.0 + resistance: 6.0 + default:hardness/obsidian: + hardness: 50.0 + resistance: 1200.0 + default:hardness/wool: + hardness: 0.8 + resistance: 0.8 + default:hardness/wood: + hardness: 2.0 + resistance: 2.0 + default:hardness/planks: + hardness: 2.0 + resistance: 3.0 + default:hardness/button: + hardness: 0.5 + resistance: 0.5 + default:hardness/melon: + hardness: 1.0 + resistance: 1.0 + +templates#burn_data: + default:burn_data/leaves: + burnable: true + burn_chance: 30 + fire_spread_chance: 60 + default:burn_data/wood: + burnable: true + burn_chance: 5 + fire_spread_chance: 5 + default:burn_data/planks: + burnable: true + burn_chance: 5 + fire_spread_chance: 20 + default:burn_data/wool: + burnable: true + burn_chance: 30 + fire_spread_chance: 60 + default:burn_data/vine: + burnable: true + burn_chance: 15 + fire_spread_chance: 100 + default:burn_data/carpet: + burnable: true + burn_chance: 60 + fire_spread_chance: 20 + default:burn_data/coal: + burnable: true + burn_chance: 5 + fire_spread_chance: 5 + default:burn_data/grass: + burnable: true + burn_chance: 60 + fire_spread_chance: 100 + +templates#sounds: + default:sound/block_template: + sounds: + break: minecraft:block.${block_type}.break + step: minecraft:block.${block_type}.step + place: minecraft:block.${block_type}.place + hit: minecraft:block.${block_type}.hit + fall: minecraft:block.${block_type}.fall + default:sound/crop: + sounds: + break: minecraft:block.crop.break + step: minecraft:block.grass.step + place: minecraft:item.crop.plant + hit: minecraft:block.grass.hit + fall: minecraft:block.grass.fall + default:sound/stem_crop: + sounds: + break: minecraft:block.crop.break + step: minecraft:block.wood.step + place: minecraft:item.crop.plant + hit: minecraft:block.wood.hit + fall: minecraft:block.wood.fall + default:sound/grass: + template: default:sound/block_template + arguments::block_type: grass + default:sound/wood: + template: default:sound/block_template + arguments::block_type: wood + default:sound/stone: + template: default:sound/block_template + arguments::block_type: stone + default:sound/deepslate: + template: default:sound/block_template + arguments::block_type: deepslate + default:sound/glass: + template: default:sound/block_template + arguments::block_type: glass + default:sound/sand: + template: default:sound/block_template + arguments::block_type: sand + default:sound/gravel: + template: default:sound/block_template + arguments::block_type: gravel + default:sound/metal: + template: default:sound/block_template + arguments::block_type: metal + default:sound/snow: + template: default:sound/block_template + arguments::block_type: snow + default:sound/bamboo: + template: default:sound/block_template + arguments::block_type: bamboo + default:sound/vine: + template: default:sound/block_template + arguments::block_type: vine + default:sound/lantern: + template: default:sound/block_template + arguments::block_type: lantern + default:sound/amethyst_block: + template: default:sound/block_template + arguments::block_type: amethyst_block \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/items/default_templates/configuration/templates/block_states.yml b/Plugin/src/test/resources/bedrock-folder/bedrock/items/default_templates/configuration/templates/block_states.yml new file mode 100644 index 00000000..f4ae3a74 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/items/default_templates/configuration/templates/block_states.yml @@ -0,0 +1,2324 @@ +templates: + default:block_state/pillar: + properties: + axis: + type: axis + default: y + appearances: + axisY: + auto_state: solid + model: + path: ${pillar_model} + generation: + parent: minecraft:block/cube_column + textures: + end: ${pillar_texture_top} + side: ${pillar_texture_side} + axisX: + auto_state: solid + model: + x: 90 + y: 90 + path: ${pillar_model}_horizontal + generation: + parent: minecraft:block/cube_column_horizontal + textures: + end: ${pillar_texture_top} + side: ${pillar_texture_side} + axisZ: + auto_state: solid + model: + x: 90 + path: ${pillar_model}_horizontal + generation: + parent: minecraft:block/cube_column_horizontal + textures: + end: ${pillar_texture_top} + side: ${pillar_texture_side} + variants: + axis=x: + appearance: axisX + axis=y: + appearance: axisY + axis=z: + appearance: axisZ + default:block_state/__leaves__: + properties: + waterlogged: + type: boolean + default: false + persistent: + type: boolean + default: true + distance: + type: int + default: ${leaves_max_distance:-7} + min: 1 + max: ${leaves_max_distance:-7} + appearances: + default: + auto_state: ${auto_state} + model: + path: ${leaves_model:-"${leaves_texture}"} + generation: + parent: minecraft:block/${leaves_parent_model} + textures: + all: ${leaves_texture:-"${leaves_model}"} + waterlogged: + auto_state: waterlogged_${auto_state} + model: + path: ${leaves_model:-"${leaves_texture}"} + variants: + waterlogged=false: + appearance: default + waterlogged=true: + appearance: waterlogged + settings: + resistance: 1200.0 + burnable: false + fluid_state: water + default:block_state/leaves: + template: default:block_state/${leaves_tint_type}_leaves + arguments: + leaves_tint_type: + type: condition + condition: ${leaves_tintable:-false} + on_true: tintable + on_false: non_tintable + default:block_state/tintable_leaves: + template: default:block_state/__leaves__ + arguments: + auto_state: tintable_leaves + leaves_parent_model: leaves + default:block_state/non_tintable_leaves: + template: default:block_state/__leaves__ + arguments: + auto_state: non_tintable_leaves + leaves_parent_model: cube_all + default:block_state/trapdoor: + properties: + waterlogged: + type: boolean + default: false + open: + type: boolean + default: false + powered: + type: boolean + default: false + facing: + type: horizontal_direction + half: + type: single_block_half + appearances: + facing=east,half=bottom,open=false,waterlogged=false: + state: ${trapdoor_base_block}[facing=east,half=bottom,open=false,powered=true,waterlogged=false] + model: + path: ${trapdoor_model}_bottom + y: 90 + generation: + parent: minecraft:block/template_orientable_trapdoor_bottom + textures: + texture: ${trapdoor_texture} + facing=east,half=bottom,open=true,waterlogged=false: + state: ${trapdoor_base_block}[facing=east,half=bottom,open=true,powered=true,waterlogged=false] + model: + path: ${trapdoor_model}_open + y: 90 + generation: + parent: minecraft:block/template_orientable_trapdoor_open + textures: + texture: ${trapdoor_texture} + facing=east,half=top,open=false,waterlogged=false: + state: ${trapdoor_base_block}[facing=east,half=top,open=false,powered=true,waterlogged=false] + model: + path: ${trapdoor_model}_top + y: 90 + generation: + parent: minecraft:block/template_orientable_trapdoor_top + textures: + texture: ${trapdoor_texture} + facing=east,half=top,open=true,waterlogged=false: + state: ${trapdoor_base_block}[facing=east,half=top,open=true,powered=true,waterlogged=false] + model: + path: ${trapdoor_model}_open + x: 180 + y: 270 + facing=north,half=bottom,open=false,waterlogged=false: + state: ${trapdoor_base_block}[facing=north,half=bottom,open=false,powered=true,waterlogged=false] + model: + path: ${trapdoor_model}_bottom + facing=north,half=bottom,open=true,waterlogged=false: + state: ${trapdoor_base_block}[facing=north,half=bottom,open=true,powered=true,waterlogged=false] + model: + path: ${trapdoor_model}_open + facing=north,half=top,open=false,waterlogged=false: + state: ${trapdoor_base_block}[facing=north,half=top,open=false,powered=true,waterlogged=false] + model: + path: ${trapdoor_model}_top + facing=north,half=top,open=true,waterlogged=false: + state: ${trapdoor_base_block}[facing=north,half=top,open=true,powered=true,waterlogged=false] + model: + path: ${trapdoor_model}_open + x: 180 + y: 180 + facing=south,half=bottom,open=false,waterlogged=false: + state: ${trapdoor_base_block}[facing=south,half=bottom,open=false,powered=true,waterlogged=false] + model: + path: ${trapdoor_model}_bottom + y: 180 + facing=south,half=bottom,open=true,waterlogged=false: + state: ${trapdoor_base_block}[facing=south,half=bottom,open=true,powered=true,waterlogged=false] + model: + path: ${trapdoor_model}_open + y: 180 + facing=south,half=top,open=false,waterlogged=false: + state: ${trapdoor_base_block}[facing=south,half=top,open=false,powered=true,waterlogged=false] + model: + path: ${trapdoor_model}_top + y: 180 + facing=south,half=top,open=true,waterlogged=false: + state: ${trapdoor_base_block}[facing=south,half=top,open=true,powered=true,waterlogged=false] + model: + path: ${trapdoor_model}_open + x: 180 + y: 0 + facing=west,half=bottom,open=false,waterlogged=false: + state: ${trapdoor_base_block}[facing=west,half=bottom,open=false,powered=true,waterlogged=false] + model: + path: ${trapdoor_model}_bottom + y: 270 + facing=west,half=bottom,open=true,waterlogged=false: + state: ${trapdoor_base_block}[facing=west,half=bottom,open=true,powered=true,waterlogged=false] + model: + path: ${trapdoor_model}_open + y: 270 + facing=west,half=top,open=false,waterlogged=false: + state: ${trapdoor_base_block}[facing=west,half=top,open=false,powered=true,waterlogged=false] + model: + path: ${trapdoor_model}_top + y: 270 + facing=west,half=top,open=true,waterlogged=false: + state: ${trapdoor_base_block}[facing=west,half=top,open=true,powered=true,waterlogged=false] + model: + path: ${trapdoor_model}_open + x: 180 + y: 90 + facing=east,half=bottom,open=false,waterlogged=true: + state: ${trapdoor_base_block}[facing=east,half=bottom,open=false,powered=true,waterlogged=true] + model: + path: ${trapdoor_model}_bottom + y: 90 + facing=east,half=bottom,open=true,waterlogged=true: + state: ${trapdoor_base_block}[facing=east,half=bottom,open=true,powered=true,waterlogged=true] + model: + path: ${trapdoor_model}_open + y: 90 + facing=east,half=top,open=false,waterlogged=true: + state: ${trapdoor_base_block}[facing=east,half=top,open=false,powered=true,waterlogged=true] + model: + path: ${trapdoor_model}_top + y: 90 + facing=east,half=top,open=true,waterlogged=true: + state: ${trapdoor_base_block}[facing=east,half=top,open=true,powered=true,waterlogged=true] + model: + path: ${trapdoor_model}_open + x: 180 + y: 270 + facing=north,half=bottom,open=false,waterlogged=true: + state: ${trapdoor_base_block}[facing=north,half=bottom,open=false,powered=true,waterlogged=true] + model: + path: ${trapdoor_model}_bottom + facing=north,half=bottom,open=true,waterlogged=true: + state: ${trapdoor_base_block}[facing=north,half=bottom,open=true,powered=true,waterlogged=true] + model: + path: ${trapdoor_model}_open + facing=north,half=top,open=false,waterlogged=true: + state: ${trapdoor_base_block}[facing=north,half=top,open=false,powered=true,waterlogged=true] + model: + path: ${trapdoor_model}_top + facing=north,half=top,open=true,waterlogged=true: + state: ${trapdoor_base_block}[facing=north,half=top,open=true,powered=true,waterlogged=true] + model: + path: ${trapdoor_model}_open + x: 180 + y: 180 + facing=south,half=bottom,open=false,waterlogged=true: + state: ${trapdoor_base_block}[facing=south,half=bottom,open=false,powered=true,waterlogged=true] + model: + path: ${trapdoor_model}_bottom + y: 180 + facing=south,half=bottom,open=true,waterlogged=true: + state: ${trapdoor_base_block}[facing=south,half=bottom,open=true,powered=true,waterlogged=true] + model: + path: ${trapdoor_model}_open + y: 180 + facing=south,half=top,open=false,waterlogged=true: + state: ${trapdoor_base_block}[facing=south,half=top,open=false,powered=true,waterlogged=true] + model: + path: ${trapdoor_model}_top + y: 180 + facing=south,half=top,open=true,waterlogged=true: + state: ${trapdoor_base_block}[facing=south,half=top,open=true,powered=true,waterlogged=true] + model: + path: ${trapdoor_model}_open + x: 180 + y: 0 + facing=west,half=bottom,open=false,waterlogged=true: + state: ${trapdoor_base_block}[facing=west,half=bottom,open=false,powered=true,waterlogged=true] + model: + path: ${trapdoor_model}_bottom + y: 270 + facing=west,half=bottom,open=true,waterlogged=true: + state: ${trapdoor_base_block}[facing=west,half=bottom,open=true,powered=true,waterlogged=true] + model: + path: ${trapdoor_model}_open + y: 270 + facing=west,half=top,open=false,waterlogged=true: + state: ${trapdoor_base_block}[facing=west,half=top,open=false,powered=true,waterlogged=true] + model: + path: ${trapdoor_model}_top + y: 270 + facing=west,half=top,open=true,waterlogged=true: + state: ${trapdoor_base_block}[facing=west,half=top,open=true,powered=true,waterlogged=true] + model: + path: ${trapdoor_model}_open + x: 180 + y: 90 + variants: + facing=east,half=bottom,open=false,waterlogged=false: + appearance: facing=east,half=bottom,open=false,waterlogged=false + facing=east,half=bottom,open=true,waterlogged=false: + appearance: facing=east,half=bottom,open=true,waterlogged=false + facing=east,half=top,open=false,waterlogged=false: + appearance: facing=east,half=top,open=false,waterlogged=false + facing=east,half=top,open=true,waterlogged=false: + appearance: facing=east,half=top,open=true,waterlogged=false + facing=north,half=bottom,open=false,waterlogged=false: + appearance: facing=north,half=bottom,open=false,waterlogged=false + facing=north,half=bottom,open=true,waterlogged=false: + appearance: facing=north,half=bottom,open=true,waterlogged=false + facing=north,half=top,open=false,waterlogged=false: + appearance: facing=north,half=top,open=false,waterlogged=false + facing=north,half=top,open=true,waterlogged=false: + appearance: facing=north,half=top,open=true,waterlogged=false + facing=south,half=bottom,open=false,waterlogged=false: + appearance: facing=south,half=bottom,open=false,waterlogged=false + facing=south,half=bottom,open=true,waterlogged=false: + appearance: facing=south,half=bottom,open=true,waterlogged=false + facing=south,half=top,open=false,waterlogged=false: + appearance: facing=south,half=top,open=false,waterlogged=false + facing=south,half=top,open=true,waterlogged=false: + appearance: facing=south,half=top,open=true,waterlogged=false + facing=west,half=bottom,open=false,waterlogged=false: + appearance: facing=west,half=bottom,open=false,waterlogged=false + facing=west,half=bottom,open=true,waterlogged=false: + appearance: facing=west,half=bottom,open=true,waterlogged=false + facing=west,half=top,open=false,waterlogged=false: + appearance: facing=west,half=top,open=false,waterlogged=false + facing=west,half=top,open=true,waterlogged=false: + appearance: facing=west,half=top,open=true,waterlogged=false + facing=east,half=bottom,open=false,waterlogged=true: + appearance: facing=east,half=bottom,open=false,waterlogged=true + settings: + resistance: 1200.0 + burnable: false + fluid_state: water + facing=east,half=bottom,open=true,waterlogged=true: + appearance: facing=east,half=bottom,open=true,waterlogged=true + settings: + resistance: 1200.0 + burnable: false + fluid_state: water + facing=east,half=top,open=false,waterlogged=true: + appearance: facing=east,half=top,open=false,waterlogged=true + settings: + resistance: 1200.0 + burnable: false + fluid_state: water + facing=east,half=top,open=true,waterlogged=true: + appearance: facing=east,half=top,open=true,waterlogged=true + settings: + resistance: 1200.0 + burnable: false + fluid_state: water + facing=north,half=bottom,open=false,waterlogged=true: + appearance: facing=north,half=bottom,open=false,waterlogged=true + settings: + resistance: 1200.0 + burnable: false + fluid_state: water + facing=north,half=bottom,open=true,waterlogged=true: + appearance: facing=north,half=bottom,open=true,waterlogged=true + settings: + resistance: 1200.0 + burnable: false + fluid_state: water + facing=north,half=top,open=false,waterlogged=true: + appearance: facing=north,half=top,open=false,waterlogged=true + settings: + resistance: 1200.0 + burnable: false + fluid_state: water + facing=north,half=top,open=true,waterlogged=true: + appearance: facing=north,half=top,open=true,waterlogged=true + settings: + resistance: 1200.0 + burnable: false + fluid_state: water + facing=south,half=bottom,open=false,waterlogged=true: + appearance: facing=south,half=bottom,open=false,waterlogged=true + settings: + resistance: 1200.0 + burnable: false + fluid_state: water + facing=south,half=bottom,open=true,waterlogged=true: + appearance: facing=south,half=bottom,open=true,waterlogged=true + settings: + resistance: 1200.0 + burnable: false + fluid_state: water + facing=south,half=top,open=false,waterlogged=true: + appearance: facing=south,half=top,open=false,waterlogged=true + settings: + resistance: 1200.0 + burnable: false + fluid_state: water + facing=south,half=top,open=true,waterlogged=true: + appearance: facing=south,half=top,open=true,waterlogged=true + settings: + resistance: 1200.0 + burnable: false + fluid_state: water + facing=west,half=bottom,open=false,waterlogged=true: + appearance: facing=west,half=bottom,open=false,waterlogged=true + settings: + resistance: 1200.0 + burnable: false + fluid_state: water + facing=west,half=bottom,open=true,waterlogged=true: + appearance: facing=west,half=bottom,open=true,waterlogged=true + settings: + resistance: 1200.0 + burnable: false + fluid_state: water + facing=west,half=top,open=false,waterlogged=true: + appearance: facing=west,half=top,open=false,waterlogged=true + settings: + resistance: 1200.0 + burnable: false + fluid_state: water + facing=west,half=top,open=true,waterlogged=true: + appearance: facing=west,half=top,open=true,waterlogged=true + settings: + fluid_state: water + default:block_state/door: + properties: + facing: + type: horizontal_direction + half: + type: double_block_half + hinge: + type: hinge + open: + type: boolean + default: false + powered: + type: boolean + default: false + appearances: + facing=east,half=lower,hinge=left,open=false: + state: ${door_base_block}[facing=east,half=lower,hinge=left,open=false,powered=true] + model: + path: ${door_model}_bottom_left + generation: + parent: minecraft:block/door_bottom_left + textures: + bottom: ${door_texture_bottom} + top: ${door_texture_top} + facing=east,half=lower,hinge=left,open=true: + state: ${door_base_block}[facing=east,half=lower,hinge=left,open=true,powered=true] + model: + path: ${door_model}_bottom_left_open + y: 90 + generation: + parent: minecraft:block/door_bottom_left_open + textures: + bottom: ${door_texture_bottom} + top: ${door_texture_top} + facing=east,half=lower,hinge=right,open=false: + state: ${door_base_block}[facing=east,half=lower,hinge=right,open=false,powered=true] + model: + path: ${door_model}_bottom_right + generation: + parent: minecraft:block/door_bottom_right + textures: + bottom: ${door_texture_bottom} + top: ${door_texture_top} + facing=east,half=lower,hinge=right,open=true: + state: ${door_base_block}[facing=east,half=lower,hinge=right,open=true,powered=true] + model: + path: ${door_model}_bottom_right_open + y: 270 + generation: + parent: minecraft:block/door_bottom_right_open + textures: + bottom: ${door_texture_bottom} + top: ${door_texture_top} + facing=east,half=upper,hinge=left,open=false: + state: ${door_base_block}[facing=east,half=upper,hinge=left,open=false,powered=true] + model: + path: ${door_model}_top_left + generation: + parent: minecraft:block/door_top_left + textures: + bottom: ${door_texture_bottom} + top: ${door_texture_top} + facing=east,half=upper,hinge=left,open=true: + state: ${door_base_block}[facing=east,half=upper,hinge=left,open=true,powered=true] + model: + path: ${door_model}_top_left_open + y: 90 + generation: + parent: minecraft:block/door_top_left_open + textures: + bottom: ${door_texture_bottom} + top: ${door_texture_top} + facing=east,half=upper,hinge=right,open=false: + state: ${door_base_block}[facing=east,half=upper,hinge=right,open=false,powered=true] + model: + path: ${door_model}_top_right + generation: + parent: minecraft:block/door_top_right + textures: + bottom: ${door_texture_bottom} + top: ${door_texture_top} + facing=east,half=upper,hinge=right,open=true: + state: ${door_base_block}[facing=east,half=upper,hinge=right,open=true,powered=true] + model: + path: ${door_model}_top_right_open + y: 270 + generation: + parent: minecraft:block/door_top_right_open + textures: + bottom: ${door_texture_bottom} + top: ${door_texture_top} + + facing=north,half=lower,hinge=left,open=false: + state: ${door_base_block}[facing=north,half=lower,hinge=left,open=false,powered=true] + model: + path: ${door_model}_bottom_left + y: 270 + facing=north,half=lower,hinge=left,open=true: + state: ${door_base_block}[facing=north,half=lower,hinge=left,open=true,powered=true] + model: + path: ${door_model}_bottom_left_open + facing=north,half=lower,hinge=right,open=false: + state: ${door_base_block}[facing=north,half=lower,hinge=right,open=false,powered=true] + model: + path: ${door_model}_bottom_right + y: 270 + facing=north,half=lower,hinge=right,open=true: + state: ${door_base_block}[facing=north,half=lower,hinge=right,open=true,powered=true] + model: + path: ${door_model}_bottom_right_open + y: 180 + facing=north,half=upper,hinge=left,open=false: + state: ${door_base_block}[facing=north,half=upper,hinge=left,open=false,powered=true] + model: + path: ${door_model}_top_left + y: 270 + facing=north,half=upper,hinge=left,open=true: + state: ${door_base_block}[facing=north,half=upper,hinge=left,open=true,powered=true] + model: + path: ${door_model}_top_left_open + facing=north,half=upper,hinge=right,open=false: + state: ${door_base_block}[facing=north,half=upper,hinge=right,open=false,powered=true] + model: + path: ${door_model}_top_right + y: 270 + facing=north,half=upper,hinge=right,open=true: + state: ${door_base_block}[facing=north,half=upper,hinge=right,open=true,powered=true] + model: + path: ${door_model}_top_right_open + y: 180 + facing=south,half=lower,hinge=left,open=false: + state: ${door_base_block}[facing=south,half=lower,hinge=left,open=false,powered=true] + model: + path: ${door_model}_bottom_left + y: 90 + facing=south,half=lower,hinge=left,open=true: + state: ${door_base_block}[facing=south,half=lower,hinge=left,open=true,powered=true] + model: + path: ${door_model}_bottom_left_open + y: 180 + facing=south,half=lower,hinge=right,open=false: + state: ${door_base_block}[facing=south,half=lower,hinge=right,open=false,powered=true] + model: + path: ${door_model}_bottom_right + y: 90 + facing=south,half=lower,hinge=right,open=true: + state: ${door_base_block}[facing=south,half=lower,hinge=right,open=true,powered=true] + model: + path: ${door_model}_bottom_right_open + facing=south,half=upper,hinge=left,open=false: + state: ${door_base_block}[facing=south,half=upper,hinge=left,open=false,powered=true] + model: + path: ${door_model}_top_left + y: 90 + facing=south,half=upper,hinge=left,open=true: + state: ${door_base_block}[facing=south,half=upper,hinge=left,open=true,powered=true] + model: + path: ${door_model}_top_left_open + y: 180 + facing=south,half=upper,hinge=right,open=false: + state: ${door_base_block}[facing=south,half=upper,hinge=right,open=false,powered=true] + model: + path: ${door_model}_top_right + y: 90 + facing=south,half=upper,hinge=right,open=true: + state: ${door_base_block}[facing=south,half=upper,hinge=right,open=true,powered=true] + model: + path: ${door_model}_top_right_open + facing=west,half=lower,hinge=left,open=false: + state: ${door_base_block}[facing=west,half=lower,hinge=left,open=false,powered=true] + model: + path: ${door_model}_bottom_left + y: 180 + facing=west,half=lower,hinge=left,open=true: + state: ${door_base_block}[facing=west,half=lower,hinge=left,open=true,powered=true] + model: + path: ${door_model}_bottom_left_open + y: 270 + facing=west,half=lower,hinge=right,open=false: + state: ${door_base_block}[facing=west,half=lower,hinge=right,open=false,powered=true] + model: + path: ${door_model}_bottom_right + y: 180 + facing=west,half=lower,hinge=right,open=true: + state: ${door_base_block}[facing=west,half=lower,hinge=right,open=true,powered=true] + model: + path: ${door_model}_bottom_right_open + y: 90 + facing=west,half=upper,hinge=left,open=false: + state: ${door_base_block}[facing=west,half=upper,hinge=left,open=false,powered=true] + model: + path: ${door_model}_top_left + y: 180 + facing=west,half=upper,hinge=left,open=true: + state: ${door_base_block}[facing=west,half=upper,hinge=left,open=true,powered=true] + model: + path: ${door_model}_top_left_open + y: 270 + facing=west,half=upper,hinge=right,open=false: + state: ${door_base_block}[facing=west,half=upper,hinge=right,open=false,powered=true] + model: + path: ${door_model}_top_right + y: 180 + facing=west,half=upper,hinge=right,open=true: + state: ${door_base_block}[facing=west,half=upper,hinge=right,open=true,powered=true] + model: + path: ${door_model}_top_right_open + y: 90 + variants: + facing=east,half=lower,hinge=left,open=false: + appearance: facing=east,half=lower,hinge=left,open=false + facing=east,half=lower,hinge=right,open=false: + appearance: facing=east,half=lower,hinge=right,open=false + facing=east,half=upper,hinge=left,open=false: + appearance: facing=east,half=upper,hinge=left,open=false + facing=east,half=upper,hinge=right,open=false: + appearance: facing=east,half=upper,hinge=right,open=false + facing=north,half=lower,hinge=left,open=false: + appearance: facing=north,half=lower,hinge=left,open=false + facing=north,half=lower,hinge=right,open=false: + appearance: facing=north,half=lower,hinge=right,open=false + facing=north,half=upper,hinge=left,open=false: + appearance: facing=north,half=upper,hinge=left,open=false + facing=north,half=upper,hinge=right,open=false: + appearance: facing=north,half=upper,hinge=right,open=false + facing=south,half=lower,hinge=left,open=false: + appearance: facing=south,half=lower,hinge=left,open=false + facing=south,half=lower,hinge=right,open=false: + appearance: facing=south,half=lower,hinge=right,open=false + facing=south,half=upper,hinge=left,open=false: + appearance: facing=south,half=upper,hinge=left,open=false + facing=south,half=upper,hinge=right,open=false: + appearance: facing=south,half=upper,hinge=right,open=false + facing=west,half=lower,hinge=left,open=false: + appearance: facing=west,half=lower,hinge=left,open=false + facing=west,half=lower,hinge=right,open=false: + appearance: facing=west,half=lower,hinge=right,open=false + facing=west,half=upper,hinge=left,open=false: + appearance: facing=west,half=upper,hinge=left,open=false + facing=west,half=upper,hinge=right,open=false: + appearance: facing=west,half=upper,hinge=right,open=false + facing=east,half=lower,hinge=left,open=true: + appearance: facing=east,half=lower,hinge=left,open=true + facing=east,half=lower,hinge=right,open=true: + appearance: facing=east,half=lower,hinge=right,open=true + facing=east,half=upper,hinge=left,open=true: + appearance: facing=east,half=upper,hinge=left,open=true + facing=east,half=upper,hinge=right,open=true: + appearance: facing=east,half=upper,hinge=right,open=true + facing=north,half=lower,hinge=left,open=true: + appearance: facing=north,half=lower,hinge=left,open=true + facing=north,half=lower,hinge=right,open=true: + appearance: facing=north,half=lower,hinge=right,open=true + facing=north,half=upper,hinge=left,open=true: + appearance: facing=north,half=upper,hinge=left,open=true + facing=north,half=upper,hinge=right,open=true: + appearance: facing=north,half=upper,hinge=right,open=true + facing=south,half=lower,hinge=left,open=true: + appearance: facing=south,half=lower,hinge=left,open=true + facing=south,half=lower,hinge=right,open=true: + appearance: facing=south,half=lower,hinge=right,open=true + facing=south,half=upper,hinge=left,open=true: + appearance: facing=south,half=upper,hinge=left,open=true + facing=south,half=upper,hinge=right,open=true: + appearance: facing=south,half=upper,hinge=right,open=true + facing=west,half=lower,hinge=left,open=true: + appearance: facing=west,half=lower,hinge=left,open=true + facing=west,half=lower,hinge=right,open=true: + appearance: facing=west,half=lower,hinge=right,open=true + facing=west,half=upper,hinge=left,open=true: + appearance: facing=west,half=upper,hinge=left,open=true + facing=west,half=upper,hinge=right,open=true: + appearance: facing=west,half=upper,hinge=right,open=true + default:block_state/fence_gate: + properties: + facing: + type: horizontal_direction + in_wall: + type: boolean + default: false + open: + type: boolean + default: false + powered: + type: boolean + default: false + appearances: + facing=east,in_wall=false,open=false: + state: ${fence_gate_base_block}[facing=east,in_wall=false,open=false,powered=true] + model: + path: ${fence_gate_model} + y: 270 + uvlock: true + generation: + parent: minecraft:block/template_fence_gate + textures: + texture: ${fence_gate_texture} + facing=east,in_wall=false,open=true: + state: ${fence_gate_base_block}[facing=east,in_wall=false,open=true,powered=true] + model: + path: ${fence_gate_model}_open + y: 270 + uvlock: true + generation: + parent: minecraft:block/template_fence_gate_open + textures: + texture: ${fence_gate_texture} + facing=east,in_wall=true,open=false: + state: ${fence_gate_base_block}[facing=east,in_wall=true,open=false,powered=true] + model: + path: ${fence_gate_model}_wall + y: 270 + uvlock: true + generation: + parent: minecraft:block/template_fence_gate_wall + textures: + texture: ${fence_gate_texture} + facing=east,in_wall=true,open=true: + state: ${fence_gate_base_block}[facing=east,in_wall=true,open=true,powered=true] + model: + path: ${fence_gate_model}_wall_open + y: 270 + uvlock: true + generation: + parent: minecraft:block/template_fence_gate_wall_open + textures: + texture: ${fence_gate_texture} + facing=north,in_wall=false,open=false: + state: ${fence_gate_base_block}[facing=north,in_wall=false,open=false,powered=true] + model: + path: ${fence_gate_model} + y: 180 + uvlock: true + facing=north,in_wall=false,open=true: + state: ${fence_gate_base_block}[facing=north,in_wall=false,open=true,powered=true] + model: + path: ${fence_gate_model}_open + y: 180 + uvlock: true + facing=north,in_wall=true,open=false: + state: ${fence_gate_base_block}[facing=north,in_wall=true,open=false,powered=true] + model: + path: ${fence_gate_model}_wall + y: 180 + uvlock: true + facing=north,in_wall=true,open=true: + state: ${fence_gate_base_block}[facing=north,in_wall=true,open=true,powered=true] + model: + path: ${fence_gate_model}_wall_open + y: 180 + uvlock: true + facing=south,in_wall=false,open=false: + state: ${fence_gate_base_block}[facing=south,in_wall=false,open=false,powered=true] + model: + path: ${fence_gate_model} + uvlock: true + facing=south,in_wall=false,open=true: + state: ${fence_gate_base_block}[facing=south,in_wall=false,open=true,powered=true] + model: + path: ${fence_gate_model}_open + uvlock: true + facing=south,in_wall=true,open=false: + state: ${fence_gate_base_block}[facing=south,in_wall=true,open=false,powered=true] + model: + path: ${fence_gate_model}_wall + uvlock: true + facing=south,in_wall=true,open=true: + state: ${fence_gate_base_block}[facing=south,in_wall=true,open=true,powered=true] + model: + path: ${fence_gate_model}_wall_open + uvlock: true + facing=west,in_wall=false,open=false: + state: ${fence_gate_base_block}[facing=west,in_wall=false,open=false,powered=true] + model: + path: ${fence_gate_model} + y: 90 + uvlock: true + facing=west,in_wall=false,open=true: + state: ${fence_gate_base_block}[facing=west,in_wall=false,open=true,powered=true] + model: + path: ${fence_gate_model}_open + y: 90 + uvlock: true + facing=west,in_wall=true,open=false: + state: ${fence_gate_base_block}[facing=west,in_wall=true,open=false,powered=true] + model: + path: ${fence_gate_model}_wall + y: 90 + uvlock: true + facing=west,in_wall=true,open=true: + state: ${fence_gate_base_block}[facing=west,in_wall=true,open=true,powered=true] + model: + path: ${fence_gate_model}_wall_open + y: 90 + uvlock: true + variants: + facing=east,in_wall=false,open=false,powered=true: + appearance: facing=east,in_wall=false,open=false + facing=east,in_wall=false,open=false,powered=false: + appearance: facing=east,in_wall=false,open=false + facing=east,in_wall=false,open=true,powered=true: + appearance: facing=east,in_wall=false,open=true + facing=east,in_wall=false,open=true,powered=false: + appearance: facing=east,in_wall=false,open=true + facing=east,in_wall=true,open=false,powered=true: + appearance: facing=east,in_wall=true,open=false + facing=east,in_wall=true,open=false,powered=false: + appearance: facing=east,in_wall=true,open=false + facing=east,in_wall=true,open=true,powered=true: + appearance: facing=east,in_wall=true,open=true + facing=east,in_wall=true,open=true,powered=false: + appearance: facing=east,in_wall=true,open=true + facing=south,in_wall=false,open=false,powered=true: + appearance: facing=south,in_wall=false,open=false + facing=south,in_wall=false,open=false,powered=false: + appearance: facing=south,in_wall=false,open=false + facing=south,in_wall=false,open=true,powered=true: + appearance: facing=south,in_wall=false,open=true + facing=south,in_wall=false,open=true,powered=false: + appearance: facing=south,in_wall=false,open=true + facing=south,in_wall=true,open=false,powered=true: + appearance: facing=south,in_wall=true,open=false + facing=south,in_wall=true,open=false,powered=false: + appearance: facing=south,in_wall=true,open=false + facing=south,in_wall=true,open=true,powered=true: + appearance: facing=south,in_wall=true,open=true + facing=south,in_wall=true,open=true,powered=false: + appearance: facing=south,in_wall=true,open=true + facing=west,in_wall=false,open=false,powered=true: + appearance: facing=west,in_wall=false,open=false + facing=west,in_wall=false,open=false,powered=false: + appearance: facing=west,in_wall=false,open=false + facing=west,in_wall=false,open=true,powered=true: + appearance: facing=west,in_wall=false,open=true + facing=west,in_wall=false,open=true,powered=false: + appearance: facing=west,in_wall=false,open=true + facing=west,in_wall=true,open=false,powered=true: + appearance: facing=west,in_wall=true,open=false + facing=west,in_wall=true,open=false,powered=false: + appearance: facing=west,in_wall=true,open=false + facing=west,in_wall=true,open=true,powered=true: + appearance: facing=west,in_wall=true,open=true + facing=west,in_wall=true,open=true,powered=false: + appearance: facing=west,in_wall=true,open=true + facing=north,in_wall=false,open=false,powered=true: + appearance: facing=north,in_wall=false,open=false + facing=north,in_wall=false,open=false,powered=false: + appearance: facing=north,in_wall=false,open=false + facing=north,in_wall=false,open=true,powered=true: + appearance: facing=north,in_wall=false,open=true + facing=north,in_wall=false,open=true,powered=false: + appearance: facing=north,in_wall=false,open=true + facing=north,in_wall=true,open=false,powered=true: + appearance: facing=north,in_wall=true,open=false + facing=north,in_wall=true,open=false,powered=false: + appearance: facing=north,in_wall=true,open=false + facing=north,in_wall=true,open=true,powered=true: + appearance: facing=north,in_wall=true,open=true + facing=north,in_wall=true,open=true,powered=false: + appearance: facing=north,in_wall=true,open=true + default:block_state/slab: + properties: + type: + type: slab_type + default: bottom + waterlogged: + type: boolean + default: false + appearances: + type=top,waterlogged=false: + state: ${slab_base_block}[type=top,waterlogged=false] + model: + path: ${slab_model}_top + generation: + parent: minecraft:block/slab_top + textures: + bottom: ${slab_texture_bottom:-"${slab_texture}"} + side: ${slab_texture_side:-"${slab_texture}"} + top: ${slab_texture_top:-"${slab_texture}"} + type=bottom,waterlogged=false: + state: ${slab_base_block}[type=bottom,waterlogged=false] + model: + path: ${slab_model} + generation: + parent: minecraft:block/slab + textures: + bottom: ${slab_texture_bottom:-"${slab_texture}"} + side: ${slab_texture_side:-"${slab_texture}"} + top: ${slab_texture_top:-"${slab_texture}"} + type=double,waterlogged=false: + state: ${slab_base_block}[type=double,waterlogged=false] + model: + path: ${planks_model} + type=top,waterlogged=true: + state: ${slab_base_block}[type=top,waterlogged=true] + model: + path: ${slab_model}_top + type=bottom,waterlogged=true: + state: ${slab_base_block}[type=bottom,waterlogged=true] + model: + path: ${slab_model} + type=double,waterlogged=true: + state: ${slab_base_block}[type=double,waterlogged=true] + model: + path: ${planks_model} + variants: + type=top,waterlogged=false: + appearance: type=top,waterlogged=false + type=bottom,waterlogged=false: + appearance: type=bottom,waterlogged=false + type=double,waterlogged=false: + appearance: type=double,waterlogged=false + type=top,waterlogged=true: + appearance: type=top,waterlogged=true + settings: + resistance: 1200.0 + burnable: false + fluid_state: water + type=bottom,waterlogged=true: + appearance: type=bottom,waterlogged=true + settings: + resistance: 1200.0 + burnable: false + fluid_state: water + type=double,waterlogged=true: + appearance: type=double,waterlogged=true + settings: + resistance: 1200.0 + burnable: false + fluid_state: water + default:block_state/stairs: + properties: + facing: + type: horizontal_direction + half: + type: single_block_half + shape: + type: stairs_shape + waterlogged: + type: boolean + default: false + appearances: + facing=east,half=bottom,shape=inner_left,waterlogged=false: + state: ${stairs_base_block}[facing=east,half=bottom,shape=inner_left,waterlogged=false] + model: + path: ${stairs_model}_inner + uvlock: true + y: 270 + generation: + parent: minecraft:block/inner_stairs + textures: + bottom: ${stairs_texture_bottom:-"${stairs_texture}"} + side: ${stairs_texture_side:-"${stairs_texture}"} + top: ${stairs_texture_top:-"${stairs_texture}"} + facing=east,half=bottom,shape=inner_right,waterlogged=false: + state: ${stairs_base_block}[facing=east,half=bottom,shape=inner_right,waterlogged=false] + model: + path: ${stairs_model}_inner + facing=east,half=bottom,shape=outer_left,waterlogged=false: + state: ${stairs_base_block}[facing=east,half=bottom,shape=outer_left,waterlogged=false] + model: + path: ${stairs_model}_outer + uvlock: true + y: 270 + generation: + parent: minecraft:block/outer_stairs + textures: + bottom: ${stairs_texture_bottom:-"${stairs_texture}"} + side: ${stairs_texture_side:-"${stairs_texture}"} + top: ${stairs_texture_top:-"${stairs_texture}"} + facing=east,half=bottom,shape=outer_right,waterlogged=false: + state: ${stairs_base_block}[facing=east,half=bottom,shape=outer_right,waterlogged=false] + model: + path: ${stairs_model}_outer + facing=east,half=bottom,shape=straight,waterlogged=false: + state: ${stairs_base_block}[facing=east,half=bottom,shape=straight,waterlogged=false] + model: + path: ${stairs_model} + generation: + parent: minecraft:block/stairs + textures: + bottom: ${stairs_texture_bottom:-"${stairs_texture}"} + side: ${stairs_texture_side:-"${stairs_texture}"} + top: ${stairs_texture_top:-"${stairs_texture}"} + facing=east,half=top,shape=inner_left,waterlogged=false: + state: ${stairs_base_block}[facing=east,half=top,shape=inner_left,waterlogged=false] + model: + path: ${stairs_model}_inner + uvlock: true + x: 180 + facing=east,half=top,shape=inner_right,waterlogged=false: + state: ${stairs_base_block}[facing=east,half=top,shape=inner_right,waterlogged=false] + model: + path: ${stairs_model}_inner + uvlock: true + x: 180 + y: 90 + facing=east,half=top,shape=outer_left,waterlogged=false: + state: ${stairs_base_block}[facing=east,half=top,shape=outer_left,waterlogged=false] + model: + path: ${stairs_model}_outer + uvlock: true + x: 180 + facing=east,half=top,shape=outer_right,waterlogged=false: + state: ${stairs_base_block}[facing=east,half=top,shape=outer_right,waterlogged=false] + model: + path: ${stairs_model}_outer + uvlock: true + x: 180 + y: 90 + facing=east,half=top,shape=straight,waterlogged=false: + state: ${stairs_base_block}[facing=east,half=top,shape=straight,waterlogged=false] + model: + path: ${stairs_model} + uvlock: true + x: 180 + facing=north,half=bottom,shape=inner_left,waterlogged=false: + state: ${stairs_base_block}[facing=north,half=bottom,shape=inner_left,waterlogged=false] + model: + path: ${stairs_model}_inner + uvlock: true + y: 180 + facing=north,half=bottom,shape=inner_right,waterlogged=false: + state: ${stairs_base_block}[facing=north,half=bottom,shape=inner_right,waterlogged=false] + model: + path: ${stairs_model}_inner + uvlock: true + y: 270 + facing=north,half=bottom,shape=outer_left,waterlogged=false: + state: ${stairs_base_block}[facing=north,half=bottom,shape=outer_left,waterlogged=false] + model: + path: ${stairs_model}_outer + uvlock: true + y: 180 + facing=north,half=bottom,shape=outer_right,waterlogged=false: + state: ${stairs_base_block}[facing=north,half=bottom,shape=outer_right,waterlogged=false] + model: + path: ${stairs_model}_outer + uvlock: true + y: 270 + facing=north,half=bottom,shape=straight,waterlogged=false: + state: ${stairs_base_block}[facing=north,half=bottom,shape=straight,waterlogged=false] + model: + path: ${stairs_model} + uvlock: true + y: 270 + facing=north,half=top,shape=inner_left,waterlogged=false: + state: ${stairs_base_block}[facing=north,half=top,shape=inner_left,waterlogged=false] + model: + path: ${stairs_model}_inner + uvlock: true + x: 180 + y: 270 + facing=north,half=top,shape=inner_right,waterlogged=false: + state: ${stairs_base_block}[facing=north,half=top,shape=inner_right,waterlogged=false] + model: + path: ${stairs_model}_inner + uvlock: true + x: 180 + facing=north,half=top,shape=outer_left,waterlogged=false: + state: ${stairs_base_block}[facing=north,half=top,shape=outer_left,waterlogged=false] + model: + path: ${stairs_model}_outer + uvlock: true + x: 180 + y: 270 + facing=north,half=top,shape=outer_right,waterlogged=false: + state: ${stairs_base_block}[facing=north,half=top,shape=outer_right,waterlogged=false] + model: + path: ${stairs_model}_outer + uvlock: true + x: 180 + facing=north,half=top,shape=straight,waterlogged=false: + state: ${stairs_base_block}[facing=north,half=top,shape=straight,waterlogged=false] + model: + path: ${stairs_model} + uvlock: true + x: 180 + y: 270 + facing=south,half=bottom,shape=inner_left,waterlogged=false: + state: ${stairs_base_block}[facing=south,half=bottom,shape=inner_left,waterlogged=false] + model: + path: ${stairs_model}_inner + facing=south,half=bottom,shape=inner_right,waterlogged=false: + state: ${stairs_base_block}[facing=south,half=bottom,shape=inner_right,waterlogged=false] + model: + path: ${stairs_model}_inner + uvlock: true + y: 90 + facing=south,half=bottom,shape=outer_left,waterlogged=false: + state: ${stairs_base_block}[facing=south,half=bottom,shape=outer_left,waterlogged=false] + model: + path: ${stairs_model}_outer + facing=south,half=bottom,shape=outer_right,waterlogged=false: + state: ${stairs_base_block}[facing=south,half=bottom,shape=outer_right,waterlogged=false] + model: + path: ${stairs_model}_outer + uvlock: true + y: 90 + facing=south,half=bottom,shape=straight,waterlogged=false: + state: ${stairs_base_block}[facing=south,half=bottom,shape=straight,waterlogged=false] + model: + path: ${stairs_model} + uvlock: true + y: 90 + facing=south,half=top,shape=inner_left,waterlogged=false: + state: ${stairs_base_block}[facing=south,half=top,shape=inner_left,waterlogged=false] + model: + path: ${stairs_model}_inner + uvlock: true + x: 180 + y: 90 + facing=south,half=top,shape=inner_right,waterlogged=false: + state: ${stairs_base_block}[facing=south,half=top,shape=inner_right,waterlogged=false] + model: + path: ${stairs_model}_inner + uvlock: true + x: 180 + y: 180 + facing=south,half=top,shape=outer_left,waterlogged=false: + state: ${stairs_base_block}[facing=south,half=top,shape=outer_left,waterlogged=false] + model: + path: ${stairs_model}_outer + uvlock: true + x: 180 + y: 90 + facing=south,half=top,shape=outer_right,waterlogged=false: + state: ${stairs_base_block}[facing=south,half=top,shape=outer_right,waterlogged=false] + model: + path: ${stairs_model}_outer + uvlock: true + x: 180 + y: 180 + facing=south,half=top,shape=straight,waterlogged=false: + state: ${stairs_base_block}[facing=south,half=top,shape=straight,waterlogged=false] + model: + path: ${stairs_model} + uvlock: true + x: 180 + y: 90 + facing=west,half=bottom,shape=inner_left,waterlogged=false: + state: ${stairs_base_block}[facing=west,half=bottom,shape=inner_left,waterlogged=false] + model: + path: ${stairs_model}_inner + uvlock: true + y: 90 + facing=west,half=bottom,shape=inner_right,waterlogged=false: + state: ${stairs_base_block}[facing=west,half=bottom,shape=inner_right,waterlogged=false] + model: + path: ${stairs_model}_inner + uvlock: true + y: 180 + facing=west,half=bottom,shape=outer_left,waterlogged=false: + state: ${stairs_base_block}[facing=west,half=bottom,shape=outer_left,waterlogged=false] + model: + path: ${stairs_model}_outer + uvlock: true + y: 90 + facing=west,half=bottom,shape=outer_right,waterlogged=false: + state: ${stairs_base_block}[facing=west,half=bottom,shape=outer_right,waterlogged=false] + model: + path: ${stairs_model}_outer + uvlock: true + y: 180 + facing=west,half=bottom,shape=straight,waterlogged=false: + state: ${stairs_base_block}[facing=west,half=bottom,shape=straight,waterlogged=false] + model: + path: ${stairs_model} + uvlock: true + y: 180 + facing=west,half=top,shape=inner_left,waterlogged=false: + state: ${stairs_base_block}[facing=west,half=top,shape=inner_left,waterlogged=false] + model: + path: ${stairs_model}_inner + uvlock: true + x: 180 + y: 180 + facing=west,half=top,shape=inner_right,waterlogged=false: + state: ${stairs_base_block}[facing=west,half=top,shape=inner_right,waterlogged=false] + model: + path: ${stairs_model}_inner + uvlock: true + x: 180 + y: 270 + facing=west,half=top,shape=outer_left,waterlogged=false: + state: ${stairs_base_block}[facing=west,half=top,shape=outer_left,waterlogged=false] + model: + path: ${stairs_model}_outer + uvlock: true + x: 180 + y: 180 + facing=west,half=top,shape=outer_right,waterlogged=false: + state: ${stairs_base_block}[facing=west,half=top,shape=outer_right,waterlogged=false] + model: + path: ${stairs_model}_outer + uvlock: true + x: 180 + y: 270 + facing=west,half=top,shape=straight,waterlogged=false: + state: ${stairs_base_block}[facing=west,half=top,shape=straight,waterlogged=false] + model: + path: ${stairs_model} + uvlock: true + x: 180 + y: 180 + facing=east,half=bottom,shape=inner_left,waterlogged=true: + state: ${stairs_base_block}[facing=east,half=bottom,shape=inner_left,waterlogged=true] + model: + path: ${stairs_model}_inner + uvlock: true + y: 270 + facing=east,half=bottom,shape=inner_right,waterlogged=true: + state: ${stairs_base_block}[facing=east,half=bottom,shape=inner_right,waterlogged=true] + model: + path: ${stairs_model}_inner + facing=east,half=bottom,shape=outer_left,waterlogged=true: + state: ${stairs_base_block}[facing=east,half=bottom,shape=outer_left,waterlogged=true] + model: + path: ${stairs_model}_outer + uvlock: true + y: 270 + facing=east,half=bottom,shape=outer_right,waterlogged=true: + state: ${stairs_base_block}[facing=east,half=bottom,shape=outer_right,waterlogged=true] + model: + path: ${stairs_model}_outer + facing=east,half=bottom,shape=straight,waterlogged=true: + state: ${stairs_base_block}[facing=east,half=bottom,shape=straight,waterlogged=true] + model: + path: ${stairs_model} + facing=east,half=top,shape=inner_left,waterlogged=true: + state: ${stairs_base_block}[facing=east,half=top,shape=inner_left,waterlogged=true] + model: + path: ${stairs_model}_inner + uvlock: true + x: 180 + facing=east,half=top,shape=inner_right,waterlogged=true: + state: ${stairs_base_block}[facing=east,half=top,shape=inner_right,waterlogged=true] + model: + path: ${stairs_model}_inner + uvlock: true + x: 180 + y: 90 + facing=east,half=top,shape=outer_left,waterlogged=true: + state: ${stairs_base_block}[facing=east,half=top,shape=outer_left,waterlogged=true] + model: + path: ${stairs_model}_outer + uvlock: true + x: 180 + facing=east,half=top,shape=outer_right,waterlogged=true: + state: ${stairs_base_block}[facing=east,half=top,shape=outer_right,waterlogged=true] + model: + path: ${stairs_model}_outer + uvlock: true + x: 180 + y: 90 + facing=east,half=top,shape=straight,waterlogged=true: + state: ${stairs_base_block}[facing=east,half=top,shape=straight,waterlogged=true] + model: + path: ${stairs_model} + uvlock: true + x: 180 + facing=north,half=bottom,shape=inner_left,waterlogged=true: + state: ${stairs_base_block}[facing=north,half=bottom,shape=inner_left,waterlogged=true] + model: + path: ${stairs_model}_inner + uvlock: true + y: 180 + facing=north,half=bottom,shape=inner_right,waterlogged=true: + state: ${stairs_base_block}[facing=north,half=bottom,shape=inner_right,waterlogged=true] + model: + path: ${stairs_model}_inner + uvlock: true + y: 270 + facing=north,half=bottom,shape=outer_left,waterlogged=true: + state: ${stairs_base_block}[facing=north,half=bottom,shape=outer_left,waterlogged=true] + model: + path: ${stairs_model}_outer + uvlock: true + y: 180 + facing=north,half=bottom,shape=outer_right,waterlogged=true: + state: ${stairs_base_block}[facing=north,half=bottom,shape=outer_right,waterlogged=true] + model: + path: ${stairs_model}_outer + uvlock: true + y: 270 + facing=north,half=bottom,shape=straight,waterlogged=true: + state: ${stairs_base_block}[facing=north,half=bottom,shape=straight,waterlogged=true] + model: + path: ${stairs_model} + uvlock: true + y: 270 + facing=north,half=top,shape=inner_left,waterlogged=true: + state: ${stairs_base_block}[facing=north,half=top,shape=inner_left,waterlogged=true] + model: + path: ${stairs_model}_inner + uvlock: true + x: 180 + y: 270 + facing=north,half=top,shape=inner_right,waterlogged=true: + state: ${stairs_base_block}[facing=north,half=top,shape=inner_right,waterlogged=true] + model: + path: ${stairs_model}_inner + uvlock: true + x: 180 + facing=north,half=top,shape=outer_left,waterlogged=true: + state: ${stairs_base_block}[facing=north,half=top,shape=outer_left,waterlogged=true] + model: + path: ${stairs_model}_outer + uvlock: true + x: 180 + y: 270 + facing=north,half=top,shape=outer_right,waterlogged=true: + state: ${stairs_base_block}[facing=north,half=top,shape=outer_right,waterlogged=true] + model: + path: ${stairs_model}_outer + uvlock: true + x: 180 + facing=north,half=top,shape=straight,waterlogged=true: + state: ${stairs_base_block}[facing=north,half=top,shape=straight,waterlogged=true] + model: + path: ${stairs_model} + uvlock: true + x: 180 + y: 270 + facing=south,half=bottom,shape=inner_left,waterlogged=true: + state: ${stairs_base_block}[facing=south,half=bottom,shape=inner_left,waterlogged=true] + model: + path: ${stairs_model}_inner + facing=south,half=bottom,shape=inner_right,waterlogged=true: + state: ${stairs_base_block}[facing=south,half=bottom,shape=inner_right,waterlogged=true] + model: + path: ${stairs_model}_inner + uvlock: true + y: 90 + facing=south,half=bottom,shape=outer_left,waterlogged=true: + state: ${stairs_base_block}[facing=south,half=bottom,shape=outer_left,waterlogged=true] + model: + path: ${stairs_model}_outer + facing=south,half=bottom,shape=outer_right,waterlogged=true: + state: ${stairs_base_block}[facing=south,half=bottom,shape=outer_right,waterlogged=true] + model: + path: ${stairs_model}_outer + uvlock: true + y: 90 + facing=south,half=bottom,shape=straight,waterlogged=true: + state: ${stairs_base_block}[facing=south,half=bottom,shape=straight,waterlogged=true] + model: + path: ${stairs_model} + uvlock: true + y: 90 + facing=south,half=top,shape=inner_left,waterlogged=true: + state: ${stairs_base_block}[facing=south,half=top,shape=inner_left,waterlogged=true] + model: + path: ${stairs_model}_inner + uvlock: true + x: 180 + y: 90 + facing=south,half=top,shape=inner_right,waterlogged=true: + state: ${stairs_base_block}[facing=south,half=top,shape=inner_right,waterlogged=true] + model: + path: ${stairs_model}_inner + uvlock: true + x: 180 + y: 180 + facing=south,half=top,shape=outer_left,waterlogged=true: + state: ${stairs_base_block}[facing=south,half=top,shape=outer_left,waterlogged=true] + model: + path: ${stairs_model}_outer + uvlock: true + x: 180 + y: 90 + facing=south,half=top,shape=outer_right,waterlogged=true: + state: ${stairs_base_block}[facing=south,half=top,shape=outer_right,waterlogged=true] + model: + path: ${stairs_model}_outer + uvlock: true + x: 180 + y: 180 + facing=south,half=top,shape=straight,waterlogged=true: + state: ${stairs_base_block}[facing=south,half=top,shape=straight,waterlogged=true] + model: + path: ${stairs_model} + uvlock: true + x: 180 + y: 90 + facing=west,half=bottom,shape=inner_left,waterlogged=true: + state: ${stairs_base_block}[facing=west,half=bottom,shape=inner_left,waterlogged=true] + model: + path: ${stairs_model}_inner + uvlock: true + y: 90 + facing=west,half=bottom,shape=inner_right,waterlogged=true: + state: ${stairs_base_block}[facing=west,half=bottom,shape=inner_right,waterlogged=true] + model: + path: ${stairs_model}_inner + uvlock: true + y: 180 + facing=west,half=bottom,shape=outer_left,waterlogged=true: + state: ${stairs_base_block}[facing=west,half=bottom,shape=outer_left,waterlogged=true] + model: + path: ${stairs_model}_outer + uvlock: true + y: 90 + facing=west,half=bottom,shape=outer_right,waterlogged=true: + state: ${stairs_base_block}[facing=west,half=bottom,shape=outer_right,waterlogged=true] + model: + path: ${stairs_model}_outer + uvlock: true + y: 180 + facing=west,half=bottom,shape=straight,waterlogged=true: + state: ${stairs_base_block}[facing=west,half=bottom,shape=straight,waterlogged=true] + model: + path: ${stairs_model} + uvlock: true + y: 180 + facing=west,half=top,shape=inner_left,waterlogged=true: + state: ${stairs_base_block}[facing=west,half=top,shape=inner_left,waterlogged=true] + model: + path: ${stairs_model}_inner + uvlock: true + x: 180 + y: 180 + facing=west,half=top,shape=inner_right,waterlogged=true: + state: ${stairs_base_block}[facing=west,half=top,shape=inner_right,waterlogged=true] + model: + path: ${stairs_model}_inner + uvlock: true + x: 180 + y: 270 + facing=west,half=top,shape=outer_left,waterlogged=true: + state: ${stairs_base_block}[facing=west,half=top,shape=outer_left,waterlogged=true] + model: + path: ${stairs_model}_outer + uvlock: true + x: 180 + y: 180 + facing=west,half=top,shape=outer_right,waterlogged=true: + state: ${stairs_base_block}[facing=west,half=top,shape=outer_right,waterlogged=true] + model: + path: ${stairs_model}_outer + uvlock: true + x: 180 + y: 270 + facing=west,half=top,shape=straight,waterlogged=true: + state: ${stairs_base_block}[facing=west,half=top,shape=straight,waterlogged=true] + model: + path: ${stairs_model} + uvlock: true + x: 180 + y: 180 + variants: + waterlogged=true: + settings: + resistance: 1200.0 + burnable: false + fluid_state: water + facing=east,half=bottom,shape=inner_left,waterlogged=false: + appearance: facing=east,half=bottom,shape=inner_left,waterlogged=false + facing=east,half=bottom,shape=inner_right,waterlogged=false: + appearance: facing=east,half=bottom,shape=inner_right,waterlogged=false + facing=east,half=bottom,shape=outer_left,waterlogged=false: + appearance: facing=east,half=bottom,shape=outer_left,waterlogged=false + facing=east,half=bottom,shape=outer_right,waterlogged=false: + appearance: facing=east,half=bottom,shape=outer_right,waterlogged=false + facing=east,half=bottom,shape=straight,waterlogged=false: + appearance: facing=east,half=bottom,shape=straight,waterlogged=false + facing=east,half=top,shape=inner_left,waterlogged=false: + appearance: facing=east,half=top,shape=inner_left,waterlogged=false + facing=east,half=top,shape=inner_right,waterlogged=false: + appearance: facing=east,half=top,shape=inner_right,waterlogged=false + facing=east,half=top,shape=outer_left,waterlogged=false: + appearance: facing=east,half=top,shape=outer_left,waterlogged=false + facing=east,half=top,shape=outer_right,waterlogged=false: + appearance: facing=east,half=top,shape=outer_right,waterlogged=false + facing=east,half=top,shape=straight,waterlogged=false: + appearance: facing=east,half=top,shape=straight,waterlogged=false + facing=north,half=bottom,shape=inner_left,waterlogged=false: + appearance: facing=north,half=bottom,shape=inner_left,waterlogged=false + facing=north,half=bottom,shape=inner_right,waterlogged=false: + appearance: facing=north,half=bottom,shape=inner_right,waterlogged=false + facing=north,half=bottom,shape=outer_left,waterlogged=false: + appearance: facing=north,half=bottom,shape=outer_left,waterlogged=false + facing=north,half=bottom,shape=outer_right,waterlogged=false: + appearance: facing=north,half=bottom,shape=outer_right,waterlogged=false + facing=north,half=bottom,shape=straight,waterlogged=false: + appearance: facing=north,half=bottom,shape=straight,waterlogged=false + facing=north,half=top,shape=inner_left,waterlogged=false: + appearance: facing=north,half=top,shape=inner_left,waterlogged=false + facing=north,half=top,shape=inner_right,waterlogged=false: + appearance: facing=north,half=top,shape=inner_right,waterlogged=false + facing=north,half=top,shape=outer_left,waterlogged=false: + appearance: facing=north,half=top,shape=outer_left,waterlogged=false + facing=north,half=top,shape=outer_right,waterlogged=false: + appearance: facing=north,half=top,shape=outer_right,waterlogged=false + facing=north,half=top,shape=straight,waterlogged=false: + appearance: facing=north,half=top,shape=straight,waterlogged=false + facing=south,half=bottom,shape=inner_left,waterlogged=false: + appearance: facing=south,half=bottom,shape=inner_left,waterlogged=false + facing=south,half=bottom,shape=inner_right,waterlogged=false: + appearance: facing=south,half=bottom,shape=inner_right,waterlogged=false + facing=south,half=bottom,shape=outer_left,waterlogged=false: + appearance: facing=south,half=bottom,shape=outer_left,waterlogged=false + facing=south,half=bottom,shape=outer_right,waterlogged=false: + appearance: facing=south,half=bottom,shape=outer_right,waterlogged=false + facing=south,half=bottom,shape=straight,waterlogged=false: + appearance: facing=south,half=bottom,shape=straight,waterlogged=false + facing=south,half=top,shape=inner_left,waterlogged=false: + appearance: facing=south,half=top,shape=inner_left,waterlogged=false + facing=south,half=top,shape=inner_right,waterlogged=false: + appearance: facing=south,half=top,shape=inner_right,waterlogged=false + facing=south,half=top,shape=outer_left,waterlogged=false: + appearance: facing=south,half=top,shape=outer_left,waterlogged=false + facing=south,half=top,shape=outer_right,waterlogged=false: + appearance: facing=south,half=top,shape=outer_right,waterlogged=false + facing=south,half=top,shape=straight,waterlogged=false: + appearance: facing=south,half=top,shape=straight,waterlogged=false + facing=west,half=bottom,shape=inner_left,waterlogged=false: + appearance: facing=west,half=bottom,shape=inner_left,waterlogged=false + facing=west,half=bottom,shape=inner_right,waterlogged=false: + appearance: facing=west,half=bottom,shape=inner_right,waterlogged=false + facing=west,half=bottom,shape=outer_left,waterlogged=false: + appearance: facing=west,half=bottom,shape=outer_left,waterlogged=false + facing=west,half=bottom,shape=outer_right,waterlogged=false: + appearance: facing=west,half=bottom,shape=outer_right,waterlogged=false + facing=west,half=bottom,shape=straight,waterlogged=false: + appearance: facing=west,half=bottom,shape=straight,waterlogged=false + facing=west,half=top,shape=inner_left,waterlogged=false: + appearance: facing=west,half=top,shape=inner_left,waterlogged=false + facing=west,half=top,shape=inner_right,waterlogged=false: + appearance: facing=west,half=top,shape=inner_right,waterlogged=false + facing=west,half=top,shape=outer_left,waterlogged=false: + appearance: facing=west,half=top,shape=outer_left,waterlogged=false + facing=west,half=top,shape=outer_right,waterlogged=false: + appearance: facing=west,half=top,shape=outer_right,waterlogged=false + facing=west,half=top,shape=straight,waterlogged=false: + appearance: facing=west,half=top,shape=straight,waterlogged=false + facing=east,half=bottom,shape=inner_left,waterlogged=true: + appearance: facing=east,half=bottom,shape=inner_left,waterlogged=true + facing=east,half=bottom,shape=inner_right,waterlogged=true: + appearance: facing=east,half=bottom,shape=inner_right,waterlogged=true + facing=east,half=bottom,shape=outer_left,waterlogged=true: + appearance: facing=east,half=bottom,shape=outer_left,waterlogged=true + facing=east,half=bottom,shape=outer_right,waterlogged=true: + appearance: facing=east,half=bottom,shape=outer_right,waterlogged=true + facing=east,half=bottom,shape=straight,waterlogged=true: + appearance: facing=east,half=bottom,shape=straight,waterlogged=true + facing=east,half=top,shape=inner_left,waterlogged=true: + appearance: facing=east,half=top,shape=inner_left,waterlogged=true + facing=east,half=top,shape=inner_right,waterlogged=true: + appearance: facing=east,half=top,shape=inner_right,waterlogged=true + facing=east,half=top,shape=outer_left,waterlogged=true: + appearance: facing=east,half=top,shape=outer_left,waterlogged=true + facing=east,half=top,shape=outer_right,waterlogged=true: + appearance: facing=east,half=top,shape=outer_right,waterlogged=true + facing=east,half=top,shape=straight,waterlogged=true: + appearance: facing=east,half=top,shape=straight,waterlogged=true + facing=north,half=bottom,shape=inner_left,waterlogged=true: + appearance: facing=north,half=bottom,shape=inner_left,waterlogged=true + facing=north,half=bottom,shape=inner_right,waterlogged=true: + appearance: facing=north,half=bottom,shape=inner_right,waterlogged=true + facing=north,half=bottom,shape=outer_left,waterlogged=true: + appearance: facing=north,half=bottom,shape=outer_left,waterlogged=true + facing=north,half=bottom,shape=outer_right,waterlogged=true: + appearance: facing=north,half=bottom,shape=outer_right,waterlogged=true + facing=north,half=bottom,shape=straight,waterlogged=true: + appearance: facing=north,half=bottom,shape=straight,waterlogged=true + facing=north,half=top,shape=inner_left,waterlogged=true: + appearance: facing=north,half=top,shape=inner_left,waterlogged=true + facing=north,half=top,shape=inner_right,waterlogged=true: + appearance: facing=north,half=top,shape=inner_right,waterlogged=true + facing=north,half=top,shape=outer_left,waterlogged=true: + appearance: facing=north,half=top,shape=outer_left,waterlogged=true + facing=north,half=top,shape=outer_right,waterlogged=true: + appearance: facing=north,half=top,shape=outer_right,waterlogged=true + facing=north,half=top,shape=straight,waterlogged=true: + appearance: facing=north,half=top,shape=straight,waterlogged=true + facing=south,half=bottom,shape=inner_left,waterlogged=true: + appearance: facing=south,half=bottom,shape=inner_left,waterlogged=true + facing=south,half=bottom,shape=inner_right,waterlogged=true: + appearance: facing=south,half=bottom,shape=inner_right,waterlogged=true + facing=south,half=bottom,shape=outer_left,waterlogged=true: + appearance: facing=south,half=bottom,shape=outer_left,waterlogged=true + facing=south,half=bottom,shape=outer_right,waterlogged=true: + appearance: facing=south,half=bottom,shape=outer_right,waterlogged=true + facing=south,half=bottom,shape=straight,waterlogged=true: + appearance: facing=south,half=bottom,shape=straight,waterlogged=true + facing=south,half=top,shape=inner_left,waterlogged=true: + appearance: facing=south,half=top,shape=inner_left,waterlogged=true + facing=south,half=top,shape=inner_right,waterlogged=true: + appearance: facing=south,half=top,shape=inner_right,waterlogged=true + facing=south,half=top,shape=outer_left,waterlogged=true: + appearance: facing=south,half=top,shape=outer_left,waterlogged=true + facing=south,half=top,shape=outer_right,waterlogged=true: + appearance: facing=south,half=top,shape=outer_right,waterlogged=true + facing=south,half=top,shape=straight,waterlogged=true: + appearance: facing=south,half=top,shape=straight,waterlogged=true + facing=west,half=bottom,shape=inner_left,waterlogged=true: + appearance: facing=west,half=bottom,shape=inner_left,waterlogged=true + facing=west,half=bottom,shape=inner_right,waterlogged=true: + appearance: facing=west,half=bottom,shape=inner_right,waterlogged=true + facing=west,half=bottom,shape=outer_left,waterlogged=true: + appearance: facing=west,half=bottom,shape=outer_left,waterlogged=true + facing=west,half=bottom,shape=outer_right,waterlogged=true: + appearance: facing=west,half=bottom,shape=outer_right,waterlogged=true + facing=west,half=bottom,shape=straight,waterlogged=true: + appearance: facing=west,half=bottom,shape=straight,waterlogged=true + facing=west,half=top,shape=inner_left,waterlogged=true: + appearance: facing=west,half=top,shape=inner_left,waterlogged=true + facing=west,half=top,shape=inner_right,waterlogged=true: + appearance: facing=west,half=top,shape=inner_right,waterlogged=true + facing=west,half=top,shape=outer_left,waterlogged=true: + appearance: facing=west,half=top,shape=outer_left,waterlogged=true + facing=west,half=top,shape=outer_right,waterlogged=true: + appearance: facing=west,half=top,shape=outer_right,waterlogged=true + facing=west,half=top,shape=straight,waterlogged=true: + appearance: facing=west,half=top,shape=straight,waterlogged=true + default:block_state/pressure_plate: + properties: + powered: + type: boolean + default: false + appearances: + normal: + auto_state: pressure_plate + model: + path: ${pressure_plate_model} + generation: + parent: minecraft:block/pressure_plate_up + textures: + texture: ${pressure_plate_texture} + powered: + auto_state: pressure_plate + model: + path: ${pressure_plate_model}_powered + generation: + parent: minecraft:block/pressure_plate_down + textures: + texture: ${pressure_plate_texture} + variants: + powered=false: + appearance: normal + powered=true: + appearance: powered + default:block_state/fence: + properties: + north: + type: boolean + default: false + east: + type: boolean + default: false + south: + type: boolean + default: false + west: + type: boolean + default: false + waterlogged: + type: boolean + default: false + appearances: + east=false,north=false,south=false,waterlogged=false,west=false: + state: ${fence_base_block}[east=false,north=false,south=false,waterlogged=false,west=false] + entity_renderer: + - item: ${fence_post_item} + rotation: 180 + scale: 1.05,1.01,1.05 + translation: 0,0.0001,0 + east=true,north=false,south=false,waterlogged=false,west=false: + state: ${fence_base_block}[east=true,north=false,south=false,waterlogged=false,west=false] + entity_renderer: + - item: ${fence_post_item} + rotation: 180 + scale: 1.05,1.01,1.05 + translation: 0,0.0001,0 + - item: ${fence_side_item} + rotation: 270 + east=false,north=true,south=false,waterlogged=false,west=false: + state: ${fence_base_block}[east=false,north=true,south=false,waterlogged=false,west=false] + entity_renderer: + - item: ${fence_post_item} + rotation: 180 + scale: 1.05,1.01,1.05 + translation: 0,0.0001,0 + - item: ${fence_side_item} + rotation: 180 + east=false,north=false,south=true,waterlogged=false,west=false: + state: ${fence_base_block}[east=false,north=false,south=true,waterlogged=false,west=false] + entity_renderer: + - item: ${fence_post_item} + rotation: 180 + scale: 1.05,1.01,1.05 + translation: 0,0.0001,0 + - item: ${fence_side_item} + rotation: 0 + east=false,north=false,south=false,waterlogged=false,west=true: + state: ${fence_base_block}[east=false,north=false,south=false,waterlogged=false,west=true] + entity_renderer: + - item: ${fence_post_item} + rotation: 180 + scale: 1.05,1.01,1.05 + translation: 0,0.0001,0 + - item: ${fence_side_item} + rotation: 90 + east=true,north=true,south=false,waterlogged=false,west=false: + state: ${fence_base_block}[east=true,north=true,south=false,waterlogged=false,west=false] + entity_renderer: + - item: ${fence_post_item} + rotation: 180 + scale: 1.05,1.01,1.05 + translation: 0,0.0001,0 + - item: ${fence_side_item} + rotation: 180 + - item: ${fence_side_item} + rotation: 270 + east=true,north=false,south=true,waterlogged=false,west=false: + state: ${fence_base_block}[east=true,north=false,south=true,waterlogged=false,west=false] + entity_renderer: + - item: ${fence_post_item} + rotation: 180 + scale: 1.05,1.01,1.05 + translation: 0,0.0001,0 + - item: ${fence_side_item} + rotation: 0 + - item: ${fence_side_item} + rotation: 270 + east=true,north=false,south=false,waterlogged=false,west=true: + state: ${fence_base_block}[east=true,north=false,south=false,waterlogged=false,west=true] + entity_renderer: + - item: ${fence_post_item} + rotation: 180 + scale: 1.05,1.01,1.05 + translation: 0,0.0001,0 + - item: ${fence_side_item} + rotation: 90 + - item: ${fence_side_item} + rotation: 270 + east=false,north=true,south=true,waterlogged=false,west=false: + state: ${fence_base_block}[east=false,north=true,south=true,waterlogged=false,west=false] + entity_renderer: + - item: ${fence_post_item} + rotation: 180 + scale: 1.05,1.01,1.05 + translation: 0,0.0001,0 + - item: ${fence_side_item} + rotation: 0 + - item: ${fence_side_item} + rotation: 180 + east=false,north=true,south=false,waterlogged=false,west=true: + state: ${fence_base_block}[east=false,north=true,south=false,waterlogged=false,west=true] + entity_renderer: + - item: ${fence_post_item} + rotation: 180 + scale: 1.05,1.01,1.05 + translation: 0,0.0001,0 + - item: ${fence_side_item} + rotation: 90 + - item: ${fence_side_item} + rotation: 180 + east=false,north=false,south=true,waterlogged=false,west=true: + state: ${fence_base_block}[east=false,north=false,south=true,waterlogged=false,west=true] + entity_renderer: + - item: ${fence_post_item} + rotation: 180 + scale: 1.05,1.01,1.05 + translation: 0,0.0001,0 + - item: ${fence_side_item} + rotation: 0 + - item: ${fence_side_item} + rotation: 90 + east=true,north=true,south=true,waterlogged=false,west=false: + state: ${fence_base_block}[east=true,north=true,south=true,waterlogged=false,west=false] + entity_renderer: + - item: ${fence_post_item} + rotation: 180 + scale: 1.05,1.01,1.05 + translation: 0,0.0001,0 + - item: ${fence_side_item} + rotation: 0 + - item: ${fence_side_item} + rotation: 180 + - item: ${fence_side_item} + rotation: 270 + east=true,north=true,south=false,waterlogged=false,west=true: + state: ${fence_base_block}[east=true,north=true,south=false,waterlogged=false,west=true] + entity_renderer: + - item: ${fence_post_item} + rotation: 180 + scale: 1.05,1.01,1.05 + translation: 0,0.0001,0 + - item: ${fence_side_item} + rotation: 90 + - item: ${fence_side_item} + rotation: 180 + - item: ${fence_side_item} + rotation: 270 + east=true,north=false,south=true,waterlogged=false,west=true: + state: ${fence_base_block}[east=true,north=false,south=true,waterlogged=false,west=true] + entity_renderer: + - item: ${fence_post_item} + rotation: 180 + scale: 1.05,1.01,1.05 + translation: 0,0.0001,0 + - item: ${fence_side_item} + rotation: 0 + - item: ${fence_side_item} + rotation: 90 + - item: ${fence_side_item} + rotation: 270 + east=false,north=true,south=true,waterlogged=false,west=true: + state: ${fence_base_block}[east=false,north=true,south=true,waterlogged=false,west=true] + entity_renderer: + - item: ${fence_post_item} + rotation: 180 + scale: 1.05,1.01,1.05 + translation: 0,0.0001,0 + - item: ${fence_side_item} + rotation: 0 + - item: ${fence_side_item} + rotation: 90 + - item: ${fence_side_item} + rotation: 180 + east=true,north=true,south=true,waterlogged=false,west=true: + state: ${fence_base_block}[east=true,north=true,south=true,waterlogged=false,west=true] + entity_renderer: + - item: ${fence_post_item} + rotation: 180 + scale: 1.05,1.01,1.05 + translation: 0,0.0001,0 + - item: ${fence_side_item} + rotation: 0 + - item: ${fence_side_item} + rotation: 90 + - item: ${fence_side_item} + rotation: 180 + - item: ${fence_side_item} + rotation: 270 + east=false,north=false,south=false,waterlogged=true,west=false: + state: ${fence_base_block}[east=false,north=false,south=false,waterlogged=true,west=false] + entity_renderer: + - item: ${fence_post_item} + rotation: 180 + scale: 1.05,1.01,1.05 + translation: 0,0.0001,0 + east=true,north=false,south=false,waterlogged=true,west=false: + state: ${fence_base_block}[east=true,north=false,south=false,waterlogged=true,west=false] + entity_renderer: + - item: ${fence_post_item} + rotation: 180 + scale: 1.05,1.01,1.05 + translation: 0,0.0001,0 + - item: ${fence_side_item} + rotation: 270 + east=false,north=true,south=false,waterlogged=true,west=false: + state: ${fence_base_block}[east=false,north=true,south=false,waterlogged=true,west=false] + entity_renderer: + - item: ${fence_post_item} + rotation: 180 + scale: 1.05,1.01,1.05 + translation: 0,0.0001,0 + - item: ${fence_side_item} + rotation: 180 + east=false,north=false,south=true,waterlogged=true,west=false: + state: ${fence_base_block}[east=false,north=false,south=true,waterlogged=true,west=false] + entity_renderer: + - item: ${fence_post_item} + rotation: 180 + scale: 1.05,1.01,1.05 + translation: 0,0.0001,0 + - item: ${fence_side_item} + rotation: 0 + east=false,north=false,south=false,waterlogged=true,west=true: + state: ${fence_base_block}[east=false,north=false,south=false,waterlogged=true,west=true] + entity_renderer: + - item: ${fence_post_item} + rotation: 180 + scale: 1.05,1.01,1.05 + translation: 0,0.0001,0 + - item: ${fence_side_item} + rotation: 90 + east=true,north=true,south=false,waterlogged=true,west=false: + state: ${fence_base_block}[east=true,north=true,south=false,waterlogged=true,west=false] + entity_renderer: + - item: ${fence_post_item} + rotation: 180 + scale: 1.05,1.01,1.05 + translation: 0,0.0001,0 + - item: ${fence_side_item} + rotation: 180 + - item: ${fence_side_item} + rotation: 270 + east=true,north=false,south=true,waterlogged=true,west=false: + state: ${fence_base_block}[east=true,north=false,south=true,waterlogged=true,west=false] + entity_renderer: + - item: ${fence_post_item} + rotation: 180 + scale: 1.05,1.01,1.05 + translation: 0,0.0001,0 + - item: ${fence_side_item} + rotation: 0 + - item: ${fence_side_item} + rotation: 270 + east=true,north=false,south=false,waterlogged=true,west=true: + state: ${fence_base_block}[east=true,north=false,south=false,waterlogged=true,west=true] + entity_renderer: + - item: ${fence_post_item} + rotation: 180 + scale: 1.05,1.01,1.05 + translation: 0,0.0001,0 + - item: ${fence_side_item} + rotation: 90 + - item: ${fence_side_item} + rotation: 270 + east=false,north=true,south=true,waterlogged=true,west=false: + state: ${fence_base_block}[east=false,north=true,south=true,waterlogged=true,west=false] + entity_renderer: + - item: ${fence_post_item} + rotation: 180 + scale: 1.05,1.01,1.05 + translation: 0,0.0001,0 + - item: ${fence_side_item} + rotation: 0 + - item: ${fence_side_item} + rotation: 180 + east=false,north=true,south=false,waterlogged=true,west=true: + state: ${fence_base_block}[east=false,north=true,south=false,waterlogged=true,west=true] + entity_renderer: + - item: ${fence_post_item} + rotation: 180 + scale: 1.05,1.01,1.05 + translation: 0,0.0001,0 + - item: ${fence_side_item} + rotation: 90 + - item: ${fence_side_item} + rotation: 180 + east=false,north=false,south=true,waterlogged=true,west=true: + state: ${fence_base_block}[east=false,north=false,south=true,waterlogged=true,west=true] + entity_renderer: + - item: ${fence_post_item} + rotation: 180 + scale: 1.05,1.01,1.05 + translation: 0,0.0001,0 + - item: ${fence_side_item} + rotation: 0 + - item: ${fence_side_item} + rotation: 90 + east=true,north=true,south=true,waterlogged=true,west=false: + state: ${fence_base_block}[east=true,north=true,south=true,waterlogged=true,west=false] + entity_renderer: + - item: ${fence_post_item} + rotation: 180 + scale: 1.05,1.01,1.05 + translation: 0,0.0001,0 + - item: ${fence_side_item} + rotation: 0 + - item: ${fence_side_item} + rotation: 180 + - item: ${fence_side_item} + rotation: 270 + east=true,north=true,south=false,waterlogged=true,west=true: + state: ${fence_base_block}[east=true,north=true,south=false,waterlogged=true,west=true] + entity_renderer: + - item: ${fence_post_item} + rotation: 180 + scale: 1.05,1.01,1.05 + translation: 0,0.0001,0 + - item: ${fence_side_item} + rotation: 90 + - item: ${fence_side_item} + rotation: 180 + - item: ${fence_side_item} + rotation: 270 + east=true,north=false,south=true,waterlogged=true,west=true: + state: ${fence_base_block}[east=true,north=false,south=true,waterlogged=true,west=true] + entity_renderer: + - item: ${fence_post_item} + rotation: 180 + scale: 1.05,1.01,1.05 + translation: 0,0.0001,0 + - item: ${fence_side_item} + rotation: 0 + - item: ${fence_side_item} + rotation: 90 + - item: ${fence_side_item} + rotation: 270 + east=false,north=true,south=true,waterlogged=true,west=true: + state: ${fence_base_block}[east=false,north=true,south=true,waterlogged=true,west=true] + entity_renderer: + - item: ${fence_post_item} + rotation: 180 + scale: 1.05,1.01,1.05 + translation: 0,0.0001,0 + - item: ${fence_side_item} + rotation: 0 + - item: ${fence_side_item} + rotation: 90 + - item: ${fence_side_item} + rotation: 180 + east=true,north=true,south=true,waterlogged=true,west=true: + state: ${fence_base_block}[east=true,north=true,south=true,waterlogged=true,west=true] + entity_renderer: + - item: ${fence_post_item} + rotation: 180 + scale: 1.05,1.01,1.05 + translation: 0,0.0001,0 + - item: ${fence_side_item} + rotation: 0 + - item: ${fence_side_item} + rotation: 90 + - item: ${fence_side_item} + rotation: 180 + - item: ${fence_side_item} + rotation: 270 + variants: + waterlogged=true: + settings: + resistance: 1200.0 + burnable: false + fluid_state: water + east=false,north=false,south=false,waterlogged=false,west=false: + appearance: east=false,north=false,south=false,waterlogged=false,west=false + east=true,north=false,south=false,waterlogged=false,west=false: + appearance: east=true,north=false,south=false,waterlogged=false,west=false + east=false,north=true,south=false,waterlogged=false,west=false: + appearance: east=false,north=true,south=false,waterlogged=false,west=false + east=false,north=false,south=true,waterlogged=false,west=false: + appearance: east=false,north=false,south=true,waterlogged=false,west=false + east=false,north=false,south=false,waterlogged=false,west=true: + appearance: east=false,north=false,south=false,waterlogged=false,west=true + east=true,north=true,south=false,waterlogged=false,west=false: + appearance: east=true,north=true,south=false,waterlogged=false,west=false + east=true,north=false,south=true,waterlogged=false,west=false: + appearance: east=true,north=false,south=true,waterlogged=false,west=false + east=true,north=false,south=false,waterlogged=false,west=true: + appearance: east=true,north=false,south=false,waterlogged=false,west=true + east=false,north=true,south=true,waterlogged=false,west=false: + appearance: east=false,north=true,south=true,waterlogged=false,west=false + east=false,north=true,south=false,waterlogged=false,west=true: + appearance: east=false,north=true,south=false,waterlogged=false,west=true + east=false,north=false,south=true,waterlogged=false,west=true: + appearance: east=false,north=false,south=true,waterlogged=false,west=true + east=true,north=true,south=true,waterlogged=false,west=false: + appearance: east=true,north=true,south=true,waterlogged=false,west=false + east=true,north=true,south=false,waterlogged=false,west=true: + appearance: east=true,north=true,south=false,waterlogged=false,west=true + east=true,north=false,south=true,waterlogged=false,west=true: + appearance: east=true,north=false,south=true,waterlogged=false,west=true + east=false,north=true,south=true,waterlogged=false,west=true: + appearance: east=false,north=true,south=true,waterlogged=false,west=true + east=true,north=true,south=true,waterlogged=false,west=true: + appearance: east=true,north=true,south=true,waterlogged=false,west=true + east=false,north=false,south=false,waterlogged=true,west=false: + appearance: east=false,north=false,south=false,waterlogged=true,west=false + east=true,north=false,south=false,waterlogged=true,west=false: + appearance: east=true,north=false,south=false,waterlogged=true,west=false + east=false,north=true,south=false,waterlogged=true,west=false: + appearance: east=false,north=true,south=false,waterlogged=true,west=false + east=false,north=false,south=true,waterlogged=true,west=false: + appearance: east=false,north=false,south=true,waterlogged=true,west=false + east=false,north=false,south=false,waterlogged=true,west=true: + appearance: east=false,north=false,south=false,waterlogged=true,west=true + east=true,north=true,south=false,waterlogged=true,west=false: + appearance: east=true,north=true,south=false,waterlogged=true,west=false + east=true,north=false,south=true,waterlogged=true,west=false: + appearance: east=true,north=false,south=true,waterlogged=true,west=false + east=true,north=false,south=false,waterlogged=true,west=true: + appearance: east=true,north=false,south=false,waterlogged=true,west=true + east=false,north=true,south=true,waterlogged=true,west=false: + appearance: east=false,north=true,south=true,waterlogged=true,west=false + east=false,north=true,south=false,waterlogged=true,west=true: + appearance: east=false,north=true,south=false,waterlogged=true,west=true + east=false,north=false,south=true,waterlogged=true,west=true: + appearance: east=false,north=false,south=true,waterlogged=true,west=true + east=true,north=true,south=true,waterlogged=true,west=false: + appearance: east=true,north=true,south=true,waterlogged=true,west=false + east=true,north=true,south=false,waterlogged=true,west=true: + appearance: east=true,north=true,south=false,waterlogged=true,west=true + east=true,north=false,south=true,waterlogged=true,west=true: + appearance: east=true,north=false,south=true,waterlogged=true,west=true + east=false,north=true,south=true,waterlogged=true,west=true: + appearance: east=false,north=true,south=true,waterlogged=true,west=true + east=true,north=true,south=true,waterlogged=true,west=true: + appearance: east=true,north=true,south=true,waterlogged=true,west=true + default:block_state/button: + properties: + powered: + type: boolean + default: false + face: + type: anchor_type + default: floor + facing: + type: 4-direction + default: north + appearances: + face=floor,facing=east,powered=true: + state: ${button_base_block}[face=floor,facing=east,powered=true] + entity_renderer: + item: ${button_pressed_item} + rotation: 0,90,0 + scale: 1.01 + translation: 0,0.005,0 + face=floor,facing=west,powered=true: + state: ${button_base_block}[face=floor,facing=west,powered=true] + entity_renderer: + item: ${button_pressed_item} + rotation: 0,-90,0 + scale: 1.01 + translation: 0,0.005,0 + face=floor,facing=east,powered=false: + state: ${button_base_block}[face=floor,facing=east,powered=false] + entity_renderer: + item: ${button_not_pressed_item} + rotation: 0,90,0 + scale: 1.01 + translation: 0,0.005,0 + face=floor,facing=west,powered=false: + state: ${button_base_block}[face=floor,facing=west,powered=false] + entity_renderer: + item: ${button_not_pressed_item} + rotation: 0,-90,0 + scale: 1.01 + translation: 0,0.005,0 + face=floor,facing=south,powered=true: + state: ${button_base_block}[face=floor,facing=south,powered=true] + entity_renderer: + item: ${button_pressed_item} + scale: 1.01 + translation: 0,0.005,0 + face=floor,facing=north,powered=true: + state: ${button_base_block}[face=floor,facing=north,powered=true] + entity_renderer: + item: ${button_pressed_item} + rotation: 0,180,0 + scale: 1.01 + translation: 0,0.005,0 + face=floor,facing=south,powered=false: + state: ${button_base_block}[face=floor,facing=south,powered=false] + entity_renderer: + item: ${button_not_pressed_item} + scale: 1.01 + translation: 0,0.005,0 + face=floor,facing=north,powered=false: + state: ${button_base_block}[face=floor,facing=north,powered=false] + entity_renderer: + item: ${button_not_pressed_item} + rotation: 0,180,0 + scale: 1.01 + translation: 0,0.005,0 + face=wall,facing=north,powered=true: + state: ${button_base_block}[face=wall,facing=north,powered=true] + entity_renderer: + item: ${button_pressed_item} + rotation: -90,0,0 + scale: 1.01 + translation: 0,0,-0.005 + face=wall,facing=south,powered=true: + state: ${button_base_block}[face=wall,facing=south,powered=true] + entity_renderer: + item: ${button_pressed_item} + rotation: 90,0,180 + scale: 1.01 + translation: 0,0,0.005 + face=wall,facing=north,powered=false: + state: ${button_base_block}[face=wall,facing=north,powered=false] + entity_renderer: + item: ${button_not_pressed_item} + rotation: -90,0,0 + scale: 1.01 + translation: 0,0,-0.005 + face=wall,facing=south,powered=false: + state: ${button_base_block}[face=wall,facing=south,powered=false] + entity_renderer: + item: ${button_not_pressed_item} + rotation: 90,0,180 + scale: 1.01 + translation: 0,0,0.005 + face=wall,facing=west,powered=true: + state: ${button_base_block}[face=wall,facing=west,powered=true] + entity_renderer: + item: ${button_pressed_item} + rotation: 0,90,90 + scale: 1.01 + translation: -0.005,0,0 + face=wall,facing=east,powered=true: + state: ${button_base_block}[face=wall,facing=east,powered=true] + entity_renderer: + item: ${button_pressed_item} + rotation: 0,270,-90 + scale: 1.01 + translation: 0.005,0,0 + face=wall,facing=west,powered=false: + state: ${button_base_block}[face=wall,facing=west,powered=false] + entity_renderer: + item: ${button_not_pressed_item} + rotation: 0,90,90 + scale: 1.01 + translation: -0.005,0,0 + face=wall,facing=east,powered=false: + state: ${button_base_block}[face=wall,facing=east,powered=false] + entity_renderer: + item: ${button_not_pressed_item} + rotation: 0,270,-90 + scale: 1.01 + translation: 0.005,0,0 + face=ceiling,facing=north,powered=true: + state: ${button_base_block}[face=ceiling,facing=north,powered=true] + entity_renderer: + item: ${button_pressed_item} + rotation: 0,180,180 + scale: 1.01 + translation: 0,-0.005,0 + face=ceiling,facing=south,powered=true: + state: ${button_base_block}[face=ceiling,facing=south,powered=true] + entity_renderer: + item: ${button_pressed_item} + rotation: 0,0,180 + scale: 1.01 + translation: 0,-0.005,0 + face=ceiling,facing=north,powered=false: + state: ${button_base_block}[face=ceiling,facing=north,powered=false] + entity_renderer: + item: ${button_not_pressed_item} + rotation: 0,180,180 + scale: 1.01 + translation: 0,-0.005,0 + face=ceiling,facing=south,powered=false: + state: ${button_base_block}[face=ceiling,facing=south,powered=false] + entity_renderer: + item: ${button_not_pressed_item} + rotation: 0,0,180 + scale: 1.01 + translation: 0,-0.005,0 + face=ceiling,facing=west,powered=true: + state: ${button_base_block}[face=ceiling,facing=west,powered=true] + entity_renderer: + item: ${button_pressed_item} + rotation: 0,90,180 + scale: 1.01 + translation: 0,-0.005,0 + face=ceiling,facing=east,powered=true: + state: ${button_base_block}[face=ceiling,facing=east,powered=true] + entity_renderer: + item: ${button_pressed_item} + rotation: -90,-90,-90 + scale: 1.01 + translation: 0,-0.005,0 + face=ceiling,facing=west,powered=false: + state: ${button_base_block}[face=ceiling,facing=west,powered=false] + entity_renderer: + item: ${button_not_pressed_item} + rotation: 0,90,180 + scale: 1.01 + translation: 0,-0.005,0 + face=ceiling,facing=east,powered=false: + state: ${button_base_block}[face=ceiling,facing=east,powered=false] + entity_renderer: + item: ${button_not_pressed_item} + rotation: -90,-90,-90 + scale: 1.01 + translation: 0,-0.005,0 + variants: + face=floor,facing=east,powered=true: + appearance: face=floor,facing=east,powered=true + face=floor,facing=west,powered=true: + appearance: face=floor,facing=west,powered=true + face=floor,facing=east,powered=false: + appearance: face=floor,facing=east,powered=false + face=floor,facing=west,powered=false: + appearance: face=floor,facing=west,powered=false + face=floor,facing=south,powered=true: + appearance: face=floor,facing=south,powered=true + face=floor,facing=north,powered=true: + appearance: face=floor,facing=north,powered=true + face=floor,facing=south,powered=false: + appearance: face=floor,facing=south,powered=false + face=floor,facing=north,powered=false: + appearance: face=floor,facing=north,powered=false + face=wall,facing=north,powered=true: + appearance: face=wall,facing=north,powered=true + face=wall,facing=south,powered=true: + appearance: face=wall,facing=south,powered=true + face=wall,facing=north,powered=false: + appearance: face=wall,facing=north,powered=false + face=wall,facing=south,powered=false: + appearance: face=wall,facing=south,powered=false + face=wall,facing=west,powered=true: + appearance: face=wall,facing=west,powered=true + face=wall,facing=east,powered=true: + appearance: face=wall,facing=east,powered=true + face=wall,facing=west,powered=false: + appearance: face=wall,facing=west,powered=false + face=wall,facing=east,powered=false: + appearance: face=wall,facing=east,powered=false + face=ceiling,facing=north,powered=true: + appearance: face=ceiling,facing=north,powered=true + face=ceiling,facing=south,powered=true: + appearance: face=ceiling,facing=south,powered=true + face=ceiling,facing=north,powered=false: + appearance: face=ceiling,facing=north,powered=false + face=ceiling,facing=south,powered=false: + appearance: face=ceiling,facing=south,powered=false + face=ceiling,facing=west,powered=true: + appearance: face=ceiling,facing=west,powered=true + face=ceiling,facing=east,powered=true: + appearance: face=ceiling,facing=east,powered=true + face=ceiling,facing=west,powered=false: + appearance: face=ceiling,facing=west,powered=false + face=ceiling,facing=east,powered=false: + appearance: face=ceiling,facing=east,powered=false diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/items/default_templates/configuration/templates/events.yml b/Plugin/src/test/resources/bedrock-folder/bedrock/items/default_templates/configuration/templates/events.yml new file mode 100644 index 00000000..ddd874e0 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/items/default_templates/configuration/templates/events.yml @@ -0,0 +1,77 @@ +templates: + default:rotatable_block: + on: right_click + conditions: + - type: "!has_item" + - type: expression + expression: + functions: + - type: update_interaction_tick + - type: play_sound + sound: ${rotate_sound:-'minecraft:block.bamboo.place'} + - type: swing_hand + - type: cycle_block_property + property: facing + rules: + north: east + east: south + south: west + west: north + default:rotatable_furniture_4: + on: right_click + conditions: + - type: "!has_item" + - type: expression + expression: + functions: + - type: update_interaction_tick + - type: rotate_furniture + degree: 90 + on_success: + - type: swing_hand + - type: play_sound + sound: ${rotate_sound:-'minecraft:block.bamboo.place'} + on_failure: + - type: rotate_furniture + degree: 180 + on_success: + - type: swing_hand + - type: play_sound + sound: ${rotate_sound:-'minecraft:block.bamboo.place'} + on_failure: + - type: rotate_furniture + degree: 270 + on_success: + - type: swing_hand + - type: play_sound + sound: ${rotate_sound:-'minecraft:block.bamboo.place'} + default:rotatable_furniture_8: + on: right_click + conditions: + - type: expression + expression: + - type: "!has_item" + - type: "!match_furniture_variant" + variants: ${blacklist_variants:-null} + functions: + - type: update_interaction_tick + - type: rotate_furniture + degree: 45 + on_success: + - type: swing_hand + - type: play_sound + sound: ${rotate_sound:-'minecraft:block.bamboo.place'} + on_failure: + - type: rotate_furniture + degree: 90 + on_success: + - type: swing_hand + - type: play_sound + sound: ${rotate_sound:-'minecraft:block.bamboo.place'} + on_failure: + - type: rotate_furniture + degree: 135 + on_success: + - type: swing_hand + - type: play_sound + sound: ${rotate_sound:-'minecraft:block.bamboo.place'} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/items/default_templates/configuration/templates/loot_tables.yml b/Plugin/src/test/resources/bedrock-folder/bedrock/items/default_templates/configuration/templates/loot_tables.yml new file mode 100644 index 00000000..c089ddca --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/items/default_templates/configuration/templates/loot_tables.yml @@ -0,0 +1,267 @@ +templates: + + # Drop itself. + # Suitable for the vast majority of loot items. + # Only requires the template ID to be filled in during use, with no parameter requirements. + + # template: default:loot_table/self + default:loot_table/self: + pools: + - rolls: 1 + conditions: + - type: survives_explosion + entries: + - type: item + item: ${__NAMESPACE__}:${__ID__} + + # Drop the original furniture item or a fallback item. + + # template: default:loot_table/furniture + # arguments: + # item: the fallback item + default:loot_table/furniture: + pools: + - rolls: 1 + entries: + - type: furniture_item + item: ${item} + + # Drop one or more items. + + # template: default:loot_table/basic + # arguments: + # item: the item + # count: the amount of the item + default:loot_table/basic: + pools: + - rolls: 1 + conditions: + - type: survives_explosion + entries: + - type: item + item: ${item} + functions: + - type: set_count + add: false + count: ${count:-1} + + # Drop the door. + # Since a door consists of two blocks, if both of them have drop items, it will cause duplication. + + # template: default:loot_table/door + default:loot_table/door: + pools: + - rolls: 1 + entries: + - type: item + item: ${__NAMESPACE__}:${__ID__} + conditions: + - type: match_block_property + properties: + half: lower + + # Drop with silk touch + # This template is used for loot that only drops when harvested with Silk Touch. + + # template: default:loot_table/silk_touch + # arguments: + # item: the item + # count: the amount of the item + default:loot_table/silk_touch: + pools: + - rolls: 1 + conditions: + - type: enchantment + predicate: minecraft:silk_touch>=1 + entries: + - type: item + item: ${item} + functions: + - type: set_count + add: false + count: ${count:-1} + + # Drop slabs + # When two slabs are stacked, the loot table should be set to drop two items. + + # template: default:loot_table/slab + default:loot_table/slab: + pools: + - rolls: 1 + entries: + - type: item + item: ${__NAMESPACE__}:${__ID__} + functions: + - type: set_count + count: 2 + add: false + conditions: + - type: match_block_property + properties: + type: double + - type: explosion_decay + + # This loot table is for crops that are grown from seeds. Example: wheat. + + # template: default:loot_table/seed_crop + # arguments: + # crop_item: the mature crop item + # crop_item_count: quantity of mature crop items + # crop_seed: the seed item of the crop + # extra_seed_count: additional seeds dropped when crop reaches maturity + # ripe_age: the max age + default:loot_table/seed_crop: + pools: + - rolls: 1 + entries: + - type: alternatives + children: + - type: item + item: ${crop_item} + conditions: + - type: match_block_property + properties: + age: ${ripe_age} + functions: + - type: set_count + add: false + count: ${crop_item_count:-1} + - type: item + item: ${crop_seed} + - rolls: 1 + conditions: + - type: match_block_property + properties: + age: ${ripe_age} + entries: + - type: item + item: ${crop_seed} + functions: + - type: apply_bonus + enchantment: minecraft:fortune + formula: + type: binomial_with_bonus_count + extra: ${extra_seed_count:-3} + probability: 0.5714286 + + # This loot table is for crops that are grown from themselves. Example: carrots. + + # template: default:loot_table/crop + # arguments: + # crop_item: the crop item + # extra_crop_count: additional crops dropped when crop reaches maturity + # ripe_age: the max age + default:loot_table/crop: + pools: + - rolls: 1 + entries: + - type: item + item: ${crop_item} + - rolls: 1 + conditions: + - type: match_block_property + properties: + age: ${ripe_age} + entries: + - type: item + item: ${crop_item} + functions: + - type: apply_bonus + enchantment: minecraft:fortune + formula: + type: binomial_with_bonus_count + extra: ${extra_crop_count:-3} + probability: 0.5714286 + + # When Silk Touch is used, it drops the ore block itself. When Fortune is used, it increases the drops of the materials. + + # template: default:loot_table/ore + # arguments: + # ore_block: the ore block + # ore_drop: the drops of the ore material + # ore_drop_count: the amount of the ore materials + default:loot_table/ore: + pools: + - rolls: 1 + entries: + - type: alternatives + children: + - type: item + item: ${ore_block} + conditions: + - type: enchantment + predicate: minecraft:silk_touch>=1 + - type: item + item: ${ore_drop} + functions: + - type: set_count + count: ${ore_drop_count:-1} + add: false + - type: apply_bonus + enchantment: minecraft:fortune + formula: + type: ore_drops + - type: explosion_decay + + # Using Silk Touch or shears will cause the leaves block itself to drop. + # Using Fortune, however, increases the drop rates of sticks and saplings. + + # template: default:loot_table/leaves + # arguments: + # leaves: the leaves block + # sapling: the sapling item + default:loot_table/leaves: + pools: + - rolls: 1 + entries: + - type: alternatives + children: + - type: item + item: ${leaves} + conditions: + - type: any_of + terms: + - type: match_item + id: minecraft:shears + - type: enchantment + predicate: minecraft:silk_touch>=1 + - type: item + item: ${sapling} + conditions: + - type: survives_explosion + - type: table_bonus + enchantment: minecraft:fortune + chances: + - 0.05 + - 0.0625 + - 0.083333333 + - 0.1 + - rolls: 1 + conditions: + - type: inverted + term: + type: any_of + terms: + - type: match_item + id: minecraft:shears + - type: enchantment + predicate: minecraft:silk_touch>=1 + entries: + - type: item + item: minecraft:stick + conditions: + - type: table_bonus + enchantment: minecraft:fortune + chances: + - 0.02 + - 0.022222222 + - 0.025 + - 0.033333333 + - 0.1 + functions: + - type: set_count + count: + type: uniform + min: 1 + max: 2 + - type: explosion_decay diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/items/default_templates/configuration/templates/tool_levels.yml b/Plugin/src/test/resources/bedrock-folder/bedrock/items/default_templates/configuration/templates/tool_levels.yml new file mode 100644 index 00000000..6478378d --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/items/default_templates/configuration/templates/tool_levels.yml @@ -0,0 +1,25 @@ +templates: + default:pickaxe_power/level_1: + - minecraft:wooden_pickaxe + - minecraft:stone_pickaxe + - minecraft:iron_pickaxe + - minecraft:golden_pickaxe + - minecraft:diamond_pickaxe + - minecraft:netherite_pickaxe + - default:topaz_pickaxe + default:pickaxe_power/level_2: + - minecraft:stone_pickaxe + - minecraft:iron_pickaxe + - minecraft:golden_pickaxe + - minecraft:diamond_pickaxe + - minecraft:netherite_pickaxe + - default:topaz_pickaxe + default:pickaxe_power/level_3: + - minecraft:iron_pickaxe + - minecraft:golden_pickaxe + - minecraft:diamond_pickaxe + - minecraft:netherite_pickaxe + - default:topaz_pickaxe + default:pickaxe_power/level_4: + - minecraft:diamond_pickaxe + - minecraft:netherite_pickaxe \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/items/default_templates/pack.yml b/Plugin/src/test/resources/bedrock-folder/bedrock/items/default_templates/pack.yml new file mode 100644 index 00000000..96d2971f --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/items/default_templates/pack.yml @@ -0,0 +1,5 @@ +author: XiaoMoMi +version: 1.0 +description: Default Templates for CraftEngine +namespace: default +enable: true \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/items/internal/configuration/gui.yml b/Plugin/src/test/resources/bedrock-folder/bedrock/items/internal/configuration/gui.yml new file mode 100644 index 00000000..098aee29 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/items/internal/configuration/gui.yml @@ -0,0 +1,181 @@ +categories: + internal:all: + priority: -1000 + name: + icon: minecraft:command_block + conditions: + - type: permission + permission: craftengine.admin + all_items: true +images: + internal:item_browser: + height: 140 + ascent: 18 + font: minecraft:gui + file: minecraft:font/gui/custom/item_browser.png + internal:category: + height: 140 + ascent: 18 + font: minecraft:gui + file: minecraft:font/gui/custom/category.png + internal:crafting_recipe: + height: 142 + ascent: 20 + font: minecraft:gui + file: minecraft:font/gui/custom/crafting_recipe.png + internal:cooking_recipe: + height: 138 + ascent: 16 + font: minecraft:gui + file: minecraft:font/gui/custom/cooking_recipe.png + internal:smelting: + height: 23 + ascent: 20 + font: minecraft:gui + file: minecraft:font/gui/custom/smelting.png + internal:smoking: + height: 23 + ascent: 20 + font: minecraft:gui + file: minecraft:font/gui/custom/smoking.png + internal:blasting: + height: 23 + ascent: 20 + font: minecraft:gui + file: minecraft:font/gui/custom/blasting.png + internal:campfire: + height: 23 + ascent: 20 + font: minecraft:gui + file: minecraft:font/gui/custom/campfire.png + internal:stonecutting_recipe: + height: 142 + ascent: 20 + font: minecraft:gui + file: minecraft:font/gui/custom/stonecutting_recipe.png + internal:smithing_transform_recipe: + height: 142 + ascent: 20 + font: minecraft:gui + file: minecraft:font/gui/custom/smithing_transform_recipe.png + internal:brewing_recipe: + height: 142 + ascent: 20 + font: minecraft:gui + file: minecraft:font/gui/custom/brewing_recipe.png + internal:no_recipe: + height: 140 + ascent: 18 + font: minecraft:gui + file: minecraft:font/gui/custom/no_recipe.png +templates: + internal:icon/2d: + material: arrow + custom_model_data: ${model_data} + data: + item_name: ${name} + lore: ${lore} + model: + template: internal:model/simplified_generated + arguments: + path: minecraft:item/custom/gui/${texture} + internal:model/simplified_generated: + type: minecraft:model + path: ${path} + generation: + parent: minecraft:item/generated + textures: + layer0: ${path} +items: + internal:next_page_0: + template: internal:icon/2d + arguments: + model_data: 1000 + texture: next_page_0 + name: <#FAFAD2> + lore: + - <#F5F5F5>/ + internal:next_page_1: + template: internal:icon/2d + arguments: + model_data: 1001 + texture: next_page_1 + name: <#808080> + lore: + - <#696969>/ + internal:previous_page_0: + template: internal:icon/2d + arguments: + model_data: 1002 + texture: previous_page_0 + name: <#FAFAD2> + lore: + - <#F5F5F5>/ + internal:previous_page_1: + template: internal:icon/2d + arguments: + model_data: 1003 + texture: previous_page_1 + name: <#808080> + lore: + - <#696969>/ + internal:return: + template: internal:icon/2d + arguments: + model_data: 1004 + texture: return + name: <#DAA520> + lore: null + internal:next_recipe_0: + material: arrow + custom_model_data: 1000 + data: + item_name: <#FAFAD2> + lore: + - <#F5F5F5>/ + internal:next_recipe_1: + material: arrow + custom_model_data: 1001 + data: + item_name: <#808080> + lore: + - <#696969>/ + internal:previous_recipe_0: + material: arrow + custom_model_data: 1002 + data: + item_name: <#FAFAD2> + lore: + - <#F5F5F5>/ + internal:previous_recipe_1: + material: arrow + custom_model_data: 1003 + data: + item_name: <#808080> + lore: + - <#696969>/ + internal:get_item: + template: internal:icon/2d + arguments: + model_data: 1005 + texture: get_item + name: <#DAA520> + lore: + - + - + internal:cooking_info: + template: internal:icon/2d + arguments: + model_data: 1006 + texture: cooking_info + name: <#FF8C00> + lore: + - '> + - '> + internal:exit: + template: internal:icon/2d + arguments: + model_data: 1007 + texture: exit + name: <#DAA520> + lore: null \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/items/internal/configuration/mappings.yml b/Plugin/src/test/resources/bedrock-folder/bedrock/items/internal/configuration/mappings.yml new file mode 100644 index 00000000..68085da6 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/items/internal/configuration/mappings.yml @@ -0,0 +1,4474 @@ +# This is one of the plugin's core settings - it basically controls how many block states you can use in your config files. +# Below is the default setup - feel free to add or remove stuff as needed. +block_state_mappings: + #### Anvil #### + # An anvil has four possible orientations, but the east-west and north-south orientations look exactly the same. + anvil[facing=north]: anvil[facing=south] + anvil[facing=east]: anvil[facing=west] + chipped_anvil[facing=north]: chipped_anvil[facing=south] + chipped_anvil[facing=east]: chipped_anvil[facing=west] + damaged_anvil[facing=north]: damaged_anvil[facing=south] + damaged_anvil[facing=east]: damaged_anvil[facing=west] + + #### Sapling #### + # Every sapling has two stages, 0 and 1, but they look exactly the same. + oak_sapling[stage=1]: oak_sapling[stage=0] + spruce_sapling[stage=1]: spruce_sapling[stage=0] + birch_sapling[stage=1]: birch_sapling[stage=0] + jungle_sapling[stage=1]: jungle_sapling[stage=0] + acacia_sapling[stage=1]: acacia_sapling[stage=0] + cherry_sapling[stage=1]: cherry_sapling[stage=0] + dark_oak_sapling[stage=1]: dark_oak_sapling[stage=0] + $$>=1.21.4#sapling: + pale_oak_sapling[stage=1]: pale_oak_sapling[stage=0] + + #### Mushroom #### + # Most people probably don't mind that mushroom blocks look the same on all six sides. So that means each type can free up like, 63 different states we could use for other stuff + brown_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=false]: brown_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + brown_mushroom_block[down=true,east=true,north=true,south=true,up=false,west=true]: brown_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + brown_mushroom_block[down=true,east=true,north=true,south=true,up=false,west=false]: brown_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + brown_mushroom_block[down=true,east=true,north=true,south=false,up=true,west=true]: brown_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + brown_mushroom_block[down=true,east=true,north=true,south=false,up=true,west=false]: brown_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + brown_mushroom_block[down=true,east=true,north=true,south=false,up=false,west=true]: brown_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + brown_mushroom_block[down=true,east=true,north=true,south=false,up=false,west=false]: brown_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + brown_mushroom_block[down=true,east=true,north=false,south=true,up=true,west=true]: brown_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + brown_mushroom_block[down=true,east=true,north=false,south=true,up=true,west=false]: brown_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + brown_mushroom_block[down=true,east=true,north=false,south=true,up=false,west=true]: brown_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + brown_mushroom_block[down=true,east=true,north=false,south=true,up=false,west=false]: brown_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + brown_mushroom_block[down=true,east=true,north=false,south=false,up=true,west=true]: brown_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + brown_mushroom_block[down=true,east=true,north=false,south=false,up=true,west=false]: brown_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + brown_mushroom_block[down=true,east=true,north=false,south=false,up=false,west=true]: brown_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + brown_mushroom_block[down=true,east=true,north=false,south=false,up=false,west=false]: brown_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + brown_mushroom_block[down=true,east=false,north=true,south=true,up=true,west=true]: brown_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + brown_mushroom_block[down=true,east=false,north=true,south=true,up=true,west=false]: brown_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + brown_mushroom_block[down=true,east=false,north=true,south=true,up=false,west=true]: brown_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + brown_mushroom_block[down=true,east=false,north=true,south=true,up=false,west=false]: brown_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + brown_mushroom_block[down=true,east=false,north=true,south=false,up=true,west=true]: brown_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + brown_mushroom_block[down=true,east=false,north=true,south=false,up=true,west=false]: brown_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + brown_mushroom_block[down=true,east=false,north=true,south=false,up=false,west=true]: brown_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + brown_mushroom_block[down=true,east=false,north=true,south=false,up=false,west=false]: brown_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + brown_mushroom_block[down=true,east=false,north=false,south=true,up=true,west=true]: brown_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + brown_mushroom_block[down=true,east=false,north=false,south=true,up=true,west=false]: brown_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + brown_mushroom_block[down=true,east=false,north=false,south=true,up=false,west=true]: brown_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + brown_mushroom_block[down=true,east=false,north=false,south=true,up=false,west=false]: brown_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + brown_mushroom_block[down=true,east=false,north=false,south=false,up=true,west=true]: brown_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + brown_mushroom_block[down=true,east=false,north=false,south=false,up=true,west=false]: brown_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + brown_mushroom_block[down=true,east=false,north=false,south=false,up=false,west=true]: brown_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + brown_mushroom_block[down=true,east=false,north=false,south=false,up=false,west=false]: brown_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + brown_mushroom_block[down=false,east=true,north=true,south=true,up=true,west=true]: brown_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + brown_mushroom_block[down=false,east=true,north=true,south=true,up=true,west=false]: brown_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + brown_mushroom_block[down=false,east=true,north=true,south=true,up=false,west=true]: brown_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + brown_mushroom_block[down=false,east=true,north=true,south=true,up=false,west=false]: brown_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + brown_mushroom_block[down=false,east=true,north=true,south=false,up=true,west=true]: brown_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + brown_mushroom_block[down=false,east=true,north=true,south=false,up=true,west=false]: brown_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + brown_mushroom_block[down=false,east=true,north=true,south=false,up=false,west=true]: brown_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + brown_mushroom_block[down=false,east=true,north=true,south=false,up=false,west=false]: brown_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + brown_mushroom_block[down=false,east=true,north=false,south=true,up=true,west=true]: brown_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + brown_mushroom_block[down=false,east=true,north=false,south=true,up=true,west=false]: brown_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + brown_mushroom_block[down=false,east=true,north=false,south=true,up=false,west=true]: brown_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + brown_mushroom_block[down=false,east=true,north=false,south=true,up=false,west=false]: brown_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + brown_mushroom_block[down=false,east=true,north=false,south=false,up=true,west=true]: brown_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + brown_mushroom_block[down=false,east=true,north=false,south=false,up=true,west=false]: brown_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + brown_mushroom_block[down=false,east=true,north=false,south=false,up=false,west=true]: brown_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + brown_mushroom_block[down=false,east=true,north=false,south=false,up=false,west=false]: brown_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + brown_mushroom_block[down=false,east=false,north=true,south=true,up=true,west=true]: brown_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + brown_mushroom_block[down=false,east=false,north=true,south=true,up=true,west=false]: brown_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + brown_mushroom_block[down=false,east=false,north=true,south=true,up=false,west=true]: brown_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + brown_mushroom_block[down=false,east=false,north=true,south=true,up=false,west=false]: brown_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + brown_mushroom_block[down=false,east=false,north=true,south=false,up=true,west=true]: brown_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + brown_mushroom_block[down=false,east=false,north=true,south=false,up=true,west=false]: brown_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + brown_mushroom_block[down=false,east=false,north=true,south=false,up=false,west=true]: brown_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + brown_mushroom_block[down=false,east=false,north=true,south=false,up=false,west=false]: brown_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + brown_mushroom_block[down=false,east=false,north=false,south=true,up=true,west=true]: brown_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + brown_mushroom_block[down=false,east=false,north=false,south=true,up=true,west=false]: brown_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + brown_mushroom_block[down=false,east=false,north=false,south=true,up=false,west=true]: brown_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + brown_mushroom_block[down=false,east=false,north=false,south=true,up=false,west=false]: brown_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + brown_mushroom_block[down=false,east=false,north=false,south=false,up=true,west=true]: brown_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + brown_mushroom_block[down=false,east=false,north=false,south=false,up=true,west=false]: brown_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + brown_mushroom_block[down=false,east=false,north=false,south=false,up=false,west=true]: brown_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + brown_mushroom_block[down=false,east=false,north=false,south=false,up=false,west=false]: brown_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + red_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=false]: red_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + red_mushroom_block[down=true,east=true,north=true,south=true,up=false,west=true]: red_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + red_mushroom_block[down=true,east=true,north=true,south=true,up=false,west=false]: red_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + red_mushroom_block[down=true,east=true,north=true,south=false,up=true,west=true]: red_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + red_mushroom_block[down=true,east=true,north=true,south=false,up=true,west=false]: red_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + red_mushroom_block[down=true,east=true,north=true,south=false,up=false,west=true]: red_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + red_mushroom_block[down=true,east=true,north=true,south=false,up=false,west=false]: red_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + red_mushroom_block[down=true,east=true,north=false,south=true,up=true,west=true]: red_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + red_mushroom_block[down=true,east=true,north=false,south=true,up=true,west=false]: red_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + red_mushroom_block[down=true,east=true,north=false,south=true,up=false,west=true]: red_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + red_mushroom_block[down=true,east=true,north=false,south=true,up=false,west=false]: red_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + red_mushroom_block[down=true,east=true,north=false,south=false,up=true,west=true]: red_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + red_mushroom_block[down=true,east=true,north=false,south=false,up=true,west=false]: red_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + red_mushroom_block[down=true,east=true,north=false,south=false,up=false,west=true]: red_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + red_mushroom_block[down=true,east=true,north=false,south=false,up=false,west=false]: red_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + red_mushroom_block[down=true,east=false,north=true,south=true,up=true,west=true]: red_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + red_mushroom_block[down=true,east=false,north=true,south=true,up=true,west=false]: red_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + red_mushroom_block[down=true,east=false,north=true,south=true,up=false,west=true]: red_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + red_mushroom_block[down=true,east=false,north=true,south=true,up=false,west=false]: red_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + red_mushroom_block[down=true,east=false,north=true,south=false,up=true,west=true]: red_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + red_mushroom_block[down=true,east=false,north=true,south=false,up=true,west=false]: red_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + red_mushroom_block[down=true,east=false,north=true,south=false,up=false,west=true]: red_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + red_mushroom_block[down=true,east=false,north=true,south=false,up=false,west=false]: red_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + red_mushroom_block[down=true,east=false,north=false,south=true,up=true,west=true]: red_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + red_mushroom_block[down=true,east=false,north=false,south=true,up=true,west=false]: red_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + red_mushroom_block[down=true,east=false,north=false,south=true,up=false,west=true]: red_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + red_mushroom_block[down=true,east=false,north=false,south=true,up=false,west=false]: red_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + red_mushroom_block[down=true,east=false,north=false,south=false,up=true,west=true]: red_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + red_mushroom_block[down=true,east=false,north=false,south=false,up=true,west=false]: red_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + red_mushroom_block[down=true,east=false,north=false,south=false,up=false,west=true]: red_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + red_mushroom_block[down=true,east=false,north=false,south=false,up=false,west=false]: red_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + red_mushroom_block[down=false,east=true,north=true,south=true,up=true,west=true]: red_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + red_mushroom_block[down=false,east=true,north=true,south=true,up=true,west=false]: red_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + red_mushroom_block[down=false,east=true,north=true,south=true,up=false,west=true]: red_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + red_mushroom_block[down=false,east=true,north=true,south=true,up=false,west=false]: red_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + red_mushroom_block[down=false,east=true,north=true,south=false,up=true,west=true]: red_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + red_mushroom_block[down=false,east=true,north=true,south=false,up=true,west=false]: red_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + red_mushroom_block[down=false,east=true,north=true,south=false,up=false,west=true]: red_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + red_mushroom_block[down=false,east=true,north=true,south=false,up=false,west=false]: red_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + red_mushroom_block[down=false,east=true,north=false,south=true,up=true,west=true]: red_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + red_mushroom_block[down=false,east=true,north=false,south=true,up=true,west=false]: red_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + red_mushroom_block[down=false,east=true,north=false,south=true,up=false,west=true]: red_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + red_mushroom_block[down=false,east=true,north=false,south=true,up=false,west=false]: red_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + red_mushroom_block[down=false,east=true,north=false,south=false,up=true,west=true]: red_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + red_mushroom_block[down=false,east=true,north=false,south=false,up=true,west=false]: red_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + red_mushroom_block[down=false,east=true,north=false,south=false,up=false,west=true]: red_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + red_mushroom_block[down=false,east=true,north=false,south=false,up=false,west=false]: red_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + red_mushroom_block[down=false,east=false,north=true,south=true,up=true,west=true]: red_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + red_mushroom_block[down=false,east=false,north=true,south=true,up=true,west=false]: red_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + red_mushroom_block[down=false,east=false,north=true,south=true,up=false,west=true]: red_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + red_mushroom_block[down=false,east=false,north=true,south=true,up=false,west=false]: red_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + red_mushroom_block[down=false,east=false,north=true,south=false,up=true,west=true]: red_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + red_mushroom_block[down=false,east=false,north=true,south=false,up=true,west=false]: red_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + red_mushroom_block[down=false,east=false,north=true,south=false,up=false,west=true]: red_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + red_mushroom_block[down=false,east=false,north=true,south=false,up=false,west=false]: red_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + red_mushroom_block[down=false,east=false,north=false,south=true,up=true,west=true]: red_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + red_mushroom_block[down=false,east=false,north=false,south=true,up=true,west=false]: red_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + red_mushroom_block[down=false,east=false,north=false,south=true,up=false,west=true]: red_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + red_mushroom_block[down=false,east=false,north=false,south=true,up=false,west=false]: red_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + red_mushroom_block[down=false,east=false,north=false,south=false,up=true,west=true]: red_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + red_mushroom_block[down=false,east=false,north=false,south=false,up=true,west=false]: red_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + red_mushroom_block[down=false,east=false,north=false,south=false,up=false,west=true]: red_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + red_mushroom_block[down=false,east=false,north=false,south=false,up=false,west=false]: red_mushroom_block[down=true,east=true,north=true,south=true,up=true,west=true] + mushroom_stem[down=true,east=true,north=true,south=true,up=true,west=false]: mushroom_stem[down=true,east=true,north=true,south=true,up=true,west=true] + mushroom_stem[down=true,east=true,north=true,south=true,up=false,west=true]: mushroom_stem[down=true,east=true,north=true,south=true,up=true,west=true] + mushroom_stem[down=true,east=true,north=true,south=true,up=false,west=false]: mushroom_stem[down=true,east=true,north=true,south=true,up=true,west=true] + mushroom_stem[down=true,east=true,north=true,south=false,up=true,west=true]: mushroom_stem[down=true,east=true,north=true,south=true,up=true,west=true] + mushroom_stem[down=true,east=true,north=true,south=false,up=true,west=false]: mushroom_stem[down=true,east=true,north=true,south=true,up=true,west=true] + mushroom_stem[down=true,east=true,north=true,south=false,up=false,west=true]: mushroom_stem[down=true,east=true,north=true,south=true,up=true,west=true] + mushroom_stem[down=true,east=true,north=true,south=false,up=false,west=false]: mushroom_stem[down=true,east=true,north=true,south=true,up=true,west=true] + mushroom_stem[down=true,east=true,north=false,south=true,up=true,west=true]: mushroom_stem[down=true,east=true,north=true,south=true,up=true,west=true] + mushroom_stem[down=true,east=true,north=false,south=true,up=true,west=false]: mushroom_stem[down=true,east=true,north=true,south=true,up=true,west=true] + mushroom_stem[down=true,east=true,north=false,south=true,up=false,west=true]: mushroom_stem[down=true,east=true,north=true,south=true,up=true,west=true] + mushroom_stem[down=true,east=true,north=false,south=true,up=false,west=false]: mushroom_stem[down=true,east=true,north=true,south=true,up=true,west=true] + mushroom_stem[down=true,east=true,north=false,south=false,up=true,west=true]: mushroom_stem[down=true,east=true,north=true,south=true,up=true,west=true] + mushroom_stem[down=true,east=true,north=false,south=false,up=true,west=false]: mushroom_stem[down=true,east=true,north=true,south=true,up=true,west=true] + mushroom_stem[down=true,east=true,north=false,south=false,up=false,west=true]: mushroom_stem[down=true,east=true,north=true,south=true,up=true,west=true] + mushroom_stem[down=true,east=true,north=false,south=false,up=false,west=false]: mushroom_stem[down=true,east=true,north=true,south=true,up=true,west=true] + mushroom_stem[down=true,east=false,north=true,south=true,up=true,west=true]: mushroom_stem[down=true,east=true,north=true,south=true,up=true,west=true] + mushroom_stem[down=true,east=false,north=true,south=true,up=true,west=false]: mushroom_stem[down=true,east=true,north=true,south=true,up=true,west=true] + mushroom_stem[down=true,east=false,north=true,south=true,up=false,west=true]: mushroom_stem[down=true,east=true,north=true,south=true,up=true,west=true] + mushroom_stem[down=true,east=false,north=true,south=true,up=false,west=false]: mushroom_stem[down=true,east=true,north=true,south=true,up=true,west=true] + mushroom_stem[down=true,east=false,north=true,south=false,up=true,west=true]: mushroom_stem[down=true,east=true,north=true,south=true,up=true,west=true] + mushroom_stem[down=true,east=false,north=true,south=false,up=true,west=false]: mushroom_stem[down=true,east=true,north=true,south=true,up=true,west=true] + mushroom_stem[down=true,east=false,north=true,south=false,up=false,west=true]: mushroom_stem[down=true,east=true,north=true,south=true,up=true,west=true] + mushroom_stem[down=true,east=false,north=true,south=false,up=false,west=false]: mushroom_stem[down=true,east=true,north=true,south=true,up=true,west=true] + mushroom_stem[down=true,east=false,north=false,south=true,up=true,west=true]: mushroom_stem[down=true,east=true,north=true,south=true,up=true,west=true] + mushroom_stem[down=true,east=false,north=false,south=true,up=true,west=false]: mushroom_stem[down=true,east=true,north=true,south=true,up=true,west=true] + mushroom_stem[down=true,east=false,north=false,south=true,up=false,west=true]: mushroom_stem[down=true,east=true,north=true,south=true,up=true,west=true] + mushroom_stem[down=true,east=false,north=false,south=true,up=false,west=false]: mushroom_stem[down=true,east=true,north=true,south=true,up=true,west=true] + mushroom_stem[down=true,east=false,north=false,south=false,up=true,west=true]: mushroom_stem[down=true,east=true,north=true,south=true,up=true,west=true] + mushroom_stem[down=true,east=false,north=false,south=false,up=true,west=false]: mushroom_stem[down=true,east=true,north=true,south=true,up=true,west=true] + mushroom_stem[down=true,east=false,north=false,south=false,up=false,west=true]: mushroom_stem[down=true,east=true,north=true,south=true,up=true,west=true] + mushroom_stem[down=true,east=false,north=false,south=false,up=false,west=false]: mushroom_stem[down=true,east=true,north=true,south=true,up=true,west=true] + mushroom_stem[down=false,east=true,north=true,south=true,up=true,west=true]: mushroom_stem[down=true,east=true,north=true,south=true,up=true,west=true] + mushroom_stem[down=false,east=true,north=true,south=true,up=true,west=false]: mushroom_stem[down=true,east=true,north=true,south=true,up=true,west=true] + mushroom_stem[down=false,east=true,north=true,south=true,up=false,west=true]: mushroom_stem[down=true,east=true,north=true,south=true,up=true,west=true] + mushroom_stem[down=false,east=true,north=true,south=true,up=false,west=false]: mushroom_stem[down=true,east=true,north=true,south=true,up=true,west=true] + mushroom_stem[down=false,east=true,north=true,south=false,up=true,west=true]: mushroom_stem[down=true,east=true,north=true,south=true,up=true,west=true] + mushroom_stem[down=false,east=true,north=true,south=false,up=true,west=false]: mushroom_stem[down=true,east=true,north=true,south=true,up=true,west=true] + mushroom_stem[down=false,east=true,north=true,south=false,up=false,west=true]: mushroom_stem[down=true,east=true,north=true,south=true,up=true,west=true] + mushroom_stem[down=false,east=true,north=true,south=false,up=false,west=false]: mushroom_stem[down=true,east=true,north=true,south=true,up=true,west=true] + mushroom_stem[down=false,east=true,north=false,south=true,up=true,west=true]: mushroom_stem[down=true,east=true,north=true,south=true,up=true,west=true] + mushroom_stem[down=false,east=true,north=false,south=true,up=true,west=false]: mushroom_stem[down=true,east=true,north=true,south=true,up=true,west=true] + mushroom_stem[down=false,east=true,north=false,south=true,up=false,west=true]: mushroom_stem[down=true,east=true,north=true,south=true,up=true,west=true] + mushroom_stem[down=false,east=true,north=false,south=true,up=false,west=false]: mushroom_stem[down=true,east=true,north=true,south=true,up=true,west=true] + mushroom_stem[down=false,east=true,north=false,south=false,up=true,west=true]: mushroom_stem[down=true,east=true,north=true,south=true,up=true,west=true] + mushroom_stem[down=false,east=true,north=false,south=false,up=true,west=false]: mushroom_stem[down=true,east=true,north=true,south=true,up=true,west=true] + mushroom_stem[down=false,east=true,north=false,south=false,up=false,west=true]: mushroom_stem[down=true,east=true,north=true,south=true,up=true,west=true] + mushroom_stem[down=false,east=true,north=false,south=false,up=false,west=false]: mushroom_stem[down=true,east=true,north=true,south=true,up=true,west=true] + mushroom_stem[down=false,east=false,north=true,south=true,up=true,west=true]: mushroom_stem[down=true,east=true,north=true,south=true,up=true,west=true] + mushroom_stem[down=false,east=false,north=true,south=true,up=true,west=false]: mushroom_stem[down=true,east=true,north=true,south=true,up=true,west=true] + mushroom_stem[down=false,east=false,north=true,south=true,up=false,west=true]: mushroom_stem[down=true,east=true,north=true,south=true,up=true,west=true] + mushroom_stem[down=false,east=false,north=true,south=true,up=false,west=false]: mushroom_stem[down=true,east=true,north=true,south=true,up=true,west=true] + mushroom_stem[down=false,east=false,north=true,south=false,up=true,west=true]: mushroom_stem[down=true,east=true,north=true,south=true,up=true,west=true] + mushroom_stem[down=false,east=false,north=true,south=false,up=true,west=false]: mushroom_stem[down=true,east=true,north=true,south=true,up=true,west=true] + mushroom_stem[down=false,east=false,north=true,south=false,up=false,west=true]: mushroom_stem[down=true,east=true,north=true,south=true,up=true,west=true] + mushroom_stem[down=false,east=false,north=true,south=false,up=false,west=false]: mushroom_stem[down=true,east=true,north=true,south=true,up=true,west=true] + mushroom_stem[down=false,east=false,north=false,south=true,up=true,west=true]: mushroom_stem[down=true,east=true,north=true,south=true,up=true,west=true] + mushroom_stem[down=false,east=false,north=false,south=true,up=true,west=false]: mushroom_stem[down=true,east=true,north=true,south=true,up=true,west=true] + mushroom_stem[down=false,east=false,north=false,south=true,up=false,west=true]: mushroom_stem[down=true,east=true,north=true,south=true,up=true,west=true] + mushroom_stem[down=false,east=false,north=false,south=true,up=false,west=false]: mushroom_stem[down=true,east=true,north=true,south=true,up=true,west=true] + mushroom_stem[down=false,east=false,north=false,south=false,up=true,west=true]: mushroom_stem[down=true,east=true,north=true,south=true,up=true,west=true] + mushroom_stem[down=false,east=false,north=false,south=false,up=true,west=false]: mushroom_stem[down=true,east=true,north=true,south=true,up=true,west=true] + mushroom_stem[down=false,east=false,north=false,south=false,up=false,west=true]: mushroom_stem[down=true,east=true,north=true,south=true,up=true,west=true] + mushroom_stem[down=false,east=false,north=false,south=false,up=false,west=false]: mushroom_stem[down=true,east=true,north=true,south=true,up=true,west=true] + + #### Kelp #### + # 'kelp' here means specifically the top block of the kelp plant. Great for making aquatic crops. + kelp[age=1]: kelp[age=0] + kelp[age=2]: kelp[age=0] + kelp[age=3]: kelp[age=0] + kelp[age=4]: kelp[age=0] + kelp[age=5]: kelp[age=0] + kelp[age=6]: kelp[age=0] + kelp[age=7]: kelp[age=0] + kelp[age=8]: kelp[age=0] + kelp[age=9]: kelp[age=0] + kelp[age=10]: kelp[age=0] + kelp[age=11]: kelp[age=0] + kelp[age=12]: kelp[age=0] + kelp[age=13]: kelp[age=0] + kelp[age=14]: kelp[age=0] + kelp[age=15]: kelp[age=0] + kelp[age=16]: kelp[age=0] + kelp[age=17]: kelp[age=0] + kelp[age=18]: kelp[age=0] + kelp[age=19]: kelp[age=0] + kelp[age=20]: kelp[age=0] + kelp[age=21]: kelp[age=0] + kelp[age=22]: kelp[age=0] + kelp[age=23]: kelp[age=0] + kelp[age=24]: kelp[age=0] + kelp[age=25]: kelp[age=0] + + #### Vines #### + # Unless you tweak the vine's block tag, the client will always think it's climbable. + # Since vines look identical at different growth stages, we can repurpose those extra states to make custom blocks like ropes. + weeping_vines[age=1]: weeping_vines[age=0] + weeping_vines[age=2]: weeping_vines[age=0] + weeping_vines[age=3]: weeping_vines[age=0] + weeping_vines[age=4]: weeping_vines[age=0] + weeping_vines[age=5]: weeping_vines[age=0] + weeping_vines[age=6]: weeping_vines[age=0] + weeping_vines[age=7]: weeping_vines[age=0] + weeping_vines[age=8]: weeping_vines[age=0] + weeping_vines[age=9]: weeping_vines[age=0] + weeping_vines[age=10]: weeping_vines[age=0] + weeping_vines[age=11]: weeping_vines[age=0] + weeping_vines[age=12]: weeping_vines[age=0] + weeping_vines[age=13]: weeping_vines[age=0] + weeping_vines[age=14]: weeping_vines[age=0] + weeping_vines[age=15]: weeping_vines[age=0] + weeping_vines[age=16]: weeping_vines[age=0] + weeping_vines[age=17]: weeping_vines[age=0] + weeping_vines[age=18]: weeping_vines[age=0] + weeping_vines[age=19]: weeping_vines[age=0] + weeping_vines[age=20]: weeping_vines[age=0] + weeping_vines[age=21]: weeping_vines[age=0] + weeping_vines[age=22]: weeping_vines[age=0] + weeping_vines[age=23]: weeping_vines[age=0] + weeping_vines[age=24]: weeping_vines[age=0] + weeping_vines[age=25]: weeping_vines[age=0] + twisting_vines[age=1]: twisting_vines[age=0] + twisting_vines[age=2]: twisting_vines[age=0] + twisting_vines[age=3]: twisting_vines[age=0] + twisting_vines[age=4]: twisting_vines[age=0] + twisting_vines[age=5]: twisting_vines[age=0] + twisting_vines[age=6]: twisting_vines[age=0] + twisting_vines[age=7]: twisting_vines[age=0] + twisting_vines[age=8]: twisting_vines[age=0] + twisting_vines[age=9]: twisting_vines[age=0] + twisting_vines[age=10]: twisting_vines[age=0] + twisting_vines[age=11]: twisting_vines[age=0] + twisting_vines[age=12]: twisting_vines[age=0] + twisting_vines[age=13]: twisting_vines[age=0] + twisting_vines[age=14]: twisting_vines[age=0] + twisting_vines[age=15]: twisting_vines[age=0] + twisting_vines[age=16]: twisting_vines[age=0] + twisting_vines[age=17]: twisting_vines[age=0] + twisting_vines[age=18]: twisting_vines[age=0] + twisting_vines[age=19]: twisting_vines[age=0] + twisting_vines[age=20]: twisting_vines[age=0] + twisting_vines[age=21]: twisting_vines[age=0] + twisting_vines[age=22]: twisting_vines[age=0] + twisting_vines[age=23]: twisting_vines[age=0] + twisting_vines[age=24]: twisting_vines[age=0] + twisting_vines[age=25]: twisting_vines[age=0] + cave_vines[age=1,berries=false]: cave_vines[age=0,berries=false] + cave_vines[age=2,berries=false]: cave_vines[age=0,berries=false] + cave_vines[age=3,berries=false]: cave_vines[age=0,berries=false] + cave_vines[age=4,berries=false]: cave_vines[age=0,berries=false] + cave_vines[age=5,berries=false]: cave_vines[age=0,berries=false] + cave_vines[age=6,berries=false]: cave_vines[age=0,berries=false] + cave_vines[age=7,berries=false]: cave_vines[age=0,berries=false] + cave_vines[age=8,berries=false]: cave_vines[age=0,berries=false] + cave_vines[age=9,berries=false]: cave_vines[age=0,berries=false] + cave_vines[age=10,berries=false]: cave_vines[age=0,berries=false] + cave_vines[age=11,berries=false]: cave_vines[age=0,berries=false] + cave_vines[age=12,berries=false]: cave_vines[age=0,berries=false] + cave_vines[age=13,berries=false]: cave_vines[age=0,berries=false] + cave_vines[age=14,berries=false]: cave_vines[age=0,berries=false] + cave_vines[age=15,berries=false]: cave_vines[age=0,berries=false] + cave_vines[age=16,berries=false]: cave_vines[age=0,berries=false] + cave_vines[age=17,berries=false]: cave_vines[age=0,berries=false] + cave_vines[age=18,berries=false]: cave_vines[age=0,berries=false] + cave_vines[age=19,berries=false]: cave_vines[age=0,berries=false] + cave_vines[age=20,berries=false]: cave_vines[age=0,berries=false] + cave_vines[age=21,berries=false]: cave_vines[age=0,berries=false] + cave_vines[age=22,berries=false]: cave_vines[age=0,berries=false] + cave_vines[age=23,berries=false]: cave_vines[age=0,berries=false] + cave_vines[age=24,berries=false]: cave_vines[age=0,berries=false] + cave_vines[age=25,berries=false]: cave_vines[age=0,berries=false] + cave_vines[age=1,berries=true]: cave_vines[age=0,berries=true] + cave_vines[age=2,berries=true]: cave_vines[age=0,berries=true] + cave_vines[age=3,berries=true]: cave_vines[age=0,berries=true] + cave_vines[age=4,berries=true]: cave_vines[age=0,berries=true] + cave_vines[age=5,berries=true]: cave_vines[age=0,berries=true] + cave_vines[age=6,berries=true]: cave_vines[age=0,berries=true] + cave_vines[age=7,berries=true]: cave_vines[age=0,berries=true] + cave_vines[age=8,berries=true]: cave_vines[age=0,berries=true] + cave_vines[age=9,berries=true]: cave_vines[age=0,berries=true] + cave_vines[age=10,berries=true]: cave_vines[age=0,berries=true] + cave_vines[age=11,berries=true]: cave_vines[age=0,berries=true] + cave_vines[age=12,berries=true]: cave_vines[age=0,berries=true] + cave_vines[age=13,berries=true]: cave_vines[age=0,berries=true] + cave_vines[age=14,berries=true]: cave_vines[age=0,berries=true] + cave_vines[age=15,berries=true]: cave_vines[age=0,berries=true] + cave_vines[age=16,berries=true]: cave_vines[age=0,berries=true] + cave_vines[age=17,berries=true]: cave_vines[age=0,berries=true] + cave_vines[age=18,berries=true]: cave_vines[age=0,berries=true] + cave_vines[age=19,berries=true]: cave_vines[age=0,berries=true] + cave_vines[age=20,berries=true]: cave_vines[age=0,berries=true] + cave_vines[age=21,berries=true]: cave_vines[age=0,berries=true] + cave_vines[age=22,berries=true]: cave_vines[age=0,berries=true] + cave_vines[age=23,berries=true]: cave_vines[age=0,berries=true] + cave_vines[age=24,berries=true]: cave_vines[age=0,berries=true] + cave_vines[age=25,berries=true]: cave_vines[age=0,berries=true] + + #### SugarCane #### + # Sugar cane looks exactly the same no matter its growth stage. Plus, it's got this perfect hitbox that makes it awesome for taller plants + sugar_cane[age=1]: sugar_cane[age=0] + sugar_cane[age=2]: sugar_cane[age=0] + sugar_cane[age=3]: sugar_cane[age=0] + sugar_cane[age=4]: sugar_cane[age=0] + sugar_cane[age=5]: sugar_cane[age=0] + sugar_cane[age=6]: sugar_cane[age=0] + sugar_cane[age=7]: sugar_cane[age=0] + sugar_cane[age=8]: sugar_cane[age=0] + sugar_cane[age=9]: sugar_cane[age=0] + sugar_cane[age=10]: sugar_cane[age=0] + sugar_cane[age=11]: sugar_cane[age=0] + sugar_cane[age=12]: sugar_cane[age=0] + sugar_cane[age=13]: sugar_cane[age=0] + sugar_cane[age=14]: sugar_cane[age=0] + sugar_cane[age=15]: sugar_cane[age=0] + + #### Cactus #### + # Cactus looks the same at all growth stages.Its hitbox is 14x14x15, making it perfect for creating blocks that are just slightly smaller than full-size + cactus[age=1]: cactus[age=0] + cactus[age=2]: cactus[age=0] + cactus[age=3]: cactus[age=0] + cactus[age=4]: cactus[age=0] + cactus[age=5]: cactus[age=0] + cactus[age=6]: cactus[age=0] + cactus[age=7]: cactus[age=0] + cactus[age=8]: cactus[age=0] + cactus[age=9]: cactus[age=0] + cactus[age=10]: cactus[age=0] + cactus[age=11]: cactus[age=0] + cactus[age=12]: cactus[age=0] + cactus[age=13]: cactus[age=0] + cactus[age=14]: cactus[age=0] + cactus[age=15]: cactus[age=0] + + #### Leaves #### + # The 'distance' and 'persistent' properties are used under the hood to optimize how leaves decay, but visually? They look exactly the same. + # These are some of the few block types that actually support transparent textures. + # tintable leaves + oak_leaves[distance=1,persistent=true,waterlogged=true]: oak_leaves[distance=7,persistent=true,waterlogged=true] + oak_leaves[distance=1,persistent=true,waterlogged=false]: oak_leaves[distance=7,persistent=true,waterlogged=false] + oak_leaves[distance=1,persistent=false,waterlogged=true]: oak_leaves[distance=7,persistent=true,waterlogged=true] + oak_leaves[distance=1,persistent=false,waterlogged=false]: oak_leaves[distance=7,persistent=true,waterlogged=false] + oak_leaves[distance=2,persistent=true,waterlogged=true]: oak_leaves[distance=7,persistent=true,waterlogged=true] + oak_leaves[distance=2,persistent=true,waterlogged=false]: oak_leaves[distance=7,persistent=true,waterlogged=false] + oak_leaves[distance=2,persistent=false,waterlogged=true]: oak_leaves[distance=7,persistent=true,waterlogged=true] + oak_leaves[distance=2,persistent=false,waterlogged=false]: oak_leaves[distance=7,persistent=true,waterlogged=false] + oak_leaves[distance=3,persistent=true,waterlogged=true]: oak_leaves[distance=7,persistent=true,waterlogged=true] + oak_leaves[distance=3,persistent=true,waterlogged=false]: oak_leaves[distance=7,persistent=true,waterlogged=false] + oak_leaves[distance=3,persistent=false,waterlogged=true]: oak_leaves[distance=7,persistent=true,waterlogged=true] + oak_leaves[distance=3,persistent=false,waterlogged=false]: oak_leaves[distance=7,persistent=true,waterlogged=false] + oak_leaves[distance=4,persistent=true,waterlogged=true]: oak_leaves[distance=7,persistent=true,waterlogged=true] + oak_leaves[distance=4,persistent=true,waterlogged=false]: oak_leaves[distance=7,persistent=true,waterlogged=false] + oak_leaves[distance=4,persistent=false,waterlogged=true]: oak_leaves[distance=7,persistent=true,waterlogged=true] + oak_leaves[distance=4,persistent=false,waterlogged=false]: oak_leaves[distance=7,persistent=true,waterlogged=false] + oak_leaves[distance=5,persistent=true,waterlogged=true]: oak_leaves[distance=7,persistent=true,waterlogged=true] + oak_leaves[distance=5,persistent=true,waterlogged=false]: oak_leaves[distance=7,persistent=true,waterlogged=false] + oak_leaves[distance=5,persistent=false,waterlogged=true]: oak_leaves[distance=7,persistent=true,waterlogged=true] + oak_leaves[distance=5,persistent=false,waterlogged=false]: oak_leaves[distance=7,persistent=true,waterlogged=false] + oak_leaves[distance=6,persistent=true,waterlogged=true]: oak_leaves[distance=7,persistent=true,waterlogged=true] + oak_leaves[distance=6,persistent=true,waterlogged=false]: oak_leaves[distance=7,persistent=true,waterlogged=false] + oak_leaves[distance=6,persistent=false,waterlogged=true]: oak_leaves[distance=7,persistent=true,waterlogged=true] + oak_leaves[distance=6,persistent=false,waterlogged=false]: oak_leaves[distance=7,persistent=true,waterlogged=false] + oak_leaves[distance=7,persistent=false,waterlogged=true]: oak_leaves[distance=7,persistent=true,waterlogged=true] + oak_leaves[distance=7,persistent=false,waterlogged=false]: oak_leaves[distance=7,persistent=true,waterlogged=false] + jungle_leaves[distance=1,persistent=true,waterlogged=true]: jungle_leaves[distance=7,persistent=true,waterlogged=true] + jungle_leaves[distance=1,persistent=true,waterlogged=false]: jungle_leaves[distance=7,persistent=true,waterlogged=false] + jungle_leaves[distance=1,persistent=false,waterlogged=true]: jungle_leaves[distance=7,persistent=true,waterlogged=true] + jungle_leaves[distance=1,persistent=false,waterlogged=false]: jungle_leaves[distance=7,persistent=true,waterlogged=false] + jungle_leaves[distance=2,persistent=true,waterlogged=true]: jungle_leaves[distance=7,persistent=true,waterlogged=true] + jungle_leaves[distance=2,persistent=true,waterlogged=false]: jungle_leaves[distance=7,persistent=true,waterlogged=false] + jungle_leaves[distance=2,persistent=false,waterlogged=true]: jungle_leaves[distance=7,persistent=true,waterlogged=true] + jungle_leaves[distance=2,persistent=false,waterlogged=false]: jungle_leaves[distance=7,persistent=true,waterlogged=false] + jungle_leaves[distance=3,persistent=true,waterlogged=true]: jungle_leaves[distance=7,persistent=true,waterlogged=true] + jungle_leaves[distance=3,persistent=true,waterlogged=false]: jungle_leaves[distance=7,persistent=true,waterlogged=false] + jungle_leaves[distance=3,persistent=false,waterlogged=true]: jungle_leaves[distance=7,persistent=true,waterlogged=true] + jungle_leaves[distance=3,persistent=false,waterlogged=false]: jungle_leaves[distance=7,persistent=true,waterlogged=false] + jungle_leaves[distance=4,persistent=true,waterlogged=true]: jungle_leaves[distance=7,persistent=true,waterlogged=true] + jungle_leaves[distance=4,persistent=true,waterlogged=false]: jungle_leaves[distance=7,persistent=true,waterlogged=false] + jungle_leaves[distance=4,persistent=false,waterlogged=true]: jungle_leaves[distance=7,persistent=true,waterlogged=true] + jungle_leaves[distance=4,persistent=false,waterlogged=false]: jungle_leaves[distance=7,persistent=true,waterlogged=false] + jungle_leaves[distance=5,persistent=true,waterlogged=true]: jungle_leaves[distance=7,persistent=true,waterlogged=true] + jungle_leaves[distance=5,persistent=true,waterlogged=false]: jungle_leaves[distance=7,persistent=true,waterlogged=false] + jungle_leaves[distance=5,persistent=false,waterlogged=true]: jungle_leaves[distance=7,persistent=true,waterlogged=true] + jungle_leaves[distance=5,persistent=false,waterlogged=false]: jungle_leaves[distance=7,persistent=true,waterlogged=false] + jungle_leaves[distance=6,persistent=true,waterlogged=true]: jungle_leaves[distance=7,persistent=true,waterlogged=true] + jungle_leaves[distance=6,persistent=true,waterlogged=false]: jungle_leaves[distance=7,persistent=true,waterlogged=false] + jungle_leaves[distance=6,persistent=false,waterlogged=true]: jungle_leaves[distance=7,persistent=true,waterlogged=true] + jungle_leaves[distance=6,persistent=false,waterlogged=false]: jungle_leaves[distance=7,persistent=true,waterlogged=false] + jungle_leaves[distance=7,persistent=false,waterlogged=true]: jungle_leaves[distance=7,persistent=true,waterlogged=true] + jungle_leaves[distance=7,persistent=false,waterlogged=false]: jungle_leaves[distance=7,persistent=true,waterlogged=false] + acacia_leaves[distance=1,persistent=true,waterlogged=true]: acacia_leaves[distance=7,persistent=true,waterlogged=true] + acacia_leaves[distance=1,persistent=true,waterlogged=false]: acacia_leaves[distance=7,persistent=true,waterlogged=false] + acacia_leaves[distance=1,persistent=false,waterlogged=true]: acacia_leaves[distance=7,persistent=true,waterlogged=true] + acacia_leaves[distance=1,persistent=false,waterlogged=false]: acacia_leaves[distance=7,persistent=true,waterlogged=false] + acacia_leaves[distance=2,persistent=true,waterlogged=true]: acacia_leaves[distance=7,persistent=true,waterlogged=true] + acacia_leaves[distance=2,persistent=true,waterlogged=false]: acacia_leaves[distance=7,persistent=true,waterlogged=false] + acacia_leaves[distance=2,persistent=false,waterlogged=true]: acacia_leaves[distance=7,persistent=true,waterlogged=true] + acacia_leaves[distance=2,persistent=false,waterlogged=false]: acacia_leaves[distance=7,persistent=true,waterlogged=false] + acacia_leaves[distance=3,persistent=true,waterlogged=true]: acacia_leaves[distance=7,persistent=true,waterlogged=true] + acacia_leaves[distance=3,persistent=true,waterlogged=false]: acacia_leaves[distance=7,persistent=true,waterlogged=false] + acacia_leaves[distance=3,persistent=false,waterlogged=true]: acacia_leaves[distance=7,persistent=true,waterlogged=true] + acacia_leaves[distance=3,persistent=false,waterlogged=false]: acacia_leaves[distance=7,persistent=true,waterlogged=false] + acacia_leaves[distance=4,persistent=true,waterlogged=true]: acacia_leaves[distance=7,persistent=true,waterlogged=true] + acacia_leaves[distance=4,persistent=true,waterlogged=false]: acacia_leaves[distance=7,persistent=true,waterlogged=false] + acacia_leaves[distance=4,persistent=false,waterlogged=true]: acacia_leaves[distance=7,persistent=true,waterlogged=true] + acacia_leaves[distance=4,persistent=false,waterlogged=false]: acacia_leaves[distance=7,persistent=true,waterlogged=false] + acacia_leaves[distance=5,persistent=true,waterlogged=true]: acacia_leaves[distance=7,persistent=true,waterlogged=true] + acacia_leaves[distance=5,persistent=true,waterlogged=false]: acacia_leaves[distance=7,persistent=true,waterlogged=false] + acacia_leaves[distance=5,persistent=false,waterlogged=true]: acacia_leaves[distance=7,persistent=true,waterlogged=true] + acacia_leaves[distance=5,persistent=false,waterlogged=false]: acacia_leaves[distance=7,persistent=true,waterlogged=false] + acacia_leaves[distance=6,persistent=true,waterlogged=true]: acacia_leaves[distance=7,persistent=true,waterlogged=true] + acacia_leaves[distance=6,persistent=true,waterlogged=false]: acacia_leaves[distance=7,persistent=true,waterlogged=false] + acacia_leaves[distance=6,persistent=false,waterlogged=true]: acacia_leaves[distance=7,persistent=true,waterlogged=true] + acacia_leaves[distance=6,persistent=false,waterlogged=false]: acacia_leaves[distance=7,persistent=true,waterlogged=false] + acacia_leaves[distance=7,persistent=false,waterlogged=true]: acacia_leaves[distance=7,persistent=true,waterlogged=true] + acacia_leaves[distance=7,persistent=false,waterlogged=false]: acacia_leaves[distance=7,persistent=true,waterlogged=false] + dark_oak_leaves[distance=1,persistent=true,waterlogged=true]: dark_oak_leaves[distance=7,persistent=true,waterlogged=true] + dark_oak_leaves[distance=1,persistent=true,waterlogged=false]: dark_oak_leaves[distance=7,persistent=true,waterlogged=false] + dark_oak_leaves[distance=1,persistent=false,waterlogged=true]: dark_oak_leaves[distance=7,persistent=true,waterlogged=true] + dark_oak_leaves[distance=1,persistent=false,waterlogged=false]: dark_oak_leaves[distance=7,persistent=true,waterlogged=false] + dark_oak_leaves[distance=2,persistent=true,waterlogged=true]: dark_oak_leaves[distance=7,persistent=true,waterlogged=true] + dark_oak_leaves[distance=2,persistent=true,waterlogged=false]: dark_oak_leaves[distance=7,persistent=true,waterlogged=false] + dark_oak_leaves[distance=2,persistent=false,waterlogged=true]: dark_oak_leaves[distance=7,persistent=true,waterlogged=true] + dark_oak_leaves[distance=2,persistent=false,waterlogged=false]: dark_oak_leaves[distance=7,persistent=true,waterlogged=false] + dark_oak_leaves[distance=3,persistent=true,waterlogged=true]: dark_oak_leaves[distance=7,persistent=true,waterlogged=true] + dark_oak_leaves[distance=3,persistent=true,waterlogged=false]: dark_oak_leaves[distance=7,persistent=true,waterlogged=false] + dark_oak_leaves[distance=3,persistent=false,waterlogged=true]: dark_oak_leaves[distance=7,persistent=true,waterlogged=true] + dark_oak_leaves[distance=3,persistent=false,waterlogged=false]: dark_oak_leaves[distance=7,persistent=true,waterlogged=false] + dark_oak_leaves[distance=4,persistent=true,waterlogged=true]: dark_oak_leaves[distance=7,persistent=true,waterlogged=true] + dark_oak_leaves[distance=4,persistent=true,waterlogged=false]: dark_oak_leaves[distance=7,persistent=true,waterlogged=false] + dark_oak_leaves[distance=4,persistent=false,waterlogged=true]: dark_oak_leaves[distance=7,persistent=true,waterlogged=true] + dark_oak_leaves[distance=4,persistent=false,waterlogged=false]: dark_oak_leaves[distance=7,persistent=true,waterlogged=false] + dark_oak_leaves[distance=5,persistent=true,waterlogged=true]: dark_oak_leaves[distance=7,persistent=true,waterlogged=true] + dark_oak_leaves[distance=5,persistent=true,waterlogged=false]: dark_oak_leaves[distance=7,persistent=true,waterlogged=false] + dark_oak_leaves[distance=5,persistent=false,waterlogged=true]: dark_oak_leaves[distance=7,persistent=true,waterlogged=true] + dark_oak_leaves[distance=5,persistent=false,waterlogged=false]: dark_oak_leaves[distance=7,persistent=true,waterlogged=false] + dark_oak_leaves[distance=6,persistent=true,waterlogged=true]: dark_oak_leaves[distance=7,persistent=true,waterlogged=true] + dark_oak_leaves[distance=6,persistent=true,waterlogged=false]: dark_oak_leaves[distance=7,persistent=true,waterlogged=false] + dark_oak_leaves[distance=6,persistent=false,waterlogged=true]: dark_oak_leaves[distance=7,persistent=true,waterlogged=true] + dark_oak_leaves[distance=6,persistent=false,waterlogged=false]: dark_oak_leaves[distance=7,persistent=true,waterlogged=false] + dark_oak_leaves[distance=7,persistent=false,waterlogged=true]: dark_oak_leaves[distance=7,persistent=true,waterlogged=true] + dark_oak_leaves[distance=7,persistent=false,waterlogged=false]: dark_oak_leaves[distance=7,persistent=true,waterlogged=false] + mangrove_leaves[distance=1,persistent=true,waterlogged=true]: mangrove_leaves[distance=7,persistent=true,waterlogged=true] + mangrove_leaves[distance=1,persistent=true,waterlogged=false]: mangrove_leaves[distance=7,persistent=true,waterlogged=false] + mangrove_leaves[distance=1,persistent=false,waterlogged=true]: mangrove_leaves[distance=7,persistent=true,waterlogged=true] + mangrove_leaves[distance=1,persistent=false,waterlogged=false]: mangrove_leaves[distance=7,persistent=true,waterlogged=false] + mangrove_leaves[distance=2,persistent=true,waterlogged=true]: mangrove_leaves[distance=7,persistent=true,waterlogged=true] + mangrove_leaves[distance=2,persistent=true,waterlogged=false]: mangrove_leaves[distance=7,persistent=true,waterlogged=false] + mangrove_leaves[distance=2,persistent=false,waterlogged=true]: mangrove_leaves[distance=7,persistent=true,waterlogged=true] + mangrove_leaves[distance=2,persistent=false,waterlogged=false]: mangrove_leaves[distance=7,persistent=true,waterlogged=false] + mangrove_leaves[distance=3,persistent=true,waterlogged=true]: mangrove_leaves[distance=7,persistent=true,waterlogged=true] + mangrove_leaves[distance=3,persistent=true,waterlogged=false]: mangrove_leaves[distance=7,persistent=true,waterlogged=false] + mangrove_leaves[distance=3,persistent=false,waterlogged=true]: mangrove_leaves[distance=7,persistent=true,waterlogged=true] + mangrove_leaves[distance=3,persistent=false,waterlogged=false]: mangrove_leaves[distance=7,persistent=true,waterlogged=false] + mangrove_leaves[distance=4,persistent=true,waterlogged=true]: mangrove_leaves[distance=7,persistent=true,waterlogged=true] + mangrove_leaves[distance=4,persistent=true,waterlogged=false]: mangrove_leaves[distance=7,persistent=true,waterlogged=false] + mangrove_leaves[distance=4,persistent=false,waterlogged=true]: mangrove_leaves[distance=7,persistent=true,waterlogged=true] + mangrove_leaves[distance=4,persistent=false,waterlogged=false]: mangrove_leaves[distance=7,persistent=true,waterlogged=false] + mangrove_leaves[distance=5,persistent=true,waterlogged=true]: mangrove_leaves[distance=7,persistent=true,waterlogged=true] + mangrove_leaves[distance=5,persistent=true,waterlogged=false]: mangrove_leaves[distance=7,persistent=true,waterlogged=false] + mangrove_leaves[distance=5,persistent=false,waterlogged=true]: mangrove_leaves[distance=7,persistent=true,waterlogged=true] + mangrove_leaves[distance=5,persistent=false,waterlogged=false]: mangrove_leaves[distance=7,persistent=true,waterlogged=false] + mangrove_leaves[distance=6,persistent=true,waterlogged=true]: mangrove_leaves[distance=7,persistent=true,waterlogged=true] + mangrove_leaves[distance=6,persistent=true,waterlogged=false]: mangrove_leaves[distance=7,persistent=true,waterlogged=false] + mangrove_leaves[distance=6,persistent=false,waterlogged=true]: mangrove_leaves[distance=7,persistent=true,waterlogged=true] + mangrove_leaves[distance=6,persistent=false,waterlogged=false]: mangrove_leaves[distance=7,persistent=true,waterlogged=false] + mangrove_leaves[distance=7,persistent=false,waterlogged=true]: mangrove_leaves[distance=7,persistent=true,waterlogged=true] + mangrove_leaves[distance=7,persistent=false,waterlogged=false]: mangrove_leaves[distance=7,persistent=true,waterlogged=false] + # non tintable leaves + azalea_leaves[distance=1,persistent=true,waterlogged=true]: azalea_leaves[distance=7,persistent=true,waterlogged=true] + azalea_leaves[distance=1,persistent=true,waterlogged=false]: azalea_leaves[distance=7,persistent=true,waterlogged=false] + azalea_leaves[distance=1,persistent=false,waterlogged=true]: azalea_leaves[distance=7,persistent=true,waterlogged=true] + azalea_leaves[distance=1,persistent=false,waterlogged=false]: azalea_leaves[distance=7,persistent=true,waterlogged=false] + azalea_leaves[distance=2,persistent=true,waterlogged=true]: azalea_leaves[distance=7,persistent=true,waterlogged=true] + azalea_leaves[distance=2,persistent=true,waterlogged=false]: azalea_leaves[distance=7,persistent=true,waterlogged=false] + azalea_leaves[distance=2,persistent=false,waterlogged=true]: azalea_leaves[distance=7,persistent=true,waterlogged=true] + azalea_leaves[distance=2,persistent=false,waterlogged=false]: azalea_leaves[distance=7,persistent=true,waterlogged=false] + azalea_leaves[distance=3,persistent=true,waterlogged=true]: azalea_leaves[distance=7,persistent=true,waterlogged=true] + azalea_leaves[distance=3,persistent=true,waterlogged=false]: azalea_leaves[distance=7,persistent=true,waterlogged=false] + azalea_leaves[distance=3,persistent=false,waterlogged=true]: azalea_leaves[distance=7,persistent=true,waterlogged=true] + azalea_leaves[distance=3,persistent=false,waterlogged=false]: azalea_leaves[distance=7,persistent=true,waterlogged=false] + azalea_leaves[distance=4,persistent=true,waterlogged=true]: azalea_leaves[distance=7,persistent=true,waterlogged=true] + azalea_leaves[distance=4,persistent=true,waterlogged=false]: azalea_leaves[distance=7,persistent=true,waterlogged=false] + azalea_leaves[distance=4,persistent=false,waterlogged=true]: azalea_leaves[distance=7,persistent=true,waterlogged=true] + azalea_leaves[distance=4,persistent=false,waterlogged=false]: azalea_leaves[distance=7,persistent=true,waterlogged=false] + azalea_leaves[distance=5,persistent=true,waterlogged=true]: azalea_leaves[distance=7,persistent=true,waterlogged=true] + azalea_leaves[distance=5,persistent=true,waterlogged=false]: azalea_leaves[distance=7,persistent=true,waterlogged=false] + azalea_leaves[distance=5,persistent=false,waterlogged=true]: azalea_leaves[distance=7,persistent=true,waterlogged=true] + azalea_leaves[distance=5,persistent=false,waterlogged=false]: azalea_leaves[distance=7,persistent=true,waterlogged=false] + azalea_leaves[distance=6,persistent=true,waterlogged=true]: azalea_leaves[distance=7,persistent=true,waterlogged=true] + azalea_leaves[distance=6,persistent=true,waterlogged=false]: azalea_leaves[distance=7,persistent=true,waterlogged=false] + azalea_leaves[distance=6,persistent=false,waterlogged=true]: azalea_leaves[distance=7,persistent=true,waterlogged=true] + azalea_leaves[distance=6,persistent=false,waterlogged=false]: azalea_leaves[distance=7,persistent=true,waterlogged=false] + azalea_leaves[distance=7,persistent=false,waterlogged=true]: azalea_leaves[distance=7,persistent=true,waterlogged=true] + azalea_leaves[distance=7,persistent=false,waterlogged=false]: azalea_leaves[distance=7,persistent=true,waterlogged=false] + flowering_azalea_leaves[distance=1,persistent=true,waterlogged=true]: flowering_azalea_leaves[distance=7,persistent=true,waterlogged=true] + flowering_azalea_leaves[distance=1,persistent=true,waterlogged=false]: flowering_azalea_leaves[distance=7,persistent=true,waterlogged=false] + flowering_azalea_leaves[distance=1,persistent=false,waterlogged=true]: flowering_azalea_leaves[distance=7,persistent=true,waterlogged=true] + flowering_azalea_leaves[distance=1,persistent=false,waterlogged=false]: flowering_azalea_leaves[distance=7,persistent=true,waterlogged=false] + flowering_azalea_leaves[distance=2,persistent=true,waterlogged=true]: flowering_azalea_leaves[distance=7,persistent=true,waterlogged=true] + flowering_azalea_leaves[distance=2,persistent=true,waterlogged=false]: flowering_azalea_leaves[distance=7,persistent=true,waterlogged=false] + flowering_azalea_leaves[distance=2,persistent=false,waterlogged=true]: flowering_azalea_leaves[distance=7,persistent=true,waterlogged=true] + flowering_azalea_leaves[distance=2,persistent=false,waterlogged=false]: flowering_azalea_leaves[distance=7,persistent=true,waterlogged=false] + flowering_azalea_leaves[distance=3,persistent=true,waterlogged=true]: flowering_azalea_leaves[distance=7,persistent=true,waterlogged=true] + flowering_azalea_leaves[distance=3,persistent=true,waterlogged=false]: flowering_azalea_leaves[distance=7,persistent=true,waterlogged=false] + flowering_azalea_leaves[distance=3,persistent=false,waterlogged=true]: flowering_azalea_leaves[distance=7,persistent=true,waterlogged=true] + flowering_azalea_leaves[distance=3,persistent=false,waterlogged=false]: flowering_azalea_leaves[distance=7,persistent=true,waterlogged=false] + flowering_azalea_leaves[distance=4,persistent=true,waterlogged=true]: flowering_azalea_leaves[distance=7,persistent=true,waterlogged=true] + flowering_azalea_leaves[distance=4,persistent=true,waterlogged=false]: flowering_azalea_leaves[distance=7,persistent=true,waterlogged=false] + flowering_azalea_leaves[distance=4,persistent=false,waterlogged=true]: flowering_azalea_leaves[distance=7,persistent=true,waterlogged=true] + flowering_azalea_leaves[distance=4,persistent=false,waterlogged=false]: flowering_azalea_leaves[distance=7,persistent=true,waterlogged=false] + flowering_azalea_leaves[distance=5,persistent=true,waterlogged=true]: flowering_azalea_leaves[distance=7,persistent=true,waterlogged=true] + flowering_azalea_leaves[distance=5,persistent=true,waterlogged=false]: flowering_azalea_leaves[distance=7,persistent=true,waterlogged=false] + flowering_azalea_leaves[distance=5,persistent=false,waterlogged=true]: flowering_azalea_leaves[distance=7,persistent=true,waterlogged=true] + flowering_azalea_leaves[distance=5,persistent=false,waterlogged=false]: flowering_azalea_leaves[distance=7,persistent=true,waterlogged=false] + flowering_azalea_leaves[distance=6,persistent=true,waterlogged=true]: flowering_azalea_leaves[distance=7,persistent=true,waterlogged=true] + flowering_azalea_leaves[distance=6,persistent=true,waterlogged=false]: flowering_azalea_leaves[distance=7,persistent=true,waterlogged=false] + flowering_azalea_leaves[distance=6,persistent=false,waterlogged=true]: flowering_azalea_leaves[distance=7,persistent=true,waterlogged=true] + flowering_azalea_leaves[distance=6,persistent=false,waterlogged=false]: flowering_azalea_leaves[distance=7,persistent=true,waterlogged=false] + flowering_azalea_leaves[distance=7,persistent=false,waterlogged=true]: flowering_azalea_leaves[distance=7,persistent=true,waterlogged=true] + flowering_azalea_leaves[distance=7,persistent=false,waterlogged=false]: flowering_azalea_leaves[distance=7,persistent=true,waterlogged=false] + cherry_leaves[distance=1,persistent=true,waterlogged=true]: cherry_leaves[distance=7,persistent=true,waterlogged=true] + cherry_leaves[distance=1,persistent=true,waterlogged=false]: cherry_leaves[distance=7,persistent=true,waterlogged=false] + cherry_leaves[distance=1,persistent=false,waterlogged=true]: cherry_leaves[distance=7,persistent=true,waterlogged=true] + cherry_leaves[distance=1,persistent=false,waterlogged=false]: cherry_leaves[distance=7,persistent=true,waterlogged=false] + cherry_leaves[distance=2,persistent=true,waterlogged=true]: cherry_leaves[distance=7,persistent=true,waterlogged=true] + cherry_leaves[distance=2,persistent=true,waterlogged=false]: cherry_leaves[distance=7,persistent=true,waterlogged=false] + cherry_leaves[distance=2,persistent=false,waterlogged=true]: cherry_leaves[distance=7,persistent=true,waterlogged=true] + cherry_leaves[distance=2,persistent=false,waterlogged=false]: cherry_leaves[distance=7,persistent=true,waterlogged=false] + cherry_leaves[distance=3,persistent=true,waterlogged=true]: cherry_leaves[distance=7,persistent=true,waterlogged=true] + cherry_leaves[distance=3,persistent=true,waterlogged=false]: cherry_leaves[distance=7,persistent=true,waterlogged=false] + cherry_leaves[distance=3,persistent=false,waterlogged=true]: cherry_leaves[distance=7,persistent=true,waterlogged=true] + cherry_leaves[distance=3,persistent=false,waterlogged=false]: cherry_leaves[distance=7,persistent=true,waterlogged=false] + cherry_leaves[distance=4,persistent=true,waterlogged=true]: cherry_leaves[distance=7,persistent=true,waterlogged=true] + cherry_leaves[distance=4,persistent=true,waterlogged=false]: cherry_leaves[distance=7,persistent=true,waterlogged=false] + cherry_leaves[distance=4,persistent=false,waterlogged=true]: cherry_leaves[distance=7,persistent=true,waterlogged=true] + cherry_leaves[distance=4,persistent=false,waterlogged=false]: cherry_leaves[distance=7,persistent=true,waterlogged=false] + cherry_leaves[distance=5,persistent=true,waterlogged=true]: cherry_leaves[distance=7,persistent=true,waterlogged=true] + cherry_leaves[distance=5,persistent=true,waterlogged=false]: cherry_leaves[distance=7,persistent=true,waterlogged=false] + cherry_leaves[distance=5,persistent=false,waterlogged=true]: cherry_leaves[distance=7,persistent=true,waterlogged=true] + cherry_leaves[distance=5,persistent=false,waterlogged=false]: cherry_leaves[distance=7,persistent=true,waterlogged=false] + cherry_leaves[distance=6,persistent=true,waterlogged=true]: cherry_leaves[distance=7,persistent=true,waterlogged=true] + cherry_leaves[distance=6,persistent=true,waterlogged=false]: cherry_leaves[distance=7,persistent=true,waterlogged=false] + cherry_leaves[distance=6,persistent=false,waterlogged=true]: cherry_leaves[distance=7,persistent=true,waterlogged=true] + cherry_leaves[distance=6,persistent=false,waterlogged=false]: cherry_leaves[distance=7,persistent=true,waterlogged=false] + cherry_leaves[distance=7,persistent=false,waterlogged=true]: cherry_leaves[distance=7,persistent=true,waterlogged=true] + cherry_leaves[distance=7,persistent=false,waterlogged=false]: cherry_leaves[distance=7,persistent=true,waterlogged=false] + $$>=1.21.4#leaves: + pale_oak_leaves[distance=1,persistent=true,waterlogged=true]: pale_oak_leaves[distance=7,persistent=true,waterlogged=true] + pale_oak_leaves[distance=1,persistent=true,waterlogged=false]: pale_oak_leaves[distance=7,persistent=true,waterlogged=false] + pale_oak_leaves[distance=1,persistent=false,waterlogged=true]: pale_oak_leaves[distance=7,persistent=true,waterlogged=true] + pale_oak_leaves[distance=1,persistent=false,waterlogged=false]: pale_oak_leaves[distance=7,persistent=true,waterlogged=false] + pale_oak_leaves[distance=2,persistent=true,waterlogged=true]: pale_oak_leaves[distance=7,persistent=true,waterlogged=true] + pale_oak_leaves[distance=2,persistent=true,waterlogged=false]: pale_oak_leaves[distance=7,persistent=true,waterlogged=false] + pale_oak_leaves[distance=2,persistent=false,waterlogged=true]: pale_oak_leaves[distance=7,persistent=true,waterlogged=true] + pale_oak_leaves[distance=2,persistent=false,waterlogged=false]: pale_oak_leaves[distance=7,persistent=true,waterlogged=false] + pale_oak_leaves[distance=3,persistent=true,waterlogged=true]: pale_oak_leaves[distance=7,persistent=true,waterlogged=true] + pale_oak_leaves[distance=3,persistent=true,waterlogged=false]: pale_oak_leaves[distance=7,persistent=true,waterlogged=false] + pale_oak_leaves[distance=3,persistent=false,waterlogged=true]: pale_oak_leaves[distance=7,persistent=true,waterlogged=true] + pale_oak_leaves[distance=3,persistent=false,waterlogged=false]: pale_oak_leaves[distance=7,persistent=true,waterlogged=false] + pale_oak_leaves[distance=4,persistent=true,waterlogged=true]: pale_oak_leaves[distance=7,persistent=true,waterlogged=true] + pale_oak_leaves[distance=4,persistent=true,waterlogged=false]: pale_oak_leaves[distance=7,persistent=true,waterlogged=false] + pale_oak_leaves[distance=4,persistent=false,waterlogged=true]: pale_oak_leaves[distance=7,persistent=true,waterlogged=true] + pale_oak_leaves[distance=4,persistent=false,waterlogged=false]: pale_oak_leaves[distance=7,persistent=true,waterlogged=false] + pale_oak_leaves[distance=5,persistent=true,waterlogged=true]: pale_oak_leaves[distance=7,persistent=true,waterlogged=true] + pale_oak_leaves[distance=5,persistent=true,waterlogged=false]: pale_oak_leaves[distance=7,persistent=true,waterlogged=false] + pale_oak_leaves[distance=5,persistent=false,waterlogged=true]: pale_oak_leaves[distance=7,persistent=true,waterlogged=true] + pale_oak_leaves[distance=5,persistent=false,waterlogged=false]: pale_oak_leaves[distance=7,persistent=true,waterlogged=false] + pale_oak_leaves[distance=6,persistent=true,waterlogged=true]: pale_oak_leaves[distance=7,persistent=true,waterlogged=true] + pale_oak_leaves[distance=6,persistent=true,waterlogged=false]: pale_oak_leaves[distance=7,persistent=true,waterlogged=false] + pale_oak_leaves[distance=6,persistent=false,waterlogged=true]: pale_oak_leaves[distance=7,persistent=true,waterlogged=true] + pale_oak_leaves[distance=6,persistent=false,waterlogged=false]: pale_oak_leaves[distance=7,persistent=true,waterlogged=false] + pale_oak_leaves[distance=7,persistent=false,waterlogged=true]: pale_oak_leaves[distance=7,persistent=true,waterlogged=true] + pale_oak_leaves[distance=7,persistent=false,waterlogged=false]: pale_oak_leaves[distance=7,persistent=true,waterlogged=false] + ## Spruce leaves always use color #619961 + # spruce_leaves[distance=1,persistent=true,waterlogged=true]: spruce_leaves[distance=7,persistent=true,waterlogged=true] + # spruce_leaves[distance=1,persistent=true,waterlogged=false]: spruce_leaves[distance=7,persistent=true,waterlogged=false] + # spruce_leaves[distance=1,persistent=false,waterlogged=true]: spruce_leaves[distance=7,persistent=true,waterlogged=true] + # spruce_leaves[distance=1,persistent=false,waterlogged=false]: spruce_leaves[distance=7,persistent=true,waterlogged=false] + # spruce_leaves[distance=2,persistent=true,waterlogged=true]: spruce_leaves[distance=7,persistent=true,waterlogged=true] + # spruce_leaves[distance=2,persistent=true,waterlogged=false]: spruce_leaves[distance=7,persistent=true,waterlogged=false] + # spruce_leaves[distance=2,persistent=false,waterlogged=true]: spruce_leaves[distance=7,persistent=true,waterlogged=true] + # spruce_leaves[distance=2,persistent=false,waterlogged=false]: spruce_leaves[distance=7,persistent=true,waterlogged=false] + # spruce_leaves[distance=3,persistent=true,waterlogged=true]: spruce_leaves[distance=7,persistent=true,waterlogged=true] + # spruce_leaves[distance=3,persistent=true,waterlogged=false]: spruce_leaves[distance=7,persistent=true,waterlogged=false] + # spruce_leaves[distance=3,persistent=false,waterlogged=true]: spruce_leaves[distance=7,persistent=true,waterlogged=true] + # spruce_leaves[distance=3,persistent=false,waterlogged=false]: spruce_leaves[distance=7,persistent=true,waterlogged=false] + # spruce_leaves[distance=4,persistent=true,waterlogged=true]: spruce_leaves[distance=7,persistent=true,waterlogged=true] + # spruce_leaves[distance=4,persistent=true,waterlogged=false]: spruce_leaves[distance=7,persistent=true,waterlogged=false] + # spruce_leaves[distance=4,persistent=false,waterlogged=true]: spruce_leaves[distance=7,persistent=true,waterlogged=true] + # spruce_leaves[distance=4,persistent=false,waterlogged=false]: spruce_leaves[distance=7,persistent=true,waterlogged=false] + # spruce_leaves[distance=5,persistent=true,waterlogged=true]: spruce_leaves[distance=7,persistent=true,waterlogged=true] + # spruce_leaves[distance=5,persistent=true,waterlogged=false]: spruce_leaves[distance=7,persistent=true,waterlogged=false] + # spruce_leaves[distance=5,persistent=false,waterlogged=true]: spruce_leaves[distance=7,persistent=true,waterlogged=true] + # spruce_leaves[distance=5,persistent=false,waterlogged=false]: spruce_leaves[distance=7,persistent=true,waterlogged=false] + # spruce_leaves[distance=6,persistent=true,waterlogged=true]: spruce_leaves[distance=7,persistent=true,waterlogged=true] + # spruce_leaves[distance=6,persistent=true,waterlogged=false]: spruce_leaves[distance=7,persistent=true,waterlogged=false] + # spruce_leaves[distance=6,persistent=false,waterlogged=true]: spruce_leaves[distance=7,persistent=true,waterlogged=true] + # spruce_leaves[distance=6,persistent=false,waterlogged=false]: spruce_leaves[distance=7,persistent=true,waterlogged=false] + # spruce_leaves[distance=7,persistent=false,waterlogged=true]: spruce_leaves[distance=7,persistent=true,waterlogged=true] + # spruce_leaves[distance=7,persistent=false,waterlogged=false]: spruce_leaves[distance=7,persistent=true,waterlogged=false] + ## Birch leaves always use color #80a755 + # birch_leaves[distance=1,persistent=true,waterlogged=true]: birch_leaves[distance=7,persistent=true,waterlogged=true] + # birch_leaves[distance=1,persistent=true,waterlogged=false]: birch_leaves[distance=7,persistent=true,waterlogged=false] + # birch_leaves[distance=1,persistent=false,waterlogged=true]: birch_leaves[distance=7,persistent=true,waterlogged=true] + # birch_leaves[distance=1,persistent=false,waterlogged=false]: birch_leaves[distance=7,persistent=true,waterlogged=false] + # birch_leaves[distance=2,persistent=true,waterlogged=true]: birch_leaves[distance=7,persistent=true,waterlogged=true] + # birch_leaves[distance=2,persistent=true,waterlogged=false]: birch_leaves[distance=7,persistent=true,waterlogged=false] + # birch_leaves[distance=2,persistent=false,waterlogged=true]: birch_leaves[distance=7,persistent=true,waterlogged=true] + # birch_leaves[distance=2,persistent=false,waterlogged=false]: birch_leaves[distance=7,persistent=true,waterlogged=false] + # birch_leaves[distance=3,persistent=true,waterlogged=true]: birch_leaves[distance=7,persistent=true,waterlogged=true] + # birch_leaves[distance=3,persistent=true,waterlogged=false]: birch_leaves[distance=7,persistent=true,waterlogged=false] + # birch_leaves[distance=3,persistent=false,waterlogged=true]: birch_leaves[distance=7,persistent=true,waterlogged=true] + # birch_leaves[distance=3,persistent=false,waterlogged=false]: birch_leaves[distance=7,persistent=true,waterlogged=false] + # birch_leaves[distance=4,persistent=true,waterlogged=true]: birch_leaves[distance=7,persistent=true,waterlogged=true] + # birch_leaves[distance=4,persistent=true,waterlogged=false]: birch_leaves[distance=7,persistent=true,waterlogged=false] + # birch_leaves[distance=4,persistent=false,waterlogged=true]: birch_leaves[distance=7,persistent=true,waterlogged=true] + # birch_leaves[distance=4,persistent=false,waterlogged=false]: birch_leaves[distance=7,persistent=true,waterlogged=false] + # birch_leaves[distance=5,persistent=true,waterlogged=true]: birch_leaves[distance=7,persistent=true,waterlogged=true] + # birch_leaves[distance=5,persistent=true,waterlogged=false]: birch_leaves[distance=7,persistent=true,waterlogged=false] + # birch_leaves[distance=5,persistent=false,waterlogged=true]: birch_leaves[distance=7,persistent=true,waterlogged=true] + # birch_leaves[distance=5,persistent=false,waterlogged=false]: birch_leaves[distance=7,persistent=true,waterlogged=false] + # birch_leaves[distance=6,persistent=true,waterlogged=true]: birch_leaves[distance=7,persistent=true,waterlogged=true] + # birch_leaves[distance=6,persistent=true,waterlogged=false]: birch_leaves[distance=7,persistent=true,waterlogged=false] + # birch_leaves[distance=6,persistent=false,waterlogged=true]: birch_leaves[distance=7,persistent=true,waterlogged=true] + # birch_leaves[distance=6,persistent=false,waterlogged=false]: birch_leaves[distance=7,persistent=true,waterlogged=false] + # birch_leaves[distance=7,persistent=false,waterlogged=true]: birch_leaves[distance=7,persistent=true,waterlogged=true] + # birch_leaves[distance=7,persistent=false,waterlogged=false]: birch_leaves[distance=7,persistent=true,waterlogged=false] + + #### Tripwire #### + # Tripwires actually have 128 different states, but we're keeping just two of them to match vanilla's visual styles. + # Honestly, as long as the tripwire works properly, most players won't even mind what it looks like. + # Tripwire hitboxes aren't all the same - the triggered ones are way shorter. + tripwire[attached=true,disarmed=true,east=true,north=true,powered=true,south=true,west=false]: tripwire[attached=true,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=true,disarmed=true,east=true,north=true,powered=true,south=false,west=true]: tripwire[attached=true,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=true,disarmed=true,east=true,north=true,powered=true,south=false,west=false]: tripwire[attached=true,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=true,disarmed=true,east=true,north=true,powered=false,south=true,west=true]: tripwire[attached=true,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=true,disarmed=true,east=true,north=true,powered=false,south=true,west=false]: tripwire[attached=true,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=true,disarmed=true,east=true,north=true,powered=false,south=false,west=true]: tripwire[attached=true,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=true,disarmed=true,east=true,north=true,powered=false,south=false,west=false]: tripwire[attached=true,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=true,disarmed=true,east=true,north=false,powered=true,south=true,west=true]: tripwire[attached=true,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=true,disarmed=true,east=true,north=false,powered=true,south=true,west=false]: tripwire[attached=true,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=true,disarmed=true,east=true,north=false,powered=true,south=false,west=true]: tripwire[attached=true,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=true,disarmed=true,east=true,north=false,powered=true,south=false,west=false]: tripwire[attached=true,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=true,disarmed=true,east=true,north=false,powered=false,south=true,west=true]: tripwire[attached=true,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=true,disarmed=true,east=true,north=false,powered=false,south=true,west=false]: tripwire[attached=true,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=true,disarmed=true,east=true,north=false,powered=false,south=false,west=true]: tripwire[attached=true,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=true,disarmed=true,east=true,north=false,powered=false,south=false,west=false]: tripwire[attached=true,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=true,disarmed=true,east=false,north=true,powered=true,south=true,west=true]: tripwire[attached=true,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=true,disarmed=true,east=false,north=true,powered=true,south=true,west=false]: tripwire[attached=true,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=true,disarmed=true,east=false,north=true,powered=true,south=false,west=true]: tripwire[attached=true,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=true,disarmed=true,east=false,north=true,powered=true,south=false,west=false]: tripwire[attached=true,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=true,disarmed=true,east=false,north=true,powered=false,south=true,west=true]: tripwire[attached=true,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=true,disarmed=true,east=false,north=true,powered=false,south=true,west=false]: tripwire[attached=true,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=true,disarmed=true,east=false,north=true,powered=false,south=false,west=true]: tripwire[attached=true,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=true,disarmed=true,east=false,north=true,powered=false,south=false,west=false]: tripwire[attached=true,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=true,disarmed=true,east=false,north=false,powered=true,south=true,west=true]: tripwire[attached=true,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=true,disarmed=true,east=false,north=false,powered=true,south=true,west=false]: tripwire[attached=true,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=true,disarmed=true,east=false,north=false,powered=true,south=false,west=true]: tripwire[attached=true,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=true,disarmed=true,east=false,north=false,powered=true,south=false,west=false]: tripwire[attached=true,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=true,disarmed=true,east=false,north=false,powered=false,south=true,west=true]: tripwire[attached=true,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=true,disarmed=true,east=false,north=false,powered=false,south=true,west=false]: tripwire[attached=true,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=true,disarmed=true,east=false,north=false,powered=false,south=false,west=true]: tripwire[attached=true,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=true,disarmed=true,east=false,north=false,powered=false,south=false,west=false]: tripwire[attached=true,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=true,disarmed=false,east=true,north=true,powered=true,south=true,west=true]: tripwire[attached=true,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=true,disarmed=false,east=true,north=true,powered=true,south=true,west=false]: tripwire[attached=true,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=true,disarmed=false,east=true,north=true,powered=true,south=false,west=true]: tripwire[attached=true,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=true,disarmed=false,east=true,north=true,powered=true,south=false,west=false]: tripwire[attached=true,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=true,disarmed=false,east=true,north=true,powered=false,south=true,west=true]: tripwire[attached=true,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=true,disarmed=false,east=true,north=true,powered=false,south=true,west=false]: tripwire[attached=true,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=true,disarmed=false,east=true,north=true,powered=false,south=false,west=true]: tripwire[attached=true,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=true,disarmed=false,east=true,north=true,powered=false,south=false,west=false]: tripwire[attached=true,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=true,disarmed=false,east=true,north=false,powered=true,south=true,west=true]: tripwire[attached=true,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=true,disarmed=false,east=true,north=false,powered=true,south=true,west=false]: tripwire[attached=true,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=true,disarmed=false,east=true,north=false,powered=true,south=false,west=true]: tripwire[attached=true,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=true,disarmed=false,east=true,north=false,powered=true,south=false,west=false]: tripwire[attached=true,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=true,disarmed=false,east=true,north=false,powered=false,south=true,west=true]: tripwire[attached=true,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=true,disarmed=false,east=true,north=false,powered=false,south=true,west=false]: tripwire[attached=true,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=true,disarmed=false,east=true,north=false,powered=false,south=false,west=true]: tripwire[attached=true,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=true,disarmed=false,east=true,north=false,powered=false,south=false,west=false]: tripwire[attached=true,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=true,disarmed=false,east=false,north=true,powered=true,south=true,west=true]: tripwire[attached=true,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=true,disarmed=false,east=false,north=true,powered=true,south=true,west=false]: tripwire[attached=true,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=true,disarmed=false,east=false,north=true,powered=true,south=false,west=true]: tripwire[attached=true,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=true,disarmed=false,east=false,north=true,powered=true,south=false,west=false]: tripwire[attached=true,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=true,disarmed=false,east=false,north=true,powered=false,south=true,west=true]: tripwire[attached=true,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=true,disarmed=false,east=false,north=true,powered=false,south=true,west=false]: tripwire[attached=true,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=true,disarmed=false,east=false,north=true,powered=false,south=false,west=true]: tripwire[attached=true,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=true,disarmed=false,east=false,north=true,powered=false,south=false,west=false]: tripwire[attached=true,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=true,disarmed=false,east=false,north=false,powered=true,south=true,west=true]: tripwire[attached=true,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=true,disarmed=false,east=false,north=false,powered=true,south=true,west=false]: tripwire[attached=true,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=true,disarmed=false,east=false,north=false,powered=true,south=false,west=true]: tripwire[attached=true,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=true,disarmed=false,east=false,north=false,powered=true,south=false,west=false]: tripwire[attached=true,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=true,disarmed=false,east=false,north=false,powered=false,south=true,west=true]: tripwire[attached=true,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=true,disarmed=false,east=false,north=false,powered=false,south=true,west=false]: tripwire[attached=true,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=true,disarmed=false,east=false,north=false,powered=false,south=false,west=true]: tripwire[attached=true,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=true,disarmed=false,east=false,north=false,powered=false,south=false,west=false]: tripwire[attached=true,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=false,disarmed=true,east=true,north=true,powered=true,south=true,west=false]: tripwire[attached=false,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=false,disarmed=true,east=true,north=true,powered=true,south=false,west=true]: tripwire[attached=false,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=false,disarmed=true,east=true,north=true,powered=true,south=false,west=false]: tripwire[attached=false,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=false,disarmed=true,east=true,north=true,powered=false,south=true,west=true]: tripwire[attached=false,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=false,disarmed=true,east=true,north=true,powered=false,south=true,west=false]: tripwire[attached=false,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=false,disarmed=true,east=true,north=true,powered=false,south=false,west=true]: tripwire[attached=false,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=false,disarmed=true,east=true,north=true,powered=false,south=false,west=false]: tripwire[attached=false,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=false,disarmed=true,east=true,north=false,powered=true,south=true,west=true]: tripwire[attached=false,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=false,disarmed=true,east=true,north=false,powered=true,south=true,west=false]: tripwire[attached=false,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=false,disarmed=true,east=true,north=false,powered=true,south=false,west=true]: tripwire[attached=false,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=false,disarmed=true,east=true,north=false,powered=true,south=false,west=false]: tripwire[attached=false,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=false,disarmed=true,east=true,north=false,powered=false,south=true,west=true]: tripwire[attached=false,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=false,disarmed=true,east=true,north=false,powered=false,south=true,west=false]: tripwire[attached=false,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=false,disarmed=true,east=true,north=false,powered=false,south=false,west=true]: tripwire[attached=false,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=false,disarmed=true,east=true,north=false,powered=false,south=false,west=false]: tripwire[attached=false,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=false,disarmed=true,east=false,north=true,powered=true,south=true,west=true]: tripwire[attached=false,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=false,disarmed=true,east=false,north=true,powered=true,south=true,west=false]: tripwire[attached=false,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=false,disarmed=true,east=false,north=true,powered=true,south=false,west=true]: tripwire[attached=false,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=false,disarmed=true,east=false,north=true,powered=true,south=false,west=false]: tripwire[attached=false,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=false,disarmed=true,east=false,north=true,powered=false,south=true,west=true]: tripwire[attached=false,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=false,disarmed=true,east=false,north=true,powered=false,south=true,west=false]: tripwire[attached=false,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=false,disarmed=true,east=false,north=true,powered=false,south=false,west=true]: tripwire[attached=false,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=false,disarmed=true,east=false,north=true,powered=false,south=false,west=false]: tripwire[attached=false,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=false,disarmed=true,east=false,north=false,powered=true,south=true,west=true]: tripwire[attached=false,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=false,disarmed=true,east=false,north=false,powered=true,south=true,west=false]: tripwire[attached=false,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=false,disarmed=true,east=false,north=false,powered=true,south=false,west=true]: tripwire[attached=false,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=false,disarmed=true,east=false,north=false,powered=true,south=false,west=false]: tripwire[attached=false,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=false,disarmed=true,east=false,north=false,powered=false,south=true,west=true]: tripwire[attached=false,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=false,disarmed=true,east=false,north=false,powered=false,south=true,west=false]: tripwire[attached=false,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=false,disarmed=true,east=false,north=false,powered=false,south=false,west=true]: tripwire[attached=false,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=false,disarmed=true,east=false,north=false,powered=false,south=false,west=false]: tripwire[attached=false,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=false,disarmed=false,east=true,north=true,powered=true,south=true,west=true]: tripwire[attached=false,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=false,disarmed=false,east=true,north=true,powered=true,south=true,west=false]: tripwire[attached=false,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=false,disarmed=false,east=true,north=true,powered=true,south=false,west=true]: tripwire[attached=false,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=false,disarmed=false,east=true,north=true,powered=true,south=false,west=false]: tripwire[attached=false,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=false,disarmed=false,east=true,north=true,powered=false,south=true,west=true]: tripwire[attached=false,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=false,disarmed=false,east=true,north=true,powered=false,south=true,west=false]: tripwire[attached=false,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=false,disarmed=false,east=true,north=true,powered=false,south=false,west=true]: tripwire[attached=false,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=false,disarmed=false,east=true,north=true,powered=false,south=false,west=false]: tripwire[attached=false,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=false,disarmed=false,east=true,north=false,powered=true,south=true,west=true]: tripwire[attached=false,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=false,disarmed=false,east=true,north=false,powered=true,south=true,west=false]: tripwire[attached=false,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=false,disarmed=false,east=true,north=false,powered=true,south=false,west=true]: tripwire[attached=false,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=false,disarmed=false,east=true,north=false,powered=true,south=false,west=false]: tripwire[attached=false,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=false,disarmed=false,east=true,north=false,powered=false,south=true,west=true]: tripwire[attached=false,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=false,disarmed=false,east=true,north=false,powered=false,south=true,west=false]: tripwire[attached=false,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=false,disarmed=false,east=true,north=false,powered=false,south=false,west=true]: tripwire[attached=false,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=false,disarmed=false,east=true,north=false,powered=false,south=false,west=false]: tripwire[attached=false,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=false,disarmed=false,east=false,north=true,powered=true,south=true,west=true]: tripwire[attached=false,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=false,disarmed=false,east=false,north=true,powered=true,south=true,west=false]: tripwire[attached=false,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=false,disarmed=false,east=false,north=true,powered=true,south=false,west=true]: tripwire[attached=false,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=false,disarmed=false,east=false,north=true,powered=true,south=false,west=false]: tripwire[attached=false,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=false,disarmed=false,east=false,north=true,powered=false,south=true,west=true]: tripwire[attached=false,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=false,disarmed=false,east=false,north=true,powered=false,south=true,west=false]: tripwire[attached=false,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=false,disarmed=false,east=false,north=true,powered=false,south=false,west=true]: tripwire[attached=false,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=false,disarmed=false,east=false,north=true,powered=false,south=false,west=false]: tripwire[attached=false,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=false,disarmed=false,east=false,north=false,powered=true,south=true,west=true]: tripwire[attached=false,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=false,disarmed=false,east=false,north=false,powered=true,south=true,west=false]: tripwire[attached=false,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=false,disarmed=false,east=false,north=false,powered=true,south=false,west=true]: tripwire[attached=false,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=false,disarmed=false,east=false,north=false,powered=true,south=false,west=false]: tripwire[attached=false,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=false,disarmed=false,east=false,north=false,powered=false,south=true,west=true]: tripwire[attached=false,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=false,disarmed=false,east=false,north=false,powered=false,south=true,west=false]: tripwire[attached=false,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=false,disarmed=false,east=false,north=false,powered=false,south=false,west=true]: tripwire[attached=false,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + tripwire[attached=false,disarmed=false,east=false,north=false,powered=false,south=false,west=false]: tripwire[attached=false,disarmed=true,east=true,north=true,powered=true,south=true,west=true] + + #### Note Block #### + # This block has the most unused states in Minecraft, but the client always thinks it's interactive. + # Plus, there's some visual glitches when the client try predicting instrument changes. + # We've kept a full set of note settings by default - that way it plays nice with resource packs that show notes + note_block[instrument=basedrum,note=0,powered=true]: note_block[instrument=harp,note=0,powered=true] + note_block[instrument=basedrum,note=0,powered=false]: note_block[instrument=harp,note=0,powered=false] + note_block[instrument=basedrum,note=1,powered=true]: note_block[instrument=harp,note=1,powered=true] + note_block[instrument=basedrum,note=1,powered=false]: note_block[instrument=harp,note=1,powered=false] + note_block[instrument=basedrum,note=2,powered=true]: note_block[instrument=harp,note=2,powered=true] + note_block[instrument=basedrum,note=2,powered=false]: note_block[instrument=harp,note=2,powered=false] + note_block[instrument=basedrum,note=3,powered=true]: note_block[instrument=harp,note=3,powered=true] + note_block[instrument=basedrum,note=3,powered=false]: note_block[instrument=harp,note=3,powered=false] + note_block[instrument=basedrum,note=4,powered=true]: note_block[instrument=harp,note=4,powered=true] + note_block[instrument=basedrum,note=4,powered=false]: note_block[instrument=harp,note=4,powered=false] + note_block[instrument=basedrum,note=5,powered=true]: note_block[instrument=harp,note=5,powered=true] + note_block[instrument=basedrum,note=5,powered=false]: note_block[instrument=harp,note=5,powered=false] + note_block[instrument=basedrum,note=6,powered=true]: note_block[instrument=harp,note=6,powered=true] + note_block[instrument=basedrum,note=6,powered=false]: note_block[instrument=harp,note=6,powered=false] + note_block[instrument=basedrum,note=7,powered=true]: note_block[instrument=harp,note=7,powered=true] + note_block[instrument=basedrum,note=7,powered=false]: note_block[instrument=harp,note=7,powered=false] + note_block[instrument=basedrum,note=8,powered=true]: note_block[instrument=harp,note=8,powered=true] + note_block[instrument=basedrum,note=8,powered=false]: note_block[instrument=harp,note=8,powered=false] + note_block[instrument=basedrum,note=9,powered=true]: note_block[instrument=harp,note=9,powered=true] + note_block[instrument=basedrum,note=9,powered=false]: note_block[instrument=harp,note=9,powered=false] + note_block[instrument=basedrum,note=10,powered=true]: note_block[instrument=harp,note=10,powered=true] + note_block[instrument=basedrum,note=10,powered=false]: note_block[instrument=harp,note=10,powered=false] + note_block[instrument=basedrum,note=11,powered=true]: note_block[instrument=harp,note=11,powered=true] + note_block[instrument=basedrum,note=11,powered=false]: note_block[instrument=harp,note=11,powered=false] + note_block[instrument=basedrum,note=12,powered=true]: note_block[instrument=harp,note=12,powered=true] + note_block[instrument=basedrum,note=12,powered=false]: note_block[instrument=harp,note=12,powered=false] + note_block[instrument=basedrum,note=13,powered=true]: note_block[instrument=harp,note=13,powered=true] + note_block[instrument=basedrum,note=13,powered=false]: note_block[instrument=harp,note=13,powered=false] + note_block[instrument=basedrum,note=14,powered=true]: note_block[instrument=harp,note=14,powered=true] + note_block[instrument=basedrum,note=14,powered=false]: note_block[instrument=harp,note=14,powered=false] + note_block[instrument=basedrum,note=15,powered=true]: note_block[instrument=harp,note=15,powered=true] + note_block[instrument=basedrum,note=15,powered=false]: note_block[instrument=harp,note=15,powered=false] + note_block[instrument=basedrum,note=16,powered=true]: note_block[instrument=harp,note=16,powered=true] + note_block[instrument=basedrum,note=16,powered=false]: note_block[instrument=harp,note=16,powered=false] + note_block[instrument=basedrum,note=17,powered=true]: note_block[instrument=harp,note=17,powered=true] + note_block[instrument=basedrum,note=17,powered=false]: note_block[instrument=harp,note=17,powered=false] + note_block[instrument=basedrum,note=18,powered=true]: note_block[instrument=harp,note=18,powered=true] + note_block[instrument=basedrum,note=18,powered=false]: note_block[instrument=harp,note=18,powered=false] + note_block[instrument=basedrum,note=19,powered=true]: note_block[instrument=harp,note=19,powered=true] + note_block[instrument=basedrum,note=19,powered=false]: note_block[instrument=harp,note=19,powered=false] + note_block[instrument=basedrum,note=20,powered=true]: note_block[instrument=harp,note=20,powered=true] + note_block[instrument=basedrum,note=20,powered=false]: note_block[instrument=harp,note=20,powered=false] + note_block[instrument=basedrum,note=21,powered=true]: note_block[instrument=harp,note=21,powered=true] + note_block[instrument=basedrum,note=21,powered=false]: note_block[instrument=harp,note=21,powered=false] + note_block[instrument=basedrum,note=22,powered=true]: note_block[instrument=harp,note=22,powered=true] + note_block[instrument=basedrum,note=22,powered=false]: note_block[instrument=harp,note=22,powered=false] + note_block[instrument=basedrum,note=23,powered=true]: note_block[instrument=harp,note=23,powered=true] + note_block[instrument=basedrum,note=23,powered=false]: note_block[instrument=harp,note=23,powered=false] + note_block[instrument=basedrum,note=24,powered=true]: note_block[instrument=harp,note=24,powered=true] + note_block[instrument=basedrum,note=24,powered=false]: note_block[instrument=harp,note=24,powered=false] + note_block[instrument=snare,note=0,powered=true]: note_block[instrument=harp,note=0,powered=true] + note_block[instrument=snare,note=0,powered=false]: note_block[instrument=harp,note=0,powered=false] + note_block[instrument=snare,note=1,powered=true]: note_block[instrument=harp,note=1,powered=true] + note_block[instrument=snare,note=1,powered=false]: note_block[instrument=harp,note=1,powered=false] + note_block[instrument=snare,note=2,powered=true]: note_block[instrument=harp,note=2,powered=true] + note_block[instrument=snare,note=2,powered=false]: note_block[instrument=harp,note=2,powered=false] + note_block[instrument=snare,note=3,powered=true]: note_block[instrument=harp,note=3,powered=true] + note_block[instrument=snare,note=3,powered=false]: note_block[instrument=harp,note=3,powered=false] + note_block[instrument=snare,note=4,powered=true]: note_block[instrument=harp,note=4,powered=true] + note_block[instrument=snare,note=4,powered=false]: note_block[instrument=harp,note=4,powered=false] + note_block[instrument=snare,note=5,powered=true]: note_block[instrument=harp,note=5,powered=true] + note_block[instrument=snare,note=5,powered=false]: note_block[instrument=harp,note=5,powered=false] + note_block[instrument=snare,note=6,powered=true]: note_block[instrument=harp,note=6,powered=true] + note_block[instrument=snare,note=6,powered=false]: note_block[instrument=harp,note=6,powered=false] + note_block[instrument=snare,note=7,powered=true]: note_block[instrument=harp,note=7,powered=true] + note_block[instrument=snare,note=7,powered=false]: note_block[instrument=harp,note=7,powered=false] + note_block[instrument=snare,note=8,powered=true]: note_block[instrument=harp,note=8,powered=true] + note_block[instrument=snare,note=8,powered=false]: note_block[instrument=harp,note=8,powered=false] + note_block[instrument=snare,note=9,powered=true]: note_block[instrument=harp,note=9,powered=true] + note_block[instrument=snare,note=9,powered=false]: note_block[instrument=harp,note=9,powered=false] + note_block[instrument=snare,note=10,powered=true]: note_block[instrument=harp,note=10,powered=true] + note_block[instrument=snare,note=10,powered=false]: note_block[instrument=harp,note=10,powered=false] + note_block[instrument=snare,note=11,powered=true]: note_block[instrument=harp,note=11,powered=true] + note_block[instrument=snare,note=11,powered=false]: note_block[instrument=harp,note=11,powered=false] + note_block[instrument=snare,note=12,powered=true]: note_block[instrument=harp,note=12,powered=true] + note_block[instrument=snare,note=12,powered=false]: note_block[instrument=harp,note=12,powered=false] + note_block[instrument=snare,note=13,powered=true]: note_block[instrument=harp,note=13,powered=true] + note_block[instrument=snare,note=13,powered=false]: note_block[instrument=harp,note=13,powered=false] + note_block[instrument=snare,note=14,powered=true]: note_block[instrument=harp,note=14,powered=true] + note_block[instrument=snare,note=14,powered=false]: note_block[instrument=harp,note=14,powered=false] + note_block[instrument=snare,note=15,powered=true]: note_block[instrument=harp,note=15,powered=true] + note_block[instrument=snare,note=15,powered=false]: note_block[instrument=harp,note=15,powered=false] + note_block[instrument=snare,note=16,powered=true]: note_block[instrument=harp,note=16,powered=true] + note_block[instrument=snare,note=16,powered=false]: note_block[instrument=harp,note=16,powered=false] + note_block[instrument=snare,note=17,powered=true]: note_block[instrument=harp,note=17,powered=true] + note_block[instrument=snare,note=17,powered=false]: note_block[instrument=harp,note=17,powered=false] + note_block[instrument=snare,note=18,powered=true]: note_block[instrument=harp,note=18,powered=true] + note_block[instrument=snare,note=18,powered=false]: note_block[instrument=harp,note=18,powered=false] + note_block[instrument=snare,note=19,powered=true]: note_block[instrument=harp,note=19,powered=true] + note_block[instrument=snare,note=19,powered=false]: note_block[instrument=harp,note=19,powered=false] + note_block[instrument=snare,note=20,powered=true]: note_block[instrument=harp,note=20,powered=true] + note_block[instrument=snare,note=20,powered=false]: note_block[instrument=harp,note=20,powered=false] + note_block[instrument=snare,note=21,powered=true]: note_block[instrument=harp,note=21,powered=true] + note_block[instrument=snare,note=21,powered=false]: note_block[instrument=harp,note=21,powered=false] + note_block[instrument=snare,note=22,powered=true]: note_block[instrument=harp,note=22,powered=true] + note_block[instrument=snare,note=22,powered=false]: note_block[instrument=harp,note=22,powered=false] + note_block[instrument=snare,note=23,powered=true]: note_block[instrument=harp,note=23,powered=true] + note_block[instrument=snare,note=23,powered=false]: note_block[instrument=harp,note=23,powered=false] + note_block[instrument=snare,note=24,powered=true]: note_block[instrument=harp,note=24,powered=true] + note_block[instrument=snare,note=24,powered=false]: note_block[instrument=harp,note=24,powered=false] + note_block[instrument=hat,note=0,powered=true]: note_block[instrument=harp,note=0,powered=true] + note_block[instrument=hat,note=0,powered=false]: note_block[instrument=harp,note=0,powered=false] + note_block[instrument=hat,note=1,powered=true]: note_block[instrument=harp,note=1,powered=true] + note_block[instrument=hat,note=1,powered=false]: note_block[instrument=harp,note=1,powered=false] + note_block[instrument=hat,note=2,powered=true]: note_block[instrument=harp,note=2,powered=true] + note_block[instrument=hat,note=2,powered=false]: note_block[instrument=harp,note=2,powered=false] + note_block[instrument=hat,note=3,powered=true]: note_block[instrument=harp,note=3,powered=true] + note_block[instrument=hat,note=3,powered=false]: note_block[instrument=harp,note=3,powered=false] + note_block[instrument=hat,note=4,powered=true]: note_block[instrument=harp,note=4,powered=true] + note_block[instrument=hat,note=4,powered=false]: note_block[instrument=harp,note=4,powered=false] + note_block[instrument=hat,note=5,powered=true]: note_block[instrument=harp,note=5,powered=true] + note_block[instrument=hat,note=5,powered=false]: note_block[instrument=harp,note=5,powered=false] + note_block[instrument=hat,note=6,powered=true]: note_block[instrument=harp,note=6,powered=true] + note_block[instrument=hat,note=6,powered=false]: note_block[instrument=harp,note=6,powered=false] + note_block[instrument=hat,note=7,powered=true]: note_block[instrument=harp,note=7,powered=true] + note_block[instrument=hat,note=7,powered=false]: note_block[instrument=harp,note=7,powered=false] + note_block[instrument=hat,note=8,powered=true]: note_block[instrument=harp,note=8,powered=true] + note_block[instrument=hat,note=8,powered=false]: note_block[instrument=harp,note=8,powered=false] + note_block[instrument=hat,note=9,powered=true]: note_block[instrument=harp,note=9,powered=true] + note_block[instrument=hat,note=9,powered=false]: note_block[instrument=harp,note=9,powered=false] + note_block[instrument=hat,note=10,powered=true]: note_block[instrument=harp,note=10,powered=true] + note_block[instrument=hat,note=10,powered=false]: note_block[instrument=harp,note=10,powered=false] + note_block[instrument=hat,note=11,powered=true]: note_block[instrument=harp,note=11,powered=true] + note_block[instrument=hat,note=11,powered=false]: note_block[instrument=harp,note=11,powered=false] + note_block[instrument=hat,note=12,powered=true]: note_block[instrument=harp,note=12,powered=true] + note_block[instrument=hat,note=12,powered=false]: note_block[instrument=harp,note=12,powered=false] + note_block[instrument=hat,note=13,powered=true]: note_block[instrument=harp,note=13,powered=true] + note_block[instrument=hat,note=13,powered=false]: note_block[instrument=harp,note=13,powered=false] + note_block[instrument=hat,note=14,powered=true]: note_block[instrument=harp,note=14,powered=true] + note_block[instrument=hat,note=14,powered=false]: note_block[instrument=harp,note=14,powered=false] + note_block[instrument=hat,note=15,powered=true]: note_block[instrument=harp,note=15,powered=true] + note_block[instrument=hat,note=15,powered=false]: note_block[instrument=harp,note=15,powered=false] + note_block[instrument=hat,note=16,powered=true]: note_block[instrument=harp,note=16,powered=true] + note_block[instrument=hat,note=16,powered=false]: note_block[instrument=harp,note=16,powered=false] + note_block[instrument=hat,note=17,powered=true]: note_block[instrument=harp,note=17,powered=true] + note_block[instrument=hat,note=17,powered=false]: note_block[instrument=harp,note=17,powered=false] + note_block[instrument=hat,note=18,powered=true]: note_block[instrument=harp,note=18,powered=true] + note_block[instrument=hat,note=18,powered=false]: note_block[instrument=harp,note=18,powered=false] + note_block[instrument=hat,note=19,powered=true]: note_block[instrument=harp,note=19,powered=true] + note_block[instrument=hat,note=19,powered=false]: note_block[instrument=harp,note=19,powered=false] + note_block[instrument=hat,note=20,powered=true]: note_block[instrument=harp,note=20,powered=true] + note_block[instrument=hat,note=20,powered=false]: note_block[instrument=harp,note=20,powered=false] + note_block[instrument=hat,note=21,powered=true]: note_block[instrument=harp,note=21,powered=true] + note_block[instrument=hat,note=21,powered=false]: note_block[instrument=harp,note=21,powered=false] + note_block[instrument=hat,note=22,powered=true]: note_block[instrument=harp,note=22,powered=true] + note_block[instrument=hat,note=22,powered=false]: note_block[instrument=harp,note=22,powered=false] + note_block[instrument=hat,note=23,powered=true]: note_block[instrument=harp,note=23,powered=true] + note_block[instrument=hat,note=23,powered=false]: note_block[instrument=harp,note=23,powered=false] + note_block[instrument=hat,note=24,powered=true]: note_block[instrument=harp,note=24,powered=true] + note_block[instrument=hat,note=24,powered=false]: note_block[instrument=harp,note=24,powered=false] + note_block[instrument=bass,note=0,powered=true]: note_block[instrument=harp,note=0,powered=true] + note_block[instrument=bass,note=0,powered=false]: note_block[instrument=harp,note=0,powered=false] + note_block[instrument=bass,note=1,powered=true]: note_block[instrument=harp,note=1,powered=true] + note_block[instrument=bass,note=1,powered=false]: note_block[instrument=harp,note=1,powered=false] + note_block[instrument=bass,note=2,powered=true]: note_block[instrument=harp,note=2,powered=true] + note_block[instrument=bass,note=2,powered=false]: note_block[instrument=harp,note=2,powered=false] + note_block[instrument=bass,note=3,powered=true]: note_block[instrument=harp,note=3,powered=true] + note_block[instrument=bass,note=3,powered=false]: note_block[instrument=harp,note=3,powered=false] + note_block[instrument=bass,note=4,powered=true]: note_block[instrument=harp,note=4,powered=true] + note_block[instrument=bass,note=4,powered=false]: note_block[instrument=harp,note=4,powered=false] + note_block[instrument=bass,note=5,powered=true]: note_block[instrument=harp,note=5,powered=true] + note_block[instrument=bass,note=5,powered=false]: note_block[instrument=harp,note=5,powered=false] + note_block[instrument=bass,note=6,powered=true]: note_block[instrument=harp,note=6,powered=true] + note_block[instrument=bass,note=6,powered=false]: note_block[instrument=harp,note=6,powered=false] + note_block[instrument=bass,note=7,powered=true]: note_block[instrument=harp,note=7,powered=true] + note_block[instrument=bass,note=7,powered=false]: note_block[instrument=harp,note=7,powered=false] + note_block[instrument=bass,note=8,powered=true]: note_block[instrument=harp,note=8,powered=true] + note_block[instrument=bass,note=8,powered=false]: note_block[instrument=harp,note=8,powered=false] + note_block[instrument=bass,note=9,powered=true]: note_block[instrument=harp,note=9,powered=true] + note_block[instrument=bass,note=9,powered=false]: note_block[instrument=harp,note=9,powered=false] + note_block[instrument=bass,note=10,powered=true]: note_block[instrument=harp,note=10,powered=true] + note_block[instrument=bass,note=10,powered=false]: note_block[instrument=harp,note=10,powered=false] + note_block[instrument=bass,note=11,powered=true]: note_block[instrument=harp,note=11,powered=true] + note_block[instrument=bass,note=11,powered=false]: note_block[instrument=harp,note=11,powered=false] + note_block[instrument=bass,note=12,powered=true]: note_block[instrument=harp,note=12,powered=true] + note_block[instrument=bass,note=12,powered=false]: note_block[instrument=harp,note=12,powered=false] + note_block[instrument=bass,note=13,powered=true]: note_block[instrument=harp,note=13,powered=true] + note_block[instrument=bass,note=13,powered=false]: note_block[instrument=harp,note=13,powered=false] + note_block[instrument=bass,note=14,powered=true]: note_block[instrument=harp,note=14,powered=true] + note_block[instrument=bass,note=14,powered=false]: note_block[instrument=harp,note=14,powered=false] + note_block[instrument=bass,note=15,powered=true]: note_block[instrument=harp,note=15,powered=true] + note_block[instrument=bass,note=15,powered=false]: note_block[instrument=harp,note=15,powered=false] + note_block[instrument=bass,note=16,powered=true]: note_block[instrument=harp,note=16,powered=true] + note_block[instrument=bass,note=16,powered=false]: note_block[instrument=harp,note=16,powered=false] + note_block[instrument=bass,note=17,powered=true]: note_block[instrument=harp,note=17,powered=true] + note_block[instrument=bass,note=17,powered=false]: note_block[instrument=harp,note=17,powered=false] + note_block[instrument=bass,note=18,powered=true]: note_block[instrument=harp,note=18,powered=true] + note_block[instrument=bass,note=18,powered=false]: note_block[instrument=harp,note=18,powered=false] + note_block[instrument=bass,note=19,powered=true]: note_block[instrument=harp,note=19,powered=true] + note_block[instrument=bass,note=19,powered=false]: note_block[instrument=harp,note=19,powered=false] + note_block[instrument=bass,note=20,powered=true]: note_block[instrument=harp,note=20,powered=true] + note_block[instrument=bass,note=20,powered=false]: note_block[instrument=harp,note=20,powered=false] + note_block[instrument=bass,note=21,powered=true]: note_block[instrument=harp,note=21,powered=true] + note_block[instrument=bass,note=21,powered=false]: note_block[instrument=harp,note=21,powered=false] + note_block[instrument=bass,note=22,powered=true]: note_block[instrument=harp,note=22,powered=true] + note_block[instrument=bass,note=22,powered=false]: note_block[instrument=harp,note=22,powered=false] + note_block[instrument=bass,note=23,powered=true]: note_block[instrument=harp,note=23,powered=true] + note_block[instrument=bass,note=23,powered=false]: note_block[instrument=harp,note=23,powered=false] + note_block[instrument=bass,note=24,powered=true]: note_block[instrument=harp,note=24,powered=true] + note_block[instrument=bass,note=24,powered=false]: note_block[instrument=harp,note=24,powered=false] + note_block[instrument=flute,note=0,powered=true]: note_block[instrument=harp,note=0,powered=true] + note_block[instrument=flute,note=0,powered=false]: note_block[instrument=harp,note=0,powered=false] + note_block[instrument=flute,note=1,powered=true]: note_block[instrument=harp,note=1,powered=true] + note_block[instrument=flute,note=1,powered=false]: note_block[instrument=harp,note=1,powered=false] + note_block[instrument=flute,note=2,powered=true]: note_block[instrument=harp,note=2,powered=true] + note_block[instrument=flute,note=2,powered=false]: note_block[instrument=harp,note=2,powered=false] + note_block[instrument=flute,note=3,powered=true]: note_block[instrument=harp,note=3,powered=true] + note_block[instrument=flute,note=3,powered=false]: note_block[instrument=harp,note=3,powered=false] + note_block[instrument=flute,note=4,powered=true]: note_block[instrument=harp,note=4,powered=true] + note_block[instrument=flute,note=4,powered=false]: note_block[instrument=harp,note=4,powered=false] + note_block[instrument=flute,note=5,powered=true]: note_block[instrument=harp,note=5,powered=true] + note_block[instrument=flute,note=5,powered=false]: note_block[instrument=harp,note=5,powered=false] + note_block[instrument=flute,note=6,powered=true]: note_block[instrument=harp,note=6,powered=true] + note_block[instrument=flute,note=6,powered=false]: note_block[instrument=harp,note=6,powered=false] + note_block[instrument=flute,note=7,powered=true]: note_block[instrument=harp,note=7,powered=true] + note_block[instrument=flute,note=7,powered=false]: note_block[instrument=harp,note=7,powered=false] + note_block[instrument=flute,note=8,powered=true]: note_block[instrument=harp,note=8,powered=true] + note_block[instrument=flute,note=8,powered=false]: note_block[instrument=harp,note=8,powered=false] + note_block[instrument=flute,note=9,powered=true]: note_block[instrument=harp,note=9,powered=true] + note_block[instrument=flute,note=9,powered=false]: note_block[instrument=harp,note=9,powered=false] + note_block[instrument=flute,note=10,powered=true]: note_block[instrument=harp,note=10,powered=true] + note_block[instrument=flute,note=10,powered=false]: note_block[instrument=harp,note=10,powered=false] + note_block[instrument=flute,note=11,powered=true]: note_block[instrument=harp,note=11,powered=true] + note_block[instrument=flute,note=11,powered=false]: note_block[instrument=harp,note=11,powered=false] + note_block[instrument=flute,note=12,powered=true]: note_block[instrument=harp,note=12,powered=true] + note_block[instrument=flute,note=12,powered=false]: note_block[instrument=harp,note=12,powered=false] + note_block[instrument=flute,note=13,powered=true]: note_block[instrument=harp,note=13,powered=true] + note_block[instrument=flute,note=13,powered=false]: note_block[instrument=harp,note=13,powered=false] + note_block[instrument=flute,note=14,powered=true]: note_block[instrument=harp,note=14,powered=true] + note_block[instrument=flute,note=14,powered=false]: note_block[instrument=harp,note=14,powered=false] + note_block[instrument=flute,note=15,powered=true]: note_block[instrument=harp,note=15,powered=true] + note_block[instrument=flute,note=15,powered=false]: note_block[instrument=harp,note=15,powered=false] + note_block[instrument=flute,note=16,powered=true]: note_block[instrument=harp,note=16,powered=true] + note_block[instrument=flute,note=16,powered=false]: note_block[instrument=harp,note=16,powered=false] + note_block[instrument=flute,note=17,powered=true]: note_block[instrument=harp,note=17,powered=true] + note_block[instrument=flute,note=17,powered=false]: note_block[instrument=harp,note=17,powered=false] + note_block[instrument=flute,note=18,powered=true]: note_block[instrument=harp,note=18,powered=true] + note_block[instrument=flute,note=18,powered=false]: note_block[instrument=harp,note=18,powered=false] + note_block[instrument=flute,note=19,powered=true]: note_block[instrument=harp,note=19,powered=true] + note_block[instrument=flute,note=19,powered=false]: note_block[instrument=harp,note=19,powered=false] + note_block[instrument=flute,note=20,powered=true]: note_block[instrument=harp,note=20,powered=true] + note_block[instrument=flute,note=20,powered=false]: note_block[instrument=harp,note=20,powered=false] + note_block[instrument=flute,note=21,powered=true]: note_block[instrument=harp,note=21,powered=true] + note_block[instrument=flute,note=21,powered=false]: note_block[instrument=harp,note=21,powered=false] + note_block[instrument=flute,note=22,powered=true]: note_block[instrument=harp,note=22,powered=true] + note_block[instrument=flute,note=22,powered=false]: note_block[instrument=harp,note=22,powered=false] + note_block[instrument=flute,note=23,powered=true]: note_block[instrument=harp,note=23,powered=true] + note_block[instrument=flute,note=23,powered=false]: note_block[instrument=harp,note=23,powered=false] + note_block[instrument=flute,note=24,powered=true]: note_block[instrument=harp,note=24,powered=true] + note_block[instrument=flute,note=24,powered=false]: note_block[instrument=harp,note=24,powered=false] + note_block[instrument=bell,note=0,powered=true]: note_block[instrument=harp,note=0,powered=true] + note_block[instrument=bell,note=0,powered=false]: note_block[instrument=harp,note=0,powered=false] + note_block[instrument=bell,note=1,powered=true]: note_block[instrument=harp,note=1,powered=true] + note_block[instrument=bell,note=1,powered=false]: note_block[instrument=harp,note=1,powered=false] + note_block[instrument=bell,note=2,powered=true]: note_block[instrument=harp,note=2,powered=true] + note_block[instrument=bell,note=2,powered=false]: note_block[instrument=harp,note=2,powered=false] + note_block[instrument=bell,note=3,powered=true]: note_block[instrument=harp,note=3,powered=true] + note_block[instrument=bell,note=3,powered=false]: note_block[instrument=harp,note=3,powered=false] + note_block[instrument=bell,note=4,powered=true]: note_block[instrument=harp,note=4,powered=true] + note_block[instrument=bell,note=4,powered=false]: note_block[instrument=harp,note=4,powered=false] + note_block[instrument=bell,note=5,powered=true]: note_block[instrument=harp,note=5,powered=true] + note_block[instrument=bell,note=5,powered=false]: note_block[instrument=harp,note=5,powered=false] + note_block[instrument=bell,note=6,powered=true]: note_block[instrument=harp,note=6,powered=true] + note_block[instrument=bell,note=6,powered=false]: note_block[instrument=harp,note=6,powered=false] + note_block[instrument=bell,note=7,powered=true]: note_block[instrument=harp,note=7,powered=true] + note_block[instrument=bell,note=7,powered=false]: note_block[instrument=harp,note=7,powered=false] + note_block[instrument=bell,note=8,powered=true]: note_block[instrument=harp,note=8,powered=true] + note_block[instrument=bell,note=8,powered=false]: note_block[instrument=harp,note=8,powered=false] + note_block[instrument=bell,note=9,powered=true]: note_block[instrument=harp,note=9,powered=true] + note_block[instrument=bell,note=9,powered=false]: note_block[instrument=harp,note=9,powered=false] + note_block[instrument=bell,note=10,powered=true]: note_block[instrument=harp,note=10,powered=true] + note_block[instrument=bell,note=10,powered=false]: note_block[instrument=harp,note=10,powered=false] + note_block[instrument=bell,note=11,powered=true]: note_block[instrument=harp,note=11,powered=true] + note_block[instrument=bell,note=11,powered=false]: note_block[instrument=harp,note=11,powered=false] + note_block[instrument=bell,note=12,powered=true]: note_block[instrument=harp,note=12,powered=true] + note_block[instrument=bell,note=12,powered=false]: note_block[instrument=harp,note=12,powered=false] + note_block[instrument=bell,note=13,powered=true]: note_block[instrument=harp,note=13,powered=true] + note_block[instrument=bell,note=13,powered=false]: note_block[instrument=harp,note=13,powered=false] + note_block[instrument=bell,note=14,powered=true]: note_block[instrument=harp,note=14,powered=true] + note_block[instrument=bell,note=14,powered=false]: note_block[instrument=harp,note=14,powered=false] + note_block[instrument=bell,note=15,powered=true]: note_block[instrument=harp,note=15,powered=true] + note_block[instrument=bell,note=15,powered=false]: note_block[instrument=harp,note=15,powered=false] + note_block[instrument=bell,note=16,powered=true]: note_block[instrument=harp,note=16,powered=true] + note_block[instrument=bell,note=16,powered=false]: note_block[instrument=harp,note=16,powered=false] + note_block[instrument=bell,note=17,powered=true]: note_block[instrument=harp,note=17,powered=true] + note_block[instrument=bell,note=17,powered=false]: note_block[instrument=harp,note=17,powered=false] + note_block[instrument=bell,note=18,powered=true]: note_block[instrument=harp,note=18,powered=true] + note_block[instrument=bell,note=18,powered=false]: note_block[instrument=harp,note=18,powered=false] + note_block[instrument=bell,note=19,powered=true]: note_block[instrument=harp,note=19,powered=true] + note_block[instrument=bell,note=19,powered=false]: note_block[instrument=harp,note=19,powered=false] + note_block[instrument=bell,note=20,powered=true]: note_block[instrument=harp,note=20,powered=true] + note_block[instrument=bell,note=20,powered=false]: note_block[instrument=harp,note=20,powered=false] + note_block[instrument=bell,note=21,powered=true]: note_block[instrument=harp,note=21,powered=true] + note_block[instrument=bell,note=21,powered=false]: note_block[instrument=harp,note=21,powered=false] + note_block[instrument=bell,note=22,powered=true]: note_block[instrument=harp,note=22,powered=true] + note_block[instrument=bell,note=22,powered=false]: note_block[instrument=harp,note=22,powered=false] + note_block[instrument=bell,note=23,powered=true]: note_block[instrument=harp,note=23,powered=true] + note_block[instrument=bell,note=23,powered=false]: note_block[instrument=harp,note=23,powered=false] + note_block[instrument=bell,note=24,powered=true]: note_block[instrument=harp,note=24,powered=true] + note_block[instrument=bell,note=24,powered=false]: note_block[instrument=harp,note=24,powered=false] + note_block[instrument=guitar,note=0,powered=true]: note_block[instrument=harp,note=0,powered=true] + note_block[instrument=guitar,note=0,powered=false]: note_block[instrument=harp,note=0,powered=false] + note_block[instrument=guitar,note=1,powered=true]: note_block[instrument=harp,note=1,powered=true] + note_block[instrument=guitar,note=1,powered=false]: note_block[instrument=harp,note=1,powered=false] + note_block[instrument=guitar,note=2,powered=true]: note_block[instrument=harp,note=2,powered=true] + note_block[instrument=guitar,note=2,powered=false]: note_block[instrument=harp,note=2,powered=false] + note_block[instrument=guitar,note=3,powered=true]: note_block[instrument=harp,note=3,powered=true] + note_block[instrument=guitar,note=3,powered=false]: note_block[instrument=harp,note=3,powered=false] + note_block[instrument=guitar,note=4,powered=true]: note_block[instrument=harp,note=4,powered=true] + note_block[instrument=guitar,note=4,powered=false]: note_block[instrument=harp,note=4,powered=false] + note_block[instrument=guitar,note=5,powered=true]: note_block[instrument=harp,note=5,powered=true] + note_block[instrument=guitar,note=5,powered=false]: note_block[instrument=harp,note=5,powered=false] + note_block[instrument=guitar,note=6,powered=true]: note_block[instrument=harp,note=6,powered=true] + note_block[instrument=guitar,note=6,powered=false]: note_block[instrument=harp,note=6,powered=false] + note_block[instrument=guitar,note=7,powered=true]: note_block[instrument=harp,note=7,powered=true] + note_block[instrument=guitar,note=7,powered=false]: note_block[instrument=harp,note=7,powered=false] + note_block[instrument=guitar,note=8,powered=true]: note_block[instrument=harp,note=8,powered=true] + note_block[instrument=guitar,note=8,powered=false]: note_block[instrument=harp,note=8,powered=false] + note_block[instrument=guitar,note=9,powered=true]: note_block[instrument=harp,note=9,powered=true] + note_block[instrument=guitar,note=9,powered=false]: note_block[instrument=harp,note=9,powered=false] + note_block[instrument=guitar,note=10,powered=true]: note_block[instrument=harp,note=10,powered=true] + note_block[instrument=guitar,note=10,powered=false]: note_block[instrument=harp,note=10,powered=false] + note_block[instrument=guitar,note=11,powered=true]: note_block[instrument=harp,note=11,powered=true] + note_block[instrument=guitar,note=11,powered=false]: note_block[instrument=harp,note=11,powered=false] + note_block[instrument=guitar,note=12,powered=true]: note_block[instrument=harp,note=12,powered=true] + note_block[instrument=guitar,note=12,powered=false]: note_block[instrument=harp,note=12,powered=false] + note_block[instrument=guitar,note=13,powered=true]: note_block[instrument=harp,note=13,powered=true] + note_block[instrument=guitar,note=13,powered=false]: note_block[instrument=harp,note=13,powered=false] + note_block[instrument=guitar,note=14,powered=true]: note_block[instrument=harp,note=14,powered=true] + note_block[instrument=guitar,note=14,powered=false]: note_block[instrument=harp,note=14,powered=false] + note_block[instrument=guitar,note=15,powered=true]: note_block[instrument=harp,note=15,powered=true] + note_block[instrument=guitar,note=15,powered=false]: note_block[instrument=harp,note=15,powered=false] + note_block[instrument=guitar,note=16,powered=true]: note_block[instrument=harp,note=16,powered=true] + note_block[instrument=guitar,note=16,powered=false]: note_block[instrument=harp,note=16,powered=false] + note_block[instrument=guitar,note=17,powered=true]: note_block[instrument=harp,note=17,powered=true] + note_block[instrument=guitar,note=17,powered=false]: note_block[instrument=harp,note=17,powered=false] + note_block[instrument=guitar,note=18,powered=true]: note_block[instrument=harp,note=18,powered=true] + note_block[instrument=guitar,note=18,powered=false]: note_block[instrument=harp,note=18,powered=false] + note_block[instrument=guitar,note=19,powered=true]: note_block[instrument=harp,note=19,powered=true] + note_block[instrument=guitar,note=19,powered=false]: note_block[instrument=harp,note=19,powered=false] + note_block[instrument=guitar,note=20,powered=true]: note_block[instrument=harp,note=20,powered=true] + note_block[instrument=guitar,note=20,powered=false]: note_block[instrument=harp,note=20,powered=false] + note_block[instrument=guitar,note=21,powered=true]: note_block[instrument=harp,note=21,powered=true] + note_block[instrument=guitar,note=21,powered=false]: note_block[instrument=harp,note=21,powered=false] + note_block[instrument=guitar,note=22,powered=true]: note_block[instrument=harp,note=22,powered=true] + note_block[instrument=guitar,note=22,powered=false]: note_block[instrument=harp,note=22,powered=false] + note_block[instrument=guitar,note=23,powered=true]: note_block[instrument=harp,note=23,powered=true] + note_block[instrument=guitar,note=23,powered=false]: note_block[instrument=harp,note=23,powered=false] + note_block[instrument=guitar,note=24,powered=true]: note_block[instrument=harp,note=24,powered=true] + note_block[instrument=guitar,note=24,powered=false]: note_block[instrument=harp,note=24,powered=false] + note_block[instrument=chime,note=0,powered=true]: note_block[instrument=harp,note=0,powered=true] + note_block[instrument=chime,note=0,powered=false]: note_block[instrument=harp,note=0,powered=false] + note_block[instrument=chime,note=1,powered=true]: note_block[instrument=harp,note=1,powered=true] + note_block[instrument=chime,note=1,powered=false]: note_block[instrument=harp,note=1,powered=false] + note_block[instrument=chime,note=2,powered=true]: note_block[instrument=harp,note=2,powered=true] + note_block[instrument=chime,note=2,powered=false]: note_block[instrument=harp,note=2,powered=false] + note_block[instrument=chime,note=3,powered=true]: note_block[instrument=harp,note=3,powered=true] + note_block[instrument=chime,note=3,powered=false]: note_block[instrument=harp,note=3,powered=false] + note_block[instrument=chime,note=4,powered=true]: note_block[instrument=harp,note=4,powered=true] + note_block[instrument=chime,note=4,powered=false]: note_block[instrument=harp,note=4,powered=false] + note_block[instrument=chime,note=5,powered=true]: note_block[instrument=harp,note=5,powered=true] + note_block[instrument=chime,note=5,powered=false]: note_block[instrument=harp,note=5,powered=false] + note_block[instrument=chime,note=6,powered=true]: note_block[instrument=harp,note=6,powered=true] + note_block[instrument=chime,note=6,powered=false]: note_block[instrument=harp,note=6,powered=false] + note_block[instrument=chime,note=7,powered=true]: note_block[instrument=harp,note=7,powered=true] + note_block[instrument=chime,note=7,powered=false]: note_block[instrument=harp,note=7,powered=false] + note_block[instrument=chime,note=8,powered=true]: note_block[instrument=harp,note=8,powered=true] + note_block[instrument=chime,note=8,powered=false]: note_block[instrument=harp,note=8,powered=false] + note_block[instrument=chime,note=9,powered=true]: note_block[instrument=harp,note=9,powered=true] + note_block[instrument=chime,note=9,powered=false]: note_block[instrument=harp,note=9,powered=false] + note_block[instrument=chime,note=10,powered=true]: note_block[instrument=harp,note=10,powered=true] + note_block[instrument=chime,note=10,powered=false]: note_block[instrument=harp,note=10,powered=false] + note_block[instrument=chime,note=11,powered=true]: note_block[instrument=harp,note=11,powered=true] + note_block[instrument=chime,note=11,powered=false]: note_block[instrument=harp,note=11,powered=false] + note_block[instrument=chime,note=12,powered=true]: note_block[instrument=harp,note=12,powered=true] + note_block[instrument=chime,note=12,powered=false]: note_block[instrument=harp,note=12,powered=false] + note_block[instrument=chime,note=13,powered=true]: note_block[instrument=harp,note=13,powered=true] + note_block[instrument=chime,note=13,powered=false]: note_block[instrument=harp,note=13,powered=false] + note_block[instrument=chime,note=14,powered=true]: note_block[instrument=harp,note=14,powered=true] + note_block[instrument=chime,note=14,powered=false]: note_block[instrument=harp,note=14,powered=false] + note_block[instrument=chime,note=15,powered=true]: note_block[instrument=harp,note=15,powered=true] + note_block[instrument=chime,note=15,powered=false]: note_block[instrument=harp,note=15,powered=false] + note_block[instrument=chime,note=16,powered=true]: note_block[instrument=harp,note=16,powered=true] + note_block[instrument=chime,note=16,powered=false]: note_block[instrument=harp,note=16,powered=false] + note_block[instrument=chime,note=17,powered=true]: note_block[instrument=harp,note=17,powered=true] + note_block[instrument=chime,note=17,powered=false]: note_block[instrument=harp,note=17,powered=false] + note_block[instrument=chime,note=18,powered=true]: note_block[instrument=harp,note=18,powered=true] + note_block[instrument=chime,note=18,powered=false]: note_block[instrument=harp,note=18,powered=false] + note_block[instrument=chime,note=19,powered=true]: note_block[instrument=harp,note=19,powered=true] + note_block[instrument=chime,note=19,powered=false]: note_block[instrument=harp,note=19,powered=false] + note_block[instrument=chime,note=20,powered=true]: note_block[instrument=harp,note=20,powered=true] + note_block[instrument=chime,note=20,powered=false]: note_block[instrument=harp,note=20,powered=false] + note_block[instrument=chime,note=21,powered=true]: note_block[instrument=harp,note=21,powered=true] + note_block[instrument=chime,note=21,powered=false]: note_block[instrument=harp,note=21,powered=false] + note_block[instrument=chime,note=22,powered=true]: note_block[instrument=harp,note=22,powered=true] + note_block[instrument=chime,note=22,powered=false]: note_block[instrument=harp,note=22,powered=false] + note_block[instrument=chime,note=23,powered=true]: note_block[instrument=harp,note=23,powered=true] + note_block[instrument=chime,note=23,powered=false]: note_block[instrument=harp,note=23,powered=false] + note_block[instrument=chime,note=24,powered=true]: note_block[instrument=harp,note=24,powered=true] + note_block[instrument=chime,note=24,powered=false]: note_block[instrument=harp,note=24,powered=false] + note_block[instrument=xylophone,note=0,powered=true]: note_block[instrument=harp,note=0,powered=true] + note_block[instrument=xylophone,note=0,powered=false]: note_block[instrument=harp,note=0,powered=false] + note_block[instrument=xylophone,note=1,powered=true]: note_block[instrument=harp,note=1,powered=true] + note_block[instrument=xylophone,note=1,powered=false]: note_block[instrument=harp,note=1,powered=false] + note_block[instrument=xylophone,note=2,powered=true]: note_block[instrument=harp,note=2,powered=true] + note_block[instrument=xylophone,note=2,powered=false]: note_block[instrument=harp,note=2,powered=false] + note_block[instrument=xylophone,note=3,powered=true]: note_block[instrument=harp,note=3,powered=true] + note_block[instrument=xylophone,note=3,powered=false]: note_block[instrument=harp,note=3,powered=false] + note_block[instrument=xylophone,note=4,powered=true]: note_block[instrument=harp,note=4,powered=true] + note_block[instrument=xylophone,note=4,powered=false]: note_block[instrument=harp,note=4,powered=false] + note_block[instrument=xylophone,note=5,powered=true]: note_block[instrument=harp,note=5,powered=true] + note_block[instrument=xylophone,note=5,powered=false]: note_block[instrument=harp,note=5,powered=false] + note_block[instrument=xylophone,note=6,powered=true]: note_block[instrument=harp,note=6,powered=true] + note_block[instrument=xylophone,note=6,powered=false]: note_block[instrument=harp,note=6,powered=false] + note_block[instrument=xylophone,note=7,powered=true]: note_block[instrument=harp,note=7,powered=true] + note_block[instrument=xylophone,note=7,powered=false]: note_block[instrument=harp,note=7,powered=false] + note_block[instrument=xylophone,note=8,powered=true]: note_block[instrument=harp,note=8,powered=true] + note_block[instrument=xylophone,note=8,powered=false]: note_block[instrument=harp,note=8,powered=false] + note_block[instrument=xylophone,note=9,powered=true]: note_block[instrument=harp,note=9,powered=true] + note_block[instrument=xylophone,note=9,powered=false]: note_block[instrument=harp,note=9,powered=false] + note_block[instrument=xylophone,note=10,powered=true]: note_block[instrument=harp,note=10,powered=true] + note_block[instrument=xylophone,note=10,powered=false]: note_block[instrument=harp,note=10,powered=false] + note_block[instrument=xylophone,note=11,powered=true]: note_block[instrument=harp,note=11,powered=true] + note_block[instrument=xylophone,note=11,powered=false]: note_block[instrument=harp,note=11,powered=false] + note_block[instrument=xylophone,note=12,powered=true]: note_block[instrument=harp,note=12,powered=true] + note_block[instrument=xylophone,note=12,powered=false]: note_block[instrument=harp,note=12,powered=false] + note_block[instrument=xylophone,note=13,powered=true]: note_block[instrument=harp,note=13,powered=true] + note_block[instrument=xylophone,note=13,powered=false]: note_block[instrument=harp,note=13,powered=false] + note_block[instrument=xylophone,note=14,powered=true]: note_block[instrument=harp,note=14,powered=true] + note_block[instrument=xylophone,note=14,powered=false]: note_block[instrument=harp,note=14,powered=false] + note_block[instrument=xylophone,note=15,powered=true]: note_block[instrument=harp,note=15,powered=true] + note_block[instrument=xylophone,note=15,powered=false]: note_block[instrument=harp,note=15,powered=false] + note_block[instrument=xylophone,note=16,powered=true]: note_block[instrument=harp,note=16,powered=true] + note_block[instrument=xylophone,note=16,powered=false]: note_block[instrument=harp,note=16,powered=false] + note_block[instrument=xylophone,note=17,powered=true]: note_block[instrument=harp,note=17,powered=true] + note_block[instrument=xylophone,note=17,powered=false]: note_block[instrument=harp,note=17,powered=false] + note_block[instrument=xylophone,note=18,powered=true]: note_block[instrument=harp,note=18,powered=true] + note_block[instrument=xylophone,note=18,powered=false]: note_block[instrument=harp,note=18,powered=false] + note_block[instrument=xylophone,note=19,powered=true]: note_block[instrument=harp,note=19,powered=true] + note_block[instrument=xylophone,note=19,powered=false]: note_block[instrument=harp,note=19,powered=false] + note_block[instrument=xylophone,note=20,powered=true]: note_block[instrument=harp,note=20,powered=true] + note_block[instrument=xylophone,note=20,powered=false]: note_block[instrument=harp,note=20,powered=false] + note_block[instrument=xylophone,note=21,powered=true]: note_block[instrument=harp,note=21,powered=true] + note_block[instrument=xylophone,note=21,powered=false]: note_block[instrument=harp,note=21,powered=false] + note_block[instrument=xylophone,note=22,powered=true]: note_block[instrument=harp,note=22,powered=true] + note_block[instrument=xylophone,note=22,powered=false]: note_block[instrument=harp,note=22,powered=false] + note_block[instrument=xylophone,note=23,powered=true]: note_block[instrument=harp,note=23,powered=true] + note_block[instrument=xylophone,note=23,powered=false]: note_block[instrument=harp,note=23,powered=false] + note_block[instrument=xylophone,note=24,powered=true]: note_block[instrument=harp,note=24,powered=true] + note_block[instrument=xylophone,note=24,powered=false]: note_block[instrument=harp,note=24,powered=false] + note_block[instrument=iron_xylophone,note=0,powered=true]: note_block[instrument=harp,note=0,powered=true] + note_block[instrument=iron_xylophone,note=0,powered=false]: note_block[instrument=harp,note=0,powered=false] + note_block[instrument=iron_xylophone,note=1,powered=true]: note_block[instrument=harp,note=1,powered=true] + note_block[instrument=iron_xylophone,note=1,powered=false]: note_block[instrument=harp,note=1,powered=false] + note_block[instrument=iron_xylophone,note=2,powered=true]: note_block[instrument=harp,note=2,powered=true] + note_block[instrument=iron_xylophone,note=2,powered=false]: note_block[instrument=harp,note=2,powered=false] + note_block[instrument=iron_xylophone,note=3,powered=true]: note_block[instrument=harp,note=3,powered=true] + note_block[instrument=iron_xylophone,note=3,powered=false]: note_block[instrument=harp,note=3,powered=false] + note_block[instrument=iron_xylophone,note=4,powered=true]: note_block[instrument=harp,note=4,powered=true] + note_block[instrument=iron_xylophone,note=4,powered=false]: note_block[instrument=harp,note=4,powered=false] + note_block[instrument=iron_xylophone,note=5,powered=true]: note_block[instrument=harp,note=5,powered=true] + note_block[instrument=iron_xylophone,note=5,powered=false]: note_block[instrument=harp,note=5,powered=false] + note_block[instrument=iron_xylophone,note=6,powered=true]: note_block[instrument=harp,note=6,powered=true] + note_block[instrument=iron_xylophone,note=6,powered=false]: note_block[instrument=harp,note=6,powered=false] + note_block[instrument=iron_xylophone,note=7,powered=true]: note_block[instrument=harp,note=7,powered=true] + note_block[instrument=iron_xylophone,note=7,powered=false]: note_block[instrument=harp,note=7,powered=false] + note_block[instrument=iron_xylophone,note=8,powered=true]: note_block[instrument=harp,note=8,powered=true] + note_block[instrument=iron_xylophone,note=8,powered=false]: note_block[instrument=harp,note=8,powered=false] + note_block[instrument=iron_xylophone,note=9,powered=true]: note_block[instrument=harp,note=9,powered=true] + note_block[instrument=iron_xylophone,note=9,powered=false]: note_block[instrument=harp,note=9,powered=false] + note_block[instrument=iron_xylophone,note=10,powered=true]: note_block[instrument=harp,note=10,powered=true] + note_block[instrument=iron_xylophone,note=10,powered=false]: note_block[instrument=harp,note=10,powered=false] + note_block[instrument=iron_xylophone,note=11,powered=true]: note_block[instrument=harp,note=11,powered=true] + note_block[instrument=iron_xylophone,note=11,powered=false]: note_block[instrument=harp,note=11,powered=false] + note_block[instrument=iron_xylophone,note=12,powered=true]: note_block[instrument=harp,note=12,powered=true] + note_block[instrument=iron_xylophone,note=12,powered=false]: note_block[instrument=harp,note=12,powered=false] + note_block[instrument=iron_xylophone,note=13,powered=true]: note_block[instrument=harp,note=13,powered=true] + note_block[instrument=iron_xylophone,note=13,powered=false]: note_block[instrument=harp,note=13,powered=false] + note_block[instrument=iron_xylophone,note=14,powered=true]: note_block[instrument=harp,note=14,powered=true] + note_block[instrument=iron_xylophone,note=14,powered=false]: note_block[instrument=harp,note=14,powered=false] + note_block[instrument=iron_xylophone,note=15,powered=true]: note_block[instrument=harp,note=15,powered=true] + note_block[instrument=iron_xylophone,note=15,powered=false]: note_block[instrument=harp,note=15,powered=false] + note_block[instrument=iron_xylophone,note=16,powered=true]: note_block[instrument=harp,note=16,powered=true] + note_block[instrument=iron_xylophone,note=16,powered=false]: note_block[instrument=harp,note=16,powered=false] + note_block[instrument=iron_xylophone,note=17,powered=true]: note_block[instrument=harp,note=17,powered=true] + note_block[instrument=iron_xylophone,note=17,powered=false]: note_block[instrument=harp,note=17,powered=false] + note_block[instrument=iron_xylophone,note=18,powered=true]: note_block[instrument=harp,note=18,powered=true] + note_block[instrument=iron_xylophone,note=18,powered=false]: note_block[instrument=harp,note=18,powered=false] + note_block[instrument=iron_xylophone,note=19,powered=true]: note_block[instrument=harp,note=19,powered=true] + note_block[instrument=iron_xylophone,note=19,powered=false]: note_block[instrument=harp,note=19,powered=false] + note_block[instrument=iron_xylophone,note=20,powered=true]: note_block[instrument=harp,note=20,powered=true] + note_block[instrument=iron_xylophone,note=20,powered=false]: note_block[instrument=harp,note=20,powered=false] + note_block[instrument=iron_xylophone,note=21,powered=true]: note_block[instrument=harp,note=21,powered=true] + note_block[instrument=iron_xylophone,note=21,powered=false]: note_block[instrument=harp,note=21,powered=false] + note_block[instrument=iron_xylophone,note=22,powered=true]: note_block[instrument=harp,note=22,powered=true] + note_block[instrument=iron_xylophone,note=22,powered=false]: note_block[instrument=harp,note=22,powered=false] + note_block[instrument=iron_xylophone,note=23,powered=true]: note_block[instrument=harp,note=23,powered=true] + note_block[instrument=iron_xylophone,note=23,powered=false]: note_block[instrument=harp,note=23,powered=false] + note_block[instrument=iron_xylophone,note=24,powered=true]: note_block[instrument=harp,note=24,powered=true] + note_block[instrument=iron_xylophone,note=24,powered=false]: note_block[instrument=harp,note=24,powered=false] + note_block[instrument=cow_bell,note=0,powered=true]: note_block[instrument=harp,note=0,powered=true] + note_block[instrument=cow_bell,note=0,powered=false]: note_block[instrument=harp,note=0,powered=false] + note_block[instrument=cow_bell,note=1,powered=true]: note_block[instrument=harp,note=1,powered=true] + note_block[instrument=cow_bell,note=1,powered=false]: note_block[instrument=harp,note=1,powered=false] + note_block[instrument=cow_bell,note=2,powered=true]: note_block[instrument=harp,note=2,powered=true] + note_block[instrument=cow_bell,note=2,powered=false]: note_block[instrument=harp,note=2,powered=false] + note_block[instrument=cow_bell,note=3,powered=true]: note_block[instrument=harp,note=3,powered=true] + note_block[instrument=cow_bell,note=3,powered=false]: note_block[instrument=harp,note=3,powered=false] + note_block[instrument=cow_bell,note=4,powered=true]: note_block[instrument=harp,note=4,powered=true] + note_block[instrument=cow_bell,note=4,powered=false]: note_block[instrument=harp,note=4,powered=false] + note_block[instrument=cow_bell,note=5,powered=true]: note_block[instrument=harp,note=5,powered=true] + note_block[instrument=cow_bell,note=5,powered=false]: note_block[instrument=harp,note=5,powered=false] + note_block[instrument=cow_bell,note=6,powered=true]: note_block[instrument=harp,note=6,powered=true] + note_block[instrument=cow_bell,note=6,powered=false]: note_block[instrument=harp,note=6,powered=false] + note_block[instrument=cow_bell,note=7,powered=true]: note_block[instrument=harp,note=7,powered=true] + note_block[instrument=cow_bell,note=7,powered=false]: note_block[instrument=harp,note=7,powered=false] + note_block[instrument=cow_bell,note=8,powered=true]: note_block[instrument=harp,note=8,powered=true] + note_block[instrument=cow_bell,note=8,powered=false]: note_block[instrument=harp,note=8,powered=false] + note_block[instrument=cow_bell,note=9,powered=true]: note_block[instrument=harp,note=9,powered=true] + note_block[instrument=cow_bell,note=9,powered=false]: note_block[instrument=harp,note=9,powered=false] + note_block[instrument=cow_bell,note=10,powered=true]: note_block[instrument=harp,note=10,powered=true] + note_block[instrument=cow_bell,note=10,powered=false]: note_block[instrument=harp,note=10,powered=false] + note_block[instrument=cow_bell,note=11,powered=true]: note_block[instrument=harp,note=11,powered=true] + note_block[instrument=cow_bell,note=11,powered=false]: note_block[instrument=harp,note=11,powered=false] + note_block[instrument=cow_bell,note=12,powered=true]: note_block[instrument=harp,note=12,powered=true] + note_block[instrument=cow_bell,note=12,powered=false]: note_block[instrument=harp,note=12,powered=false] + note_block[instrument=cow_bell,note=13,powered=true]: note_block[instrument=harp,note=13,powered=true] + note_block[instrument=cow_bell,note=13,powered=false]: note_block[instrument=harp,note=13,powered=false] + note_block[instrument=cow_bell,note=14,powered=true]: note_block[instrument=harp,note=14,powered=true] + note_block[instrument=cow_bell,note=14,powered=false]: note_block[instrument=harp,note=14,powered=false] + note_block[instrument=cow_bell,note=15,powered=true]: note_block[instrument=harp,note=15,powered=true] + note_block[instrument=cow_bell,note=15,powered=false]: note_block[instrument=harp,note=15,powered=false] + note_block[instrument=cow_bell,note=16,powered=true]: note_block[instrument=harp,note=16,powered=true] + note_block[instrument=cow_bell,note=16,powered=false]: note_block[instrument=harp,note=16,powered=false] + note_block[instrument=cow_bell,note=17,powered=true]: note_block[instrument=harp,note=17,powered=true] + note_block[instrument=cow_bell,note=17,powered=false]: note_block[instrument=harp,note=17,powered=false] + note_block[instrument=cow_bell,note=18,powered=true]: note_block[instrument=harp,note=18,powered=true] + note_block[instrument=cow_bell,note=18,powered=false]: note_block[instrument=harp,note=18,powered=false] + note_block[instrument=cow_bell,note=19,powered=true]: note_block[instrument=harp,note=19,powered=true] + note_block[instrument=cow_bell,note=19,powered=false]: note_block[instrument=harp,note=19,powered=false] + note_block[instrument=cow_bell,note=20,powered=true]: note_block[instrument=harp,note=20,powered=true] + note_block[instrument=cow_bell,note=20,powered=false]: note_block[instrument=harp,note=20,powered=false] + note_block[instrument=cow_bell,note=21,powered=true]: note_block[instrument=harp,note=21,powered=true] + note_block[instrument=cow_bell,note=21,powered=false]: note_block[instrument=harp,note=21,powered=false] + note_block[instrument=cow_bell,note=22,powered=true]: note_block[instrument=harp,note=22,powered=true] + note_block[instrument=cow_bell,note=22,powered=false]: note_block[instrument=harp,note=22,powered=false] + note_block[instrument=cow_bell,note=23,powered=true]: note_block[instrument=harp,note=23,powered=true] + note_block[instrument=cow_bell,note=23,powered=false]: note_block[instrument=harp,note=23,powered=false] + note_block[instrument=cow_bell,note=24,powered=true]: note_block[instrument=harp,note=24,powered=true] + note_block[instrument=cow_bell,note=24,powered=false]: note_block[instrument=harp,note=24,powered=false] + note_block[instrument=didgeridoo,note=0,powered=true]: note_block[instrument=harp,note=0,powered=true] + note_block[instrument=didgeridoo,note=0,powered=false]: note_block[instrument=harp,note=0,powered=false] + note_block[instrument=didgeridoo,note=1,powered=true]: note_block[instrument=harp,note=1,powered=true] + note_block[instrument=didgeridoo,note=1,powered=false]: note_block[instrument=harp,note=1,powered=false] + note_block[instrument=didgeridoo,note=2,powered=true]: note_block[instrument=harp,note=2,powered=true] + note_block[instrument=didgeridoo,note=2,powered=false]: note_block[instrument=harp,note=2,powered=false] + note_block[instrument=didgeridoo,note=3,powered=true]: note_block[instrument=harp,note=3,powered=true] + note_block[instrument=didgeridoo,note=3,powered=false]: note_block[instrument=harp,note=3,powered=false] + note_block[instrument=didgeridoo,note=4,powered=true]: note_block[instrument=harp,note=4,powered=true] + note_block[instrument=didgeridoo,note=4,powered=false]: note_block[instrument=harp,note=4,powered=false] + note_block[instrument=didgeridoo,note=5,powered=true]: note_block[instrument=harp,note=5,powered=true] + note_block[instrument=didgeridoo,note=5,powered=false]: note_block[instrument=harp,note=5,powered=false] + note_block[instrument=didgeridoo,note=6,powered=true]: note_block[instrument=harp,note=6,powered=true] + note_block[instrument=didgeridoo,note=6,powered=false]: note_block[instrument=harp,note=6,powered=false] + note_block[instrument=didgeridoo,note=7,powered=true]: note_block[instrument=harp,note=7,powered=true] + note_block[instrument=didgeridoo,note=7,powered=false]: note_block[instrument=harp,note=7,powered=false] + note_block[instrument=didgeridoo,note=8,powered=true]: note_block[instrument=harp,note=8,powered=true] + note_block[instrument=didgeridoo,note=8,powered=false]: note_block[instrument=harp,note=8,powered=false] + note_block[instrument=didgeridoo,note=9,powered=true]: note_block[instrument=harp,note=9,powered=true] + note_block[instrument=didgeridoo,note=9,powered=false]: note_block[instrument=harp,note=9,powered=false] + note_block[instrument=didgeridoo,note=10,powered=true]: note_block[instrument=harp,note=10,powered=true] + note_block[instrument=didgeridoo,note=10,powered=false]: note_block[instrument=harp,note=10,powered=false] + note_block[instrument=didgeridoo,note=11,powered=true]: note_block[instrument=harp,note=11,powered=true] + note_block[instrument=didgeridoo,note=11,powered=false]: note_block[instrument=harp,note=11,powered=false] + note_block[instrument=didgeridoo,note=12,powered=true]: note_block[instrument=harp,note=12,powered=true] + note_block[instrument=didgeridoo,note=12,powered=false]: note_block[instrument=harp,note=12,powered=false] + note_block[instrument=didgeridoo,note=13,powered=true]: note_block[instrument=harp,note=13,powered=true] + note_block[instrument=didgeridoo,note=13,powered=false]: note_block[instrument=harp,note=13,powered=false] + note_block[instrument=didgeridoo,note=14,powered=true]: note_block[instrument=harp,note=14,powered=true] + note_block[instrument=didgeridoo,note=14,powered=false]: note_block[instrument=harp,note=14,powered=false] + note_block[instrument=didgeridoo,note=15,powered=true]: note_block[instrument=harp,note=15,powered=true] + note_block[instrument=didgeridoo,note=15,powered=false]: note_block[instrument=harp,note=15,powered=false] + note_block[instrument=didgeridoo,note=16,powered=true]: note_block[instrument=harp,note=16,powered=true] + note_block[instrument=didgeridoo,note=16,powered=false]: note_block[instrument=harp,note=16,powered=false] + note_block[instrument=didgeridoo,note=17,powered=true]: note_block[instrument=harp,note=17,powered=true] + note_block[instrument=didgeridoo,note=17,powered=false]: note_block[instrument=harp,note=17,powered=false] + note_block[instrument=didgeridoo,note=18,powered=true]: note_block[instrument=harp,note=18,powered=true] + note_block[instrument=didgeridoo,note=18,powered=false]: note_block[instrument=harp,note=18,powered=false] + note_block[instrument=didgeridoo,note=19,powered=true]: note_block[instrument=harp,note=19,powered=true] + note_block[instrument=didgeridoo,note=19,powered=false]: note_block[instrument=harp,note=19,powered=false] + note_block[instrument=didgeridoo,note=20,powered=true]: note_block[instrument=harp,note=20,powered=true] + note_block[instrument=didgeridoo,note=20,powered=false]: note_block[instrument=harp,note=20,powered=false] + note_block[instrument=didgeridoo,note=21,powered=true]: note_block[instrument=harp,note=21,powered=true] + note_block[instrument=didgeridoo,note=21,powered=false]: note_block[instrument=harp,note=21,powered=false] + note_block[instrument=didgeridoo,note=22,powered=true]: note_block[instrument=harp,note=22,powered=true] + note_block[instrument=didgeridoo,note=22,powered=false]: note_block[instrument=harp,note=22,powered=false] + note_block[instrument=didgeridoo,note=23,powered=true]: note_block[instrument=harp,note=23,powered=true] + note_block[instrument=didgeridoo,note=23,powered=false]: note_block[instrument=harp,note=23,powered=false] + note_block[instrument=didgeridoo,note=24,powered=true]: note_block[instrument=harp,note=24,powered=true] + note_block[instrument=didgeridoo,note=24,powered=false]: note_block[instrument=harp,note=24,powered=false] + note_block[instrument=bit,note=0,powered=true]: note_block[instrument=harp,note=0,powered=true] + note_block[instrument=bit,note=0,powered=false]: note_block[instrument=harp,note=0,powered=false] + note_block[instrument=bit,note=1,powered=true]: note_block[instrument=harp,note=1,powered=true] + note_block[instrument=bit,note=1,powered=false]: note_block[instrument=harp,note=1,powered=false] + note_block[instrument=bit,note=2,powered=true]: note_block[instrument=harp,note=2,powered=true] + note_block[instrument=bit,note=2,powered=false]: note_block[instrument=harp,note=2,powered=false] + note_block[instrument=bit,note=3,powered=true]: note_block[instrument=harp,note=3,powered=true] + note_block[instrument=bit,note=3,powered=false]: note_block[instrument=harp,note=3,powered=false] + note_block[instrument=bit,note=4,powered=true]: note_block[instrument=harp,note=4,powered=true] + note_block[instrument=bit,note=4,powered=false]: note_block[instrument=harp,note=4,powered=false] + note_block[instrument=bit,note=5,powered=true]: note_block[instrument=harp,note=5,powered=true] + note_block[instrument=bit,note=5,powered=false]: note_block[instrument=harp,note=5,powered=false] + note_block[instrument=bit,note=6,powered=true]: note_block[instrument=harp,note=6,powered=true] + note_block[instrument=bit,note=6,powered=false]: note_block[instrument=harp,note=6,powered=false] + note_block[instrument=bit,note=7,powered=true]: note_block[instrument=harp,note=7,powered=true] + note_block[instrument=bit,note=7,powered=false]: note_block[instrument=harp,note=7,powered=false] + note_block[instrument=bit,note=8,powered=true]: note_block[instrument=harp,note=8,powered=true] + note_block[instrument=bit,note=8,powered=false]: note_block[instrument=harp,note=8,powered=false] + note_block[instrument=bit,note=9,powered=true]: note_block[instrument=harp,note=9,powered=true] + note_block[instrument=bit,note=9,powered=false]: note_block[instrument=harp,note=9,powered=false] + note_block[instrument=bit,note=10,powered=true]: note_block[instrument=harp,note=10,powered=true] + note_block[instrument=bit,note=10,powered=false]: note_block[instrument=harp,note=10,powered=false] + note_block[instrument=bit,note=11,powered=true]: note_block[instrument=harp,note=11,powered=true] + note_block[instrument=bit,note=11,powered=false]: note_block[instrument=harp,note=11,powered=false] + note_block[instrument=bit,note=12,powered=true]: note_block[instrument=harp,note=12,powered=true] + note_block[instrument=bit,note=12,powered=false]: note_block[instrument=harp,note=12,powered=false] + note_block[instrument=bit,note=13,powered=true]: note_block[instrument=harp,note=13,powered=true] + note_block[instrument=bit,note=13,powered=false]: note_block[instrument=harp,note=13,powered=false] + note_block[instrument=bit,note=14,powered=true]: note_block[instrument=harp,note=14,powered=true] + note_block[instrument=bit,note=14,powered=false]: note_block[instrument=harp,note=14,powered=false] + note_block[instrument=bit,note=15,powered=true]: note_block[instrument=harp,note=15,powered=true] + note_block[instrument=bit,note=15,powered=false]: note_block[instrument=harp,note=15,powered=false] + note_block[instrument=bit,note=16,powered=true]: note_block[instrument=harp,note=16,powered=true] + note_block[instrument=bit,note=16,powered=false]: note_block[instrument=harp,note=16,powered=false] + note_block[instrument=bit,note=17,powered=true]: note_block[instrument=harp,note=17,powered=true] + note_block[instrument=bit,note=17,powered=false]: note_block[instrument=harp,note=17,powered=false] + note_block[instrument=bit,note=18,powered=true]: note_block[instrument=harp,note=18,powered=true] + note_block[instrument=bit,note=18,powered=false]: note_block[instrument=harp,note=18,powered=false] + note_block[instrument=bit,note=19,powered=true]: note_block[instrument=harp,note=19,powered=true] + note_block[instrument=bit,note=19,powered=false]: note_block[instrument=harp,note=19,powered=false] + note_block[instrument=bit,note=20,powered=true]: note_block[instrument=harp,note=20,powered=true] + note_block[instrument=bit,note=20,powered=false]: note_block[instrument=harp,note=20,powered=false] + note_block[instrument=bit,note=21,powered=true]: note_block[instrument=harp,note=21,powered=true] + note_block[instrument=bit,note=21,powered=false]: note_block[instrument=harp,note=21,powered=false] + note_block[instrument=bit,note=22,powered=true]: note_block[instrument=harp,note=22,powered=true] + note_block[instrument=bit,note=22,powered=false]: note_block[instrument=harp,note=22,powered=false] + note_block[instrument=bit,note=23,powered=true]: note_block[instrument=harp,note=23,powered=true] + note_block[instrument=bit,note=23,powered=false]: note_block[instrument=harp,note=23,powered=false] + note_block[instrument=bit,note=24,powered=true]: note_block[instrument=harp,note=24,powered=true] + note_block[instrument=bit,note=24,powered=false]: note_block[instrument=harp,note=24,powered=false] + note_block[instrument=banjo,note=0,powered=true]: note_block[instrument=harp,note=0,powered=true] + note_block[instrument=banjo,note=0,powered=false]: note_block[instrument=harp,note=0,powered=false] + note_block[instrument=banjo,note=1,powered=true]: note_block[instrument=harp,note=1,powered=true] + note_block[instrument=banjo,note=1,powered=false]: note_block[instrument=harp,note=1,powered=false] + note_block[instrument=banjo,note=2,powered=true]: note_block[instrument=harp,note=2,powered=true] + note_block[instrument=banjo,note=2,powered=false]: note_block[instrument=harp,note=2,powered=false] + note_block[instrument=banjo,note=3,powered=true]: note_block[instrument=harp,note=3,powered=true] + note_block[instrument=banjo,note=3,powered=false]: note_block[instrument=harp,note=3,powered=false] + note_block[instrument=banjo,note=4,powered=true]: note_block[instrument=harp,note=4,powered=true] + note_block[instrument=banjo,note=4,powered=false]: note_block[instrument=harp,note=4,powered=false] + note_block[instrument=banjo,note=5,powered=true]: note_block[instrument=harp,note=5,powered=true] + note_block[instrument=banjo,note=5,powered=false]: note_block[instrument=harp,note=5,powered=false] + note_block[instrument=banjo,note=6,powered=true]: note_block[instrument=harp,note=6,powered=true] + note_block[instrument=banjo,note=6,powered=false]: note_block[instrument=harp,note=6,powered=false] + note_block[instrument=banjo,note=7,powered=true]: note_block[instrument=harp,note=7,powered=true] + note_block[instrument=banjo,note=7,powered=false]: note_block[instrument=harp,note=7,powered=false] + note_block[instrument=banjo,note=8,powered=true]: note_block[instrument=harp,note=8,powered=true] + note_block[instrument=banjo,note=8,powered=false]: note_block[instrument=harp,note=8,powered=false] + note_block[instrument=banjo,note=9,powered=true]: note_block[instrument=harp,note=9,powered=true] + note_block[instrument=banjo,note=9,powered=false]: note_block[instrument=harp,note=9,powered=false] + note_block[instrument=banjo,note=10,powered=true]: note_block[instrument=harp,note=10,powered=true] + note_block[instrument=banjo,note=10,powered=false]: note_block[instrument=harp,note=10,powered=false] + note_block[instrument=banjo,note=11,powered=true]: note_block[instrument=harp,note=11,powered=true] + note_block[instrument=banjo,note=11,powered=false]: note_block[instrument=harp,note=11,powered=false] + note_block[instrument=banjo,note=12,powered=true]: note_block[instrument=harp,note=12,powered=true] + note_block[instrument=banjo,note=12,powered=false]: note_block[instrument=harp,note=12,powered=false] + note_block[instrument=banjo,note=13,powered=true]: note_block[instrument=harp,note=13,powered=true] + note_block[instrument=banjo,note=13,powered=false]: note_block[instrument=harp,note=13,powered=false] + note_block[instrument=banjo,note=14,powered=true]: note_block[instrument=harp,note=14,powered=true] + note_block[instrument=banjo,note=14,powered=false]: note_block[instrument=harp,note=14,powered=false] + note_block[instrument=banjo,note=15,powered=true]: note_block[instrument=harp,note=15,powered=true] + note_block[instrument=banjo,note=15,powered=false]: note_block[instrument=harp,note=15,powered=false] + note_block[instrument=banjo,note=16,powered=true]: note_block[instrument=harp,note=16,powered=true] + note_block[instrument=banjo,note=16,powered=false]: note_block[instrument=harp,note=16,powered=false] + note_block[instrument=banjo,note=17,powered=true]: note_block[instrument=harp,note=17,powered=true] + note_block[instrument=banjo,note=17,powered=false]: note_block[instrument=harp,note=17,powered=false] + note_block[instrument=banjo,note=18,powered=true]: note_block[instrument=harp,note=18,powered=true] + note_block[instrument=banjo,note=18,powered=false]: note_block[instrument=harp,note=18,powered=false] + note_block[instrument=banjo,note=19,powered=true]: note_block[instrument=harp,note=19,powered=true] + note_block[instrument=banjo,note=19,powered=false]: note_block[instrument=harp,note=19,powered=false] + note_block[instrument=banjo,note=20,powered=true]: note_block[instrument=harp,note=20,powered=true] + note_block[instrument=banjo,note=20,powered=false]: note_block[instrument=harp,note=20,powered=false] + note_block[instrument=banjo,note=21,powered=true]: note_block[instrument=harp,note=21,powered=true] + note_block[instrument=banjo,note=21,powered=false]: note_block[instrument=harp,note=21,powered=false] + note_block[instrument=banjo,note=22,powered=true]: note_block[instrument=harp,note=22,powered=true] + note_block[instrument=banjo,note=22,powered=false]: note_block[instrument=harp,note=22,powered=false] + note_block[instrument=banjo,note=23,powered=true]: note_block[instrument=harp,note=23,powered=true] + note_block[instrument=banjo,note=23,powered=false]: note_block[instrument=harp,note=23,powered=false] + note_block[instrument=banjo,note=24,powered=true]: note_block[instrument=harp,note=24,powered=true] + note_block[instrument=banjo,note=24,powered=false]: note_block[instrument=harp,note=24,powered=false] + note_block[instrument=pling,note=0,powered=true]: note_block[instrument=harp,note=0,powered=true] + note_block[instrument=pling,note=0,powered=false]: note_block[instrument=harp,note=0,powered=false] + note_block[instrument=pling,note=1,powered=true]: note_block[instrument=harp,note=1,powered=true] + note_block[instrument=pling,note=1,powered=false]: note_block[instrument=harp,note=1,powered=false] + note_block[instrument=pling,note=2,powered=true]: note_block[instrument=harp,note=2,powered=true] + note_block[instrument=pling,note=2,powered=false]: note_block[instrument=harp,note=2,powered=false] + note_block[instrument=pling,note=3,powered=true]: note_block[instrument=harp,note=3,powered=true] + note_block[instrument=pling,note=3,powered=false]: note_block[instrument=harp,note=3,powered=false] + note_block[instrument=pling,note=4,powered=true]: note_block[instrument=harp,note=4,powered=true] + note_block[instrument=pling,note=4,powered=false]: note_block[instrument=harp,note=4,powered=false] + note_block[instrument=pling,note=5,powered=true]: note_block[instrument=harp,note=5,powered=true] + note_block[instrument=pling,note=5,powered=false]: note_block[instrument=harp,note=5,powered=false] + note_block[instrument=pling,note=6,powered=true]: note_block[instrument=harp,note=6,powered=true] + note_block[instrument=pling,note=6,powered=false]: note_block[instrument=harp,note=6,powered=false] + note_block[instrument=pling,note=7,powered=true]: note_block[instrument=harp,note=7,powered=true] + note_block[instrument=pling,note=7,powered=false]: note_block[instrument=harp,note=7,powered=false] + note_block[instrument=pling,note=8,powered=true]: note_block[instrument=harp,note=8,powered=true] + note_block[instrument=pling,note=8,powered=false]: note_block[instrument=harp,note=8,powered=false] + note_block[instrument=pling,note=9,powered=true]: note_block[instrument=harp,note=9,powered=true] + note_block[instrument=pling,note=9,powered=false]: note_block[instrument=harp,note=9,powered=false] + note_block[instrument=pling,note=10,powered=true]: note_block[instrument=harp,note=10,powered=true] + note_block[instrument=pling,note=10,powered=false]: note_block[instrument=harp,note=10,powered=false] + note_block[instrument=pling,note=11,powered=true]: note_block[instrument=harp,note=11,powered=true] + note_block[instrument=pling,note=11,powered=false]: note_block[instrument=harp,note=11,powered=false] + note_block[instrument=pling,note=12,powered=true]: note_block[instrument=harp,note=12,powered=true] + note_block[instrument=pling,note=12,powered=false]: note_block[instrument=harp,note=12,powered=false] + note_block[instrument=pling,note=13,powered=true]: note_block[instrument=harp,note=13,powered=true] + note_block[instrument=pling,note=13,powered=false]: note_block[instrument=harp,note=13,powered=false] + note_block[instrument=pling,note=14,powered=true]: note_block[instrument=harp,note=14,powered=true] + note_block[instrument=pling,note=14,powered=false]: note_block[instrument=harp,note=14,powered=false] + note_block[instrument=pling,note=15,powered=true]: note_block[instrument=harp,note=15,powered=true] + note_block[instrument=pling,note=15,powered=false]: note_block[instrument=harp,note=15,powered=false] + note_block[instrument=pling,note=16,powered=true]: note_block[instrument=harp,note=16,powered=true] + note_block[instrument=pling,note=16,powered=false]: note_block[instrument=harp,note=16,powered=false] + note_block[instrument=pling,note=17,powered=true]: note_block[instrument=harp,note=17,powered=true] + note_block[instrument=pling,note=17,powered=false]: note_block[instrument=harp,note=17,powered=false] + note_block[instrument=pling,note=18,powered=true]: note_block[instrument=harp,note=18,powered=true] + note_block[instrument=pling,note=18,powered=false]: note_block[instrument=harp,note=18,powered=false] + note_block[instrument=pling,note=19,powered=true]: note_block[instrument=harp,note=19,powered=true] + note_block[instrument=pling,note=19,powered=false]: note_block[instrument=harp,note=19,powered=false] + note_block[instrument=pling,note=20,powered=true]: note_block[instrument=harp,note=20,powered=true] + note_block[instrument=pling,note=20,powered=false]: note_block[instrument=harp,note=20,powered=false] + note_block[instrument=pling,note=21,powered=true]: note_block[instrument=harp,note=21,powered=true] + note_block[instrument=pling,note=21,powered=false]: note_block[instrument=harp,note=21,powered=false] + note_block[instrument=pling,note=22,powered=true]: note_block[instrument=harp,note=22,powered=true] + note_block[instrument=pling,note=22,powered=false]: note_block[instrument=harp,note=22,powered=false] + note_block[instrument=pling,note=23,powered=true]: note_block[instrument=harp,note=23,powered=true] + note_block[instrument=pling,note=23,powered=false]: note_block[instrument=harp,note=23,powered=false] + note_block[instrument=pling,note=24,powered=true]: note_block[instrument=harp,note=24,powered=true] + note_block[instrument=pling,note=24,powered=false]: note_block[instrument=harp,note=24,powered=false] + note_block[instrument=zombie,note=0,powered=true]: note_block[instrument=harp,note=0,powered=true] + note_block[instrument=zombie,note=0,powered=false]: note_block[instrument=harp,note=0,powered=false] + note_block[instrument=zombie,note=1,powered=true]: note_block[instrument=harp,note=1,powered=true] + note_block[instrument=zombie,note=1,powered=false]: note_block[instrument=harp,note=1,powered=false] + note_block[instrument=zombie,note=2,powered=true]: note_block[instrument=harp,note=2,powered=true] + note_block[instrument=zombie,note=2,powered=false]: note_block[instrument=harp,note=2,powered=false] + note_block[instrument=zombie,note=3,powered=true]: note_block[instrument=harp,note=3,powered=true] + note_block[instrument=zombie,note=3,powered=false]: note_block[instrument=harp,note=3,powered=false] + note_block[instrument=zombie,note=4,powered=true]: note_block[instrument=harp,note=4,powered=true] + note_block[instrument=zombie,note=4,powered=false]: note_block[instrument=harp,note=4,powered=false] + note_block[instrument=zombie,note=5,powered=true]: note_block[instrument=harp,note=5,powered=true] + note_block[instrument=zombie,note=5,powered=false]: note_block[instrument=harp,note=5,powered=false] + note_block[instrument=zombie,note=6,powered=true]: note_block[instrument=harp,note=6,powered=true] + note_block[instrument=zombie,note=6,powered=false]: note_block[instrument=harp,note=6,powered=false] + note_block[instrument=zombie,note=7,powered=true]: note_block[instrument=harp,note=7,powered=true] + note_block[instrument=zombie,note=7,powered=false]: note_block[instrument=harp,note=7,powered=false] + note_block[instrument=zombie,note=8,powered=true]: note_block[instrument=harp,note=8,powered=true] + note_block[instrument=zombie,note=8,powered=false]: note_block[instrument=harp,note=8,powered=false] + note_block[instrument=zombie,note=9,powered=true]: note_block[instrument=harp,note=9,powered=true] + note_block[instrument=zombie,note=9,powered=false]: note_block[instrument=harp,note=9,powered=false] + note_block[instrument=zombie,note=10,powered=true]: note_block[instrument=harp,note=10,powered=true] + note_block[instrument=zombie,note=10,powered=false]: note_block[instrument=harp,note=10,powered=false] + note_block[instrument=zombie,note=11,powered=true]: note_block[instrument=harp,note=11,powered=true] + note_block[instrument=zombie,note=11,powered=false]: note_block[instrument=harp,note=11,powered=false] + note_block[instrument=zombie,note=12,powered=true]: note_block[instrument=harp,note=12,powered=true] + note_block[instrument=zombie,note=12,powered=false]: note_block[instrument=harp,note=12,powered=false] + note_block[instrument=zombie,note=13,powered=true]: note_block[instrument=harp,note=13,powered=true] + note_block[instrument=zombie,note=13,powered=false]: note_block[instrument=harp,note=13,powered=false] + note_block[instrument=zombie,note=14,powered=true]: note_block[instrument=harp,note=14,powered=true] + note_block[instrument=zombie,note=14,powered=false]: note_block[instrument=harp,note=14,powered=false] + note_block[instrument=zombie,note=15,powered=true]: note_block[instrument=harp,note=15,powered=true] + note_block[instrument=zombie,note=15,powered=false]: note_block[instrument=harp,note=15,powered=false] + note_block[instrument=zombie,note=16,powered=true]: note_block[instrument=harp,note=16,powered=true] + note_block[instrument=zombie,note=16,powered=false]: note_block[instrument=harp,note=16,powered=false] + note_block[instrument=zombie,note=17,powered=true]: note_block[instrument=harp,note=17,powered=true] + note_block[instrument=zombie,note=17,powered=false]: note_block[instrument=harp,note=17,powered=false] + note_block[instrument=zombie,note=18,powered=true]: note_block[instrument=harp,note=18,powered=true] + note_block[instrument=zombie,note=18,powered=false]: note_block[instrument=harp,note=18,powered=false] + note_block[instrument=zombie,note=19,powered=true]: note_block[instrument=harp,note=19,powered=true] + note_block[instrument=zombie,note=19,powered=false]: note_block[instrument=harp,note=19,powered=false] + note_block[instrument=zombie,note=20,powered=true]: note_block[instrument=harp,note=20,powered=true] + note_block[instrument=zombie,note=20,powered=false]: note_block[instrument=harp,note=20,powered=false] + note_block[instrument=zombie,note=21,powered=true]: note_block[instrument=harp,note=21,powered=true] + note_block[instrument=zombie,note=21,powered=false]: note_block[instrument=harp,note=21,powered=false] + note_block[instrument=zombie,note=22,powered=true]: note_block[instrument=harp,note=22,powered=true] + note_block[instrument=zombie,note=22,powered=false]: note_block[instrument=harp,note=22,powered=false] + note_block[instrument=zombie,note=23,powered=true]: note_block[instrument=harp,note=23,powered=true] + note_block[instrument=zombie,note=23,powered=false]: note_block[instrument=harp,note=23,powered=false] + note_block[instrument=zombie,note=24,powered=true]: note_block[instrument=harp,note=24,powered=true] + note_block[instrument=zombie,note=24,powered=false]: note_block[instrument=harp,note=24,powered=false] + note_block[instrument=skeleton,note=0,powered=true]: note_block[instrument=harp,note=0,powered=true] + note_block[instrument=skeleton,note=0,powered=false]: note_block[instrument=harp,note=0,powered=false] + note_block[instrument=skeleton,note=1,powered=true]: note_block[instrument=harp,note=1,powered=true] + note_block[instrument=skeleton,note=1,powered=false]: note_block[instrument=harp,note=1,powered=false] + note_block[instrument=skeleton,note=2,powered=true]: note_block[instrument=harp,note=2,powered=true] + note_block[instrument=skeleton,note=2,powered=false]: note_block[instrument=harp,note=2,powered=false] + note_block[instrument=skeleton,note=3,powered=true]: note_block[instrument=harp,note=3,powered=true] + note_block[instrument=skeleton,note=3,powered=false]: note_block[instrument=harp,note=3,powered=false] + note_block[instrument=skeleton,note=4,powered=true]: note_block[instrument=harp,note=4,powered=true] + note_block[instrument=skeleton,note=4,powered=false]: note_block[instrument=harp,note=4,powered=false] + note_block[instrument=skeleton,note=5,powered=true]: note_block[instrument=harp,note=5,powered=true] + note_block[instrument=skeleton,note=5,powered=false]: note_block[instrument=harp,note=5,powered=false] + note_block[instrument=skeleton,note=6,powered=true]: note_block[instrument=harp,note=6,powered=true] + note_block[instrument=skeleton,note=6,powered=false]: note_block[instrument=harp,note=6,powered=false] + note_block[instrument=skeleton,note=7,powered=true]: note_block[instrument=harp,note=7,powered=true] + note_block[instrument=skeleton,note=7,powered=false]: note_block[instrument=harp,note=7,powered=false] + note_block[instrument=skeleton,note=8,powered=true]: note_block[instrument=harp,note=8,powered=true] + note_block[instrument=skeleton,note=8,powered=false]: note_block[instrument=harp,note=8,powered=false] + note_block[instrument=skeleton,note=9,powered=true]: note_block[instrument=harp,note=9,powered=true] + note_block[instrument=skeleton,note=9,powered=false]: note_block[instrument=harp,note=9,powered=false] + note_block[instrument=skeleton,note=10,powered=true]: note_block[instrument=harp,note=10,powered=true] + note_block[instrument=skeleton,note=10,powered=false]: note_block[instrument=harp,note=10,powered=false] + note_block[instrument=skeleton,note=11,powered=true]: note_block[instrument=harp,note=11,powered=true] + note_block[instrument=skeleton,note=11,powered=false]: note_block[instrument=harp,note=11,powered=false] + note_block[instrument=skeleton,note=12,powered=true]: note_block[instrument=harp,note=12,powered=true] + note_block[instrument=skeleton,note=12,powered=false]: note_block[instrument=harp,note=12,powered=false] + note_block[instrument=skeleton,note=13,powered=true]: note_block[instrument=harp,note=13,powered=true] + note_block[instrument=skeleton,note=13,powered=false]: note_block[instrument=harp,note=13,powered=false] + note_block[instrument=skeleton,note=14,powered=true]: note_block[instrument=harp,note=14,powered=true] + note_block[instrument=skeleton,note=14,powered=false]: note_block[instrument=harp,note=14,powered=false] + note_block[instrument=skeleton,note=15,powered=true]: note_block[instrument=harp,note=15,powered=true] + note_block[instrument=skeleton,note=15,powered=false]: note_block[instrument=harp,note=15,powered=false] + note_block[instrument=skeleton,note=16,powered=true]: note_block[instrument=harp,note=16,powered=true] + note_block[instrument=skeleton,note=16,powered=false]: note_block[instrument=harp,note=16,powered=false] + note_block[instrument=skeleton,note=17,powered=true]: note_block[instrument=harp,note=17,powered=true] + note_block[instrument=skeleton,note=17,powered=false]: note_block[instrument=harp,note=17,powered=false] + note_block[instrument=skeleton,note=18,powered=true]: note_block[instrument=harp,note=18,powered=true] + note_block[instrument=skeleton,note=18,powered=false]: note_block[instrument=harp,note=18,powered=false] + note_block[instrument=skeleton,note=19,powered=true]: note_block[instrument=harp,note=19,powered=true] + note_block[instrument=skeleton,note=19,powered=false]: note_block[instrument=harp,note=19,powered=false] + note_block[instrument=skeleton,note=20,powered=true]: note_block[instrument=harp,note=20,powered=true] + note_block[instrument=skeleton,note=20,powered=false]: note_block[instrument=harp,note=20,powered=false] + note_block[instrument=skeleton,note=21,powered=true]: note_block[instrument=harp,note=21,powered=true] + note_block[instrument=skeleton,note=21,powered=false]: note_block[instrument=harp,note=21,powered=false] + note_block[instrument=skeleton,note=22,powered=true]: note_block[instrument=harp,note=22,powered=true] + note_block[instrument=skeleton,note=22,powered=false]: note_block[instrument=harp,note=22,powered=false] + note_block[instrument=skeleton,note=23,powered=true]: note_block[instrument=harp,note=23,powered=true] + note_block[instrument=skeleton,note=23,powered=false]: note_block[instrument=harp,note=23,powered=false] + note_block[instrument=skeleton,note=24,powered=true]: note_block[instrument=harp,note=24,powered=true] + note_block[instrument=skeleton,note=24,powered=false]: note_block[instrument=harp,note=24,powered=false] + note_block[instrument=creeper,note=0,powered=true]: note_block[instrument=harp,note=0,powered=true] + note_block[instrument=creeper,note=0,powered=false]: note_block[instrument=harp,note=0,powered=false] + note_block[instrument=creeper,note=1,powered=true]: note_block[instrument=harp,note=1,powered=true] + note_block[instrument=creeper,note=1,powered=false]: note_block[instrument=harp,note=1,powered=false] + note_block[instrument=creeper,note=2,powered=true]: note_block[instrument=harp,note=2,powered=true] + note_block[instrument=creeper,note=2,powered=false]: note_block[instrument=harp,note=2,powered=false] + note_block[instrument=creeper,note=3,powered=true]: note_block[instrument=harp,note=3,powered=true] + note_block[instrument=creeper,note=3,powered=false]: note_block[instrument=harp,note=3,powered=false] + note_block[instrument=creeper,note=4,powered=true]: note_block[instrument=harp,note=4,powered=true] + note_block[instrument=creeper,note=4,powered=false]: note_block[instrument=harp,note=4,powered=false] + note_block[instrument=creeper,note=5,powered=true]: note_block[instrument=harp,note=5,powered=true] + note_block[instrument=creeper,note=5,powered=false]: note_block[instrument=harp,note=5,powered=false] + note_block[instrument=creeper,note=6,powered=true]: note_block[instrument=harp,note=6,powered=true] + note_block[instrument=creeper,note=6,powered=false]: note_block[instrument=harp,note=6,powered=false] + note_block[instrument=creeper,note=7,powered=true]: note_block[instrument=harp,note=7,powered=true] + note_block[instrument=creeper,note=7,powered=false]: note_block[instrument=harp,note=7,powered=false] + note_block[instrument=creeper,note=8,powered=true]: note_block[instrument=harp,note=8,powered=true] + note_block[instrument=creeper,note=8,powered=false]: note_block[instrument=harp,note=8,powered=false] + note_block[instrument=creeper,note=9,powered=true]: note_block[instrument=harp,note=9,powered=true] + note_block[instrument=creeper,note=9,powered=false]: note_block[instrument=harp,note=9,powered=false] + note_block[instrument=creeper,note=10,powered=true]: note_block[instrument=harp,note=10,powered=true] + note_block[instrument=creeper,note=10,powered=false]: note_block[instrument=harp,note=10,powered=false] + note_block[instrument=creeper,note=11,powered=true]: note_block[instrument=harp,note=11,powered=true] + note_block[instrument=creeper,note=11,powered=false]: note_block[instrument=harp,note=11,powered=false] + note_block[instrument=creeper,note=12,powered=true]: note_block[instrument=harp,note=12,powered=true] + note_block[instrument=creeper,note=12,powered=false]: note_block[instrument=harp,note=12,powered=false] + note_block[instrument=creeper,note=13,powered=true]: note_block[instrument=harp,note=13,powered=true] + note_block[instrument=creeper,note=13,powered=false]: note_block[instrument=harp,note=13,powered=false] + note_block[instrument=creeper,note=14,powered=true]: note_block[instrument=harp,note=14,powered=true] + note_block[instrument=creeper,note=14,powered=false]: note_block[instrument=harp,note=14,powered=false] + note_block[instrument=creeper,note=15,powered=true]: note_block[instrument=harp,note=15,powered=true] + note_block[instrument=creeper,note=15,powered=false]: note_block[instrument=harp,note=15,powered=false] + note_block[instrument=creeper,note=16,powered=true]: note_block[instrument=harp,note=16,powered=true] + note_block[instrument=creeper,note=16,powered=false]: note_block[instrument=harp,note=16,powered=false] + note_block[instrument=creeper,note=17,powered=true]: note_block[instrument=harp,note=17,powered=true] + note_block[instrument=creeper,note=17,powered=false]: note_block[instrument=harp,note=17,powered=false] + note_block[instrument=creeper,note=18,powered=true]: note_block[instrument=harp,note=18,powered=true] + note_block[instrument=creeper,note=18,powered=false]: note_block[instrument=harp,note=18,powered=false] + note_block[instrument=creeper,note=19,powered=true]: note_block[instrument=harp,note=19,powered=true] + note_block[instrument=creeper,note=19,powered=false]: note_block[instrument=harp,note=19,powered=false] + note_block[instrument=creeper,note=20,powered=true]: note_block[instrument=harp,note=20,powered=true] + note_block[instrument=creeper,note=20,powered=false]: note_block[instrument=harp,note=20,powered=false] + note_block[instrument=creeper,note=21,powered=true]: note_block[instrument=harp,note=21,powered=true] + note_block[instrument=creeper,note=21,powered=false]: note_block[instrument=harp,note=21,powered=false] + note_block[instrument=creeper,note=22,powered=true]: note_block[instrument=harp,note=22,powered=true] + note_block[instrument=creeper,note=22,powered=false]: note_block[instrument=harp,note=22,powered=false] + note_block[instrument=creeper,note=23,powered=true]: note_block[instrument=harp,note=23,powered=true] + note_block[instrument=creeper,note=23,powered=false]: note_block[instrument=harp,note=23,powered=false] + note_block[instrument=creeper,note=24,powered=true]: note_block[instrument=harp,note=24,powered=true] + note_block[instrument=creeper,note=24,powered=false]: note_block[instrument=harp,note=24,powered=false] + note_block[instrument=dragon,note=0,powered=true]: note_block[instrument=harp,note=0,powered=true] + note_block[instrument=dragon,note=0,powered=false]: note_block[instrument=harp,note=0,powered=false] + note_block[instrument=dragon,note=1,powered=true]: note_block[instrument=harp,note=1,powered=true] + note_block[instrument=dragon,note=1,powered=false]: note_block[instrument=harp,note=1,powered=false] + note_block[instrument=dragon,note=2,powered=true]: note_block[instrument=harp,note=2,powered=true] + note_block[instrument=dragon,note=2,powered=false]: note_block[instrument=harp,note=2,powered=false] + note_block[instrument=dragon,note=3,powered=true]: note_block[instrument=harp,note=3,powered=true] + note_block[instrument=dragon,note=3,powered=false]: note_block[instrument=harp,note=3,powered=false] + note_block[instrument=dragon,note=4,powered=true]: note_block[instrument=harp,note=4,powered=true] + note_block[instrument=dragon,note=4,powered=false]: note_block[instrument=harp,note=4,powered=false] + note_block[instrument=dragon,note=5,powered=true]: note_block[instrument=harp,note=5,powered=true] + note_block[instrument=dragon,note=5,powered=false]: note_block[instrument=harp,note=5,powered=false] + note_block[instrument=dragon,note=6,powered=true]: note_block[instrument=harp,note=6,powered=true] + note_block[instrument=dragon,note=6,powered=false]: note_block[instrument=harp,note=6,powered=false] + note_block[instrument=dragon,note=7,powered=true]: note_block[instrument=harp,note=7,powered=true] + note_block[instrument=dragon,note=7,powered=false]: note_block[instrument=harp,note=7,powered=false] + note_block[instrument=dragon,note=8,powered=true]: note_block[instrument=harp,note=8,powered=true] + note_block[instrument=dragon,note=8,powered=false]: note_block[instrument=harp,note=8,powered=false] + note_block[instrument=dragon,note=9,powered=true]: note_block[instrument=harp,note=9,powered=true] + note_block[instrument=dragon,note=9,powered=false]: note_block[instrument=harp,note=9,powered=false] + note_block[instrument=dragon,note=10,powered=true]: note_block[instrument=harp,note=10,powered=true] + note_block[instrument=dragon,note=10,powered=false]: note_block[instrument=harp,note=10,powered=false] + note_block[instrument=dragon,note=11,powered=true]: note_block[instrument=harp,note=11,powered=true] + note_block[instrument=dragon,note=11,powered=false]: note_block[instrument=harp,note=11,powered=false] + note_block[instrument=dragon,note=12,powered=true]: note_block[instrument=harp,note=12,powered=true] + note_block[instrument=dragon,note=12,powered=false]: note_block[instrument=harp,note=12,powered=false] + note_block[instrument=dragon,note=13,powered=true]: note_block[instrument=harp,note=13,powered=true] + note_block[instrument=dragon,note=13,powered=false]: note_block[instrument=harp,note=13,powered=false] + note_block[instrument=dragon,note=14,powered=true]: note_block[instrument=harp,note=14,powered=true] + note_block[instrument=dragon,note=14,powered=false]: note_block[instrument=harp,note=14,powered=false] + note_block[instrument=dragon,note=15,powered=true]: note_block[instrument=harp,note=15,powered=true] + note_block[instrument=dragon,note=15,powered=false]: note_block[instrument=harp,note=15,powered=false] + note_block[instrument=dragon,note=16,powered=true]: note_block[instrument=harp,note=16,powered=true] + note_block[instrument=dragon,note=16,powered=false]: note_block[instrument=harp,note=16,powered=false] + note_block[instrument=dragon,note=17,powered=true]: note_block[instrument=harp,note=17,powered=true] + note_block[instrument=dragon,note=17,powered=false]: note_block[instrument=harp,note=17,powered=false] + note_block[instrument=dragon,note=18,powered=true]: note_block[instrument=harp,note=18,powered=true] + note_block[instrument=dragon,note=18,powered=false]: note_block[instrument=harp,note=18,powered=false] + note_block[instrument=dragon,note=19,powered=true]: note_block[instrument=harp,note=19,powered=true] + note_block[instrument=dragon,note=19,powered=false]: note_block[instrument=harp,note=19,powered=false] + note_block[instrument=dragon,note=20,powered=true]: note_block[instrument=harp,note=20,powered=true] + note_block[instrument=dragon,note=20,powered=false]: note_block[instrument=harp,note=20,powered=false] + note_block[instrument=dragon,note=21,powered=true]: note_block[instrument=harp,note=21,powered=true] + note_block[instrument=dragon,note=21,powered=false]: note_block[instrument=harp,note=21,powered=false] + note_block[instrument=dragon,note=22,powered=true]: note_block[instrument=harp,note=22,powered=true] + note_block[instrument=dragon,note=22,powered=false]: note_block[instrument=harp,note=22,powered=false] + note_block[instrument=dragon,note=23,powered=true]: note_block[instrument=harp,note=23,powered=true] + note_block[instrument=dragon,note=23,powered=false]: note_block[instrument=harp,note=23,powered=false] + note_block[instrument=dragon,note=24,powered=true]: note_block[instrument=harp,note=24,powered=true] + note_block[instrument=dragon,note=24,powered=false]: note_block[instrument=harp,note=24,powered=false] + note_block[instrument=wither_skeleton,note=0,powered=true]: note_block[instrument=harp,note=0,powered=true] + note_block[instrument=wither_skeleton,note=0,powered=false]: note_block[instrument=harp,note=0,powered=false] + note_block[instrument=wither_skeleton,note=1,powered=true]: note_block[instrument=harp,note=1,powered=true] + note_block[instrument=wither_skeleton,note=1,powered=false]: note_block[instrument=harp,note=1,powered=false] + note_block[instrument=wither_skeleton,note=2,powered=true]: note_block[instrument=harp,note=2,powered=true] + note_block[instrument=wither_skeleton,note=2,powered=false]: note_block[instrument=harp,note=2,powered=false] + note_block[instrument=wither_skeleton,note=3,powered=true]: note_block[instrument=harp,note=3,powered=true] + note_block[instrument=wither_skeleton,note=3,powered=false]: note_block[instrument=harp,note=3,powered=false] + note_block[instrument=wither_skeleton,note=4,powered=true]: note_block[instrument=harp,note=4,powered=true] + note_block[instrument=wither_skeleton,note=4,powered=false]: note_block[instrument=harp,note=4,powered=false] + note_block[instrument=wither_skeleton,note=5,powered=true]: note_block[instrument=harp,note=5,powered=true] + note_block[instrument=wither_skeleton,note=5,powered=false]: note_block[instrument=harp,note=5,powered=false] + note_block[instrument=wither_skeleton,note=6,powered=true]: note_block[instrument=harp,note=6,powered=true] + note_block[instrument=wither_skeleton,note=6,powered=false]: note_block[instrument=harp,note=6,powered=false] + note_block[instrument=wither_skeleton,note=7,powered=true]: note_block[instrument=harp,note=7,powered=true] + note_block[instrument=wither_skeleton,note=7,powered=false]: note_block[instrument=harp,note=7,powered=false] + note_block[instrument=wither_skeleton,note=8,powered=true]: note_block[instrument=harp,note=8,powered=true] + note_block[instrument=wither_skeleton,note=8,powered=false]: note_block[instrument=harp,note=8,powered=false] + note_block[instrument=wither_skeleton,note=9,powered=true]: note_block[instrument=harp,note=9,powered=true] + note_block[instrument=wither_skeleton,note=9,powered=false]: note_block[instrument=harp,note=9,powered=false] + note_block[instrument=wither_skeleton,note=10,powered=true]: note_block[instrument=harp,note=10,powered=true] + note_block[instrument=wither_skeleton,note=10,powered=false]: note_block[instrument=harp,note=10,powered=false] + note_block[instrument=wither_skeleton,note=11,powered=true]: note_block[instrument=harp,note=11,powered=true] + note_block[instrument=wither_skeleton,note=11,powered=false]: note_block[instrument=harp,note=11,powered=false] + note_block[instrument=wither_skeleton,note=12,powered=true]: note_block[instrument=harp,note=12,powered=true] + note_block[instrument=wither_skeleton,note=12,powered=false]: note_block[instrument=harp,note=12,powered=false] + note_block[instrument=wither_skeleton,note=13,powered=true]: note_block[instrument=harp,note=13,powered=true] + note_block[instrument=wither_skeleton,note=13,powered=false]: note_block[instrument=harp,note=13,powered=false] + note_block[instrument=wither_skeleton,note=14,powered=true]: note_block[instrument=harp,note=14,powered=true] + note_block[instrument=wither_skeleton,note=14,powered=false]: note_block[instrument=harp,note=14,powered=false] + note_block[instrument=wither_skeleton,note=15,powered=true]: note_block[instrument=harp,note=15,powered=true] + note_block[instrument=wither_skeleton,note=15,powered=false]: note_block[instrument=harp,note=15,powered=false] + note_block[instrument=wither_skeleton,note=16,powered=true]: note_block[instrument=harp,note=16,powered=true] + note_block[instrument=wither_skeleton,note=16,powered=false]: note_block[instrument=harp,note=16,powered=false] + note_block[instrument=wither_skeleton,note=17,powered=true]: note_block[instrument=harp,note=17,powered=true] + note_block[instrument=wither_skeleton,note=17,powered=false]: note_block[instrument=harp,note=17,powered=false] + note_block[instrument=wither_skeleton,note=18,powered=true]: note_block[instrument=harp,note=18,powered=true] + note_block[instrument=wither_skeleton,note=18,powered=false]: note_block[instrument=harp,note=18,powered=false] + note_block[instrument=wither_skeleton,note=19,powered=true]: note_block[instrument=harp,note=19,powered=true] + note_block[instrument=wither_skeleton,note=19,powered=false]: note_block[instrument=harp,note=19,powered=false] + note_block[instrument=wither_skeleton,note=20,powered=true]: note_block[instrument=harp,note=20,powered=true] + note_block[instrument=wither_skeleton,note=20,powered=false]: note_block[instrument=harp,note=20,powered=false] + note_block[instrument=wither_skeleton,note=21,powered=true]: note_block[instrument=harp,note=21,powered=true] + note_block[instrument=wither_skeleton,note=21,powered=false]: note_block[instrument=harp,note=21,powered=false] + note_block[instrument=wither_skeleton,note=22,powered=true]: note_block[instrument=harp,note=22,powered=true] + note_block[instrument=wither_skeleton,note=22,powered=false]: note_block[instrument=harp,note=22,powered=false] + note_block[instrument=wither_skeleton,note=23,powered=true]: note_block[instrument=harp,note=23,powered=true] + note_block[instrument=wither_skeleton,note=23,powered=false]: note_block[instrument=harp,note=23,powered=false] + note_block[instrument=wither_skeleton,note=24,powered=true]: note_block[instrument=harp,note=24,powered=true] + note_block[instrument=wither_skeleton,note=24,powered=false]: note_block[instrument=harp,note=24,powered=false] + note_block[instrument=piglin,note=0,powered=true]: note_block[instrument=harp,note=0,powered=true] + note_block[instrument=piglin,note=0,powered=false]: note_block[instrument=harp,note=0,powered=false] + note_block[instrument=piglin,note=1,powered=true]: note_block[instrument=harp,note=1,powered=true] + note_block[instrument=piglin,note=1,powered=false]: note_block[instrument=harp,note=1,powered=false] + note_block[instrument=piglin,note=2,powered=true]: note_block[instrument=harp,note=2,powered=true] + note_block[instrument=piglin,note=2,powered=false]: note_block[instrument=harp,note=2,powered=false] + note_block[instrument=piglin,note=3,powered=true]: note_block[instrument=harp,note=3,powered=true] + note_block[instrument=piglin,note=3,powered=false]: note_block[instrument=harp,note=3,powered=false] + note_block[instrument=piglin,note=4,powered=true]: note_block[instrument=harp,note=4,powered=true] + note_block[instrument=piglin,note=4,powered=false]: note_block[instrument=harp,note=4,powered=false] + note_block[instrument=piglin,note=5,powered=true]: note_block[instrument=harp,note=5,powered=true] + note_block[instrument=piglin,note=5,powered=false]: note_block[instrument=harp,note=5,powered=false] + note_block[instrument=piglin,note=6,powered=true]: note_block[instrument=harp,note=6,powered=true] + note_block[instrument=piglin,note=6,powered=false]: note_block[instrument=harp,note=6,powered=false] + note_block[instrument=piglin,note=7,powered=true]: note_block[instrument=harp,note=7,powered=true] + note_block[instrument=piglin,note=7,powered=false]: note_block[instrument=harp,note=7,powered=false] + note_block[instrument=piglin,note=8,powered=true]: note_block[instrument=harp,note=8,powered=true] + note_block[instrument=piglin,note=8,powered=false]: note_block[instrument=harp,note=8,powered=false] + note_block[instrument=piglin,note=9,powered=true]: note_block[instrument=harp,note=9,powered=true] + note_block[instrument=piglin,note=9,powered=false]: note_block[instrument=harp,note=9,powered=false] + note_block[instrument=piglin,note=10,powered=true]: note_block[instrument=harp,note=10,powered=true] + note_block[instrument=piglin,note=10,powered=false]: note_block[instrument=harp,note=10,powered=false] + note_block[instrument=piglin,note=11,powered=true]: note_block[instrument=harp,note=11,powered=true] + note_block[instrument=piglin,note=11,powered=false]: note_block[instrument=harp,note=11,powered=false] + note_block[instrument=piglin,note=12,powered=true]: note_block[instrument=harp,note=12,powered=true] + note_block[instrument=piglin,note=12,powered=false]: note_block[instrument=harp,note=12,powered=false] + note_block[instrument=piglin,note=13,powered=true]: note_block[instrument=harp,note=13,powered=true] + note_block[instrument=piglin,note=13,powered=false]: note_block[instrument=harp,note=13,powered=false] + note_block[instrument=piglin,note=14,powered=true]: note_block[instrument=harp,note=14,powered=true] + note_block[instrument=piglin,note=14,powered=false]: note_block[instrument=harp,note=14,powered=false] + note_block[instrument=piglin,note=15,powered=true]: note_block[instrument=harp,note=15,powered=true] + note_block[instrument=piglin,note=15,powered=false]: note_block[instrument=harp,note=15,powered=false] + note_block[instrument=piglin,note=16,powered=true]: note_block[instrument=harp,note=16,powered=true] + note_block[instrument=piglin,note=16,powered=false]: note_block[instrument=harp,note=16,powered=false] + note_block[instrument=piglin,note=17,powered=true]: note_block[instrument=harp,note=17,powered=true] + note_block[instrument=piglin,note=17,powered=false]: note_block[instrument=harp,note=17,powered=false] + note_block[instrument=piglin,note=18,powered=true]: note_block[instrument=harp,note=18,powered=true] + note_block[instrument=piglin,note=18,powered=false]: note_block[instrument=harp,note=18,powered=false] + note_block[instrument=piglin,note=19,powered=true]: note_block[instrument=harp,note=19,powered=true] + note_block[instrument=piglin,note=19,powered=false]: note_block[instrument=harp,note=19,powered=false] + note_block[instrument=piglin,note=20,powered=true]: note_block[instrument=harp,note=20,powered=true] + note_block[instrument=piglin,note=20,powered=false]: note_block[instrument=harp,note=20,powered=false] + note_block[instrument=piglin,note=21,powered=true]: note_block[instrument=harp,note=21,powered=true] + note_block[instrument=piglin,note=21,powered=false]: note_block[instrument=harp,note=21,powered=false] + note_block[instrument=piglin,note=22,powered=true]: note_block[instrument=harp,note=22,powered=true] + note_block[instrument=piglin,note=22,powered=false]: note_block[instrument=harp,note=22,powered=false] + note_block[instrument=piglin,note=23,powered=true]: note_block[instrument=harp,note=23,powered=true] + note_block[instrument=piglin,note=23,powered=false]: note_block[instrument=harp,note=23,powered=false] + note_block[instrument=piglin,note=24,powered=true]: note_block[instrument=harp,note=24,powered=true] + note_block[instrument=piglin,note=24,powered=false]: note_block[instrument=harp,note=24,powered=false] + note_block[instrument=custom_head,note=0,powered=true]: note_block[instrument=harp,note=0,powered=true] + note_block[instrument=custom_head,note=0,powered=false]: note_block[instrument=harp,note=0,powered=false] + note_block[instrument=custom_head,note=1,powered=true]: note_block[instrument=harp,note=1,powered=true] + note_block[instrument=custom_head,note=1,powered=false]: note_block[instrument=harp,note=1,powered=false] + note_block[instrument=custom_head,note=2,powered=true]: note_block[instrument=harp,note=2,powered=true] + note_block[instrument=custom_head,note=2,powered=false]: note_block[instrument=harp,note=2,powered=false] + note_block[instrument=custom_head,note=3,powered=true]: note_block[instrument=harp,note=3,powered=true] + note_block[instrument=custom_head,note=3,powered=false]: note_block[instrument=harp,note=3,powered=false] + note_block[instrument=custom_head,note=4,powered=true]: note_block[instrument=harp,note=4,powered=true] + note_block[instrument=custom_head,note=4,powered=false]: note_block[instrument=harp,note=4,powered=false] + note_block[instrument=custom_head,note=5,powered=true]: note_block[instrument=harp,note=5,powered=true] + note_block[instrument=custom_head,note=5,powered=false]: note_block[instrument=harp,note=5,powered=false] + note_block[instrument=custom_head,note=6,powered=true]: note_block[instrument=harp,note=6,powered=true] + note_block[instrument=custom_head,note=6,powered=false]: note_block[instrument=harp,note=6,powered=false] + note_block[instrument=custom_head,note=7,powered=true]: note_block[instrument=harp,note=7,powered=true] + note_block[instrument=custom_head,note=7,powered=false]: note_block[instrument=harp,note=7,powered=false] + note_block[instrument=custom_head,note=8,powered=true]: note_block[instrument=harp,note=8,powered=true] + note_block[instrument=custom_head,note=8,powered=false]: note_block[instrument=harp,note=8,powered=false] + note_block[instrument=custom_head,note=9,powered=true]: note_block[instrument=harp,note=9,powered=true] + note_block[instrument=custom_head,note=9,powered=false]: note_block[instrument=harp,note=9,powered=false] + note_block[instrument=custom_head,note=10,powered=true]: note_block[instrument=harp,note=10,powered=true] + note_block[instrument=custom_head,note=10,powered=false]: note_block[instrument=harp,note=10,powered=false] + note_block[instrument=custom_head,note=11,powered=true]: note_block[instrument=harp,note=11,powered=true] + note_block[instrument=custom_head,note=11,powered=false]: note_block[instrument=harp,note=11,powered=false] + note_block[instrument=custom_head,note=12,powered=true]: note_block[instrument=harp,note=12,powered=true] + note_block[instrument=custom_head,note=12,powered=false]: note_block[instrument=harp,note=12,powered=false] + note_block[instrument=custom_head,note=13,powered=true]: note_block[instrument=harp,note=13,powered=true] + note_block[instrument=custom_head,note=13,powered=false]: note_block[instrument=harp,note=13,powered=false] + note_block[instrument=custom_head,note=14,powered=true]: note_block[instrument=harp,note=14,powered=true] + note_block[instrument=custom_head,note=14,powered=false]: note_block[instrument=harp,note=14,powered=false] + note_block[instrument=custom_head,note=15,powered=true]: note_block[instrument=harp,note=15,powered=true] + note_block[instrument=custom_head,note=15,powered=false]: note_block[instrument=harp,note=15,powered=false] + note_block[instrument=custom_head,note=16,powered=true]: note_block[instrument=harp,note=16,powered=true] + note_block[instrument=custom_head,note=16,powered=false]: note_block[instrument=harp,note=16,powered=false] + note_block[instrument=custom_head,note=17,powered=true]: note_block[instrument=harp,note=17,powered=true] + note_block[instrument=custom_head,note=17,powered=false]: note_block[instrument=harp,note=17,powered=false] + note_block[instrument=custom_head,note=18,powered=true]: note_block[instrument=harp,note=18,powered=true] + note_block[instrument=custom_head,note=18,powered=false]: note_block[instrument=harp,note=18,powered=false] + note_block[instrument=custom_head,note=19,powered=true]: note_block[instrument=harp,note=19,powered=true] + note_block[instrument=custom_head,note=19,powered=false]: note_block[instrument=harp,note=19,powered=false] + note_block[instrument=custom_head,note=20,powered=true]: note_block[instrument=harp,note=20,powered=true] + note_block[instrument=custom_head,note=20,powered=false]: note_block[instrument=harp,note=20,powered=false] + note_block[instrument=custom_head,note=21,powered=true]: note_block[instrument=harp,note=21,powered=true] + note_block[instrument=custom_head,note=21,powered=false]: note_block[instrument=harp,note=21,powered=false] + note_block[instrument=custom_head,note=22,powered=true]: note_block[instrument=harp,note=22,powered=true] + note_block[instrument=custom_head,note=22,powered=false]: note_block[instrument=harp,note=22,powered=false] + note_block[instrument=custom_head,note=23,powered=true]: note_block[instrument=harp,note=23,powered=true] + note_block[instrument=custom_head,note=23,powered=false]: note_block[instrument=harp,note=23,powered=false] + note_block[instrument=custom_head,note=24,powered=true]: note_block[instrument=harp,note=24,powered=true] + note_block[instrument=custom_head,note=24,powered=false]: note_block[instrument=harp,note=24,powered=false] + $$>=26.1#note_block: + note_block[instrument=trumpet,note=0,powered=true]: note_block[instrument=harp,note=0,powered=true] + note_block[instrument=trumpet,note=0,powered=false]: note_block[instrument=harp,note=0,powered=false] + note_block[instrument=trumpet,note=1,powered=true]: note_block[instrument=harp,note=1,powered=true] + note_block[instrument=trumpet,note=1,powered=false]: note_block[instrument=harp,note=1,powered=false] + note_block[instrument=trumpet,note=2,powered=true]: note_block[instrument=harp,note=2,powered=true] + note_block[instrument=trumpet,note=2,powered=false]: note_block[instrument=harp,note=2,powered=false] + note_block[instrument=trumpet,note=3,powered=true]: note_block[instrument=harp,note=3,powered=true] + note_block[instrument=trumpet,note=3,powered=false]: note_block[instrument=harp,note=3,powered=false] + note_block[instrument=trumpet,note=4,powered=true]: note_block[instrument=harp,note=4,powered=true] + note_block[instrument=trumpet,note=4,powered=false]: note_block[instrument=harp,note=4,powered=false] + note_block[instrument=trumpet,note=5,powered=true]: note_block[instrument=harp,note=5,powered=true] + note_block[instrument=trumpet,note=5,powered=false]: note_block[instrument=harp,note=5,powered=false] + note_block[instrument=trumpet,note=6,powered=true]: note_block[instrument=harp,note=6,powered=true] + note_block[instrument=trumpet,note=6,powered=false]: note_block[instrument=harp,note=6,powered=false] + note_block[instrument=trumpet,note=7,powered=true]: note_block[instrument=harp,note=7,powered=true] + note_block[instrument=trumpet,note=7,powered=false]: note_block[instrument=harp,note=7,powered=false] + note_block[instrument=trumpet,note=8,powered=true]: note_block[instrument=harp,note=8,powered=true] + note_block[instrument=trumpet,note=8,powered=false]: note_block[instrument=harp,note=8,powered=false] + note_block[instrument=trumpet,note=9,powered=true]: note_block[instrument=harp,note=9,powered=true] + note_block[instrument=trumpet,note=9,powered=false]: note_block[instrument=harp,note=9,powered=false] + note_block[instrument=trumpet,note=10,powered=true]: note_block[instrument=harp,note=10,powered=true] + note_block[instrument=trumpet,note=10,powered=false]: note_block[instrument=harp,note=10,powered=false] + note_block[instrument=trumpet,note=11,powered=true]: note_block[instrument=harp,note=11,powered=true] + note_block[instrument=trumpet,note=11,powered=false]: note_block[instrument=harp,note=11,powered=false] + note_block[instrument=trumpet,note=12,powered=true]: note_block[instrument=harp,note=12,powered=true] + note_block[instrument=trumpet,note=12,powered=false]: note_block[instrument=harp,note=12,powered=false] + note_block[instrument=trumpet,note=13,powered=true]: note_block[instrument=harp,note=13,powered=true] + note_block[instrument=trumpet,note=13,powered=false]: note_block[instrument=harp,note=13,powered=false] + note_block[instrument=trumpet,note=14,powered=true]: note_block[instrument=harp,note=14,powered=true] + note_block[instrument=trumpet,note=14,powered=false]: note_block[instrument=harp,note=14,powered=false] + note_block[instrument=trumpet,note=15,powered=true]: note_block[instrument=harp,note=15,powered=true] + note_block[instrument=trumpet,note=15,powered=false]: note_block[instrument=harp,note=15,powered=false] + note_block[instrument=trumpet,note=16,powered=true]: note_block[instrument=harp,note=16,powered=true] + note_block[instrument=trumpet,note=16,powered=false]: note_block[instrument=harp,note=16,powered=false] + note_block[instrument=trumpet,note=17,powered=true]: note_block[instrument=harp,note=17,powered=true] + note_block[instrument=trumpet,note=17,powered=false]: note_block[instrument=harp,note=17,powered=false] + note_block[instrument=trumpet,note=18,powered=true]: note_block[instrument=harp,note=18,powered=true] + note_block[instrument=trumpet,note=18,powered=false]: note_block[instrument=harp,note=18,powered=false] + note_block[instrument=trumpet,note=19,powered=true]: note_block[instrument=harp,note=19,powered=true] + note_block[instrument=trumpet,note=19,powered=false]: note_block[instrument=harp,note=19,powered=false] + note_block[instrument=trumpet,note=20,powered=true]: note_block[instrument=harp,note=20,powered=true] + note_block[instrument=trumpet,note=20,powered=false]: note_block[instrument=harp,note=20,powered=false] + note_block[instrument=trumpet,note=21,powered=true]: note_block[instrument=harp,note=21,powered=true] + note_block[instrument=trumpet,note=21,powered=false]: note_block[instrument=harp,note=21,powered=false] + note_block[instrument=trumpet,note=22,powered=true]: note_block[instrument=harp,note=22,powered=true] + note_block[instrument=trumpet,note=22,powered=false]: note_block[instrument=harp,note=22,powered=false] + note_block[instrument=trumpet,note=23,powered=true]: note_block[instrument=harp,note=23,powered=true] + note_block[instrument=trumpet,note=23,powered=false]: note_block[instrument=harp,note=23,powered=false] + note_block[instrument=trumpet,note=24,powered=true]: note_block[instrument=harp,note=24,powered=true] + note_block[instrument=trumpet,note=24,powered=false]: note_block[instrument=harp,note=24,powered=false] + note_block[instrument=trumpet_exposed,note=0,powered=true]: note_block[instrument=harp,note=0,powered=true] + note_block[instrument=trumpet_exposed,note=0,powered=false]: note_block[instrument=harp,note=0,powered=false] + note_block[instrument=trumpet_exposed,note=1,powered=true]: note_block[instrument=harp,note=1,powered=true] + note_block[instrument=trumpet_exposed,note=1,powered=false]: note_block[instrument=harp,note=1,powered=false] + note_block[instrument=trumpet_exposed,note=2,powered=true]: note_block[instrument=harp,note=2,powered=true] + note_block[instrument=trumpet_exposed,note=2,powered=false]: note_block[instrument=harp,note=2,powered=false] + note_block[instrument=trumpet_exposed,note=3,powered=true]: note_block[instrument=harp,note=3,powered=true] + note_block[instrument=trumpet_exposed,note=3,powered=false]: note_block[instrument=harp,note=3,powered=false] + note_block[instrument=trumpet_exposed,note=4,powered=true]: note_block[instrument=harp,note=4,powered=true] + note_block[instrument=trumpet_exposed,note=4,powered=false]: note_block[instrument=harp,note=4,powered=false] + note_block[instrument=trumpet_exposed,note=5,powered=true]: note_block[instrument=harp,note=5,powered=true] + note_block[instrument=trumpet_exposed,note=5,powered=false]: note_block[instrument=harp,note=5,powered=false] + note_block[instrument=trumpet_exposed,note=6,powered=true]: note_block[instrument=harp,note=6,powered=true] + note_block[instrument=trumpet_exposed,note=6,powered=false]: note_block[instrument=harp,note=6,powered=false] + note_block[instrument=trumpet_exposed,note=7,powered=true]: note_block[instrument=harp,note=7,powered=true] + note_block[instrument=trumpet_exposed,note=7,powered=false]: note_block[instrument=harp,note=7,powered=false] + note_block[instrument=trumpet_exposed,note=8,powered=true]: note_block[instrument=harp,note=8,powered=true] + note_block[instrument=trumpet_exposed,note=8,powered=false]: note_block[instrument=harp,note=8,powered=false] + note_block[instrument=trumpet_exposed,note=9,powered=true]: note_block[instrument=harp,note=9,powered=true] + note_block[instrument=trumpet_exposed,note=9,powered=false]: note_block[instrument=harp,note=9,powered=false] + note_block[instrument=trumpet_exposed,note=10,powered=true]: note_block[instrument=harp,note=10,powered=true] + note_block[instrument=trumpet_exposed,note=10,powered=false]: note_block[instrument=harp,note=10,powered=false] + note_block[instrument=trumpet_exposed,note=11,powered=true]: note_block[instrument=harp,note=11,powered=true] + note_block[instrument=trumpet_exposed,note=11,powered=false]: note_block[instrument=harp,note=11,powered=false] + note_block[instrument=trumpet_exposed,note=12,powered=true]: note_block[instrument=harp,note=12,powered=true] + note_block[instrument=trumpet_exposed,note=12,powered=false]: note_block[instrument=harp,note=12,powered=false] + note_block[instrument=trumpet_exposed,note=13,powered=true]: note_block[instrument=harp,note=13,powered=true] + note_block[instrument=trumpet_exposed,note=13,powered=false]: note_block[instrument=harp,note=13,powered=false] + note_block[instrument=trumpet_exposed,note=14,powered=true]: note_block[instrument=harp,note=14,powered=true] + note_block[instrument=trumpet_exposed,note=14,powered=false]: note_block[instrument=harp,note=14,powered=false] + note_block[instrument=trumpet_exposed,note=15,powered=true]: note_block[instrument=harp,note=15,powered=true] + note_block[instrument=trumpet_exposed,note=15,powered=false]: note_block[instrument=harp,note=15,powered=false] + note_block[instrument=trumpet_exposed,note=16,powered=true]: note_block[instrument=harp,note=16,powered=true] + note_block[instrument=trumpet_exposed,note=16,powered=false]: note_block[instrument=harp,note=16,powered=false] + note_block[instrument=trumpet_exposed,note=17,powered=true]: note_block[instrument=harp,note=17,powered=true] + note_block[instrument=trumpet_exposed,note=17,powered=false]: note_block[instrument=harp,note=17,powered=false] + note_block[instrument=trumpet_exposed,note=18,powered=true]: note_block[instrument=harp,note=18,powered=true] + note_block[instrument=trumpet_exposed,note=18,powered=false]: note_block[instrument=harp,note=18,powered=false] + note_block[instrument=trumpet_exposed,note=19,powered=true]: note_block[instrument=harp,note=19,powered=true] + note_block[instrument=trumpet_exposed,note=19,powered=false]: note_block[instrument=harp,note=19,powered=false] + note_block[instrument=trumpet_exposed,note=20,powered=true]: note_block[instrument=harp,note=20,powered=true] + note_block[instrument=trumpet_exposed,note=20,powered=false]: note_block[instrument=harp,note=20,powered=false] + note_block[instrument=trumpet_exposed,note=21,powered=true]: note_block[instrument=harp,note=21,powered=true] + note_block[instrument=trumpet_exposed,note=21,powered=false]: note_block[instrument=harp,note=21,powered=false] + note_block[instrument=trumpet_exposed,note=22,powered=true]: note_block[instrument=harp,note=22,powered=true] + note_block[instrument=trumpet_exposed,note=22,powered=false]: note_block[instrument=harp,note=22,powered=false] + note_block[instrument=trumpet_exposed,note=23,powered=true]: note_block[instrument=harp,note=23,powered=true] + note_block[instrument=trumpet_exposed,note=23,powered=false]: note_block[instrument=harp,note=23,powered=false] + note_block[instrument=trumpet_exposed,note=24,powered=true]: note_block[instrument=harp,note=24,powered=true] + note_block[instrument=trumpet_exposed,note=24,powered=false]: note_block[instrument=harp,note=24,powered=false] + note_block[instrument=trumpet_oxidized,note=0,powered=true]: note_block[instrument=harp,note=0,powered=true] + note_block[instrument=trumpet_oxidized,note=0,powered=false]: note_block[instrument=harp,note=0,powered=false] + note_block[instrument=trumpet_oxidized,note=1,powered=true]: note_block[instrument=harp,note=1,powered=true] + note_block[instrument=trumpet_oxidized,note=1,powered=false]: note_block[instrument=harp,note=1,powered=false] + note_block[instrument=trumpet_oxidized,note=2,powered=true]: note_block[instrument=harp,note=2,powered=true] + note_block[instrument=trumpet_oxidized,note=2,powered=false]: note_block[instrument=harp,note=2,powered=false] + note_block[instrument=trumpet_oxidized,note=3,powered=true]: note_block[instrument=harp,note=3,powered=true] + note_block[instrument=trumpet_oxidized,note=3,powered=false]: note_block[instrument=harp,note=3,powered=false] + note_block[instrument=trumpet_oxidized,note=4,powered=true]: note_block[instrument=harp,note=4,powered=true] + note_block[instrument=trumpet_oxidized,note=4,powered=false]: note_block[instrument=harp,note=4,powered=false] + note_block[instrument=trumpet_oxidized,note=5,powered=true]: note_block[instrument=harp,note=5,powered=true] + note_block[instrument=trumpet_oxidized,note=5,powered=false]: note_block[instrument=harp,note=5,powered=false] + note_block[instrument=trumpet_oxidized,note=6,powered=true]: note_block[instrument=harp,note=6,powered=true] + note_block[instrument=trumpet_oxidized,note=6,powered=false]: note_block[instrument=harp,note=6,powered=false] + note_block[instrument=trumpet_oxidized,note=7,powered=true]: note_block[instrument=harp,note=7,powered=true] + note_block[instrument=trumpet_oxidized,note=7,powered=false]: note_block[instrument=harp,note=7,powered=false] + note_block[instrument=trumpet_oxidized,note=8,powered=true]: note_block[instrument=harp,note=8,powered=true] + note_block[instrument=trumpet_oxidized,note=8,powered=false]: note_block[instrument=harp,note=8,powered=false] + note_block[instrument=trumpet_oxidized,note=9,powered=true]: note_block[instrument=harp,note=9,powered=true] + note_block[instrument=trumpet_oxidized,note=9,powered=false]: note_block[instrument=harp,note=9,powered=false] + note_block[instrument=trumpet_oxidized,note=10,powered=true]: note_block[instrument=harp,note=10,powered=true] + note_block[instrument=trumpet_oxidized,note=10,powered=false]: note_block[instrument=harp,note=10,powered=false] + note_block[instrument=trumpet_oxidized,note=11,powered=true]: note_block[instrument=harp,note=11,powered=true] + note_block[instrument=trumpet_oxidized,note=11,powered=false]: note_block[instrument=harp,note=11,powered=false] + note_block[instrument=trumpet_oxidized,note=12,powered=true]: note_block[instrument=harp,note=12,powered=true] + note_block[instrument=trumpet_oxidized,note=12,powered=false]: note_block[instrument=harp,note=12,powered=false] + note_block[instrument=trumpet_oxidized,note=13,powered=true]: note_block[instrument=harp,note=13,powered=true] + note_block[instrument=trumpet_oxidized,note=13,powered=false]: note_block[instrument=harp,note=13,powered=false] + note_block[instrument=trumpet_oxidized,note=14,powered=true]: note_block[instrument=harp,note=14,powered=true] + note_block[instrument=trumpet_oxidized,note=14,powered=false]: note_block[instrument=harp,note=14,powered=false] + note_block[instrument=trumpet_oxidized,note=15,powered=true]: note_block[instrument=harp,note=15,powered=true] + note_block[instrument=trumpet_oxidized,note=15,powered=false]: note_block[instrument=harp,note=15,powered=false] + note_block[instrument=trumpet_oxidized,note=16,powered=true]: note_block[instrument=harp,note=16,powered=true] + note_block[instrument=trumpet_oxidized,note=16,powered=false]: note_block[instrument=harp,note=16,powered=false] + note_block[instrument=trumpet_oxidized,note=17,powered=true]: note_block[instrument=harp,note=17,powered=true] + note_block[instrument=trumpet_oxidized,note=17,powered=false]: note_block[instrument=harp,note=17,powered=false] + note_block[instrument=trumpet_oxidized,note=18,powered=true]: note_block[instrument=harp,note=18,powered=true] + note_block[instrument=trumpet_oxidized,note=18,powered=false]: note_block[instrument=harp,note=18,powered=false] + note_block[instrument=trumpet_oxidized,note=19,powered=true]: note_block[instrument=harp,note=19,powered=true] + note_block[instrument=trumpet_oxidized,note=19,powered=false]: note_block[instrument=harp,note=19,powered=false] + note_block[instrument=trumpet_oxidized,note=20,powered=true]: note_block[instrument=harp,note=20,powered=true] + note_block[instrument=trumpet_oxidized,note=20,powered=false]: note_block[instrument=harp,note=20,powered=false] + note_block[instrument=trumpet_oxidized,note=21,powered=true]: note_block[instrument=harp,note=21,powered=true] + note_block[instrument=trumpet_oxidized,note=21,powered=false]: note_block[instrument=harp,note=21,powered=false] + note_block[instrument=trumpet_oxidized,note=22,powered=true]: note_block[instrument=harp,note=22,powered=true] + note_block[instrument=trumpet_oxidized,note=22,powered=false]: note_block[instrument=harp,note=22,powered=false] + note_block[instrument=trumpet_oxidized,note=23,powered=true]: note_block[instrument=harp,note=23,powered=true] + note_block[instrument=trumpet_oxidized,note=23,powered=false]: note_block[instrument=harp,note=23,powered=false] + note_block[instrument=trumpet_oxidized,note=24,powered=true]: note_block[instrument=harp,note=24,powered=true] + note_block[instrument=trumpet_oxidized,note=24,powered=false]: note_block[instrument=harp,note=24,powered=false] + note_block[instrument=trumpet_weathered,note=0,powered=true]: note_block[instrument=harp,note=0,powered=true] + note_block[instrument=trumpet_weathered,note=0,powered=false]: note_block[instrument=harp,note=0,powered=false] + note_block[instrument=trumpet_weathered,note=1,powered=true]: note_block[instrument=harp,note=1,powered=true] + note_block[instrument=trumpet_weathered,note=1,powered=false]: note_block[instrument=harp,note=1,powered=false] + note_block[instrument=trumpet_weathered,note=2,powered=true]: note_block[instrument=harp,note=2,powered=true] + note_block[instrument=trumpet_weathered,note=2,powered=false]: note_block[instrument=harp,note=2,powered=false] + note_block[instrument=trumpet_weathered,note=3,powered=true]: note_block[instrument=harp,note=3,powered=true] + note_block[instrument=trumpet_weathered,note=3,powered=false]: note_block[instrument=harp,note=3,powered=false] + note_block[instrument=trumpet_weathered,note=4,powered=true]: note_block[instrument=harp,note=4,powered=true] + note_block[instrument=trumpet_weathered,note=4,powered=false]: note_block[instrument=harp,note=4,powered=false] + note_block[instrument=trumpet_weathered,note=5,powered=true]: note_block[instrument=harp,note=5,powered=true] + note_block[instrument=trumpet_weathered,note=5,powered=false]: note_block[instrument=harp,note=5,powered=false] + note_block[instrument=trumpet_weathered,note=6,powered=true]: note_block[instrument=harp,note=6,powered=true] + note_block[instrument=trumpet_weathered,note=6,powered=false]: note_block[instrument=harp,note=6,powered=false] + note_block[instrument=trumpet_weathered,note=7,powered=true]: note_block[instrument=harp,note=7,powered=true] + note_block[instrument=trumpet_weathered,note=7,powered=false]: note_block[instrument=harp,note=7,powered=false] + note_block[instrument=trumpet_weathered,note=8,powered=true]: note_block[instrument=harp,note=8,powered=true] + note_block[instrument=trumpet_weathered,note=8,powered=false]: note_block[instrument=harp,note=8,powered=false] + note_block[instrument=trumpet_weathered,note=9,powered=true]: note_block[instrument=harp,note=9,powered=true] + note_block[instrument=trumpet_weathered,note=9,powered=false]: note_block[instrument=harp,note=9,powered=false] + note_block[instrument=trumpet_weathered,note=10,powered=true]: note_block[instrument=harp,note=10,powered=true] + note_block[instrument=trumpet_weathered,note=10,powered=false]: note_block[instrument=harp,note=10,powered=false] + note_block[instrument=trumpet_weathered,note=11,powered=true]: note_block[instrument=harp,note=11,powered=true] + note_block[instrument=trumpet_weathered,note=11,powered=false]: note_block[instrument=harp,note=11,powered=false] + note_block[instrument=trumpet_weathered,note=12,powered=true]: note_block[instrument=harp,note=12,powered=true] + note_block[instrument=trumpet_weathered,note=12,powered=false]: note_block[instrument=harp,note=12,powered=false] + note_block[instrument=trumpet_weathered,note=13,powered=true]: note_block[instrument=harp,note=13,powered=true] + note_block[instrument=trumpet_weathered,note=13,powered=false]: note_block[instrument=harp,note=13,powered=false] + note_block[instrument=trumpet_weathered,note=14,powered=true]: note_block[instrument=harp,note=14,powered=true] + note_block[instrument=trumpet_weathered,note=14,powered=false]: note_block[instrument=harp,note=14,powered=false] + note_block[instrument=trumpet_weathered,note=15,powered=true]: note_block[instrument=harp,note=15,powered=true] + note_block[instrument=trumpet_weathered,note=15,powered=false]: note_block[instrument=harp,note=15,powered=false] + note_block[instrument=trumpet_weathered,note=16,powered=true]: note_block[instrument=harp,note=16,powered=true] + note_block[instrument=trumpet_weathered,note=16,powered=false]: note_block[instrument=harp,note=16,powered=false] + note_block[instrument=trumpet_weathered,note=17,powered=true]: note_block[instrument=harp,note=17,powered=true] + note_block[instrument=trumpet_weathered,note=17,powered=false]: note_block[instrument=harp,note=17,powered=false] + note_block[instrument=trumpet_weathered,note=18,powered=true]: note_block[instrument=harp,note=18,powered=true] + note_block[instrument=trumpet_weathered,note=18,powered=false]: note_block[instrument=harp,note=18,powered=false] + note_block[instrument=trumpet_weathered,note=19,powered=true]: note_block[instrument=harp,note=19,powered=true] + note_block[instrument=trumpet_weathered,note=19,powered=false]: note_block[instrument=harp,note=19,powered=false] + note_block[instrument=trumpet_weathered,note=20,powered=true]: note_block[instrument=harp,note=20,powered=true] + note_block[instrument=trumpet_weathered,note=20,powered=false]: note_block[instrument=harp,note=20,powered=false] + note_block[instrument=trumpet_weathered,note=21,powered=true]: note_block[instrument=harp,note=21,powered=true] + note_block[instrument=trumpet_weathered,note=21,powered=false]: note_block[instrument=harp,note=21,powered=false] + note_block[instrument=trumpet_weathered,note=22,powered=true]: note_block[instrument=harp,note=22,powered=true] + note_block[instrument=trumpet_weathered,note=22,powered=false]: note_block[instrument=harp,note=22,powered=false] + note_block[instrument=trumpet_weathered,note=23,powered=true]: note_block[instrument=harp,note=23,powered=true] + note_block[instrument=trumpet_weathered,note=23,powered=false]: note_block[instrument=harp,note=23,powered=false] + note_block[instrument=trumpet_weathered,note=24,powered=true]: note_block[instrument=harp,note=24,powered=true] + note_block[instrument=trumpet_weathered,note=24,powered=false]: note_block[instrument=harp,note=24,powered=false] + + #### Trapdoor #### + # Trapdoors look identical whether they're powered or not - which means we can double our trapdoors by using both states + iron_trapdoor[facing=north,half=top,open=true,powered=true,waterlogged=false]: iron_trapdoor[facing=north,half=top,open=true,powered=false,waterlogged=false] + iron_trapdoor[facing=south,half=top,open=true,powered=true,waterlogged=false]: iron_trapdoor[facing=south,half=top,open=true,powered=false,waterlogged=false] + iron_trapdoor[facing=east,half=top,open=true,powered=true,waterlogged=false]: iron_trapdoor[facing=east,half=top,open=true,powered=false,waterlogged=false] + iron_trapdoor[facing=west,half=top,open=true,powered=true,waterlogged=false]: iron_trapdoor[facing=west,half=top,open=true,powered=false,waterlogged=false] + iron_trapdoor[facing=north,half=top,open=false,powered=true,waterlogged=false]: iron_trapdoor[facing=north,half=top,open=false,powered=false,waterlogged=false] + iron_trapdoor[facing=south,half=top,open=false,powered=true,waterlogged=false]: iron_trapdoor[facing=south,half=top,open=false,powered=false,waterlogged=false] + iron_trapdoor[facing=east,half=top,open=false,powered=true,waterlogged=false]: iron_trapdoor[facing=east,half=top,open=false,powered=false,waterlogged=false] + iron_trapdoor[facing=west,half=top,open=false,powered=true,waterlogged=false]: iron_trapdoor[facing=west,half=top,open=false,powered=false,waterlogged=false] + iron_trapdoor[facing=north,half=top,open=true,powered=true,waterlogged=true]: iron_trapdoor[facing=north,half=top,open=true,powered=false,waterlogged=true] + iron_trapdoor[facing=south,half=top,open=true,powered=true,waterlogged=true]: iron_trapdoor[facing=south,half=top,open=true,powered=false,waterlogged=true] + iron_trapdoor[facing=east,half=top,open=true,powered=true,waterlogged=true]: iron_trapdoor[facing=east,half=top,open=true,powered=false,waterlogged=true] + iron_trapdoor[facing=west,half=top,open=true,powered=true,waterlogged=true]: iron_trapdoor[facing=west,half=top,open=true,powered=false,waterlogged=true] + iron_trapdoor[facing=north,half=top,open=false,powered=true,waterlogged=true]: iron_trapdoor[facing=north,half=top,open=false,powered=false,waterlogged=true] + iron_trapdoor[facing=south,half=top,open=false,powered=true,waterlogged=true]: iron_trapdoor[facing=south,half=top,open=false,powered=false,waterlogged=true] + iron_trapdoor[facing=east,half=top,open=false,powered=true,waterlogged=true]: iron_trapdoor[facing=east,half=top,open=false,powered=false,waterlogged=true] + iron_trapdoor[facing=west,half=top,open=false,powered=true,waterlogged=true]: iron_trapdoor[facing=west,half=top,open=false,powered=false,waterlogged=true] + iron_trapdoor[facing=north,half=bottom,open=true,powered=true,waterlogged=false]: iron_trapdoor[facing=north,half=bottom,open=true,powered=false,waterlogged=false] + iron_trapdoor[facing=south,half=bottom,open=true,powered=true,waterlogged=false]: iron_trapdoor[facing=south,half=bottom,open=true,powered=false,waterlogged=false] + iron_trapdoor[facing=east,half=bottom,open=true,powered=true,waterlogged=false]: iron_trapdoor[facing=east,half=bottom,open=true,powered=false,waterlogged=false] + iron_trapdoor[facing=west,half=bottom,open=true,powered=true,waterlogged=false]: iron_trapdoor[facing=west,half=bottom,open=true,powered=false,waterlogged=false] + iron_trapdoor[facing=north,half=bottom,open=false,powered=true,waterlogged=false]: iron_trapdoor[facing=north,half=bottom,open=false,powered=false,waterlogged=false] + iron_trapdoor[facing=south,half=bottom,open=false,powered=true,waterlogged=false]: iron_trapdoor[facing=south,half=bottom,open=false,powered=false,waterlogged=false] + iron_trapdoor[facing=east,half=bottom,open=false,powered=true,waterlogged=false]: iron_trapdoor[facing=east,half=bottom,open=false,powered=false,waterlogged=false] + iron_trapdoor[facing=west,half=bottom,open=false,powered=true,waterlogged=false]: iron_trapdoor[facing=west,half=bottom,open=false,powered=false,waterlogged=false] + iron_trapdoor[facing=north,half=bottom,open=true,powered=true,waterlogged=true]: iron_trapdoor[facing=north,half=bottom,open=true,powered=false,waterlogged=true] + iron_trapdoor[facing=south,half=bottom,open=true,powered=true,waterlogged=true]: iron_trapdoor[facing=south,half=bottom,open=true,powered=false,waterlogged=true] + iron_trapdoor[facing=east,half=bottom,open=true,powered=true,waterlogged=true]: iron_trapdoor[facing=east,half=bottom,open=true,powered=false,waterlogged=true] + iron_trapdoor[facing=west,half=bottom,open=true,powered=true,waterlogged=true]: iron_trapdoor[facing=west,half=bottom,open=true,powered=false,waterlogged=true] + iron_trapdoor[facing=north,half=bottom,open=false,powered=true,waterlogged=true]: iron_trapdoor[facing=north,half=bottom,open=false,powered=false,waterlogged=true] + iron_trapdoor[facing=south,half=bottom,open=false,powered=true,waterlogged=true]: iron_trapdoor[facing=south,half=bottom,open=false,powered=false,waterlogged=true] + iron_trapdoor[facing=east,half=bottom,open=false,powered=true,waterlogged=true]: iron_trapdoor[facing=east,half=bottom,open=false,powered=false,waterlogged=true] + iron_trapdoor[facing=west,half=bottom,open=false,powered=true,waterlogged=true]: iron_trapdoor[facing=west,half=bottom,open=false,powered=false,waterlogged=true] + acacia_trapdoor[facing=north,half=top,open=true,powered=true,waterlogged=false]: acacia_trapdoor[facing=north,half=top,open=true,powered=false,waterlogged=false] + acacia_trapdoor[facing=south,half=top,open=true,powered=true,waterlogged=false]: acacia_trapdoor[facing=south,half=top,open=true,powered=false,waterlogged=false] + acacia_trapdoor[facing=east,half=top,open=true,powered=true,waterlogged=false]: acacia_trapdoor[facing=east,half=top,open=true,powered=false,waterlogged=false] + acacia_trapdoor[facing=west,half=top,open=true,powered=true,waterlogged=false]: acacia_trapdoor[facing=west,half=top,open=true,powered=false,waterlogged=false] + acacia_trapdoor[facing=north,half=top,open=false,powered=true,waterlogged=false]: acacia_trapdoor[facing=north,half=top,open=false,powered=false,waterlogged=false] + acacia_trapdoor[facing=south,half=top,open=false,powered=true,waterlogged=false]: acacia_trapdoor[facing=south,half=top,open=false,powered=false,waterlogged=false] + acacia_trapdoor[facing=east,half=top,open=false,powered=true,waterlogged=false]: acacia_trapdoor[facing=east,half=top,open=false,powered=false,waterlogged=false] + acacia_trapdoor[facing=west,half=top,open=false,powered=true,waterlogged=false]: acacia_trapdoor[facing=west,half=top,open=false,powered=false,waterlogged=false] + acacia_trapdoor[facing=north,half=top,open=true,powered=true,waterlogged=true]: acacia_trapdoor[facing=north,half=top,open=true,powered=false,waterlogged=true] + acacia_trapdoor[facing=south,half=top,open=true,powered=true,waterlogged=true]: acacia_trapdoor[facing=south,half=top,open=true,powered=false,waterlogged=true] + acacia_trapdoor[facing=east,half=top,open=true,powered=true,waterlogged=true]: acacia_trapdoor[facing=east,half=top,open=true,powered=false,waterlogged=true] + acacia_trapdoor[facing=west,half=top,open=true,powered=true,waterlogged=true]: acacia_trapdoor[facing=west,half=top,open=true,powered=false,waterlogged=true] + acacia_trapdoor[facing=north,half=top,open=false,powered=true,waterlogged=true]: acacia_trapdoor[facing=north,half=top,open=false,powered=false,waterlogged=true] + acacia_trapdoor[facing=south,half=top,open=false,powered=true,waterlogged=true]: acacia_trapdoor[facing=south,half=top,open=false,powered=false,waterlogged=true] + acacia_trapdoor[facing=east,half=top,open=false,powered=true,waterlogged=true]: acacia_trapdoor[facing=east,half=top,open=false,powered=false,waterlogged=true] + acacia_trapdoor[facing=west,half=top,open=false,powered=true,waterlogged=true]: acacia_trapdoor[facing=west,half=top,open=false,powered=false,waterlogged=true] + acacia_trapdoor[facing=north,half=bottom,open=true,powered=true,waterlogged=false]: acacia_trapdoor[facing=north,half=bottom,open=true,powered=false,waterlogged=false] + acacia_trapdoor[facing=south,half=bottom,open=true,powered=true,waterlogged=false]: acacia_trapdoor[facing=south,half=bottom,open=true,powered=false,waterlogged=false] + acacia_trapdoor[facing=east,half=bottom,open=true,powered=true,waterlogged=false]: acacia_trapdoor[facing=east,half=bottom,open=true,powered=false,waterlogged=false] + acacia_trapdoor[facing=west,half=bottom,open=true,powered=true,waterlogged=false]: acacia_trapdoor[facing=west,half=bottom,open=true,powered=false,waterlogged=false] + acacia_trapdoor[facing=north,half=bottom,open=false,powered=true,waterlogged=false]: acacia_trapdoor[facing=north,half=bottom,open=false,powered=false,waterlogged=false] + acacia_trapdoor[facing=south,half=bottom,open=false,powered=true,waterlogged=false]: acacia_trapdoor[facing=south,half=bottom,open=false,powered=false,waterlogged=false] + acacia_trapdoor[facing=east,half=bottom,open=false,powered=true,waterlogged=false]: acacia_trapdoor[facing=east,half=bottom,open=false,powered=false,waterlogged=false] + acacia_trapdoor[facing=west,half=bottom,open=false,powered=true,waterlogged=false]: acacia_trapdoor[facing=west,half=bottom,open=false,powered=false,waterlogged=false] + acacia_trapdoor[facing=north,half=bottom,open=true,powered=true,waterlogged=true]: acacia_trapdoor[facing=north,half=bottom,open=true,powered=false,waterlogged=true] + acacia_trapdoor[facing=south,half=bottom,open=true,powered=true,waterlogged=true]: acacia_trapdoor[facing=south,half=bottom,open=true,powered=false,waterlogged=true] + acacia_trapdoor[facing=east,half=bottom,open=true,powered=true,waterlogged=true]: acacia_trapdoor[facing=east,half=bottom,open=true,powered=false,waterlogged=true] + acacia_trapdoor[facing=west,half=bottom,open=true,powered=true,waterlogged=true]: acacia_trapdoor[facing=west,half=bottom,open=true,powered=false,waterlogged=true] + acacia_trapdoor[facing=north,half=bottom,open=false,powered=true,waterlogged=true]: acacia_trapdoor[facing=north,half=bottom,open=false,powered=false,waterlogged=true] + acacia_trapdoor[facing=south,half=bottom,open=false,powered=true,waterlogged=true]: acacia_trapdoor[facing=south,half=bottom,open=false,powered=false,waterlogged=true] + acacia_trapdoor[facing=east,half=bottom,open=false,powered=true,waterlogged=true]: acacia_trapdoor[facing=east,half=bottom,open=false,powered=false,waterlogged=true] + acacia_trapdoor[facing=west,half=bottom,open=false,powered=true,waterlogged=true]: acacia_trapdoor[facing=west,half=bottom,open=false,powered=false,waterlogged=true] + oak_trapdoor[facing=north,half=top,open=true,powered=true,waterlogged=false]: oak_trapdoor[facing=north,half=top,open=true,powered=false,waterlogged=false] + oak_trapdoor[facing=south,half=top,open=true,powered=true,waterlogged=false]: oak_trapdoor[facing=south,half=top,open=true,powered=false,waterlogged=false] + oak_trapdoor[facing=east,half=top,open=true,powered=true,waterlogged=false]: oak_trapdoor[facing=east,half=top,open=true,powered=false,waterlogged=false] + oak_trapdoor[facing=west,half=top,open=true,powered=true,waterlogged=false]: oak_trapdoor[facing=west,half=top,open=true,powered=false,waterlogged=false] + oak_trapdoor[facing=north,half=top,open=false,powered=true,waterlogged=false]: oak_trapdoor[facing=north,half=top,open=false,powered=false,waterlogged=false] + oak_trapdoor[facing=south,half=top,open=false,powered=true,waterlogged=false]: oak_trapdoor[facing=south,half=top,open=false,powered=false,waterlogged=false] + oak_trapdoor[facing=east,half=top,open=false,powered=true,waterlogged=false]: oak_trapdoor[facing=east,half=top,open=false,powered=false,waterlogged=false] + oak_trapdoor[facing=west,half=top,open=false,powered=true,waterlogged=false]: oak_trapdoor[facing=west,half=top,open=false,powered=false,waterlogged=false] + oak_trapdoor[facing=north,half=top,open=true,powered=true,waterlogged=true]: oak_trapdoor[facing=north,half=top,open=true,powered=false,waterlogged=true] + oak_trapdoor[facing=south,half=top,open=true,powered=true,waterlogged=true]: oak_trapdoor[facing=south,half=top,open=true,powered=false,waterlogged=true] + oak_trapdoor[facing=east,half=top,open=true,powered=true,waterlogged=true]: oak_trapdoor[facing=east,half=top,open=true,powered=false,waterlogged=true] + oak_trapdoor[facing=west,half=top,open=true,powered=true,waterlogged=true]: oak_trapdoor[facing=west,half=top,open=true,powered=false,waterlogged=true] + oak_trapdoor[facing=north,half=top,open=false,powered=true,waterlogged=true]: oak_trapdoor[facing=north,half=top,open=false,powered=false,waterlogged=true] + oak_trapdoor[facing=south,half=top,open=false,powered=true,waterlogged=true]: oak_trapdoor[facing=south,half=top,open=false,powered=false,waterlogged=true] + oak_trapdoor[facing=east,half=top,open=false,powered=true,waterlogged=true]: oak_trapdoor[facing=east,half=top,open=false,powered=false,waterlogged=true] + oak_trapdoor[facing=west,half=top,open=false,powered=true,waterlogged=true]: oak_trapdoor[facing=west,half=top,open=false,powered=false,waterlogged=true] + oak_trapdoor[facing=north,half=bottom,open=true,powered=true,waterlogged=false]: oak_trapdoor[facing=north,half=bottom,open=true,powered=false,waterlogged=false] + oak_trapdoor[facing=south,half=bottom,open=true,powered=true,waterlogged=false]: oak_trapdoor[facing=south,half=bottom,open=true,powered=false,waterlogged=false] + oak_trapdoor[facing=east,half=bottom,open=true,powered=true,waterlogged=false]: oak_trapdoor[facing=east,half=bottom,open=true,powered=false,waterlogged=false] + oak_trapdoor[facing=west,half=bottom,open=true,powered=true,waterlogged=false]: oak_trapdoor[facing=west,half=bottom,open=true,powered=false,waterlogged=false] + oak_trapdoor[facing=north,half=bottom,open=false,powered=true,waterlogged=false]: oak_trapdoor[facing=north,half=bottom,open=false,powered=false,waterlogged=false] + oak_trapdoor[facing=south,half=bottom,open=false,powered=true,waterlogged=false]: oak_trapdoor[facing=south,half=bottom,open=false,powered=false,waterlogged=false] + oak_trapdoor[facing=east,half=bottom,open=false,powered=true,waterlogged=false]: oak_trapdoor[facing=east,half=bottom,open=false,powered=false,waterlogged=false] + oak_trapdoor[facing=west,half=bottom,open=false,powered=true,waterlogged=false]: oak_trapdoor[facing=west,half=bottom,open=false,powered=false,waterlogged=false] + oak_trapdoor[facing=north,half=bottom,open=true,powered=true,waterlogged=true]: oak_trapdoor[facing=north,half=bottom,open=true,powered=false,waterlogged=true] + oak_trapdoor[facing=south,half=bottom,open=true,powered=true,waterlogged=true]: oak_trapdoor[facing=south,half=bottom,open=true,powered=false,waterlogged=true] + oak_trapdoor[facing=east,half=bottom,open=true,powered=true,waterlogged=true]: oak_trapdoor[facing=east,half=bottom,open=true,powered=false,waterlogged=true] + oak_trapdoor[facing=west,half=bottom,open=true,powered=true,waterlogged=true]: oak_trapdoor[facing=west,half=bottom,open=true,powered=false,waterlogged=true] + oak_trapdoor[facing=north,half=bottom,open=false,powered=true,waterlogged=true]: oak_trapdoor[facing=north,half=bottom,open=false,powered=false,waterlogged=true] + oak_trapdoor[facing=south,half=bottom,open=false,powered=true,waterlogged=true]: oak_trapdoor[facing=south,half=bottom,open=false,powered=false,waterlogged=true] + oak_trapdoor[facing=east,half=bottom,open=false,powered=true,waterlogged=true]: oak_trapdoor[facing=east,half=bottom,open=false,powered=false,waterlogged=true] + oak_trapdoor[facing=west,half=bottom,open=false,powered=true,waterlogged=true]: oak_trapdoor[facing=west,half=bottom,open=false,powered=false,waterlogged=true] + spruce_trapdoor[facing=north,half=top,open=true,powered=true,waterlogged=false]: spruce_trapdoor[facing=north,half=top,open=true,powered=false,waterlogged=false] + spruce_trapdoor[facing=south,half=top,open=true,powered=true,waterlogged=false]: spruce_trapdoor[facing=south,half=top,open=true,powered=false,waterlogged=false] + spruce_trapdoor[facing=east,half=top,open=true,powered=true,waterlogged=false]: spruce_trapdoor[facing=east,half=top,open=true,powered=false,waterlogged=false] + spruce_trapdoor[facing=west,half=top,open=true,powered=true,waterlogged=false]: spruce_trapdoor[facing=west,half=top,open=true,powered=false,waterlogged=false] + spruce_trapdoor[facing=north,half=top,open=false,powered=true,waterlogged=false]: spruce_trapdoor[facing=north,half=top,open=false,powered=false,waterlogged=false] + spruce_trapdoor[facing=south,half=top,open=false,powered=true,waterlogged=false]: spruce_trapdoor[facing=south,half=top,open=false,powered=false,waterlogged=false] + spruce_trapdoor[facing=east,half=top,open=false,powered=true,waterlogged=false]: spruce_trapdoor[facing=east,half=top,open=false,powered=false,waterlogged=false] + spruce_trapdoor[facing=west,half=top,open=false,powered=true,waterlogged=false]: spruce_trapdoor[facing=west,half=top,open=false,powered=false,waterlogged=false] + spruce_trapdoor[facing=north,half=top,open=true,powered=true,waterlogged=true]: spruce_trapdoor[facing=north,half=top,open=true,powered=false,waterlogged=true] + spruce_trapdoor[facing=south,half=top,open=true,powered=true,waterlogged=true]: spruce_trapdoor[facing=south,half=top,open=true,powered=false,waterlogged=true] + spruce_trapdoor[facing=east,half=top,open=true,powered=true,waterlogged=true]: spruce_trapdoor[facing=east,half=top,open=true,powered=false,waterlogged=true] + spruce_trapdoor[facing=west,half=top,open=true,powered=true,waterlogged=true]: spruce_trapdoor[facing=west,half=top,open=true,powered=false,waterlogged=true] + spruce_trapdoor[facing=north,half=top,open=false,powered=true,waterlogged=true]: spruce_trapdoor[facing=north,half=top,open=false,powered=false,waterlogged=true] + spruce_trapdoor[facing=south,half=top,open=false,powered=true,waterlogged=true]: spruce_trapdoor[facing=south,half=top,open=false,powered=false,waterlogged=true] + spruce_trapdoor[facing=east,half=top,open=false,powered=true,waterlogged=true]: spruce_trapdoor[facing=east,half=top,open=false,powered=false,waterlogged=true] + spruce_trapdoor[facing=west,half=top,open=false,powered=true,waterlogged=true]: spruce_trapdoor[facing=west,half=top,open=false,powered=false,waterlogged=true] + spruce_trapdoor[facing=north,half=bottom,open=true,powered=true,waterlogged=false]: spruce_trapdoor[facing=north,half=bottom,open=true,powered=false,waterlogged=false] + spruce_trapdoor[facing=south,half=bottom,open=true,powered=true,waterlogged=false]: spruce_trapdoor[facing=south,half=bottom,open=true,powered=false,waterlogged=false] + spruce_trapdoor[facing=east,half=bottom,open=true,powered=true,waterlogged=false]: spruce_trapdoor[facing=east,half=bottom,open=true,powered=false,waterlogged=false] + spruce_trapdoor[facing=west,half=bottom,open=true,powered=true,waterlogged=false]: spruce_trapdoor[facing=west,half=bottom,open=true,powered=false,waterlogged=false] + spruce_trapdoor[facing=north,half=bottom,open=false,powered=true,waterlogged=false]: spruce_trapdoor[facing=north,half=bottom,open=false,powered=false,waterlogged=false] + spruce_trapdoor[facing=south,half=bottom,open=false,powered=true,waterlogged=false]: spruce_trapdoor[facing=south,half=bottom,open=false,powered=false,waterlogged=false] + spruce_trapdoor[facing=east,half=bottom,open=false,powered=true,waterlogged=false]: spruce_trapdoor[facing=east,half=bottom,open=false,powered=false,waterlogged=false] + spruce_trapdoor[facing=west,half=bottom,open=false,powered=true,waterlogged=false]: spruce_trapdoor[facing=west,half=bottom,open=false,powered=false,waterlogged=false] + spruce_trapdoor[facing=north,half=bottom,open=true,powered=true,waterlogged=true]: spruce_trapdoor[facing=north,half=bottom,open=true,powered=false,waterlogged=true] + spruce_trapdoor[facing=south,half=bottom,open=true,powered=true,waterlogged=true]: spruce_trapdoor[facing=south,half=bottom,open=true,powered=false,waterlogged=true] + spruce_trapdoor[facing=east,half=bottom,open=true,powered=true,waterlogged=true]: spruce_trapdoor[facing=east,half=bottom,open=true,powered=false,waterlogged=true] + spruce_trapdoor[facing=west,half=bottom,open=true,powered=true,waterlogged=true]: spruce_trapdoor[facing=west,half=bottom,open=true,powered=false,waterlogged=true] + spruce_trapdoor[facing=north,half=bottom,open=false,powered=true,waterlogged=true]: spruce_trapdoor[facing=north,half=bottom,open=false,powered=false,waterlogged=true] + spruce_trapdoor[facing=south,half=bottom,open=false,powered=true,waterlogged=true]: spruce_trapdoor[facing=south,half=bottom,open=false,powered=false,waterlogged=true] + spruce_trapdoor[facing=east,half=bottom,open=false,powered=true,waterlogged=true]: spruce_trapdoor[facing=east,half=bottom,open=false,powered=false,waterlogged=true] + spruce_trapdoor[facing=west,half=bottom,open=false,powered=true,waterlogged=true]: spruce_trapdoor[facing=west,half=bottom,open=false,powered=false,waterlogged=true] + birch_trapdoor[facing=north,half=top,open=true,powered=true,waterlogged=false]: birch_trapdoor[facing=north,half=top,open=true,powered=false,waterlogged=false] + birch_trapdoor[facing=south,half=top,open=true,powered=true,waterlogged=false]: birch_trapdoor[facing=south,half=top,open=true,powered=false,waterlogged=false] + birch_trapdoor[facing=east,half=top,open=true,powered=true,waterlogged=false]: birch_trapdoor[facing=east,half=top,open=true,powered=false,waterlogged=false] + birch_trapdoor[facing=west,half=top,open=true,powered=true,waterlogged=false]: birch_trapdoor[facing=west,half=top,open=true,powered=false,waterlogged=false] + birch_trapdoor[facing=north,half=top,open=false,powered=true,waterlogged=false]: birch_trapdoor[facing=north,half=top,open=false,powered=false,waterlogged=false] + birch_trapdoor[facing=south,half=top,open=false,powered=true,waterlogged=false]: birch_trapdoor[facing=south,half=top,open=false,powered=false,waterlogged=false] + birch_trapdoor[facing=east,half=top,open=false,powered=true,waterlogged=false]: birch_trapdoor[facing=east,half=top,open=false,powered=false,waterlogged=false] + birch_trapdoor[facing=west,half=top,open=false,powered=true,waterlogged=false]: birch_trapdoor[facing=west,half=top,open=false,powered=false,waterlogged=false] + birch_trapdoor[facing=north,half=top,open=true,powered=true,waterlogged=true]: birch_trapdoor[facing=north,half=top,open=true,powered=false,waterlogged=true] + birch_trapdoor[facing=south,half=top,open=true,powered=true,waterlogged=true]: birch_trapdoor[facing=south,half=top,open=true,powered=false,waterlogged=true] + birch_trapdoor[facing=east,half=top,open=true,powered=true,waterlogged=true]: birch_trapdoor[facing=east,half=top,open=true,powered=false,waterlogged=true] + birch_trapdoor[facing=west,half=top,open=true,powered=true,waterlogged=true]: birch_trapdoor[facing=west,half=top,open=true,powered=false,waterlogged=true] + birch_trapdoor[facing=north,half=top,open=false,powered=true,waterlogged=true]: birch_trapdoor[facing=north,half=top,open=false,powered=false,waterlogged=true] + birch_trapdoor[facing=south,half=top,open=false,powered=true,waterlogged=true]: birch_trapdoor[facing=south,half=top,open=false,powered=false,waterlogged=true] + birch_trapdoor[facing=east,half=top,open=false,powered=true,waterlogged=true]: birch_trapdoor[facing=east,half=top,open=false,powered=false,waterlogged=true] + birch_trapdoor[facing=west,half=top,open=false,powered=true,waterlogged=true]: birch_trapdoor[facing=west,half=top,open=false,powered=false,waterlogged=true] + birch_trapdoor[facing=north,half=bottom,open=true,powered=true,waterlogged=false]: birch_trapdoor[facing=north,half=bottom,open=true,powered=false,waterlogged=false] + birch_trapdoor[facing=south,half=bottom,open=true,powered=true,waterlogged=false]: birch_trapdoor[facing=south,half=bottom,open=true,powered=false,waterlogged=false] + birch_trapdoor[facing=east,half=bottom,open=true,powered=true,waterlogged=false]: birch_trapdoor[facing=east,half=bottom,open=true,powered=false,waterlogged=false] + birch_trapdoor[facing=west,half=bottom,open=true,powered=true,waterlogged=false]: birch_trapdoor[facing=west,half=bottom,open=true,powered=false,waterlogged=false] + birch_trapdoor[facing=north,half=bottom,open=false,powered=true,waterlogged=false]: birch_trapdoor[facing=north,half=bottom,open=false,powered=false,waterlogged=false] + birch_trapdoor[facing=south,half=bottom,open=false,powered=true,waterlogged=false]: birch_trapdoor[facing=south,half=bottom,open=false,powered=false,waterlogged=false] + birch_trapdoor[facing=east,half=bottom,open=false,powered=true,waterlogged=false]: birch_trapdoor[facing=east,half=bottom,open=false,powered=false,waterlogged=false] + birch_trapdoor[facing=west,half=bottom,open=false,powered=true,waterlogged=false]: birch_trapdoor[facing=west,half=bottom,open=false,powered=false,waterlogged=false] + birch_trapdoor[facing=north,half=bottom,open=true,powered=true,waterlogged=true]: birch_trapdoor[facing=north,half=bottom,open=true,powered=false,waterlogged=true] + birch_trapdoor[facing=south,half=bottom,open=true,powered=true,waterlogged=true]: birch_trapdoor[facing=south,half=bottom,open=true,powered=false,waterlogged=true] + birch_trapdoor[facing=east,half=bottom,open=true,powered=true,waterlogged=true]: birch_trapdoor[facing=east,half=bottom,open=true,powered=false,waterlogged=true] + birch_trapdoor[facing=west,half=bottom,open=true,powered=true,waterlogged=true]: birch_trapdoor[facing=west,half=bottom,open=true,powered=false,waterlogged=true] + birch_trapdoor[facing=north,half=bottom,open=false,powered=true,waterlogged=true]: birch_trapdoor[facing=north,half=bottom,open=false,powered=false,waterlogged=true] + birch_trapdoor[facing=south,half=bottom,open=false,powered=true,waterlogged=true]: birch_trapdoor[facing=south,half=bottom,open=false,powered=false,waterlogged=true] + birch_trapdoor[facing=east,half=bottom,open=false,powered=true,waterlogged=true]: birch_trapdoor[facing=east,half=bottom,open=false,powered=false,waterlogged=true] + birch_trapdoor[facing=west,half=bottom,open=false,powered=true,waterlogged=true]: birch_trapdoor[facing=west,half=bottom,open=false,powered=false,waterlogged=true] + jungle_trapdoor[facing=north,half=top,open=true,powered=true,waterlogged=false]: jungle_trapdoor[facing=north,half=top,open=true,powered=false,waterlogged=false] + jungle_trapdoor[facing=south,half=top,open=true,powered=true,waterlogged=false]: jungle_trapdoor[facing=south,half=top,open=true,powered=false,waterlogged=false] + jungle_trapdoor[facing=east,half=top,open=true,powered=true,waterlogged=false]: jungle_trapdoor[facing=east,half=top,open=true,powered=false,waterlogged=false] + jungle_trapdoor[facing=west,half=top,open=true,powered=true,waterlogged=false]: jungle_trapdoor[facing=west,half=top,open=true,powered=false,waterlogged=false] + jungle_trapdoor[facing=north,half=top,open=false,powered=true,waterlogged=false]: jungle_trapdoor[facing=north,half=top,open=false,powered=false,waterlogged=false] + jungle_trapdoor[facing=south,half=top,open=false,powered=true,waterlogged=false]: jungle_trapdoor[facing=south,half=top,open=false,powered=false,waterlogged=false] + jungle_trapdoor[facing=east,half=top,open=false,powered=true,waterlogged=false]: jungle_trapdoor[facing=east,half=top,open=false,powered=false,waterlogged=false] + jungle_trapdoor[facing=west,half=top,open=false,powered=true,waterlogged=false]: jungle_trapdoor[facing=west,half=top,open=false,powered=false,waterlogged=false] + jungle_trapdoor[facing=north,half=top,open=true,powered=true,waterlogged=true]: jungle_trapdoor[facing=north,half=top,open=true,powered=false,waterlogged=true] + jungle_trapdoor[facing=south,half=top,open=true,powered=true,waterlogged=true]: jungle_trapdoor[facing=south,half=top,open=true,powered=false,waterlogged=true] + jungle_trapdoor[facing=east,half=top,open=true,powered=true,waterlogged=true]: jungle_trapdoor[facing=east,half=top,open=true,powered=false,waterlogged=true] + jungle_trapdoor[facing=west,half=top,open=true,powered=true,waterlogged=true]: jungle_trapdoor[facing=west,half=top,open=true,powered=false,waterlogged=true] + jungle_trapdoor[facing=north,half=top,open=false,powered=true,waterlogged=true]: jungle_trapdoor[facing=north,half=top,open=false,powered=false,waterlogged=true] + jungle_trapdoor[facing=south,half=top,open=false,powered=true,waterlogged=true]: jungle_trapdoor[facing=south,half=top,open=false,powered=false,waterlogged=true] + jungle_trapdoor[facing=east,half=top,open=false,powered=true,waterlogged=true]: jungle_trapdoor[facing=east,half=top,open=false,powered=false,waterlogged=true] + jungle_trapdoor[facing=west,half=top,open=false,powered=true,waterlogged=true]: jungle_trapdoor[facing=west,half=top,open=false,powered=false,waterlogged=true] + jungle_trapdoor[facing=north,half=bottom,open=true,powered=true,waterlogged=false]: jungle_trapdoor[facing=north,half=bottom,open=true,powered=false,waterlogged=false] + jungle_trapdoor[facing=south,half=bottom,open=true,powered=true,waterlogged=false]: jungle_trapdoor[facing=south,half=bottom,open=true,powered=false,waterlogged=false] + jungle_trapdoor[facing=east,half=bottom,open=true,powered=true,waterlogged=false]: jungle_trapdoor[facing=east,half=bottom,open=true,powered=false,waterlogged=false] + jungle_trapdoor[facing=west,half=bottom,open=true,powered=true,waterlogged=false]: jungle_trapdoor[facing=west,half=bottom,open=true,powered=false,waterlogged=false] + jungle_trapdoor[facing=north,half=bottom,open=false,powered=true,waterlogged=false]: jungle_trapdoor[facing=north,half=bottom,open=false,powered=false,waterlogged=false] + jungle_trapdoor[facing=south,half=bottom,open=false,powered=true,waterlogged=false]: jungle_trapdoor[facing=south,half=bottom,open=false,powered=false,waterlogged=false] + jungle_trapdoor[facing=east,half=bottom,open=false,powered=true,waterlogged=false]: jungle_trapdoor[facing=east,half=bottom,open=false,powered=false,waterlogged=false] + jungle_trapdoor[facing=west,half=bottom,open=false,powered=true,waterlogged=false]: jungle_trapdoor[facing=west,half=bottom,open=false,powered=false,waterlogged=false] + jungle_trapdoor[facing=north,half=bottom,open=true,powered=true,waterlogged=true]: jungle_trapdoor[facing=north,half=bottom,open=true,powered=false,waterlogged=true] + jungle_trapdoor[facing=south,half=bottom,open=true,powered=true,waterlogged=true]: jungle_trapdoor[facing=south,half=bottom,open=true,powered=false,waterlogged=true] + jungle_trapdoor[facing=east,half=bottom,open=true,powered=true,waterlogged=true]: jungle_trapdoor[facing=east,half=bottom,open=true,powered=false,waterlogged=true] + jungle_trapdoor[facing=west,half=bottom,open=true,powered=true,waterlogged=true]: jungle_trapdoor[facing=west,half=bottom,open=true,powered=false,waterlogged=true] + jungle_trapdoor[facing=north,half=bottom,open=false,powered=true,waterlogged=true]: jungle_trapdoor[facing=north,half=bottom,open=false,powered=false,waterlogged=true] + jungle_trapdoor[facing=south,half=bottom,open=false,powered=true,waterlogged=true]: jungle_trapdoor[facing=south,half=bottom,open=false,powered=false,waterlogged=true] + jungle_trapdoor[facing=east,half=bottom,open=false,powered=true,waterlogged=true]: jungle_trapdoor[facing=east,half=bottom,open=false,powered=false,waterlogged=true] + jungle_trapdoor[facing=west,half=bottom,open=false,powered=true,waterlogged=true]: jungle_trapdoor[facing=west,half=bottom,open=false,powered=false,waterlogged=true] + dark_oak_trapdoor[facing=north,half=top,open=true,powered=true,waterlogged=false]: dark_oak_trapdoor[facing=north,half=top,open=true,powered=false,waterlogged=false] + dark_oak_trapdoor[facing=south,half=top,open=true,powered=true,waterlogged=false]: dark_oak_trapdoor[facing=south,half=top,open=true,powered=false,waterlogged=false] + dark_oak_trapdoor[facing=east,half=top,open=true,powered=true,waterlogged=false]: dark_oak_trapdoor[facing=east,half=top,open=true,powered=false,waterlogged=false] + dark_oak_trapdoor[facing=west,half=top,open=true,powered=true,waterlogged=false]: dark_oak_trapdoor[facing=west,half=top,open=true,powered=false,waterlogged=false] + dark_oak_trapdoor[facing=north,half=top,open=false,powered=true,waterlogged=false]: dark_oak_trapdoor[facing=north,half=top,open=false,powered=false,waterlogged=false] + dark_oak_trapdoor[facing=south,half=top,open=false,powered=true,waterlogged=false]: dark_oak_trapdoor[facing=south,half=top,open=false,powered=false,waterlogged=false] + dark_oak_trapdoor[facing=east,half=top,open=false,powered=true,waterlogged=false]: dark_oak_trapdoor[facing=east,half=top,open=false,powered=false,waterlogged=false] + dark_oak_trapdoor[facing=west,half=top,open=false,powered=true,waterlogged=false]: dark_oak_trapdoor[facing=west,half=top,open=false,powered=false,waterlogged=false] + dark_oak_trapdoor[facing=north,half=top,open=true,powered=true,waterlogged=true]: dark_oak_trapdoor[facing=north,half=top,open=true,powered=false,waterlogged=true] + dark_oak_trapdoor[facing=south,half=top,open=true,powered=true,waterlogged=true]: dark_oak_trapdoor[facing=south,half=top,open=true,powered=false,waterlogged=true] + dark_oak_trapdoor[facing=east,half=top,open=true,powered=true,waterlogged=true]: dark_oak_trapdoor[facing=east,half=top,open=true,powered=false,waterlogged=true] + dark_oak_trapdoor[facing=west,half=top,open=true,powered=true,waterlogged=true]: dark_oak_trapdoor[facing=west,half=top,open=true,powered=false,waterlogged=true] + dark_oak_trapdoor[facing=north,half=top,open=false,powered=true,waterlogged=true]: dark_oak_trapdoor[facing=north,half=top,open=false,powered=false,waterlogged=true] + dark_oak_trapdoor[facing=south,half=top,open=false,powered=true,waterlogged=true]: dark_oak_trapdoor[facing=south,half=top,open=false,powered=false,waterlogged=true] + dark_oak_trapdoor[facing=east,half=top,open=false,powered=true,waterlogged=true]: dark_oak_trapdoor[facing=east,half=top,open=false,powered=false,waterlogged=true] + dark_oak_trapdoor[facing=west,half=top,open=false,powered=true,waterlogged=true]: dark_oak_trapdoor[facing=west,half=top,open=false,powered=false,waterlogged=true] + dark_oak_trapdoor[facing=north,half=bottom,open=true,powered=true,waterlogged=false]: dark_oak_trapdoor[facing=north,half=bottom,open=true,powered=false,waterlogged=false] + dark_oak_trapdoor[facing=south,half=bottom,open=true,powered=true,waterlogged=false]: dark_oak_trapdoor[facing=south,half=bottom,open=true,powered=false,waterlogged=false] + dark_oak_trapdoor[facing=east,half=bottom,open=true,powered=true,waterlogged=false]: dark_oak_trapdoor[facing=east,half=bottom,open=true,powered=false,waterlogged=false] + dark_oak_trapdoor[facing=west,half=bottom,open=true,powered=true,waterlogged=false]: dark_oak_trapdoor[facing=west,half=bottom,open=true,powered=false,waterlogged=false] + dark_oak_trapdoor[facing=north,half=bottom,open=false,powered=true,waterlogged=false]: dark_oak_trapdoor[facing=north,half=bottom,open=false,powered=false,waterlogged=false] + dark_oak_trapdoor[facing=south,half=bottom,open=false,powered=true,waterlogged=false]: dark_oak_trapdoor[facing=south,half=bottom,open=false,powered=false,waterlogged=false] + dark_oak_trapdoor[facing=east,half=bottom,open=false,powered=true,waterlogged=false]: dark_oak_trapdoor[facing=east,half=bottom,open=false,powered=false,waterlogged=false] + dark_oak_trapdoor[facing=west,half=bottom,open=false,powered=true,waterlogged=false]: dark_oak_trapdoor[facing=west,half=bottom,open=false,powered=false,waterlogged=false] + dark_oak_trapdoor[facing=north,half=bottom,open=true,powered=true,waterlogged=true]: dark_oak_trapdoor[facing=north,half=bottom,open=true,powered=false,waterlogged=true] + dark_oak_trapdoor[facing=south,half=bottom,open=true,powered=true,waterlogged=true]: dark_oak_trapdoor[facing=south,half=bottom,open=true,powered=false,waterlogged=true] + dark_oak_trapdoor[facing=east,half=bottom,open=true,powered=true,waterlogged=true]: dark_oak_trapdoor[facing=east,half=bottom,open=true,powered=false,waterlogged=true] + dark_oak_trapdoor[facing=west,half=bottom,open=true,powered=true,waterlogged=true]: dark_oak_trapdoor[facing=west,half=bottom,open=true,powered=false,waterlogged=true] + dark_oak_trapdoor[facing=north,half=bottom,open=false,powered=true,waterlogged=true]: dark_oak_trapdoor[facing=north,half=bottom,open=false,powered=false,waterlogged=true] + dark_oak_trapdoor[facing=south,half=bottom,open=false,powered=true,waterlogged=true]: dark_oak_trapdoor[facing=south,half=bottom,open=false,powered=false,waterlogged=true] + dark_oak_trapdoor[facing=east,half=bottom,open=false,powered=true,waterlogged=true]: dark_oak_trapdoor[facing=east,half=bottom,open=false,powered=false,waterlogged=true] + dark_oak_trapdoor[facing=west,half=bottom,open=false,powered=true,waterlogged=true]: dark_oak_trapdoor[facing=west,half=bottom,open=false,powered=false,waterlogged=true] + mangrove_trapdoor[facing=north,half=top,open=true,powered=true,waterlogged=false]: mangrove_trapdoor[facing=north,half=top,open=true,powered=false,waterlogged=false] + mangrove_trapdoor[facing=south,half=top,open=true,powered=true,waterlogged=false]: mangrove_trapdoor[facing=south,half=top,open=true,powered=false,waterlogged=false] + mangrove_trapdoor[facing=east,half=top,open=true,powered=true,waterlogged=false]: mangrove_trapdoor[facing=east,half=top,open=true,powered=false,waterlogged=false] + mangrove_trapdoor[facing=west,half=top,open=true,powered=true,waterlogged=false]: mangrove_trapdoor[facing=west,half=top,open=true,powered=false,waterlogged=false] + mangrove_trapdoor[facing=north,half=top,open=false,powered=true,waterlogged=false]: mangrove_trapdoor[facing=north,half=top,open=false,powered=false,waterlogged=false] + mangrove_trapdoor[facing=south,half=top,open=false,powered=true,waterlogged=false]: mangrove_trapdoor[facing=south,half=top,open=false,powered=false,waterlogged=false] + mangrove_trapdoor[facing=east,half=top,open=false,powered=true,waterlogged=false]: mangrove_trapdoor[facing=east,half=top,open=false,powered=false,waterlogged=false] + mangrove_trapdoor[facing=west,half=top,open=false,powered=true,waterlogged=false]: mangrove_trapdoor[facing=west,half=top,open=false,powered=false,waterlogged=false] + mangrove_trapdoor[facing=north,half=top,open=true,powered=true,waterlogged=true]: mangrove_trapdoor[facing=north,half=top,open=true,powered=false,waterlogged=true] + mangrove_trapdoor[facing=south,half=top,open=true,powered=true,waterlogged=true]: mangrove_trapdoor[facing=south,half=top,open=true,powered=false,waterlogged=true] + mangrove_trapdoor[facing=east,half=top,open=true,powered=true,waterlogged=true]: mangrove_trapdoor[facing=east,half=top,open=true,powered=false,waterlogged=true] + mangrove_trapdoor[facing=west,half=top,open=true,powered=true,waterlogged=true]: mangrove_trapdoor[facing=west,half=top,open=true,powered=false,waterlogged=true] + mangrove_trapdoor[facing=north,half=top,open=false,powered=true,waterlogged=true]: mangrove_trapdoor[facing=north,half=top,open=false,powered=false,waterlogged=true] + mangrove_trapdoor[facing=south,half=top,open=false,powered=true,waterlogged=true]: mangrove_trapdoor[facing=south,half=top,open=false,powered=false,waterlogged=true] + mangrove_trapdoor[facing=east,half=top,open=false,powered=true,waterlogged=true]: mangrove_trapdoor[facing=east,half=top,open=false,powered=false,waterlogged=true] + mangrove_trapdoor[facing=west,half=top,open=false,powered=true,waterlogged=true]: mangrove_trapdoor[facing=west,half=top,open=false,powered=false,waterlogged=true] + mangrove_trapdoor[facing=north,half=bottom,open=true,powered=true,waterlogged=false]: mangrove_trapdoor[facing=north,half=bottom,open=true,powered=false,waterlogged=false] + mangrove_trapdoor[facing=south,half=bottom,open=true,powered=true,waterlogged=false]: mangrove_trapdoor[facing=south,half=bottom,open=true,powered=false,waterlogged=false] + mangrove_trapdoor[facing=east,half=bottom,open=true,powered=true,waterlogged=false]: mangrove_trapdoor[facing=east,half=bottom,open=true,powered=false,waterlogged=false] + mangrove_trapdoor[facing=west,half=bottom,open=true,powered=true,waterlogged=false]: mangrove_trapdoor[facing=west,half=bottom,open=true,powered=false,waterlogged=false] + mangrove_trapdoor[facing=north,half=bottom,open=false,powered=true,waterlogged=false]: mangrove_trapdoor[facing=north,half=bottom,open=false,powered=false,waterlogged=false] + mangrove_trapdoor[facing=south,half=bottom,open=false,powered=true,waterlogged=false]: mangrove_trapdoor[facing=south,half=bottom,open=false,powered=false,waterlogged=false] + mangrove_trapdoor[facing=east,half=bottom,open=false,powered=true,waterlogged=false]: mangrove_trapdoor[facing=east,half=bottom,open=false,powered=false,waterlogged=false] + mangrove_trapdoor[facing=west,half=bottom,open=false,powered=true,waterlogged=false]: mangrove_trapdoor[facing=west,half=bottom,open=false,powered=false,waterlogged=false] + mangrove_trapdoor[facing=north,half=bottom,open=true,powered=true,waterlogged=true]: mangrove_trapdoor[facing=north,half=bottom,open=true,powered=false,waterlogged=true] + mangrove_trapdoor[facing=south,half=bottom,open=true,powered=true,waterlogged=true]: mangrove_trapdoor[facing=south,half=bottom,open=true,powered=false,waterlogged=true] + mangrove_trapdoor[facing=east,half=bottom,open=true,powered=true,waterlogged=true]: mangrove_trapdoor[facing=east,half=bottom,open=true,powered=false,waterlogged=true] + mangrove_trapdoor[facing=west,half=bottom,open=true,powered=true,waterlogged=true]: mangrove_trapdoor[facing=west,half=bottom,open=true,powered=false,waterlogged=true] + mangrove_trapdoor[facing=north,half=bottom,open=false,powered=true,waterlogged=true]: mangrove_trapdoor[facing=north,half=bottom,open=false,powered=false,waterlogged=true] + mangrove_trapdoor[facing=south,half=bottom,open=false,powered=true,waterlogged=true]: mangrove_trapdoor[facing=south,half=bottom,open=false,powered=false,waterlogged=true] + mangrove_trapdoor[facing=east,half=bottom,open=false,powered=true,waterlogged=true]: mangrove_trapdoor[facing=east,half=bottom,open=false,powered=false,waterlogged=true] + mangrove_trapdoor[facing=west,half=bottom,open=false,powered=true,waterlogged=true]: mangrove_trapdoor[facing=west,half=bottom,open=false,powered=false,waterlogged=true] + cherry_trapdoor[facing=north,half=top,open=true,powered=true,waterlogged=false]: cherry_trapdoor[facing=north,half=top,open=true,powered=false,waterlogged=false] + cherry_trapdoor[facing=south,half=top,open=true,powered=true,waterlogged=false]: cherry_trapdoor[facing=south,half=top,open=true,powered=false,waterlogged=false] + cherry_trapdoor[facing=east,half=top,open=true,powered=true,waterlogged=false]: cherry_trapdoor[facing=east,half=top,open=true,powered=false,waterlogged=false] + cherry_trapdoor[facing=west,half=top,open=true,powered=true,waterlogged=false]: cherry_trapdoor[facing=west,half=top,open=true,powered=false,waterlogged=false] + cherry_trapdoor[facing=north,half=top,open=false,powered=true,waterlogged=false]: cherry_trapdoor[facing=north,half=top,open=false,powered=false,waterlogged=false] + cherry_trapdoor[facing=south,half=top,open=false,powered=true,waterlogged=false]: cherry_trapdoor[facing=south,half=top,open=false,powered=false,waterlogged=false] + cherry_trapdoor[facing=east,half=top,open=false,powered=true,waterlogged=false]: cherry_trapdoor[facing=east,half=top,open=false,powered=false,waterlogged=false] + cherry_trapdoor[facing=west,half=top,open=false,powered=true,waterlogged=false]: cherry_trapdoor[facing=west,half=top,open=false,powered=false,waterlogged=false] + cherry_trapdoor[facing=north,half=top,open=true,powered=true,waterlogged=true]: cherry_trapdoor[facing=north,half=top,open=true,powered=false,waterlogged=true] + cherry_trapdoor[facing=south,half=top,open=true,powered=true,waterlogged=true]: cherry_trapdoor[facing=south,half=top,open=true,powered=false,waterlogged=true] + cherry_trapdoor[facing=east,half=top,open=true,powered=true,waterlogged=true]: cherry_trapdoor[facing=east,half=top,open=true,powered=false,waterlogged=true] + cherry_trapdoor[facing=west,half=top,open=true,powered=true,waterlogged=true]: cherry_trapdoor[facing=west,half=top,open=true,powered=false,waterlogged=true] + cherry_trapdoor[facing=north,half=top,open=false,powered=true,waterlogged=true]: cherry_trapdoor[facing=north,half=top,open=false,powered=false,waterlogged=true] + cherry_trapdoor[facing=south,half=top,open=false,powered=true,waterlogged=true]: cherry_trapdoor[facing=south,half=top,open=false,powered=false,waterlogged=true] + cherry_trapdoor[facing=east,half=top,open=false,powered=true,waterlogged=true]: cherry_trapdoor[facing=east,half=top,open=false,powered=false,waterlogged=true] + cherry_trapdoor[facing=west,half=top,open=false,powered=true,waterlogged=true]: cherry_trapdoor[facing=west,half=top,open=false,powered=false,waterlogged=true] + cherry_trapdoor[facing=north,half=bottom,open=true,powered=true,waterlogged=false]: cherry_trapdoor[facing=north,half=bottom,open=true,powered=false,waterlogged=false] + cherry_trapdoor[facing=south,half=bottom,open=true,powered=true,waterlogged=false]: cherry_trapdoor[facing=south,half=bottom,open=true,powered=false,waterlogged=false] + cherry_trapdoor[facing=east,half=bottom,open=true,powered=true,waterlogged=false]: cherry_trapdoor[facing=east,half=bottom,open=true,powered=false,waterlogged=false] + cherry_trapdoor[facing=west,half=bottom,open=true,powered=true,waterlogged=false]: cherry_trapdoor[facing=west,half=bottom,open=true,powered=false,waterlogged=false] + cherry_trapdoor[facing=north,half=bottom,open=false,powered=true,waterlogged=false]: cherry_trapdoor[facing=north,half=bottom,open=false,powered=false,waterlogged=false] + cherry_trapdoor[facing=south,half=bottom,open=false,powered=true,waterlogged=false]: cherry_trapdoor[facing=south,half=bottom,open=false,powered=false,waterlogged=false] + cherry_trapdoor[facing=east,half=bottom,open=false,powered=true,waterlogged=false]: cherry_trapdoor[facing=east,half=bottom,open=false,powered=false,waterlogged=false] + cherry_trapdoor[facing=west,half=bottom,open=false,powered=true,waterlogged=false]: cherry_trapdoor[facing=west,half=bottom,open=false,powered=false,waterlogged=false] + cherry_trapdoor[facing=north,half=bottom,open=true,powered=true,waterlogged=true]: cherry_trapdoor[facing=north,half=bottom,open=true,powered=false,waterlogged=true] + cherry_trapdoor[facing=south,half=bottom,open=true,powered=true,waterlogged=true]: cherry_trapdoor[facing=south,half=bottom,open=true,powered=false,waterlogged=true] + cherry_trapdoor[facing=east,half=bottom,open=true,powered=true,waterlogged=true]: cherry_trapdoor[facing=east,half=bottom,open=true,powered=false,waterlogged=true] + cherry_trapdoor[facing=west,half=bottom,open=true,powered=true,waterlogged=true]: cherry_trapdoor[facing=west,half=bottom,open=true,powered=false,waterlogged=true] + cherry_trapdoor[facing=north,half=bottom,open=false,powered=true,waterlogged=true]: cherry_trapdoor[facing=north,half=bottom,open=false,powered=false,waterlogged=true] + cherry_trapdoor[facing=south,half=bottom,open=false,powered=true,waterlogged=true]: cherry_trapdoor[facing=south,half=bottom,open=false,powered=false,waterlogged=true] + cherry_trapdoor[facing=east,half=bottom,open=false,powered=true,waterlogged=true]: cherry_trapdoor[facing=east,half=bottom,open=false,powered=false,waterlogged=true] + cherry_trapdoor[facing=west,half=bottom,open=false,powered=true,waterlogged=true]: cherry_trapdoor[facing=west,half=bottom,open=false,powered=false,waterlogged=true] + bamboo_trapdoor[facing=north,half=top,open=true,powered=true,waterlogged=false]: bamboo_trapdoor[facing=north,half=top,open=true,powered=false,waterlogged=false] + bamboo_trapdoor[facing=south,half=top,open=true,powered=true,waterlogged=false]: bamboo_trapdoor[facing=south,half=top,open=true,powered=false,waterlogged=false] + bamboo_trapdoor[facing=east,half=top,open=true,powered=true,waterlogged=false]: bamboo_trapdoor[facing=east,half=top,open=true,powered=false,waterlogged=false] + bamboo_trapdoor[facing=west,half=top,open=true,powered=true,waterlogged=false]: bamboo_trapdoor[facing=west,half=top,open=true,powered=false,waterlogged=false] + bamboo_trapdoor[facing=north,half=top,open=false,powered=true,waterlogged=false]: bamboo_trapdoor[facing=north,half=top,open=false,powered=false,waterlogged=false] + bamboo_trapdoor[facing=south,half=top,open=false,powered=true,waterlogged=false]: bamboo_trapdoor[facing=south,half=top,open=false,powered=false,waterlogged=false] + bamboo_trapdoor[facing=east,half=top,open=false,powered=true,waterlogged=false]: bamboo_trapdoor[facing=east,half=top,open=false,powered=false,waterlogged=false] + bamboo_trapdoor[facing=west,half=top,open=false,powered=true,waterlogged=false]: bamboo_trapdoor[facing=west,half=top,open=false,powered=false,waterlogged=false] + bamboo_trapdoor[facing=north,half=top,open=true,powered=true,waterlogged=true]: bamboo_trapdoor[facing=north,half=top,open=true,powered=false,waterlogged=true] + bamboo_trapdoor[facing=south,half=top,open=true,powered=true,waterlogged=true]: bamboo_trapdoor[facing=south,half=top,open=true,powered=false,waterlogged=true] + bamboo_trapdoor[facing=east,half=top,open=true,powered=true,waterlogged=true]: bamboo_trapdoor[facing=east,half=top,open=true,powered=false,waterlogged=true] + bamboo_trapdoor[facing=west,half=top,open=true,powered=true,waterlogged=true]: bamboo_trapdoor[facing=west,half=top,open=true,powered=false,waterlogged=true] + bamboo_trapdoor[facing=north,half=top,open=false,powered=true,waterlogged=true]: bamboo_trapdoor[facing=north,half=top,open=false,powered=false,waterlogged=true] + bamboo_trapdoor[facing=south,half=top,open=false,powered=true,waterlogged=true]: bamboo_trapdoor[facing=south,half=top,open=false,powered=false,waterlogged=true] + bamboo_trapdoor[facing=east,half=top,open=false,powered=true,waterlogged=true]: bamboo_trapdoor[facing=east,half=top,open=false,powered=false,waterlogged=true] + bamboo_trapdoor[facing=west,half=top,open=false,powered=true,waterlogged=true]: bamboo_trapdoor[facing=west,half=top,open=false,powered=false,waterlogged=true] + bamboo_trapdoor[facing=north,half=bottom,open=true,powered=true,waterlogged=false]: bamboo_trapdoor[facing=north,half=bottom,open=true,powered=false,waterlogged=false] + bamboo_trapdoor[facing=south,half=bottom,open=true,powered=true,waterlogged=false]: bamboo_trapdoor[facing=south,half=bottom,open=true,powered=false,waterlogged=false] + bamboo_trapdoor[facing=east,half=bottom,open=true,powered=true,waterlogged=false]: bamboo_trapdoor[facing=east,half=bottom,open=true,powered=false,waterlogged=false] + bamboo_trapdoor[facing=west,half=bottom,open=true,powered=true,waterlogged=false]: bamboo_trapdoor[facing=west,half=bottom,open=true,powered=false,waterlogged=false] + bamboo_trapdoor[facing=north,half=bottom,open=false,powered=true,waterlogged=false]: bamboo_trapdoor[facing=north,half=bottom,open=false,powered=false,waterlogged=false] + bamboo_trapdoor[facing=south,half=bottom,open=false,powered=true,waterlogged=false]: bamboo_trapdoor[facing=south,half=bottom,open=false,powered=false,waterlogged=false] + bamboo_trapdoor[facing=east,half=bottom,open=false,powered=true,waterlogged=false]: bamboo_trapdoor[facing=east,half=bottom,open=false,powered=false,waterlogged=false] + bamboo_trapdoor[facing=west,half=bottom,open=false,powered=true,waterlogged=false]: bamboo_trapdoor[facing=west,half=bottom,open=false,powered=false,waterlogged=false] + bamboo_trapdoor[facing=north,half=bottom,open=true,powered=true,waterlogged=true]: bamboo_trapdoor[facing=north,half=bottom,open=true,powered=false,waterlogged=true] + bamboo_trapdoor[facing=south,half=bottom,open=true,powered=true,waterlogged=true]: bamboo_trapdoor[facing=south,half=bottom,open=true,powered=false,waterlogged=true] + bamboo_trapdoor[facing=east,half=bottom,open=true,powered=true,waterlogged=true]: bamboo_trapdoor[facing=east,half=bottom,open=true,powered=false,waterlogged=true] + bamboo_trapdoor[facing=west,half=bottom,open=true,powered=true,waterlogged=true]: bamboo_trapdoor[facing=west,half=bottom,open=true,powered=false,waterlogged=true] + bamboo_trapdoor[facing=north,half=bottom,open=false,powered=true,waterlogged=true]: bamboo_trapdoor[facing=north,half=bottom,open=false,powered=false,waterlogged=true] + bamboo_trapdoor[facing=south,half=bottom,open=false,powered=true,waterlogged=true]: bamboo_trapdoor[facing=south,half=bottom,open=false,powered=false,waterlogged=true] + bamboo_trapdoor[facing=east,half=bottom,open=false,powered=true,waterlogged=true]: bamboo_trapdoor[facing=east,half=bottom,open=false,powered=false,waterlogged=true] + bamboo_trapdoor[facing=west,half=bottom,open=false,powered=true,waterlogged=true]: bamboo_trapdoor[facing=west,half=bottom,open=false,powered=false,waterlogged=true] + crimson_trapdoor[facing=north,half=top,open=true,powered=true,waterlogged=false]: crimson_trapdoor[facing=north,half=top,open=true,powered=false,waterlogged=false] + crimson_trapdoor[facing=south,half=top,open=true,powered=true,waterlogged=false]: crimson_trapdoor[facing=south,half=top,open=true,powered=false,waterlogged=false] + crimson_trapdoor[facing=east,half=top,open=true,powered=true,waterlogged=false]: crimson_trapdoor[facing=east,half=top,open=true,powered=false,waterlogged=false] + crimson_trapdoor[facing=west,half=top,open=true,powered=true,waterlogged=false]: crimson_trapdoor[facing=west,half=top,open=true,powered=false,waterlogged=false] + crimson_trapdoor[facing=north,half=top,open=false,powered=true,waterlogged=false]: crimson_trapdoor[facing=north,half=top,open=false,powered=false,waterlogged=false] + crimson_trapdoor[facing=south,half=top,open=false,powered=true,waterlogged=false]: crimson_trapdoor[facing=south,half=top,open=false,powered=false,waterlogged=false] + crimson_trapdoor[facing=east,half=top,open=false,powered=true,waterlogged=false]: crimson_trapdoor[facing=east,half=top,open=false,powered=false,waterlogged=false] + crimson_trapdoor[facing=west,half=top,open=false,powered=true,waterlogged=false]: crimson_trapdoor[facing=west,half=top,open=false,powered=false,waterlogged=false] + crimson_trapdoor[facing=north,half=top,open=true,powered=true,waterlogged=true]: crimson_trapdoor[facing=north,half=top,open=true,powered=false,waterlogged=true] + crimson_trapdoor[facing=south,half=top,open=true,powered=true,waterlogged=true]: crimson_trapdoor[facing=south,half=top,open=true,powered=false,waterlogged=true] + crimson_trapdoor[facing=east,half=top,open=true,powered=true,waterlogged=true]: crimson_trapdoor[facing=east,half=top,open=true,powered=false,waterlogged=true] + crimson_trapdoor[facing=west,half=top,open=true,powered=true,waterlogged=true]: crimson_trapdoor[facing=west,half=top,open=true,powered=false,waterlogged=true] + crimson_trapdoor[facing=north,half=top,open=false,powered=true,waterlogged=true]: crimson_trapdoor[facing=north,half=top,open=false,powered=false,waterlogged=true] + crimson_trapdoor[facing=south,half=top,open=false,powered=true,waterlogged=true]: crimson_trapdoor[facing=south,half=top,open=false,powered=false,waterlogged=true] + crimson_trapdoor[facing=east,half=top,open=false,powered=true,waterlogged=true]: crimson_trapdoor[facing=east,half=top,open=false,powered=false,waterlogged=true] + crimson_trapdoor[facing=west,half=top,open=false,powered=true,waterlogged=true]: crimson_trapdoor[facing=west,half=top,open=false,powered=false,waterlogged=true] + crimson_trapdoor[facing=north,half=bottom,open=true,powered=true,waterlogged=false]: crimson_trapdoor[facing=north,half=bottom,open=true,powered=false,waterlogged=false] + crimson_trapdoor[facing=south,half=bottom,open=true,powered=true,waterlogged=false]: crimson_trapdoor[facing=south,half=bottom,open=true,powered=false,waterlogged=false] + crimson_trapdoor[facing=east,half=bottom,open=true,powered=true,waterlogged=false]: crimson_trapdoor[facing=east,half=bottom,open=true,powered=false,waterlogged=false] + crimson_trapdoor[facing=west,half=bottom,open=true,powered=true,waterlogged=false]: crimson_trapdoor[facing=west,half=bottom,open=true,powered=false,waterlogged=false] + crimson_trapdoor[facing=north,half=bottom,open=false,powered=true,waterlogged=false]: crimson_trapdoor[facing=north,half=bottom,open=false,powered=false,waterlogged=false] + crimson_trapdoor[facing=south,half=bottom,open=false,powered=true,waterlogged=false]: crimson_trapdoor[facing=south,half=bottom,open=false,powered=false,waterlogged=false] + crimson_trapdoor[facing=east,half=bottom,open=false,powered=true,waterlogged=false]: crimson_trapdoor[facing=east,half=bottom,open=false,powered=false,waterlogged=false] + crimson_trapdoor[facing=west,half=bottom,open=false,powered=true,waterlogged=false]: crimson_trapdoor[facing=west,half=bottom,open=false,powered=false,waterlogged=false] + crimson_trapdoor[facing=north,half=bottom,open=true,powered=true,waterlogged=true]: crimson_trapdoor[facing=north,half=bottom,open=true,powered=false,waterlogged=true] + crimson_trapdoor[facing=south,half=bottom,open=true,powered=true,waterlogged=true]: crimson_trapdoor[facing=south,half=bottom,open=true,powered=false,waterlogged=true] + crimson_trapdoor[facing=east,half=bottom,open=true,powered=true,waterlogged=true]: crimson_trapdoor[facing=east,half=bottom,open=true,powered=false,waterlogged=true] + crimson_trapdoor[facing=west,half=bottom,open=true,powered=true,waterlogged=true]: crimson_trapdoor[facing=west,half=bottom,open=true,powered=false,waterlogged=true] + crimson_trapdoor[facing=north,half=bottom,open=false,powered=true,waterlogged=true]: crimson_trapdoor[facing=north,half=bottom,open=false,powered=false,waterlogged=true] + crimson_trapdoor[facing=south,half=bottom,open=false,powered=true,waterlogged=true]: crimson_trapdoor[facing=south,half=bottom,open=false,powered=false,waterlogged=true] + crimson_trapdoor[facing=east,half=bottom,open=false,powered=true,waterlogged=true]: crimson_trapdoor[facing=east,half=bottom,open=false,powered=false,waterlogged=true] + crimson_trapdoor[facing=west,half=bottom,open=false,powered=true,waterlogged=true]: crimson_trapdoor[facing=west,half=bottom,open=false,powered=false,waterlogged=true] + warped_trapdoor[facing=north,half=top,open=true,powered=true,waterlogged=false]: warped_trapdoor[facing=north,half=top,open=true,powered=false,waterlogged=false] + warped_trapdoor[facing=south,half=top,open=true,powered=true,waterlogged=false]: warped_trapdoor[facing=south,half=top,open=true,powered=false,waterlogged=false] + warped_trapdoor[facing=east,half=top,open=true,powered=true,waterlogged=false]: warped_trapdoor[facing=east,half=top,open=true,powered=false,waterlogged=false] + warped_trapdoor[facing=west,half=top,open=true,powered=true,waterlogged=false]: warped_trapdoor[facing=west,half=top,open=true,powered=false,waterlogged=false] + warped_trapdoor[facing=north,half=top,open=false,powered=true,waterlogged=false]: warped_trapdoor[facing=north,half=top,open=false,powered=false,waterlogged=false] + warped_trapdoor[facing=south,half=top,open=false,powered=true,waterlogged=false]: warped_trapdoor[facing=south,half=top,open=false,powered=false,waterlogged=false] + warped_trapdoor[facing=east,half=top,open=false,powered=true,waterlogged=false]: warped_trapdoor[facing=east,half=top,open=false,powered=false,waterlogged=false] + warped_trapdoor[facing=west,half=top,open=false,powered=true,waterlogged=false]: warped_trapdoor[facing=west,half=top,open=false,powered=false,waterlogged=false] + warped_trapdoor[facing=north,half=top,open=true,powered=true,waterlogged=true]: warped_trapdoor[facing=north,half=top,open=true,powered=false,waterlogged=true] + warped_trapdoor[facing=south,half=top,open=true,powered=true,waterlogged=true]: warped_trapdoor[facing=south,half=top,open=true,powered=false,waterlogged=true] + warped_trapdoor[facing=east,half=top,open=true,powered=true,waterlogged=true]: warped_trapdoor[facing=east,half=top,open=true,powered=false,waterlogged=true] + warped_trapdoor[facing=west,half=top,open=true,powered=true,waterlogged=true]: warped_trapdoor[facing=west,half=top,open=true,powered=false,waterlogged=true] + warped_trapdoor[facing=north,half=top,open=false,powered=true,waterlogged=true]: warped_trapdoor[facing=north,half=top,open=false,powered=false,waterlogged=true] + warped_trapdoor[facing=south,half=top,open=false,powered=true,waterlogged=true]: warped_trapdoor[facing=south,half=top,open=false,powered=false,waterlogged=true] + warped_trapdoor[facing=east,half=top,open=false,powered=true,waterlogged=true]: warped_trapdoor[facing=east,half=top,open=false,powered=false,waterlogged=true] + warped_trapdoor[facing=west,half=top,open=false,powered=true,waterlogged=true]: warped_trapdoor[facing=west,half=top,open=false,powered=false,waterlogged=true] + warped_trapdoor[facing=north,half=bottom,open=true,powered=true,waterlogged=false]: warped_trapdoor[facing=north,half=bottom,open=true,powered=false,waterlogged=false] + warped_trapdoor[facing=south,half=bottom,open=true,powered=true,waterlogged=false]: warped_trapdoor[facing=south,half=bottom,open=true,powered=false,waterlogged=false] + warped_trapdoor[facing=east,half=bottom,open=true,powered=true,waterlogged=false]: warped_trapdoor[facing=east,half=bottom,open=true,powered=false,waterlogged=false] + warped_trapdoor[facing=west,half=bottom,open=true,powered=true,waterlogged=false]: warped_trapdoor[facing=west,half=bottom,open=true,powered=false,waterlogged=false] + warped_trapdoor[facing=north,half=bottom,open=false,powered=true,waterlogged=false]: warped_trapdoor[facing=north,half=bottom,open=false,powered=false,waterlogged=false] + warped_trapdoor[facing=south,half=bottom,open=false,powered=true,waterlogged=false]: warped_trapdoor[facing=south,half=bottom,open=false,powered=false,waterlogged=false] + warped_trapdoor[facing=east,half=bottom,open=false,powered=true,waterlogged=false]: warped_trapdoor[facing=east,half=bottom,open=false,powered=false,waterlogged=false] + warped_trapdoor[facing=west,half=bottom,open=false,powered=true,waterlogged=false]: warped_trapdoor[facing=west,half=bottom,open=false,powered=false,waterlogged=false] + warped_trapdoor[facing=north,half=bottom,open=true,powered=true,waterlogged=true]: warped_trapdoor[facing=north,half=bottom,open=true,powered=false,waterlogged=true] + warped_trapdoor[facing=south,half=bottom,open=true,powered=true,waterlogged=true]: warped_trapdoor[facing=south,half=bottom,open=true,powered=false,waterlogged=true] + warped_trapdoor[facing=east,half=bottom,open=true,powered=true,waterlogged=true]: warped_trapdoor[facing=east,half=bottom,open=true,powered=false,waterlogged=true] + warped_trapdoor[facing=west,half=bottom,open=true,powered=true,waterlogged=true]: warped_trapdoor[facing=west,half=bottom,open=true,powered=false,waterlogged=true] + warped_trapdoor[facing=north,half=bottom,open=false,powered=true,waterlogged=true]: warped_trapdoor[facing=north,half=bottom,open=false,powered=false,waterlogged=true] + warped_trapdoor[facing=south,half=bottom,open=false,powered=true,waterlogged=true]: warped_trapdoor[facing=south,half=bottom,open=false,powered=false,waterlogged=true] + warped_trapdoor[facing=east,half=bottom,open=false,powered=true,waterlogged=true]: warped_trapdoor[facing=east,half=bottom,open=false,powered=false,waterlogged=true] + warped_trapdoor[facing=west,half=bottom,open=false,powered=true,waterlogged=true]: warped_trapdoor[facing=west,half=bottom,open=false,powered=false,waterlogged=true] + + $$>=1.20.3#trapdoor: + copper_trapdoor[facing=north,half=top,open=true,powered=true,waterlogged=false]: copper_trapdoor[facing=north,half=top,open=true,powered=false,waterlogged=false] + copper_trapdoor[facing=south,half=top,open=true,powered=true,waterlogged=false]: copper_trapdoor[facing=south,half=top,open=true,powered=false,waterlogged=false] + copper_trapdoor[facing=east,half=top,open=true,powered=true,waterlogged=false]: copper_trapdoor[facing=east,half=top,open=true,powered=false,waterlogged=false] + copper_trapdoor[facing=west,half=top,open=true,powered=true,waterlogged=false]: copper_trapdoor[facing=west,half=top,open=true,powered=false,waterlogged=false] + copper_trapdoor[facing=north,half=top,open=false,powered=true,waterlogged=false]: copper_trapdoor[facing=north,half=top,open=false,powered=false,waterlogged=false] + copper_trapdoor[facing=south,half=top,open=false,powered=true,waterlogged=false]: copper_trapdoor[facing=south,half=top,open=false,powered=false,waterlogged=false] + copper_trapdoor[facing=east,half=top,open=false,powered=true,waterlogged=false]: copper_trapdoor[facing=east,half=top,open=false,powered=false,waterlogged=false] + copper_trapdoor[facing=west,half=top,open=false,powered=true,waterlogged=false]: copper_trapdoor[facing=west,half=top,open=false,powered=false,waterlogged=false] + copper_trapdoor[facing=north,half=top,open=true,powered=true,waterlogged=true]: copper_trapdoor[facing=north,half=top,open=true,powered=false,waterlogged=true] + copper_trapdoor[facing=south,half=top,open=true,powered=true,waterlogged=true]: copper_trapdoor[facing=south,half=top,open=true,powered=false,waterlogged=true] + copper_trapdoor[facing=east,half=top,open=true,powered=true,waterlogged=true]: copper_trapdoor[facing=east,half=top,open=true,powered=false,waterlogged=true] + copper_trapdoor[facing=west,half=top,open=true,powered=true,waterlogged=true]: copper_trapdoor[facing=west,half=top,open=true,powered=false,waterlogged=true] + copper_trapdoor[facing=north,half=top,open=false,powered=true,waterlogged=true]: copper_trapdoor[facing=north,half=top,open=false,powered=false,waterlogged=true] + copper_trapdoor[facing=south,half=top,open=false,powered=true,waterlogged=true]: copper_trapdoor[facing=south,half=top,open=false,powered=false,waterlogged=true] + copper_trapdoor[facing=east,half=top,open=false,powered=true,waterlogged=true]: copper_trapdoor[facing=east,half=top,open=false,powered=false,waterlogged=true] + copper_trapdoor[facing=west,half=top,open=false,powered=true,waterlogged=true]: copper_trapdoor[facing=west,half=top,open=false,powered=false,waterlogged=true] + copper_trapdoor[facing=north,half=bottom,open=true,powered=true,waterlogged=false]: copper_trapdoor[facing=north,half=bottom,open=true,powered=false,waterlogged=false] + copper_trapdoor[facing=south,half=bottom,open=true,powered=true,waterlogged=false]: copper_trapdoor[facing=south,half=bottom,open=true,powered=false,waterlogged=false] + copper_trapdoor[facing=east,half=bottom,open=true,powered=true,waterlogged=false]: copper_trapdoor[facing=east,half=bottom,open=true,powered=false,waterlogged=false] + copper_trapdoor[facing=west,half=bottom,open=true,powered=true,waterlogged=false]: copper_trapdoor[facing=west,half=bottom,open=true,powered=false,waterlogged=false] + copper_trapdoor[facing=north,half=bottom,open=false,powered=true,waterlogged=false]: copper_trapdoor[facing=north,half=bottom,open=false,powered=false,waterlogged=false] + copper_trapdoor[facing=south,half=bottom,open=false,powered=true,waterlogged=false]: copper_trapdoor[facing=south,half=bottom,open=false,powered=false,waterlogged=false] + copper_trapdoor[facing=east,half=bottom,open=false,powered=true,waterlogged=false]: copper_trapdoor[facing=east,half=bottom,open=false,powered=false,waterlogged=false] + copper_trapdoor[facing=west,half=bottom,open=false,powered=true,waterlogged=false]: copper_trapdoor[facing=west,half=bottom,open=false,powered=false,waterlogged=false] + copper_trapdoor[facing=north,half=bottom,open=true,powered=true,waterlogged=true]: copper_trapdoor[facing=north,half=bottom,open=true,powered=false,waterlogged=true] + copper_trapdoor[facing=south,half=bottom,open=true,powered=true,waterlogged=true]: copper_trapdoor[facing=south,half=bottom,open=true,powered=false,waterlogged=true] + copper_trapdoor[facing=east,half=bottom,open=true,powered=true,waterlogged=true]: copper_trapdoor[facing=east,half=bottom,open=true,powered=false,waterlogged=true] + copper_trapdoor[facing=west,half=bottom,open=true,powered=true,waterlogged=true]: copper_trapdoor[facing=west,half=bottom,open=true,powered=false,waterlogged=true] + copper_trapdoor[facing=north,half=bottom,open=false,powered=true,waterlogged=true]: copper_trapdoor[facing=north,half=bottom,open=false,powered=false,waterlogged=true] + copper_trapdoor[facing=south,half=bottom,open=false,powered=true,waterlogged=true]: copper_trapdoor[facing=south,half=bottom,open=false,powered=false,waterlogged=true] + copper_trapdoor[facing=east,half=bottom,open=false,powered=true,waterlogged=true]: copper_trapdoor[facing=east,half=bottom,open=false,powered=false,waterlogged=true] + copper_trapdoor[facing=west,half=bottom,open=false,powered=true,waterlogged=true]: copper_trapdoor[facing=west,half=bottom,open=false,powered=false,waterlogged=true] + exposed_copper_trapdoor[facing=north,half=top,open=true,powered=true,waterlogged=false]: exposed_copper_trapdoor[facing=north,half=top,open=true,powered=false,waterlogged=false] + exposed_copper_trapdoor[facing=south,half=top,open=true,powered=true,waterlogged=false]: exposed_copper_trapdoor[facing=south,half=top,open=true,powered=false,waterlogged=false] + exposed_copper_trapdoor[facing=east,half=top,open=true,powered=true,waterlogged=false]: exposed_copper_trapdoor[facing=east,half=top,open=true,powered=false,waterlogged=false] + exposed_copper_trapdoor[facing=west,half=top,open=true,powered=true,waterlogged=false]: exposed_copper_trapdoor[facing=west,half=top,open=true,powered=false,waterlogged=false] + exposed_copper_trapdoor[facing=north,half=top,open=false,powered=true,waterlogged=false]: exposed_copper_trapdoor[facing=north,half=top,open=false,powered=false,waterlogged=false] + exposed_copper_trapdoor[facing=south,half=top,open=false,powered=true,waterlogged=false]: exposed_copper_trapdoor[facing=south,half=top,open=false,powered=false,waterlogged=false] + exposed_copper_trapdoor[facing=east,half=top,open=false,powered=true,waterlogged=false]: exposed_copper_trapdoor[facing=east,half=top,open=false,powered=false,waterlogged=false] + exposed_copper_trapdoor[facing=west,half=top,open=false,powered=true,waterlogged=false]: exposed_copper_trapdoor[facing=west,half=top,open=false,powered=false,waterlogged=false] + exposed_copper_trapdoor[facing=north,half=top,open=true,powered=true,waterlogged=true]: exposed_copper_trapdoor[facing=north,half=top,open=true,powered=false,waterlogged=true] + exposed_copper_trapdoor[facing=south,half=top,open=true,powered=true,waterlogged=true]: exposed_copper_trapdoor[facing=south,half=top,open=true,powered=false,waterlogged=true] + exposed_copper_trapdoor[facing=east,half=top,open=true,powered=true,waterlogged=true]: exposed_copper_trapdoor[facing=east,half=top,open=true,powered=false,waterlogged=true] + exposed_copper_trapdoor[facing=west,half=top,open=true,powered=true,waterlogged=true]: exposed_copper_trapdoor[facing=west,half=top,open=true,powered=false,waterlogged=true] + exposed_copper_trapdoor[facing=north,half=top,open=false,powered=true,waterlogged=true]: exposed_copper_trapdoor[facing=north,half=top,open=false,powered=false,waterlogged=true] + exposed_copper_trapdoor[facing=south,half=top,open=false,powered=true,waterlogged=true]: exposed_copper_trapdoor[facing=south,half=top,open=false,powered=false,waterlogged=true] + exposed_copper_trapdoor[facing=east,half=top,open=false,powered=true,waterlogged=true]: exposed_copper_trapdoor[facing=east,half=top,open=false,powered=false,waterlogged=true] + exposed_copper_trapdoor[facing=west,half=top,open=false,powered=true,waterlogged=true]: exposed_copper_trapdoor[facing=west,half=top,open=false,powered=false,waterlogged=true] + exposed_copper_trapdoor[facing=north,half=bottom,open=true,powered=true,waterlogged=false]: exposed_copper_trapdoor[facing=north,half=bottom,open=true,powered=false,waterlogged=false] + exposed_copper_trapdoor[facing=south,half=bottom,open=true,powered=true,waterlogged=false]: exposed_copper_trapdoor[facing=south,half=bottom,open=true,powered=false,waterlogged=false] + exposed_copper_trapdoor[facing=east,half=bottom,open=true,powered=true,waterlogged=false]: exposed_copper_trapdoor[facing=east,half=bottom,open=true,powered=false,waterlogged=false] + exposed_copper_trapdoor[facing=west,half=bottom,open=true,powered=true,waterlogged=false]: exposed_copper_trapdoor[facing=west,half=bottom,open=true,powered=false,waterlogged=false] + exposed_copper_trapdoor[facing=north,half=bottom,open=false,powered=true,waterlogged=false]: exposed_copper_trapdoor[facing=north,half=bottom,open=false,powered=false,waterlogged=false] + exposed_copper_trapdoor[facing=south,half=bottom,open=false,powered=true,waterlogged=false]: exposed_copper_trapdoor[facing=south,half=bottom,open=false,powered=false,waterlogged=false] + exposed_copper_trapdoor[facing=east,half=bottom,open=false,powered=true,waterlogged=false]: exposed_copper_trapdoor[facing=east,half=bottom,open=false,powered=false,waterlogged=false] + exposed_copper_trapdoor[facing=west,half=bottom,open=false,powered=true,waterlogged=false]: exposed_copper_trapdoor[facing=west,half=bottom,open=false,powered=false,waterlogged=false] + exposed_copper_trapdoor[facing=north,half=bottom,open=true,powered=true,waterlogged=true]: exposed_copper_trapdoor[facing=north,half=bottom,open=true,powered=false,waterlogged=true] + exposed_copper_trapdoor[facing=south,half=bottom,open=true,powered=true,waterlogged=true]: exposed_copper_trapdoor[facing=south,half=bottom,open=true,powered=false,waterlogged=true] + exposed_copper_trapdoor[facing=east,half=bottom,open=true,powered=true,waterlogged=true]: exposed_copper_trapdoor[facing=east,half=bottom,open=true,powered=false,waterlogged=true] + exposed_copper_trapdoor[facing=west,half=bottom,open=true,powered=true,waterlogged=true]: exposed_copper_trapdoor[facing=west,half=bottom,open=true,powered=false,waterlogged=true] + exposed_copper_trapdoor[facing=north,half=bottom,open=false,powered=true,waterlogged=true]: exposed_copper_trapdoor[facing=north,half=bottom,open=false,powered=false,waterlogged=true] + exposed_copper_trapdoor[facing=south,half=bottom,open=false,powered=true,waterlogged=true]: exposed_copper_trapdoor[facing=south,half=bottom,open=false,powered=false,waterlogged=true] + exposed_copper_trapdoor[facing=east,half=bottom,open=false,powered=true,waterlogged=true]: exposed_copper_trapdoor[facing=east,half=bottom,open=false,powered=false,waterlogged=true] + exposed_copper_trapdoor[facing=west,half=bottom,open=false,powered=true,waterlogged=true]: exposed_copper_trapdoor[facing=west,half=bottom,open=false,powered=false,waterlogged=true] + weathered_copper_trapdoor[facing=north,half=top,open=true,powered=true,waterlogged=false]: weathered_copper_trapdoor[facing=north,half=top,open=true,powered=false,waterlogged=false] + weathered_copper_trapdoor[facing=south,half=top,open=true,powered=true,waterlogged=false]: weathered_copper_trapdoor[facing=south,half=top,open=true,powered=false,waterlogged=false] + weathered_copper_trapdoor[facing=east,half=top,open=true,powered=true,waterlogged=false]: weathered_copper_trapdoor[facing=east,half=top,open=true,powered=false,waterlogged=false] + weathered_copper_trapdoor[facing=west,half=top,open=true,powered=true,waterlogged=false]: weathered_copper_trapdoor[facing=west,half=top,open=true,powered=false,waterlogged=false] + weathered_copper_trapdoor[facing=north,half=top,open=false,powered=true,waterlogged=false]: weathered_copper_trapdoor[facing=north,half=top,open=false,powered=false,waterlogged=false] + weathered_copper_trapdoor[facing=south,half=top,open=false,powered=true,waterlogged=false]: weathered_copper_trapdoor[facing=south,half=top,open=false,powered=false,waterlogged=false] + weathered_copper_trapdoor[facing=east,half=top,open=false,powered=true,waterlogged=false]: weathered_copper_trapdoor[facing=east,half=top,open=false,powered=false,waterlogged=false] + weathered_copper_trapdoor[facing=west,half=top,open=false,powered=true,waterlogged=false]: weathered_copper_trapdoor[facing=west,half=top,open=false,powered=false,waterlogged=false] + weathered_copper_trapdoor[facing=north,half=top,open=true,powered=true,waterlogged=true]: weathered_copper_trapdoor[facing=north,half=top,open=true,powered=false,waterlogged=true] + weathered_copper_trapdoor[facing=south,half=top,open=true,powered=true,waterlogged=true]: weathered_copper_trapdoor[facing=south,half=top,open=true,powered=false,waterlogged=true] + weathered_copper_trapdoor[facing=east,half=top,open=true,powered=true,waterlogged=true]: weathered_copper_trapdoor[facing=east,half=top,open=true,powered=false,waterlogged=true] + weathered_copper_trapdoor[facing=west,half=top,open=true,powered=true,waterlogged=true]: weathered_copper_trapdoor[facing=west,half=top,open=true,powered=false,waterlogged=true] + weathered_copper_trapdoor[facing=north,half=top,open=false,powered=true,waterlogged=true]: weathered_copper_trapdoor[facing=north,half=top,open=false,powered=false,waterlogged=true] + weathered_copper_trapdoor[facing=south,half=top,open=false,powered=true,waterlogged=true]: weathered_copper_trapdoor[facing=south,half=top,open=false,powered=false,waterlogged=true] + weathered_copper_trapdoor[facing=east,half=top,open=false,powered=true,waterlogged=true]: weathered_copper_trapdoor[facing=east,half=top,open=false,powered=false,waterlogged=true] + weathered_copper_trapdoor[facing=west,half=top,open=false,powered=true,waterlogged=true]: weathered_copper_trapdoor[facing=west,half=top,open=false,powered=false,waterlogged=true] + weathered_copper_trapdoor[facing=north,half=bottom,open=true,powered=true,waterlogged=false]: weathered_copper_trapdoor[facing=north,half=bottom,open=true,powered=false,waterlogged=false] + weathered_copper_trapdoor[facing=south,half=bottom,open=true,powered=true,waterlogged=false]: weathered_copper_trapdoor[facing=south,half=bottom,open=true,powered=false,waterlogged=false] + weathered_copper_trapdoor[facing=east,half=bottom,open=true,powered=true,waterlogged=false]: weathered_copper_trapdoor[facing=east,half=bottom,open=true,powered=false,waterlogged=false] + weathered_copper_trapdoor[facing=west,half=bottom,open=true,powered=true,waterlogged=false]: weathered_copper_trapdoor[facing=west,half=bottom,open=true,powered=false,waterlogged=false] + weathered_copper_trapdoor[facing=north,half=bottom,open=false,powered=true,waterlogged=false]: weathered_copper_trapdoor[facing=north,half=bottom,open=false,powered=false,waterlogged=false] + weathered_copper_trapdoor[facing=south,half=bottom,open=false,powered=true,waterlogged=false]: weathered_copper_trapdoor[facing=south,half=bottom,open=false,powered=false,waterlogged=false] + weathered_copper_trapdoor[facing=east,half=bottom,open=false,powered=true,waterlogged=false]: weathered_copper_trapdoor[facing=east,half=bottom,open=false,powered=false,waterlogged=false] + weathered_copper_trapdoor[facing=west,half=bottom,open=false,powered=true,waterlogged=false]: weathered_copper_trapdoor[facing=west,half=bottom,open=false,powered=false,waterlogged=false] + weathered_copper_trapdoor[facing=north,half=bottom,open=true,powered=true,waterlogged=true]: weathered_copper_trapdoor[facing=north,half=bottom,open=true,powered=false,waterlogged=true] + weathered_copper_trapdoor[facing=south,half=bottom,open=true,powered=true,waterlogged=true]: weathered_copper_trapdoor[facing=south,half=bottom,open=true,powered=false,waterlogged=true] + weathered_copper_trapdoor[facing=east,half=bottom,open=true,powered=true,waterlogged=true]: weathered_copper_trapdoor[facing=east,half=bottom,open=true,powered=false,waterlogged=true] + weathered_copper_trapdoor[facing=west,half=bottom,open=true,powered=true,waterlogged=true]: weathered_copper_trapdoor[facing=west,half=bottom,open=true,powered=false,waterlogged=true] + weathered_copper_trapdoor[facing=north,half=bottom,open=false,powered=true,waterlogged=true]: weathered_copper_trapdoor[facing=north,half=bottom,open=false,powered=false,waterlogged=true] + weathered_copper_trapdoor[facing=south,half=bottom,open=false,powered=true,waterlogged=true]: weathered_copper_trapdoor[facing=south,half=bottom,open=false,powered=false,waterlogged=true] + weathered_copper_trapdoor[facing=east,half=bottom,open=false,powered=true,waterlogged=true]: weathered_copper_trapdoor[facing=east,half=bottom,open=false,powered=false,waterlogged=true] + weathered_copper_trapdoor[facing=west,half=bottom,open=false,powered=true,waterlogged=true]: weathered_copper_trapdoor[facing=west,half=bottom,open=false,powered=false,waterlogged=true] + oxidized_copper_trapdoor[facing=north,half=top,open=true,powered=true,waterlogged=false]: oxidized_copper_trapdoor[facing=north,half=top,open=true,powered=false,waterlogged=false] + oxidized_copper_trapdoor[facing=south,half=top,open=true,powered=true,waterlogged=false]: oxidized_copper_trapdoor[facing=south,half=top,open=true,powered=false,waterlogged=false] + oxidized_copper_trapdoor[facing=east,half=top,open=true,powered=true,waterlogged=false]: oxidized_copper_trapdoor[facing=east,half=top,open=true,powered=false,waterlogged=false] + oxidized_copper_trapdoor[facing=west,half=top,open=true,powered=true,waterlogged=false]: oxidized_copper_trapdoor[facing=west,half=top,open=true,powered=false,waterlogged=false] + oxidized_copper_trapdoor[facing=north,half=top,open=false,powered=true,waterlogged=false]: oxidized_copper_trapdoor[facing=north,half=top,open=false,powered=false,waterlogged=false] + oxidized_copper_trapdoor[facing=south,half=top,open=false,powered=true,waterlogged=false]: oxidized_copper_trapdoor[facing=south,half=top,open=false,powered=false,waterlogged=false] + oxidized_copper_trapdoor[facing=east,half=top,open=false,powered=true,waterlogged=false]: oxidized_copper_trapdoor[facing=east,half=top,open=false,powered=false,waterlogged=false] + oxidized_copper_trapdoor[facing=west,half=top,open=false,powered=true,waterlogged=false]: oxidized_copper_trapdoor[facing=west,half=top,open=false,powered=false,waterlogged=false] + oxidized_copper_trapdoor[facing=north,half=top,open=true,powered=true,waterlogged=true]: oxidized_copper_trapdoor[facing=north,half=top,open=true,powered=false,waterlogged=true] + oxidized_copper_trapdoor[facing=south,half=top,open=true,powered=true,waterlogged=true]: oxidized_copper_trapdoor[facing=south,half=top,open=true,powered=false,waterlogged=true] + oxidized_copper_trapdoor[facing=east,half=top,open=true,powered=true,waterlogged=true]: oxidized_copper_trapdoor[facing=east,half=top,open=true,powered=false,waterlogged=true] + oxidized_copper_trapdoor[facing=west,half=top,open=true,powered=true,waterlogged=true]: oxidized_copper_trapdoor[facing=west,half=top,open=true,powered=false,waterlogged=true] + oxidized_copper_trapdoor[facing=north,half=top,open=false,powered=true,waterlogged=true]: oxidized_copper_trapdoor[facing=north,half=top,open=false,powered=false,waterlogged=true] + oxidized_copper_trapdoor[facing=south,half=top,open=false,powered=true,waterlogged=true]: oxidized_copper_trapdoor[facing=south,half=top,open=false,powered=false,waterlogged=true] + oxidized_copper_trapdoor[facing=east,half=top,open=false,powered=true,waterlogged=true]: oxidized_copper_trapdoor[facing=east,half=top,open=false,powered=false,waterlogged=true] + oxidized_copper_trapdoor[facing=west,half=top,open=false,powered=true,waterlogged=true]: oxidized_copper_trapdoor[facing=west,half=top,open=false,powered=false,waterlogged=true] + oxidized_copper_trapdoor[facing=north,half=bottom,open=true,powered=true,waterlogged=false]: oxidized_copper_trapdoor[facing=north,half=bottom,open=true,powered=false,waterlogged=false] + oxidized_copper_trapdoor[facing=south,half=bottom,open=true,powered=true,waterlogged=false]: oxidized_copper_trapdoor[facing=south,half=bottom,open=true,powered=false,waterlogged=false] + oxidized_copper_trapdoor[facing=east,half=bottom,open=true,powered=true,waterlogged=false]: oxidized_copper_trapdoor[facing=east,half=bottom,open=true,powered=false,waterlogged=false] + oxidized_copper_trapdoor[facing=west,half=bottom,open=true,powered=true,waterlogged=false]: oxidized_copper_trapdoor[facing=west,half=bottom,open=true,powered=false,waterlogged=false] + oxidized_copper_trapdoor[facing=north,half=bottom,open=false,powered=true,waterlogged=false]: oxidized_copper_trapdoor[facing=north,half=bottom,open=false,powered=false,waterlogged=false] + oxidized_copper_trapdoor[facing=south,half=bottom,open=false,powered=true,waterlogged=false]: oxidized_copper_trapdoor[facing=south,half=bottom,open=false,powered=false,waterlogged=false] + oxidized_copper_trapdoor[facing=east,half=bottom,open=false,powered=true,waterlogged=false]: oxidized_copper_trapdoor[facing=east,half=bottom,open=false,powered=false,waterlogged=false] + oxidized_copper_trapdoor[facing=west,half=bottom,open=false,powered=true,waterlogged=false]: oxidized_copper_trapdoor[facing=west,half=bottom,open=false,powered=false,waterlogged=false] + oxidized_copper_trapdoor[facing=north,half=bottom,open=true,powered=true,waterlogged=true]: oxidized_copper_trapdoor[facing=north,half=bottom,open=true,powered=false,waterlogged=true] + oxidized_copper_trapdoor[facing=south,half=bottom,open=true,powered=true,waterlogged=true]: oxidized_copper_trapdoor[facing=south,half=bottom,open=true,powered=false,waterlogged=true] + oxidized_copper_trapdoor[facing=east,half=bottom,open=true,powered=true,waterlogged=true]: oxidized_copper_trapdoor[facing=east,half=bottom,open=true,powered=false,waterlogged=true] + oxidized_copper_trapdoor[facing=west,half=bottom,open=true,powered=true,waterlogged=true]: oxidized_copper_trapdoor[facing=west,half=bottom,open=true,powered=false,waterlogged=true] + oxidized_copper_trapdoor[facing=north,half=bottom,open=false,powered=true,waterlogged=true]: oxidized_copper_trapdoor[facing=north,half=bottom,open=false,powered=false,waterlogged=true] + oxidized_copper_trapdoor[facing=south,half=bottom,open=false,powered=true,waterlogged=true]: oxidized_copper_trapdoor[facing=south,half=bottom,open=false,powered=false,waterlogged=true] + oxidized_copper_trapdoor[facing=east,half=bottom,open=false,powered=true,waterlogged=true]: oxidized_copper_trapdoor[facing=east,half=bottom,open=false,powered=false,waterlogged=true] + oxidized_copper_trapdoor[facing=west,half=bottom,open=false,powered=true,waterlogged=true]: oxidized_copper_trapdoor[facing=west,half=bottom,open=false,powered=false,waterlogged=true] + # Fun fact: copper blocks look the same whether waxed or not. + # We're playing it safe with the default setup - keeping vanilla's waxed states recognizable. + # But you can always change it to convert waxed blocks back to regular ones. + waxed_copper_trapdoor[facing=north,half=top,open=true,powered=true,waterlogged=false]: waxed_copper_trapdoor[facing=north,half=top,open=true,powered=false,waterlogged=false] + waxed_copper_trapdoor[facing=south,half=top,open=true,powered=true,waterlogged=false]: waxed_copper_trapdoor[facing=south,half=top,open=true,powered=false,waterlogged=false] + waxed_copper_trapdoor[facing=east,half=top,open=true,powered=true,waterlogged=false]: waxed_copper_trapdoor[facing=east,half=top,open=true,powered=false,waterlogged=false] + waxed_copper_trapdoor[facing=west,half=top,open=true,powered=true,waterlogged=false]: waxed_copper_trapdoor[facing=west,half=top,open=true,powered=false,waterlogged=false] + waxed_copper_trapdoor[facing=north,half=top,open=false,powered=true,waterlogged=false]: waxed_copper_trapdoor[facing=north,half=top,open=false,powered=false,waterlogged=false] + waxed_copper_trapdoor[facing=south,half=top,open=false,powered=true,waterlogged=false]: waxed_copper_trapdoor[facing=south,half=top,open=false,powered=false,waterlogged=false] + waxed_copper_trapdoor[facing=east,half=top,open=false,powered=true,waterlogged=false]: waxed_copper_trapdoor[facing=east,half=top,open=false,powered=false,waterlogged=false] + waxed_copper_trapdoor[facing=west,half=top,open=false,powered=true,waterlogged=false]: waxed_copper_trapdoor[facing=west,half=top,open=false,powered=false,waterlogged=false] + waxed_copper_trapdoor[facing=north,half=top,open=true,powered=true,waterlogged=true]: waxed_copper_trapdoor[facing=north,half=top,open=true,powered=false,waterlogged=true] + waxed_copper_trapdoor[facing=south,half=top,open=true,powered=true,waterlogged=true]: waxed_copper_trapdoor[facing=south,half=top,open=true,powered=false,waterlogged=true] + waxed_copper_trapdoor[facing=east,half=top,open=true,powered=true,waterlogged=true]: waxed_copper_trapdoor[facing=east,half=top,open=true,powered=false,waterlogged=true] + waxed_copper_trapdoor[facing=west,half=top,open=true,powered=true,waterlogged=true]: waxed_copper_trapdoor[facing=west,half=top,open=true,powered=false,waterlogged=true] + waxed_copper_trapdoor[facing=north,half=top,open=false,powered=true,waterlogged=true]: waxed_copper_trapdoor[facing=north,half=top,open=false,powered=false,waterlogged=true] + waxed_copper_trapdoor[facing=south,half=top,open=false,powered=true,waterlogged=true]: waxed_copper_trapdoor[facing=south,half=top,open=false,powered=false,waterlogged=true] + waxed_copper_trapdoor[facing=east,half=top,open=false,powered=true,waterlogged=true]: waxed_copper_trapdoor[facing=east,half=top,open=false,powered=false,waterlogged=true] + waxed_copper_trapdoor[facing=west,half=top,open=false,powered=true,waterlogged=true]: waxed_copper_trapdoor[facing=west,half=top,open=false,powered=false,waterlogged=true] + waxed_copper_trapdoor[facing=north,half=bottom,open=true,powered=true,waterlogged=false]: waxed_copper_trapdoor[facing=north,half=bottom,open=true,powered=false,waterlogged=false] + waxed_copper_trapdoor[facing=south,half=bottom,open=true,powered=true,waterlogged=false]: waxed_copper_trapdoor[facing=south,half=bottom,open=true,powered=false,waterlogged=false] + waxed_copper_trapdoor[facing=east,half=bottom,open=true,powered=true,waterlogged=false]: waxed_copper_trapdoor[facing=east,half=bottom,open=true,powered=false,waterlogged=false] + waxed_copper_trapdoor[facing=west,half=bottom,open=true,powered=true,waterlogged=false]: waxed_copper_trapdoor[facing=west,half=bottom,open=true,powered=false,waterlogged=false] + waxed_copper_trapdoor[facing=north,half=bottom,open=false,powered=true,waterlogged=false]: waxed_copper_trapdoor[facing=north,half=bottom,open=false,powered=false,waterlogged=false] + waxed_copper_trapdoor[facing=south,half=bottom,open=false,powered=true,waterlogged=false]: waxed_copper_trapdoor[facing=south,half=bottom,open=false,powered=false,waterlogged=false] + waxed_copper_trapdoor[facing=east,half=bottom,open=false,powered=true,waterlogged=false]: waxed_copper_trapdoor[facing=east,half=bottom,open=false,powered=false,waterlogged=false] + waxed_copper_trapdoor[facing=west,half=bottom,open=false,powered=true,waterlogged=false]: waxed_copper_trapdoor[facing=west,half=bottom,open=false,powered=false,waterlogged=false] + waxed_copper_trapdoor[facing=north,half=bottom,open=true,powered=true,waterlogged=true]: waxed_copper_trapdoor[facing=north,half=bottom,open=true,powered=false,waterlogged=true] + waxed_copper_trapdoor[facing=south,half=bottom,open=true,powered=true,waterlogged=true]: waxed_copper_trapdoor[facing=south,half=bottom,open=true,powered=false,waterlogged=true] + waxed_copper_trapdoor[facing=east,half=bottom,open=true,powered=true,waterlogged=true]: waxed_copper_trapdoor[facing=east,half=bottom,open=true,powered=false,waterlogged=true] + waxed_copper_trapdoor[facing=west,half=bottom,open=true,powered=true,waterlogged=true]: waxed_copper_trapdoor[facing=west,half=bottom,open=true,powered=false,waterlogged=true] + waxed_copper_trapdoor[facing=north,half=bottom,open=false,powered=true,waterlogged=true]: waxed_copper_trapdoor[facing=north,half=bottom,open=false,powered=false,waterlogged=true] + waxed_copper_trapdoor[facing=south,half=bottom,open=false,powered=true,waterlogged=true]: waxed_copper_trapdoor[facing=south,half=bottom,open=false,powered=false,waterlogged=true] + waxed_copper_trapdoor[facing=east,half=bottom,open=false,powered=true,waterlogged=true]: waxed_copper_trapdoor[facing=east,half=bottom,open=false,powered=false,waterlogged=true] + waxed_copper_trapdoor[facing=west,half=bottom,open=false,powered=true,waterlogged=true]: waxed_copper_trapdoor[facing=west,half=bottom,open=false,powered=false,waterlogged=true] + waxed_exposed_copper_trapdoor[facing=north,half=top,open=true,powered=true,waterlogged=false]: waxed_exposed_copper_trapdoor[facing=north,half=top,open=true,powered=false,waterlogged=false] + waxed_exposed_copper_trapdoor[facing=south,half=top,open=true,powered=true,waterlogged=false]: waxed_exposed_copper_trapdoor[facing=south,half=top,open=true,powered=false,waterlogged=false] + waxed_exposed_copper_trapdoor[facing=east,half=top,open=true,powered=true,waterlogged=false]: waxed_exposed_copper_trapdoor[facing=east,half=top,open=true,powered=false,waterlogged=false] + waxed_exposed_copper_trapdoor[facing=west,half=top,open=true,powered=true,waterlogged=false]: waxed_exposed_copper_trapdoor[facing=west,half=top,open=true,powered=false,waterlogged=false] + waxed_exposed_copper_trapdoor[facing=north,half=top,open=false,powered=true,waterlogged=false]: waxed_exposed_copper_trapdoor[facing=north,half=top,open=false,powered=false,waterlogged=false] + waxed_exposed_copper_trapdoor[facing=south,half=top,open=false,powered=true,waterlogged=false]: waxed_exposed_copper_trapdoor[facing=south,half=top,open=false,powered=false,waterlogged=false] + waxed_exposed_copper_trapdoor[facing=east,half=top,open=false,powered=true,waterlogged=false]: waxed_exposed_copper_trapdoor[facing=east,half=top,open=false,powered=false,waterlogged=false] + waxed_exposed_copper_trapdoor[facing=west,half=top,open=false,powered=true,waterlogged=false]: waxed_exposed_copper_trapdoor[facing=west,half=top,open=false,powered=false,waterlogged=false] + waxed_exposed_copper_trapdoor[facing=north,half=top,open=true,powered=true,waterlogged=true]: waxed_exposed_copper_trapdoor[facing=north,half=top,open=true,powered=false,waterlogged=true] + waxed_exposed_copper_trapdoor[facing=south,half=top,open=true,powered=true,waterlogged=true]: waxed_exposed_copper_trapdoor[facing=south,half=top,open=true,powered=false,waterlogged=true] + waxed_exposed_copper_trapdoor[facing=east,half=top,open=true,powered=true,waterlogged=true]: waxed_exposed_copper_trapdoor[facing=east,half=top,open=true,powered=false,waterlogged=true] + waxed_exposed_copper_trapdoor[facing=west,half=top,open=true,powered=true,waterlogged=true]: waxed_exposed_copper_trapdoor[facing=west,half=top,open=true,powered=false,waterlogged=true] + waxed_exposed_copper_trapdoor[facing=north,half=top,open=false,powered=true,waterlogged=true]: waxed_exposed_copper_trapdoor[facing=north,half=top,open=false,powered=false,waterlogged=true] + waxed_exposed_copper_trapdoor[facing=south,half=top,open=false,powered=true,waterlogged=true]: waxed_exposed_copper_trapdoor[facing=south,half=top,open=false,powered=false,waterlogged=true] + waxed_exposed_copper_trapdoor[facing=east,half=top,open=false,powered=true,waterlogged=true]: waxed_exposed_copper_trapdoor[facing=east,half=top,open=false,powered=false,waterlogged=true] + waxed_exposed_copper_trapdoor[facing=west,half=top,open=false,powered=true,waterlogged=true]: waxed_exposed_copper_trapdoor[facing=west,half=top,open=false,powered=false,waterlogged=true] + waxed_exposed_copper_trapdoor[facing=north,half=bottom,open=true,powered=true,waterlogged=false]: waxed_exposed_copper_trapdoor[facing=north,half=bottom,open=true,powered=false,waterlogged=false] + waxed_exposed_copper_trapdoor[facing=south,half=bottom,open=true,powered=true,waterlogged=false]: waxed_exposed_copper_trapdoor[facing=south,half=bottom,open=true,powered=false,waterlogged=false] + waxed_exposed_copper_trapdoor[facing=east,half=bottom,open=true,powered=true,waterlogged=false]: waxed_exposed_copper_trapdoor[facing=east,half=bottom,open=true,powered=false,waterlogged=false] + waxed_exposed_copper_trapdoor[facing=west,half=bottom,open=true,powered=true,waterlogged=false]: waxed_exposed_copper_trapdoor[facing=west,half=bottom,open=true,powered=false,waterlogged=false] + waxed_exposed_copper_trapdoor[facing=north,half=bottom,open=false,powered=true,waterlogged=false]: waxed_exposed_copper_trapdoor[facing=north,half=bottom,open=false,powered=false,waterlogged=false] + waxed_exposed_copper_trapdoor[facing=south,half=bottom,open=false,powered=true,waterlogged=false]: waxed_exposed_copper_trapdoor[facing=south,half=bottom,open=false,powered=false,waterlogged=false] + waxed_exposed_copper_trapdoor[facing=east,half=bottom,open=false,powered=true,waterlogged=false]: waxed_exposed_copper_trapdoor[facing=east,half=bottom,open=false,powered=false,waterlogged=false] + waxed_exposed_copper_trapdoor[facing=west,half=bottom,open=false,powered=true,waterlogged=false]: waxed_exposed_copper_trapdoor[facing=west,half=bottom,open=false,powered=false,waterlogged=false] + waxed_exposed_copper_trapdoor[facing=north,half=bottom,open=true,powered=true,waterlogged=true]: waxed_exposed_copper_trapdoor[facing=north,half=bottom,open=true,powered=false,waterlogged=true] + waxed_exposed_copper_trapdoor[facing=south,half=bottom,open=true,powered=true,waterlogged=true]: waxed_exposed_copper_trapdoor[facing=south,half=bottom,open=true,powered=false,waterlogged=true] + waxed_exposed_copper_trapdoor[facing=east,half=bottom,open=true,powered=true,waterlogged=true]: waxed_exposed_copper_trapdoor[facing=east,half=bottom,open=true,powered=false,waterlogged=true] + waxed_exposed_copper_trapdoor[facing=west,half=bottom,open=true,powered=true,waterlogged=true]: waxed_exposed_copper_trapdoor[facing=west,half=bottom,open=true,powered=false,waterlogged=true] + waxed_exposed_copper_trapdoor[facing=north,half=bottom,open=false,powered=true,waterlogged=true]: waxed_exposed_copper_trapdoor[facing=north,half=bottom,open=false,powered=false,waterlogged=true] + waxed_exposed_copper_trapdoor[facing=south,half=bottom,open=false,powered=true,waterlogged=true]: waxed_exposed_copper_trapdoor[facing=south,half=bottom,open=false,powered=false,waterlogged=true] + waxed_exposed_copper_trapdoor[facing=east,half=bottom,open=false,powered=true,waterlogged=true]: waxed_exposed_copper_trapdoor[facing=east,half=bottom,open=false,powered=false,waterlogged=true] + waxed_exposed_copper_trapdoor[facing=west,half=bottom,open=false,powered=true,waterlogged=true]: waxed_exposed_copper_trapdoor[facing=west,half=bottom,open=false,powered=false,waterlogged=true] + waxed_weathered_copper_trapdoor[facing=north,half=top,open=true,powered=true,waterlogged=false]: waxed_weathered_copper_trapdoor[facing=north,half=top,open=true,powered=false,waterlogged=false] + waxed_weathered_copper_trapdoor[facing=south,half=top,open=true,powered=true,waterlogged=false]: waxed_weathered_copper_trapdoor[facing=south,half=top,open=true,powered=false,waterlogged=false] + waxed_weathered_copper_trapdoor[facing=east,half=top,open=true,powered=true,waterlogged=false]: waxed_weathered_copper_trapdoor[facing=east,half=top,open=true,powered=false,waterlogged=false] + waxed_weathered_copper_trapdoor[facing=west,half=top,open=true,powered=true,waterlogged=false]: waxed_weathered_copper_trapdoor[facing=west,half=top,open=true,powered=false,waterlogged=false] + waxed_weathered_copper_trapdoor[facing=north,half=top,open=false,powered=true,waterlogged=false]: waxed_weathered_copper_trapdoor[facing=north,half=top,open=false,powered=false,waterlogged=false] + waxed_weathered_copper_trapdoor[facing=south,half=top,open=false,powered=true,waterlogged=false]: waxed_weathered_copper_trapdoor[facing=south,half=top,open=false,powered=false,waterlogged=false] + waxed_weathered_copper_trapdoor[facing=east,half=top,open=false,powered=true,waterlogged=false]: waxed_weathered_copper_trapdoor[facing=east,half=top,open=false,powered=false,waterlogged=false] + waxed_weathered_copper_trapdoor[facing=west,half=top,open=false,powered=true,waterlogged=false]: waxed_weathered_copper_trapdoor[facing=west,half=top,open=false,powered=false,waterlogged=false] + waxed_weathered_copper_trapdoor[facing=north,half=top,open=true,powered=true,waterlogged=true]: waxed_weathered_copper_trapdoor[facing=north,half=top,open=true,powered=false,waterlogged=true] + waxed_weathered_copper_trapdoor[facing=south,half=top,open=true,powered=true,waterlogged=true]: waxed_weathered_copper_trapdoor[facing=south,half=top,open=true,powered=false,waterlogged=true] + waxed_weathered_copper_trapdoor[facing=east,half=top,open=true,powered=true,waterlogged=true]: waxed_weathered_copper_trapdoor[facing=east,half=top,open=true,powered=false,waterlogged=true] + waxed_weathered_copper_trapdoor[facing=west,half=top,open=true,powered=true,waterlogged=true]: waxed_weathered_copper_trapdoor[facing=west,half=top,open=true,powered=false,waterlogged=true] + waxed_weathered_copper_trapdoor[facing=north,half=top,open=false,powered=true,waterlogged=true]: waxed_weathered_copper_trapdoor[facing=north,half=top,open=false,powered=false,waterlogged=true] + waxed_weathered_copper_trapdoor[facing=south,half=top,open=false,powered=true,waterlogged=true]: waxed_weathered_copper_trapdoor[facing=south,half=top,open=false,powered=false,waterlogged=true] + waxed_weathered_copper_trapdoor[facing=east,half=top,open=false,powered=true,waterlogged=true]: waxed_weathered_copper_trapdoor[facing=east,half=top,open=false,powered=false,waterlogged=true] + waxed_weathered_copper_trapdoor[facing=west,half=top,open=false,powered=true,waterlogged=true]: waxed_weathered_copper_trapdoor[facing=west,half=top,open=false,powered=false,waterlogged=true] + waxed_weathered_copper_trapdoor[facing=north,half=bottom,open=true,powered=true,waterlogged=false]: waxed_weathered_copper_trapdoor[facing=north,half=bottom,open=true,powered=false,waterlogged=false] + waxed_weathered_copper_trapdoor[facing=south,half=bottom,open=true,powered=true,waterlogged=false]: waxed_weathered_copper_trapdoor[facing=south,half=bottom,open=true,powered=false,waterlogged=false] + waxed_weathered_copper_trapdoor[facing=east,half=bottom,open=true,powered=true,waterlogged=false]: waxed_weathered_copper_trapdoor[facing=east,half=bottom,open=true,powered=false,waterlogged=false] + waxed_weathered_copper_trapdoor[facing=west,half=bottom,open=true,powered=true,waterlogged=false]: waxed_weathered_copper_trapdoor[facing=west,half=bottom,open=true,powered=false,waterlogged=false] + waxed_weathered_copper_trapdoor[facing=north,half=bottom,open=false,powered=true,waterlogged=false]: waxed_weathered_copper_trapdoor[facing=north,half=bottom,open=false,powered=false,waterlogged=false] + waxed_weathered_copper_trapdoor[facing=south,half=bottom,open=false,powered=true,waterlogged=false]: waxed_weathered_copper_trapdoor[facing=south,half=bottom,open=false,powered=false,waterlogged=false] + waxed_weathered_copper_trapdoor[facing=east,half=bottom,open=false,powered=true,waterlogged=false]: waxed_weathered_copper_trapdoor[facing=east,half=bottom,open=false,powered=false,waterlogged=false] + waxed_weathered_copper_trapdoor[facing=west,half=bottom,open=false,powered=true,waterlogged=false]: waxed_weathered_copper_trapdoor[facing=west,half=bottom,open=false,powered=false,waterlogged=false] + waxed_weathered_copper_trapdoor[facing=north,half=bottom,open=true,powered=true,waterlogged=true]: waxed_weathered_copper_trapdoor[facing=north,half=bottom,open=true,powered=false,waterlogged=true] + waxed_weathered_copper_trapdoor[facing=south,half=bottom,open=true,powered=true,waterlogged=true]: waxed_weathered_copper_trapdoor[facing=south,half=bottom,open=true,powered=false,waterlogged=true] + waxed_weathered_copper_trapdoor[facing=east,half=bottom,open=true,powered=true,waterlogged=true]: waxed_weathered_copper_trapdoor[facing=east,half=bottom,open=true,powered=false,waterlogged=true] + waxed_weathered_copper_trapdoor[facing=west,half=bottom,open=true,powered=true,waterlogged=true]: waxed_weathered_copper_trapdoor[facing=west,half=bottom,open=true,powered=false,waterlogged=true] + waxed_weathered_copper_trapdoor[facing=north,half=bottom,open=false,powered=true,waterlogged=true]: waxed_weathered_copper_trapdoor[facing=north,half=bottom,open=false,powered=false,waterlogged=true] + waxed_weathered_copper_trapdoor[facing=south,half=bottom,open=false,powered=true,waterlogged=true]: waxed_weathered_copper_trapdoor[facing=south,half=bottom,open=false,powered=false,waterlogged=true] + waxed_weathered_copper_trapdoor[facing=east,half=bottom,open=false,powered=true,waterlogged=true]: waxed_weathered_copper_trapdoor[facing=east,half=bottom,open=false,powered=false,waterlogged=true] + waxed_weathered_copper_trapdoor[facing=west,half=bottom,open=false,powered=true,waterlogged=true]: waxed_weathered_copper_trapdoor[facing=west,half=bottom,open=false,powered=false,waterlogged=true] + waxed_oxidized_copper_trapdoor[facing=north,half=top,open=true,powered=true,waterlogged=false]: waxed_oxidized_copper_trapdoor[facing=north,half=top,open=true,powered=false,waterlogged=false] + waxed_oxidized_copper_trapdoor[facing=south,half=top,open=true,powered=true,waterlogged=false]: waxed_oxidized_copper_trapdoor[facing=south,half=top,open=true,powered=false,waterlogged=false] + waxed_oxidized_copper_trapdoor[facing=east,half=top,open=true,powered=true,waterlogged=false]: waxed_oxidized_copper_trapdoor[facing=east,half=top,open=true,powered=false,waterlogged=false] + waxed_oxidized_copper_trapdoor[facing=west,half=top,open=true,powered=true,waterlogged=false]: waxed_oxidized_copper_trapdoor[facing=west,half=top,open=true,powered=false,waterlogged=false] + waxed_oxidized_copper_trapdoor[facing=north,half=top,open=false,powered=true,waterlogged=false]: waxed_oxidized_copper_trapdoor[facing=north,half=top,open=false,powered=false,waterlogged=false] + waxed_oxidized_copper_trapdoor[facing=south,half=top,open=false,powered=true,waterlogged=false]: waxed_oxidized_copper_trapdoor[facing=south,half=top,open=false,powered=false,waterlogged=false] + waxed_oxidized_copper_trapdoor[facing=east,half=top,open=false,powered=true,waterlogged=false]: waxed_oxidized_copper_trapdoor[facing=east,half=top,open=false,powered=false,waterlogged=false] + waxed_oxidized_copper_trapdoor[facing=west,half=top,open=false,powered=true,waterlogged=false]: waxed_oxidized_copper_trapdoor[facing=west,half=top,open=false,powered=false,waterlogged=false] + waxed_oxidized_copper_trapdoor[facing=north,half=top,open=true,powered=true,waterlogged=true]: waxed_oxidized_copper_trapdoor[facing=north,half=top,open=true,powered=false,waterlogged=true] + waxed_oxidized_copper_trapdoor[facing=south,half=top,open=true,powered=true,waterlogged=true]: waxed_oxidized_copper_trapdoor[facing=south,half=top,open=true,powered=false,waterlogged=true] + waxed_oxidized_copper_trapdoor[facing=east,half=top,open=true,powered=true,waterlogged=true]: waxed_oxidized_copper_trapdoor[facing=east,half=top,open=true,powered=false,waterlogged=true] + waxed_oxidized_copper_trapdoor[facing=west,half=top,open=true,powered=true,waterlogged=true]: waxed_oxidized_copper_trapdoor[facing=west,half=top,open=true,powered=false,waterlogged=true] + waxed_oxidized_copper_trapdoor[facing=north,half=top,open=false,powered=true,waterlogged=true]: waxed_oxidized_copper_trapdoor[facing=north,half=top,open=false,powered=false,waterlogged=true] + waxed_oxidized_copper_trapdoor[facing=south,half=top,open=false,powered=true,waterlogged=true]: waxed_oxidized_copper_trapdoor[facing=south,half=top,open=false,powered=false,waterlogged=true] + waxed_oxidized_copper_trapdoor[facing=east,half=top,open=false,powered=true,waterlogged=true]: waxed_oxidized_copper_trapdoor[facing=east,half=top,open=false,powered=false,waterlogged=true] + waxed_oxidized_copper_trapdoor[facing=west,half=top,open=false,powered=true,waterlogged=true]: waxed_oxidized_copper_trapdoor[facing=west,half=top,open=false,powered=false,waterlogged=true] + waxed_oxidized_copper_trapdoor[facing=north,half=bottom,open=true,powered=true,waterlogged=false]: waxed_oxidized_copper_trapdoor[facing=north,half=bottom,open=true,powered=false,waterlogged=false] + waxed_oxidized_copper_trapdoor[facing=south,half=bottom,open=true,powered=true,waterlogged=false]: waxed_oxidized_copper_trapdoor[facing=south,half=bottom,open=true,powered=false,waterlogged=false] + waxed_oxidized_copper_trapdoor[facing=east,half=bottom,open=true,powered=true,waterlogged=false]: waxed_oxidized_copper_trapdoor[facing=east,half=bottom,open=true,powered=false,waterlogged=false] + waxed_oxidized_copper_trapdoor[facing=west,half=bottom,open=true,powered=true,waterlogged=false]: waxed_oxidized_copper_trapdoor[facing=west,half=bottom,open=true,powered=false,waterlogged=false] + waxed_oxidized_copper_trapdoor[facing=north,half=bottom,open=false,powered=true,waterlogged=false]: waxed_oxidized_copper_trapdoor[facing=north,half=bottom,open=false,powered=false,waterlogged=false] + waxed_oxidized_copper_trapdoor[facing=south,half=bottom,open=false,powered=true,waterlogged=false]: waxed_oxidized_copper_trapdoor[facing=south,half=bottom,open=false,powered=false,waterlogged=false] + waxed_oxidized_copper_trapdoor[facing=east,half=bottom,open=false,powered=true,waterlogged=false]: waxed_oxidized_copper_trapdoor[facing=east,half=bottom,open=false,powered=false,waterlogged=false] + waxed_oxidized_copper_trapdoor[facing=west,half=bottom,open=false,powered=true,waterlogged=false]: waxed_oxidized_copper_trapdoor[facing=west,half=bottom,open=false,powered=false,waterlogged=false] + waxed_oxidized_copper_trapdoor[facing=north,half=bottom,open=true,powered=true,waterlogged=true]: waxed_oxidized_copper_trapdoor[facing=north,half=bottom,open=true,powered=false,waterlogged=true] + waxed_oxidized_copper_trapdoor[facing=south,half=bottom,open=true,powered=true,waterlogged=true]: waxed_oxidized_copper_trapdoor[facing=south,half=bottom,open=true,powered=false,waterlogged=true] + waxed_oxidized_copper_trapdoor[facing=east,half=bottom,open=true,powered=true,waterlogged=true]: waxed_oxidized_copper_trapdoor[facing=east,half=bottom,open=true,powered=false,waterlogged=true] + waxed_oxidized_copper_trapdoor[facing=west,half=bottom,open=true,powered=true,waterlogged=true]: waxed_oxidized_copper_trapdoor[facing=west,half=bottom,open=true,powered=false,waterlogged=true] + waxed_oxidized_copper_trapdoor[facing=north,half=bottom,open=false,powered=true,waterlogged=true]: waxed_oxidized_copper_trapdoor[facing=north,half=bottom,open=false,powered=false,waterlogged=true] + waxed_oxidized_copper_trapdoor[facing=south,half=bottom,open=false,powered=true,waterlogged=true]: waxed_oxidized_copper_trapdoor[facing=south,half=bottom,open=false,powered=false,waterlogged=true] + waxed_oxidized_copper_trapdoor[facing=east,half=bottom,open=false,powered=true,waterlogged=true]: waxed_oxidized_copper_trapdoor[facing=east,half=bottom,open=false,powered=false,waterlogged=true] + waxed_oxidized_copper_trapdoor[facing=west,half=bottom,open=false,powered=true,waterlogged=true]: waxed_oxidized_copper_trapdoor[facing=west,half=bottom,open=false,powered=false,waterlogged=true] + + $$>=1.21.4#trapdoor: + pale_oak_trapdoor[facing=north,half=top,open=true,powered=true,waterlogged=false]: pale_oak_trapdoor[facing=north,half=top,open=true,powered=false,waterlogged=false] + pale_oak_trapdoor[facing=south,half=top,open=true,powered=true,waterlogged=false]: pale_oak_trapdoor[facing=south,half=top,open=true,powered=false,waterlogged=false] + pale_oak_trapdoor[facing=east,half=top,open=true,powered=true,waterlogged=false]: pale_oak_trapdoor[facing=east,half=top,open=true,powered=false,waterlogged=false] + pale_oak_trapdoor[facing=west,half=top,open=true,powered=true,waterlogged=false]: pale_oak_trapdoor[facing=west,half=top,open=true,powered=false,waterlogged=false] + pale_oak_trapdoor[facing=north,half=top,open=false,powered=true,waterlogged=false]: pale_oak_trapdoor[facing=north,half=top,open=false,powered=false,waterlogged=false] + pale_oak_trapdoor[facing=south,half=top,open=false,powered=true,waterlogged=false]: pale_oak_trapdoor[facing=south,half=top,open=false,powered=false,waterlogged=false] + pale_oak_trapdoor[facing=east,half=top,open=false,powered=true,waterlogged=false]: pale_oak_trapdoor[facing=east,half=top,open=false,powered=false,waterlogged=false] + pale_oak_trapdoor[facing=west,half=top,open=false,powered=true,waterlogged=false]: pale_oak_trapdoor[facing=west,half=top,open=false,powered=false,waterlogged=false] + pale_oak_trapdoor[facing=north,half=top,open=true,powered=true,waterlogged=true]: pale_oak_trapdoor[facing=north,half=top,open=true,powered=false,waterlogged=true] + pale_oak_trapdoor[facing=south,half=top,open=true,powered=true,waterlogged=true]: pale_oak_trapdoor[facing=south,half=top,open=true,powered=false,waterlogged=true] + pale_oak_trapdoor[facing=east,half=top,open=true,powered=true,waterlogged=true]: pale_oak_trapdoor[facing=east,half=top,open=true,powered=false,waterlogged=true] + pale_oak_trapdoor[facing=west,half=top,open=true,powered=true,waterlogged=true]: pale_oak_trapdoor[facing=west,half=top,open=true,powered=false,waterlogged=true] + pale_oak_trapdoor[facing=north,half=top,open=false,powered=true,waterlogged=true]: pale_oak_trapdoor[facing=north,half=top,open=false,powered=false,waterlogged=true] + pale_oak_trapdoor[facing=south,half=top,open=false,powered=true,waterlogged=true]: pale_oak_trapdoor[facing=south,half=top,open=false,powered=false,waterlogged=true] + pale_oak_trapdoor[facing=east,half=top,open=false,powered=true,waterlogged=true]: pale_oak_trapdoor[facing=east,half=top,open=false,powered=false,waterlogged=true] + pale_oak_trapdoor[facing=west,half=top,open=false,powered=true,waterlogged=true]: pale_oak_trapdoor[facing=west,half=top,open=false,powered=false,waterlogged=true] + pale_oak_trapdoor[facing=north,half=bottom,open=true,powered=true,waterlogged=false]: pale_oak_trapdoor[facing=north,half=bottom,open=true,powered=false,waterlogged=false] + pale_oak_trapdoor[facing=south,half=bottom,open=true,powered=true,waterlogged=false]: pale_oak_trapdoor[facing=south,half=bottom,open=true,powered=false,waterlogged=false] + pale_oak_trapdoor[facing=east,half=bottom,open=true,powered=true,waterlogged=false]: pale_oak_trapdoor[facing=east,half=bottom,open=true,powered=false,waterlogged=false] + pale_oak_trapdoor[facing=west,half=bottom,open=true,powered=true,waterlogged=false]: pale_oak_trapdoor[facing=west,half=bottom,open=true,powered=false,waterlogged=false] + pale_oak_trapdoor[facing=north,half=bottom,open=false,powered=true,waterlogged=false]: pale_oak_trapdoor[facing=north,half=bottom,open=false,powered=false,waterlogged=false] + pale_oak_trapdoor[facing=south,half=bottom,open=false,powered=true,waterlogged=false]: pale_oak_trapdoor[facing=south,half=bottom,open=false,powered=false,waterlogged=false] + pale_oak_trapdoor[facing=east,half=bottom,open=false,powered=true,waterlogged=false]: pale_oak_trapdoor[facing=east,half=bottom,open=false,powered=false,waterlogged=false] + pale_oak_trapdoor[facing=west,half=bottom,open=false,powered=true,waterlogged=false]: pale_oak_trapdoor[facing=west,half=bottom,open=false,powered=false,waterlogged=false] + pale_oak_trapdoor[facing=north,half=bottom,open=true,powered=true,waterlogged=true]: pale_oak_trapdoor[facing=north,half=bottom,open=true,powered=false,waterlogged=true] + pale_oak_trapdoor[facing=south,half=bottom,open=true,powered=true,waterlogged=true]: pale_oak_trapdoor[facing=south,half=bottom,open=true,powered=false,waterlogged=true] + pale_oak_trapdoor[facing=east,half=bottom,open=true,powered=true,waterlogged=true]: pale_oak_trapdoor[facing=east,half=bottom,open=true,powered=false,waterlogged=true] + pale_oak_trapdoor[facing=west,half=bottom,open=true,powered=true,waterlogged=true]: pale_oak_trapdoor[facing=west,half=bottom,open=true,powered=false,waterlogged=true] + pale_oak_trapdoor[facing=north,half=bottom,open=false,powered=true,waterlogged=true]: pale_oak_trapdoor[facing=north,half=bottom,open=false,powered=false,waterlogged=true] + pale_oak_trapdoor[facing=south,half=bottom,open=false,powered=true,waterlogged=true]: pale_oak_trapdoor[facing=south,half=bottom,open=false,powered=false,waterlogged=true] + pale_oak_trapdoor[facing=east,half=bottom,open=false,powered=true,waterlogged=true]: pale_oak_trapdoor[facing=east,half=bottom,open=false,powered=false,waterlogged=true] + pale_oak_trapdoor[facing=west,half=bottom,open=false,powered=true,waterlogged=true]: pale_oak_trapdoor[facing=west,half=bottom,open=false,powered=false,waterlogged=true] + + #### Door #### + # A door look exactly the same whether it's powered on or off, just like how a trapdoor works + oak_door[facing=east,half=lower,hinge=left,open=false,powered=true]: oak_door[facing=east,half=lower,hinge=left,open=false,powered=false] + oak_door[facing=east,half=lower,hinge=right,open=false,powered=true]: oak_door[facing=east,half=lower,hinge=right,open=false,powered=false] + oak_door[facing=east,half=upper,hinge=left,open=false,powered=true]: oak_door[facing=east,half=upper,hinge=left,open=false,powered=false] + oak_door[facing=east,half=upper,hinge=right,open=false,powered=true]: oak_door[facing=east,half=upper,hinge=right,open=false,powered=false] + oak_door[facing=east,half=lower,hinge=left,open=true,powered=true]: oak_door[facing=east,half=lower,hinge=left,open=true,powered=false] + oak_door[facing=east,half=lower,hinge=right,open=true,powered=true]: oak_door[facing=east,half=lower,hinge=right,open=true,powered=false] + oak_door[facing=east,half=upper,hinge=left,open=true,powered=true]: oak_door[facing=east,half=upper,hinge=left,open=true,powered=false] + oak_door[facing=east,half=upper,hinge=right,open=true,powered=true]: oak_door[facing=east,half=upper,hinge=right,open=true,powered=false] + oak_door[facing=north,half=lower,hinge=left,open=false,powered=true]: oak_door[facing=north,half=lower,hinge=left,open=false,powered=false] + oak_door[facing=north,half=lower,hinge=right,open=false,powered=true]: oak_door[facing=north,half=lower,hinge=right,open=false,powered=false] + oak_door[facing=north,half=upper,hinge=left,open=false,powered=true]: oak_door[facing=north,half=upper,hinge=left,open=false,powered=false] + oak_door[facing=north,half=upper,hinge=right,open=false,powered=true]: oak_door[facing=north,half=upper,hinge=right,open=false,powered=false] + oak_door[facing=north,half=lower,hinge=left,open=true,powered=true]: oak_door[facing=north,half=lower,hinge=left,open=true,powered=false] + oak_door[facing=north,half=lower,hinge=right,open=true,powered=true]: oak_door[facing=north,half=lower,hinge=right,open=true,powered=false] + oak_door[facing=north,half=upper,hinge=left,open=true,powered=true]: oak_door[facing=north,half=upper,hinge=left,open=true,powered=false] + oak_door[facing=north,half=upper,hinge=right,open=true,powered=true]: oak_door[facing=north,half=upper,hinge=right,open=true,powered=false] + oak_door[facing=south,half=lower,hinge=left,open=false,powered=true]: oak_door[facing=south,half=lower,hinge=left,open=false,powered=false] + oak_door[facing=south,half=lower,hinge=right,open=false,powered=true]: oak_door[facing=south,half=lower,hinge=right,open=false,powered=false] + oak_door[facing=south,half=upper,hinge=left,open=false,powered=true]: oak_door[facing=south,half=upper,hinge=left,open=false,powered=false] + oak_door[facing=south,half=upper,hinge=right,open=false,powered=true]: oak_door[facing=south,half=upper,hinge=right,open=false,powered=false] + oak_door[facing=south,half=lower,hinge=left,open=true,powered=true]: oak_door[facing=south,half=lower,hinge=left,open=true,powered=false] + oak_door[facing=south,half=lower,hinge=right,open=true,powered=true]: oak_door[facing=south,half=lower,hinge=right,open=true,powered=false] + oak_door[facing=south,half=upper,hinge=left,open=true,powered=true]: oak_door[facing=south,half=upper,hinge=left,open=true,powered=false] + oak_door[facing=south,half=upper,hinge=right,open=true,powered=true]: oak_door[facing=south,half=upper,hinge=right,open=true,powered=false] + oak_door[facing=west,half=lower,hinge=left,open=false,powered=true]: oak_door[facing=west,half=lower,hinge=left,open=false,powered=false] + oak_door[facing=west,half=lower,hinge=right,open=false,powered=true]: oak_door[facing=west,half=lower,hinge=right,open=false,powered=false] + oak_door[facing=west,half=upper,hinge=left,open=false,powered=true]: oak_door[facing=west,half=upper,hinge=left,open=false,powered=false] + oak_door[facing=west,half=upper,hinge=right,open=false,powered=true]: oak_door[facing=west,half=upper,hinge=right,open=false,powered=false] + oak_door[facing=west,half=lower,hinge=left,open=true,powered=true]: oak_door[facing=west,half=lower,hinge=left,open=true,powered=false] + oak_door[facing=west,half=lower,hinge=right,open=true,powered=true]: oak_door[facing=west,half=lower,hinge=right,open=true,powered=false] + oak_door[facing=west,half=upper,hinge=left,open=true,powered=true]: oak_door[facing=west,half=upper,hinge=left,open=true,powered=false] + oak_door[facing=west,half=upper,hinge=right,open=true,powered=true]: oak_door[facing=west,half=upper,hinge=right,open=true,powered=false] + spruce_door[facing=east,half=lower,hinge=left,open=false,powered=true]: spruce_door[facing=east,half=lower,hinge=left,open=false,powered=false] + spruce_door[facing=east,half=lower,hinge=right,open=false,powered=true]: spruce_door[facing=east,half=lower,hinge=right,open=false,powered=false] + spruce_door[facing=east,half=upper,hinge=left,open=false,powered=true]: spruce_door[facing=east,half=upper,hinge=left,open=false,powered=false] + spruce_door[facing=east,half=upper,hinge=right,open=false,powered=true]: spruce_door[facing=east,half=upper,hinge=right,open=false,powered=false] + spruce_door[facing=east,half=lower,hinge=left,open=true,powered=true]: spruce_door[facing=east,half=lower,hinge=left,open=true,powered=false] + spruce_door[facing=east,half=lower,hinge=right,open=true,powered=true]: spruce_door[facing=east,half=lower,hinge=right,open=true,powered=false] + spruce_door[facing=east,half=upper,hinge=left,open=true,powered=true]: spruce_door[facing=east,half=upper,hinge=left,open=true,powered=false] + spruce_door[facing=east,half=upper,hinge=right,open=true,powered=true]: spruce_door[facing=east,half=upper,hinge=right,open=true,powered=false] + spruce_door[facing=north,half=lower,hinge=left,open=false,powered=true]: spruce_door[facing=north,half=lower,hinge=left,open=false,powered=false] + spruce_door[facing=north,half=lower,hinge=right,open=false,powered=true]: spruce_door[facing=north,half=lower,hinge=right,open=false,powered=false] + spruce_door[facing=north,half=upper,hinge=left,open=false,powered=true]: spruce_door[facing=north,half=upper,hinge=left,open=false,powered=false] + spruce_door[facing=north,half=upper,hinge=right,open=false,powered=true]: spruce_door[facing=north,half=upper,hinge=right,open=false,powered=false] + spruce_door[facing=north,half=lower,hinge=left,open=true,powered=true]: spruce_door[facing=north,half=lower,hinge=left,open=true,powered=false] + spruce_door[facing=north,half=lower,hinge=right,open=true,powered=true]: spruce_door[facing=north,half=lower,hinge=right,open=true,powered=false] + spruce_door[facing=north,half=upper,hinge=left,open=true,powered=true]: spruce_door[facing=north,half=upper,hinge=left,open=true,powered=false] + spruce_door[facing=north,half=upper,hinge=right,open=true,powered=true]: spruce_door[facing=north,half=upper,hinge=right,open=true,powered=false] + spruce_door[facing=south,half=lower,hinge=left,open=false,powered=true]: spruce_door[facing=south,half=lower,hinge=left,open=false,powered=false] + spruce_door[facing=south,half=lower,hinge=right,open=false,powered=true]: spruce_door[facing=south,half=lower,hinge=right,open=false,powered=false] + spruce_door[facing=south,half=upper,hinge=left,open=false,powered=true]: spruce_door[facing=south,half=upper,hinge=left,open=false,powered=false] + spruce_door[facing=south,half=upper,hinge=right,open=false,powered=true]: spruce_door[facing=south,half=upper,hinge=right,open=false,powered=false] + spruce_door[facing=south,half=lower,hinge=left,open=true,powered=true]: spruce_door[facing=south,half=lower,hinge=left,open=true,powered=false] + spruce_door[facing=south,half=lower,hinge=right,open=true,powered=true]: spruce_door[facing=south,half=lower,hinge=right,open=true,powered=false] + spruce_door[facing=south,half=upper,hinge=left,open=true,powered=true]: spruce_door[facing=south,half=upper,hinge=left,open=true,powered=false] + spruce_door[facing=south,half=upper,hinge=right,open=true,powered=true]: spruce_door[facing=south,half=upper,hinge=right,open=true,powered=false] + spruce_door[facing=west,half=lower,hinge=left,open=false,powered=true]: spruce_door[facing=west,half=lower,hinge=left,open=false,powered=false] + spruce_door[facing=west,half=lower,hinge=right,open=false,powered=true]: spruce_door[facing=west,half=lower,hinge=right,open=false,powered=false] + spruce_door[facing=west,half=upper,hinge=left,open=false,powered=true]: spruce_door[facing=west,half=upper,hinge=left,open=false,powered=false] + spruce_door[facing=west,half=upper,hinge=right,open=false,powered=true]: spruce_door[facing=west,half=upper,hinge=right,open=false,powered=false] + spruce_door[facing=west,half=lower,hinge=left,open=true,powered=true]: spruce_door[facing=west,half=lower,hinge=left,open=true,powered=false] + spruce_door[facing=west,half=lower,hinge=right,open=true,powered=true]: spruce_door[facing=west,half=lower,hinge=right,open=true,powered=false] + spruce_door[facing=west,half=upper,hinge=left,open=true,powered=true]: spruce_door[facing=west,half=upper,hinge=left,open=true,powered=false] + spruce_door[facing=west,half=upper,hinge=right,open=true,powered=true]: spruce_door[facing=west,half=upper,hinge=right,open=true,powered=false] + birch_door[facing=east,half=lower,hinge=left,open=false,powered=true]: birch_door[facing=east,half=lower,hinge=left,open=false,powered=false] + birch_door[facing=east,half=lower,hinge=right,open=false,powered=true]: birch_door[facing=east,half=lower,hinge=right,open=false,powered=false] + birch_door[facing=east,half=upper,hinge=left,open=false,powered=true]: birch_door[facing=east,half=upper,hinge=left,open=false,powered=false] + birch_door[facing=east,half=upper,hinge=right,open=false,powered=true]: birch_door[facing=east,half=upper,hinge=right,open=false,powered=false] + birch_door[facing=east,half=lower,hinge=left,open=true,powered=true]: birch_door[facing=east,half=lower,hinge=left,open=true,powered=false] + birch_door[facing=east,half=lower,hinge=right,open=true,powered=true]: birch_door[facing=east,half=lower,hinge=right,open=true,powered=false] + birch_door[facing=east,half=upper,hinge=left,open=true,powered=true]: birch_door[facing=east,half=upper,hinge=left,open=true,powered=false] + birch_door[facing=east,half=upper,hinge=right,open=true,powered=true]: birch_door[facing=east,half=upper,hinge=right,open=true,powered=false] + birch_door[facing=north,half=lower,hinge=left,open=false,powered=true]: birch_door[facing=north,half=lower,hinge=left,open=false,powered=false] + birch_door[facing=north,half=lower,hinge=right,open=false,powered=true]: birch_door[facing=north,half=lower,hinge=right,open=false,powered=false] + birch_door[facing=north,half=upper,hinge=left,open=false,powered=true]: birch_door[facing=north,half=upper,hinge=left,open=false,powered=false] + birch_door[facing=north,half=upper,hinge=right,open=false,powered=true]: birch_door[facing=north,half=upper,hinge=right,open=false,powered=false] + birch_door[facing=north,half=lower,hinge=left,open=true,powered=true]: birch_door[facing=north,half=lower,hinge=left,open=true,powered=false] + birch_door[facing=north,half=lower,hinge=right,open=true,powered=true]: birch_door[facing=north,half=lower,hinge=right,open=true,powered=false] + birch_door[facing=north,half=upper,hinge=left,open=true,powered=true]: birch_door[facing=north,half=upper,hinge=left,open=true,powered=false] + birch_door[facing=north,half=upper,hinge=right,open=true,powered=true]: birch_door[facing=north,half=upper,hinge=right,open=true,powered=false] + birch_door[facing=south,half=lower,hinge=left,open=false,powered=true]: birch_door[facing=south,half=lower,hinge=left,open=false,powered=false] + birch_door[facing=south,half=lower,hinge=right,open=false,powered=true]: birch_door[facing=south,half=lower,hinge=right,open=false,powered=false] + birch_door[facing=south,half=upper,hinge=left,open=false,powered=true]: birch_door[facing=south,half=upper,hinge=left,open=false,powered=false] + birch_door[facing=south,half=upper,hinge=right,open=false,powered=true]: birch_door[facing=south,half=upper,hinge=right,open=false,powered=false] + birch_door[facing=south,half=lower,hinge=left,open=true,powered=true]: birch_door[facing=south,half=lower,hinge=left,open=true,powered=false] + birch_door[facing=south,half=lower,hinge=right,open=true,powered=true]: birch_door[facing=south,half=lower,hinge=right,open=true,powered=false] + birch_door[facing=south,half=upper,hinge=left,open=true,powered=true]: birch_door[facing=south,half=upper,hinge=left,open=true,powered=false] + birch_door[facing=south,half=upper,hinge=right,open=true,powered=true]: birch_door[facing=south,half=upper,hinge=right,open=true,powered=false] + birch_door[facing=west,half=lower,hinge=left,open=false,powered=true]: birch_door[facing=west,half=lower,hinge=left,open=false,powered=false] + birch_door[facing=west,half=lower,hinge=right,open=false,powered=true]: birch_door[facing=west,half=lower,hinge=right,open=false,powered=false] + birch_door[facing=west,half=upper,hinge=left,open=false,powered=true]: birch_door[facing=west,half=upper,hinge=left,open=false,powered=false] + birch_door[facing=west,half=upper,hinge=right,open=false,powered=true]: birch_door[facing=west,half=upper,hinge=right,open=false,powered=false] + birch_door[facing=west,half=lower,hinge=left,open=true,powered=true]: birch_door[facing=west,half=lower,hinge=left,open=true,powered=false] + birch_door[facing=west,half=lower,hinge=right,open=true,powered=true]: birch_door[facing=west,half=lower,hinge=right,open=true,powered=false] + birch_door[facing=west,half=upper,hinge=left,open=true,powered=true]: birch_door[facing=west,half=upper,hinge=left,open=true,powered=false] + birch_door[facing=west,half=upper,hinge=right,open=true,powered=true]: birch_door[facing=west,half=upper,hinge=right,open=true,powered=false] + jungle_door[facing=east,half=lower,hinge=left,open=false,powered=true]: jungle_door[facing=east,half=lower,hinge=left,open=false,powered=false] + jungle_door[facing=east,half=lower,hinge=right,open=false,powered=true]: jungle_door[facing=east,half=lower,hinge=right,open=false,powered=false] + jungle_door[facing=east,half=upper,hinge=left,open=false,powered=true]: jungle_door[facing=east,half=upper,hinge=left,open=false,powered=false] + jungle_door[facing=east,half=upper,hinge=right,open=false,powered=true]: jungle_door[facing=east,half=upper,hinge=right,open=false,powered=false] + jungle_door[facing=east,half=lower,hinge=left,open=true,powered=true]: jungle_door[facing=east,half=lower,hinge=left,open=true,powered=false] + jungle_door[facing=east,half=lower,hinge=right,open=true,powered=true]: jungle_door[facing=east,half=lower,hinge=right,open=true,powered=false] + jungle_door[facing=east,half=upper,hinge=left,open=true,powered=true]: jungle_door[facing=east,half=upper,hinge=left,open=true,powered=false] + jungle_door[facing=east,half=upper,hinge=right,open=true,powered=true]: jungle_door[facing=east,half=upper,hinge=right,open=true,powered=false] + jungle_door[facing=north,half=lower,hinge=left,open=false,powered=true]: jungle_door[facing=north,half=lower,hinge=left,open=false,powered=false] + jungle_door[facing=north,half=lower,hinge=right,open=false,powered=true]: jungle_door[facing=north,half=lower,hinge=right,open=false,powered=false] + jungle_door[facing=north,half=upper,hinge=left,open=false,powered=true]: jungle_door[facing=north,half=upper,hinge=left,open=false,powered=false] + jungle_door[facing=north,half=upper,hinge=right,open=false,powered=true]: jungle_door[facing=north,half=upper,hinge=right,open=false,powered=false] + jungle_door[facing=north,half=lower,hinge=left,open=true,powered=true]: jungle_door[facing=north,half=lower,hinge=left,open=true,powered=false] + jungle_door[facing=north,half=lower,hinge=right,open=true,powered=true]: jungle_door[facing=north,half=lower,hinge=right,open=true,powered=false] + jungle_door[facing=north,half=upper,hinge=left,open=true,powered=true]: jungle_door[facing=north,half=upper,hinge=left,open=true,powered=false] + jungle_door[facing=north,half=upper,hinge=right,open=true,powered=true]: jungle_door[facing=north,half=upper,hinge=right,open=true,powered=false] + jungle_door[facing=south,half=lower,hinge=left,open=false,powered=true]: jungle_door[facing=south,half=lower,hinge=left,open=false,powered=false] + jungle_door[facing=south,half=lower,hinge=right,open=false,powered=true]: jungle_door[facing=south,half=lower,hinge=right,open=false,powered=false] + jungle_door[facing=south,half=upper,hinge=left,open=false,powered=true]: jungle_door[facing=south,half=upper,hinge=left,open=false,powered=false] + jungle_door[facing=south,half=upper,hinge=right,open=false,powered=true]: jungle_door[facing=south,half=upper,hinge=right,open=false,powered=false] + jungle_door[facing=south,half=lower,hinge=left,open=true,powered=true]: jungle_door[facing=south,half=lower,hinge=left,open=true,powered=false] + jungle_door[facing=south,half=lower,hinge=right,open=true,powered=true]: jungle_door[facing=south,half=lower,hinge=right,open=true,powered=false] + jungle_door[facing=south,half=upper,hinge=left,open=true,powered=true]: jungle_door[facing=south,half=upper,hinge=left,open=true,powered=false] + jungle_door[facing=south,half=upper,hinge=right,open=true,powered=true]: jungle_door[facing=south,half=upper,hinge=right,open=true,powered=false] + jungle_door[facing=west,half=lower,hinge=left,open=false,powered=true]: jungle_door[facing=west,half=lower,hinge=left,open=false,powered=false] + jungle_door[facing=west,half=lower,hinge=right,open=false,powered=true]: jungle_door[facing=west,half=lower,hinge=right,open=false,powered=false] + jungle_door[facing=west,half=upper,hinge=left,open=false,powered=true]: jungle_door[facing=west,half=upper,hinge=left,open=false,powered=false] + jungle_door[facing=west,half=upper,hinge=right,open=false,powered=true]: jungle_door[facing=west,half=upper,hinge=right,open=false,powered=false] + jungle_door[facing=west,half=lower,hinge=left,open=true,powered=true]: jungle_door[facing=west,half=lower,hinge=left,open=true,powered=false] + jungle_door[facing=west,half=lower,hinge=right,open=true,powered=true]: jungle_door[facing=west,half=lower,hinge=right,open=true,powered=false] + jungle_door[facing=west,half=upper,hinge=left,open=true,powered=true]: jungle_door[facing=west,half=upper,hinge=left,open=true,powered=false] + jungle_door[facing=west,half=upper,hinge=right,open=true,powered=true]: jungle_door[facing=west,half=upper,hinge=right,open=true,powered=false] + acacia_door[facing=east,half=lower,hinge=left,open=false,powered=true]: acacia_door[facing=east,half=lower,hinge=left,open=false,powered=false] + acacia_door[facing=east,half=lower,hinge=right,open=false,powered=true]: acacia_door[facing=east,half=lower,hinge=right,open=false,powered=false] + acacia_door[facing=east,half=upper,hinge=left,open=false,powered=true]: acacia_door[facing=east,half=upper,hinge=left,open=false,powered=false] + acacia_door[facing=east,half=upper,hinge=right,open=false,powered=true]: acacia_door[facing=east,half=upper,hinge=right,open=false,powered=false] + acacia_door[facing=east,half=lower,hinge=left,open=true,powered=true]: acacia_door[facing=east,half=lower,hinge=left,open=true,powered=false] + acacia_door[facing=east,half=lower,hinge=right,open=true,powered=true]: acacia_door[facing=east,half=lower,hinge=right,open=true,powered=false] + acacia_door[facing=east,half=upper,hinge=left,open=true,powered=true]: acacia_door[facing=east,half=upper,hinge=left,open=true,powered=false] + acacia_door[facing=east,half=upper,hinge=right,open=true,powered=true]: acacia_door[facing=east,half=upper,hinge=right,open=true,powered=false] + acacia_door[facing=north,half=lower,hinge=left,open=false,powered=true]: acacia_door[facing=north,half=lower,hinge=left,open=false,powered=false] + acacia_door[facing=north,half=lower,hinge=right,open=false,powered=true]: acacia_door[facing=north,half=lower,hinge=right,open=false,powered=false] + acacia_door[facing=north,half=upper,hinge=left,open=false,powered=true]: acacia_door[facing=north,half=upper,hinge=left,open=false,powered=false] + acacia_door[facing=north,half=upper,hinge=right,open=false,powered=true]: acacia_door[facing=north,half=upper,hinge=right,open=false,powered=false] + acacia_door[facing=north,half=lower,hinge=left,open=true,powered=true]: acacia_door[facing=north,half=lower,hinge=left,open=true,powered=false] + acacia_door[facing=north,half=lower,hinge=right,open=true,powered=true]: acacia_door[facing=north,half=lower,hinge=right,open=true,powered=false] + acacia_door[facing=north,half=upper,hinge=left,open=true,powered=true]: acacia_door[facing=north,half=upper,hinge=left,open=true,powered=false] + acacia_door[facing=north,half=upper,hinge=right,open=true,powered=true]: acacia_door[facing=north,half=upper,hinge=right,open=true,powered=false] + acacia_door[facing=south,half=lower,hinge=left,open=false,powered=true]: acacia_door[facing=south,half=lower,hinge=left,open=false,powered=false] + acacia_door[facing=south,half=lower,hinge=right,open=false,powered=true]: acacia_door[facing=south,half=lower,hinge=right,open=false,powered=false] + acacia_door[facing=south,half=upper,hinge=left,open=false,powered=true]: acacia_door[facing=south,half=upper,hinge=left,open=false,powered=false] + acacia_door[facing=south,half=upper,hinge=right,open=false,powered=true]: acacia_door[facing=south,half=upper,hinge=right,open=false,powered=false] + acacia_door[facing=south,half=lower,hinge=left,open=true,powered=true]: acacia_door[facing=south,half=lower,hinge=left,open=true,powered=false] + acacia_door[facing=south,half=lower,hinge=right,open=true,powered=true]: acacia_door[facing=south,half=lower,hinge=right,open=true,powered=false] + acacia_door[facing=south,half=upper,hinge=left,open=true,powered=true]: acacia_door[facing=south,half=upper,hinge=left,open=true,powered=false] + acacia_door[facing=south,half=upper,hinge=right,open=true,powered=true]: acacia_door[facing=south,half=upper,hinge=right,open=true,powered=false] + acacia_door[facing=west,half=lower,hinge=left,open=false,powered=true]: acacia_door[facing=west,half=lower,hinge=left,open=false,powered=false] + acacia_door[facing=west,half=lower,hinge=right,open=false,powered=true]: acacia_door[facing=west,half=lower,hinge=right,open=false,powered=false] + acacia_door[facing=west,half=upper,hinge=left,open=false,powered=true]: acacia_door[facing=west,half=upper,hinge=left,open=false,powered=false] + acacia_door[facing=west,half=upper,hinge=right,open=false,powered=true]: acacia_door[facing=west,half=upper,hinge=right,open=false,powered=false] + acacia_door[facing=west,half=lower,hinge=left,open=true,powered=true]: acacia_door[facing=west,half=lower,hinge=left,open=true,powered=false] + acacia_door[facing=west,half=lower,hinge=right,open=true,powered=true]: acacia_door[facing=west,half=lower,hinge=right,open=true,powered=false] + acacia_door[facing=west,half=upper,hinge=left,open=true,powered=true]: acacia_door[facing=west,half=upper,hinge=left,open=true,powered=false] + acacia_door[facing=west,half=upper,hinge=right,open=true,powered=true]: acacia_door[facing=west,half=upper,hinge=right,open=true,powered=false] + dark_oak_door[facing=east,half=lower,hinge=left,open=false,powered=true]: dark_oak_door[facing=east,half=lower,hinge=left,open=false,powered=false] + dark_oak_door[facing=east,half=lower,hinge=right,open=false,powered=true]: dark_oak_door[facing=east,half=lower,hinge=right,open=false,powered=false] + dark_oak_door[facing=east,half=upper,hinge=left,open=false,powered=true]: dark_oak_door[facing=east,half=upper,hinge=left,open=false,powered=false] + dark_oak_door[facing=east,half=upper,hinge=right,open=false,powered=true]: dark_oak_door[facing=east,half=upper,hinge=right,open=false,powered=false] + dark_oak_door[facing=east,half=lower,hinge=left,open=true,powered=true]: dark_oak_door[facing=east,half=lower,hinge=left,open=true,powered=false] + dark_oak_door[facing=east,half=lower,hinge=right,open=true,powered=true]: dark_oak_door[facing=east,half=lower,hinge=right,open=true,powered=false] + dark_oak_door[facing=east,half=upper,hinge=left,open=true,powered=true]: dark_oak_door[facing=east,half=upper,hinge=left,open=true,powered=false] + dark_oak_door[facing=east,half=upper,hinge=right,open=true,powered=true]: dark_oak_door[facing=east,half=upper,hinge=right,open=true,powered=false] + dark_oak_door[facing=north,half=lower,hinge=left,open=false,powered=true]: dark_oak_door[facing=north,half=lower,hinge=left,open=false,powered=false] + dark_oak_door[facing=north,half=lower,hinge=right,open=false,powered=true]: dark_oak_door[facing=north,half=lower,hinge=right,open=false,powered=false] + dark_oak_door[facing=north,half=upper,hinge=left,open=false,powered=true]: dark_oak_door[facing=north,half=upper,hinge=left,open=false,powered=false] + dark_oak_door[facing=north,half=upper,hinge=right,open=false,powered=true]: dark_oak_door[facing=north,half=upper,hinge=right,open=false,powered=false] + dark_oak_door[facing=north,half=lower,hinge=left,open=true,powered=true]: dark_oak_door[facing=north,half=lower,hinge=left,open=true,powered=false] + dark_oak_door[facing=north,half=lower,hinge=right,open=true,powered=true]: dark_oak_door[facing=north,half=lower,hinge=right,open=true,powered=false] + dark_oak_door[facing=north,half=upper,hinge=left,open=true,powered=true]: dark_oak_door[facing=north,half=upper,hinge=left,open=true,powered=false] + dark_oak_door[facing=north,half=upper,hinge=right,open=true,powered=true]: dark_oak_door[facing=north,half=upper,hinge=right,open=true,powered=false] + dark_oak_door[facing=south,half=lower,hinge=left,open=false,powered=true]: dark_oak_door[facing=south,half=lower,hinge=left,open=false,powered=false] + dark_oak_door[facing=south,half=lower,hinge=right,open=false,powered=true]: dark_oak_door[facing=south,half=lower,hinge=right,open=false,powered=false] + dark_oak_door[facing=south,half=upper,hinge=left,open=false,powered=true]: dark_oak_door[facing=south,half=upper,hinge=left,open=false,powered=false] + dark_oak_door[facing=south,half=upper,hinge=right,open=false,powered=true]: dark_oak_door[facing=south,half=upper,hinge=right,open=false,powered=false] + dark_oak_door[facing=south,half=lower,hinge=left,open=true,powered=true]: dark_oak_door[facing=south,half=lower,hinge=left,open=true,powered=false] + dark_oak_door[facing=south,half=lower,hinge=right,open=true,powered=true]: dark_oak_door[facing=south,half=lower,hinge=right,open=true,powered=false] + dark_oak_door[facing=south,half=upper,hinge=left,open=true,powered=true]: dark_oak_door[facing=south,half=upper,hinge=left,open=true,powered=false] + dark_oak_door[facing=south,half=upper,hinge=right,open=true,powered=true]: dark_oak_door[facing=south,half=upper,hinge=right,open=true,powered=false] + dark_oak_door[facing=west,half=lower,hinge=left,open=false,powered=true]: dark_oak_door[facing=west,half=lower,hinge=left,open=false,powered=false] + dark_oak_door[facing=west,half=lower,hinge=right,open=false,powered=true]: dark_oak_door[facing=west,half=lower,hinge=right,open=false,powered=false] + dark_oak_door[facing=west,half=upper,hinge=left,open=false,powered=true]: dark_oak_door[facing=west,half=upper,hinge=left,open=false,powered=false] + dark_oak_door[facing=west,half=upper,hinge=right,open=false,powered=true]: dark_oak_door[facing=west,half=upper,hinge=right,open=false,powered=false] + dark_oak_door[facing=west,half=lower,hinge=left,open=true,powered=true]: dark_oak_door[facing=west,half=lower,hinge=left,open=true,powered=false] + dark_oak_door[facing=west,half=lower,hinge=right,open=true,powered=true]: dark_oak_door[facing=west,half=lower,hinge=right,open=true,powered=false] + dark_oak_door[facing=west,half=upper,hinge=left,open=true,powered=true]: dark_oak_door[facing=west,half=upper,hinge=left,open=true,powered=false] + dark_oak_door[facing=west,half=upper,hinge=right,open=true,powered=true]: dark_oak_door[facing=west,half=upper,hinge=right,open=true,powered=false] + mangrove_door[facing=east,half=lower,hinge=left,open=false,powered=true]: mangrove_door[facing=east,half=lower,hinge=left,open=false,powered=false] + mangrove_door[facing=east,half=lower,hinge=right,open=false,powered=true]: mangrove_door[facing=east,half=lower,hinge=right,open=false,powered=false] + mangrove_door[facing=east,half=upper,hinge=left,open=false,powered=true]: mangrove_door[facing=east,half=upper,hinge=left,open=false,powered=false] + mangrove_door[facing=east,half=upper,hinge=right,open=false,powered=true]: mangrove_door[facing=east,half=upper,hinge=right,open=false,powered=false] + mangrove_door[facing=east,half=lower,hinge=left,open=true,powered=true]: mangrove_door[facing=east,half=lower,hinge=left,open=true,powered=false] + mangrove_door[facing=east,half=lower,hinge=right,open=true,powered=true]: mangrove_door[facing=east,half=lower,hinge=right,open=true,powered=false] + mangrove_door[facing=east,half=upper,hinge=left,open=true,powered=true]: mangrove_door[facing=east,half=upper,hinge=left,open=true,powered=false] + mangrove_door[facing=east,half=upper,hinge=right,open=true,powered=true]: mangrove_door[facing=east,half=upper,hinge=right,open=true,powered=false] + mangrove_door[facing=north,half=lower,hinge=left,open=false,powered=true]: mangrove_door[facing=north,half=lower,hinge=left,open=false,powered=false] + mangrove_door[facing=north,half=lower,hinge=right,open=false,powered=true]: mangrove_door[facing=north,half=lower,hinge=right,open=false,powered=false] + mangrove_door[facing=north,half=upper,hinge=left,open=false,powered=true]: mangrove_door[facing=north,half=upper,hinge=left,open=false,powered=false] + mangrove_door[facing=north,half=upper,hinge=right,open=false,powered=true]: mangrove_door[facing=north,half=upper,hinge=right,open=false,powered=false] + mangrove_door[facing=north,half=lower,hinge=left,open=true,powered=true]: mangrove_door[facing=north,half=lower,hinge=left,open=true,powered=false] + mangrove_door[facing=north,half=lower,hinge=right,open=true,powered=true]: mangrove_door[facing=north,half=lower,hinge=right,open=true,powered=false] + mangrove_door[facing=north,half=upper,hinge=left,open=true,powered=true]: mangrove_door[facing=north,half=upper,hinge=left,open=true,powered=false] + mangrove_door[facing=north,half=upper,hinge=right,open=true,powered=true]: mangrove_door[facing=north,half=upper,hinge=right,open=true,powered=false] + mangrove_door[facing=south,half=lower,hinge=left,open=false,powered=true]: mangrove_door[facing=south,half=lower,hinge=left,open=false,powered=false] + mangrove_door[facing=south,half=lower,hinge=right,open=false,powered=true]: mangrove_door[facing=south,half=lower,hinge=right,open=false,powered=false] + mangrove_door[facing=south,half=upper,hinge=left,open=false,powered=true]: mangrove_door[facing=south,half=upper,hinge=left,open=false,powered=false] + mangrove_door[facing=south,half=upper,hinge=right,open=false,powered=true]: mangrove_door[facing=south,half=upper,hinge=right,open=false,powered=false] + mangrove_door[facing=south,half=lower,hinge=left,open=true,powered=true]: mangrove_door[facing=south,half=lower,hinge=left,open=true,powered=false] + mangrove_door[facing=south,half=lower,hinge=right,open=true,powered=true]: mangrove_door[facing=south,half=lower,hinge=right,open=true,powered=false] + mangrove_door[facing=south,half=upper,hinge=left,open=true,powered=true]: mangrove_door[facing=south,half=upper,hinge=left,open=true,powered=false] + mangrove_door[facing=south,half=upper,hinge=right,open=true,powered=true]: mangrove_door[facing=south,half=upper,hinge=right,open=true,powered=false] + mangrove_door[facing=west,half=lower,hinge=left,open=false,powered=true]: mangrove_door[facing=west,half=lower,hinge=left,open=false,powered=false] + mangrove_door[facing=west,half=lower,hinge=right,open=false,powered=true]: mangrove_door[facing=west,half=lower,hinge=right,open=false,powered=false] + mangrove_door[facing=west,half=upper,hinge=left,open=false,powered=true]: mangrove_door[facing=west,half=upper,hinge=left,open=false,powered=false] + mangrove_door[facing=west,half=upper,hinge=right,open=false,powered=true]: mangrove_door[facing=west,half=upper,hinge=right,open=false,powered=false] + mangrove_door[facing=west,half=lower,hinge=left,open=true,powered=true]: mangrove_door[facing=west,half=lower,hinge=left,open=true,powered=false] + mangrove_door[facing=west,half=lower,hinge=right,open=true,powered=true]: mangrove_door[facing=west,half=lower,hinge=right,open=true,powered=false] + mangrove_door[facing=west,half=upper,hinge=left,open=true,powered=true]: mangrove_door[facing=west,half=upper,hinge=left,open=true,powered=false] + mangrove_door[facing=west,half=upper,hinge=right,open=true,powered=true]: mangrove_door[facing=west,half=upper,hinge=right,open=true,powered=false] + cherry_door[facing=east,half=lower,hinge=left,open=false,powered=true]: cherry_door[facing=east,half=lower,hinge=left,open=false,powered=false] + cherry_door[facing=east,half=lower,hinge=right,open=false,powered=true]: cherry_door[facing=east,half=lower,hinge=right,open=false,powered=false] + cherry_door[facing=east,half=upper,hinge=left,open=false,powered=true]: cherry_door[facing=east,half=upper,hinge=left,open=false,powered=false] + cherry_door[facing=east,half=upper,hinge=right,open=false,powered=true]: cherry_door[facing=east,half=upper,hinge=right,open=false,powered=false] + cherry_door[facing=east,half=lower,hinge=left,open=true,powered=true]: cherry_door[facing=east,half=lower,hinge=left,open=true,powered=false] + cherry_door[facing=east,half=lower,hinge=right,open=true,powered=true]: cherry_door[facing=east,half=lower,hinge=right,open=true,powered=false] + cherry_door[facing=east,half=upper,hinge=left,open=true,powered=true]: cherry_door[facing=east,half=upper,hinge=left,open=true,powered=false] + cherry_door[facing=east,half=upper,hinge=right,open=true,powered=true]: cherry_door[facing=east,half=upper,hinge=right,open=true,powered=false] + cherry_door[facing=north,half=lower,hinge=left,open=false,powered=true]: cherry_door[facing=north,half=lower,hinge=left,open=false,powered=false] + cherry_door[facing=north,half=lower,hinge=right,open=false,powered=true]: cherry_door[facing=north,half=lower,hinge=right,open=false,powered=false] + cherry_door[facing=north,half=upper,hinge=left,open=false,powered=true]: cherry_door[facing=north,half=upper,hinge=left,open=false,powered=false] + cherry_door[facing=north,half=upper,hinge=right,open=false,powered=true]: cherry_door[facing=north,half=upper,hinge=right,open=false,powered=false] + cherry_door[facing=north,half=lower,hinge=left,open=true,powered=true]: cherry_door[facing=north,half=lower,hinge=left,open=true,powered=false] + cherry_door[facing=north,half=lower,hinge=right,open=true,powered=true]: cherry_door[facing=north,half=lower,hinge=right,open=true,powered=false] + cherry_door[facing=north,half=upper,hinge=left,open=true,powered=true]: cherry_door[facing=north,half=upper,hinge=left,open=true,powered=false] + cherry_door[facing=north,half=upper,hinge=right,open=true,powered=true]: cherry_door[facing=north,half=upper,hinge=right,open=true,powered=false] + cherry_door[facing=south,half=lower,hinge=left,open=false,powered=true]: cherry_door[facing=south,half=lower,hinge=left,open=false,powered=false] + cherry_door[facing=south,half=lower,hinge=right,open=false,powered=true]: cherry_door[facing=south,half=lower,hinge=right,open=false,powered=false] + cherry_door[facing=south,half=upper,hinge=left,open=false,powered=true]: cherry_door[facing=south,half=upper,hinge=left,open=false,powered=false] + cherry_door[facing=south,half=upper,hinge=right,open=false,powered=true]: cherry_door[facing=south,half=upper,hinge=right,open=false,powered=false] + cherry_door[facing=south,half=lower,hinge=left,open=true,powered=true]: cherry_door[facing=south,half=lower,hinge=left,open=true,powered=false] + cherry_door[facing=south,half=lower,hinge=right,open=true,powered=true]: cherry_door[facing=south,half=lower,hinge=right,open=true,powered=false] + cherry_door[facing=south,half=upper,hinge=left,open=true,powered=true]: cherry_door[facing=south,half=upper,hinge=left,open=true,powered=false] + cherry_door[facing=south,half=upper,hinge=right,open=true,powered=true]: cherry_door[facing=south,half=upper,hinge=right,open=true,powered=false] + cherry_door[facing=west,half=lower,hinge=left,open=false,powered=true]: cherry_door[facing=west,half=lower,hinge=left,open=false,powered=false] + cherry_door[facing=west,half=lower,hinge=right,open=false,powered=true]: cherry_door[facing=west,half=lower,hinge=right,open=false,powered=false] + cherry_door[facing=west,half=upper,hinge=left,open=false,powered=true]: cherry_door[facing=west,half=upper,hinge=left,open=false,powered=false] + cherry_door[facing=west,half=upper,hinge=right,open=false,powered=true]: cherry_door[facing=west,half=upper,hinge=right,open=false,powered=false] + cherry_door[facing=west,half=lower,hinge=left,open=true,powered=true]: cherry_door[facing=west,half=lower,hinge=left,open=true,powered=false] + cherry_door[facing=west,half=lower,hinge=right,open=true,powered=true]: cherry_door[facing=west,half=lower,hinge=right,open=true,powered=false] + cherry_door[facing=west,half=upper,hinge=left,open=true,powered=true]: cherry_door[facing=west,half=upper,hinge=left,open=true,powered=false] + cherry_door[facing=west,half=upper,hinge=right,open=true,powered=true]: cherry_door[facing=west,half=upper,hinge=right,open=true,powered=false] + bamboo_door[facing=east,half=lower,hinge=left,open=false,powered=true]: bamboo_door[facing=east,half=lower,hinge=left,open=false,powered=false] + bamboo_door[facing=east,half=lower,hinge=right,open=false,powered=true]: bamboo_door[facing=east,half=lower,hinge=right,open=false,powered=false] + bamboo_door[facing=east,half=upper,hinge=left,open=false,powered=true]: bamboo_door[facing=east,half=upper,hinge=left,open=false,powered=false] + bamboo_door[facing=east,half=upper,hinge=right,open=false,powered=true]: bamboo_door[facing=east,half=upper,hinge=right,open=false,powered=false] + bamboo_door[facing=east,half=lower,hinge=left,open=true,powered=true]: bamboo_door[facing=east,half=lower,hinge=left,open=true,powered=false] + bamboo_door[facing=east,half=lower,hinge=right,open=true,powered=true]: bamboo_door[facing=east,half=lower,hinge=right,open=true,powered=false] + bamboo_door[facing=east,half=upper,hinge=left,open=true,powered=true]: bamboo_door[facing=east,half=upper,hinge=left,open=true,powered=false] + bamboo_door[facing=east,half=upper,hinge=right,open=true,powered=true]: bamboo_door[facing=east,half=upper,hinge=right,open=true,powered=false] + bamboo_door[facing=north,half=lower,hinge=left,open=false,powered=true]: bamboo_door[facing=north,half=lower,hinge=left,open=false,powered=false] + bamboo_door[facing=north,half=lower,hinge=right,open=false,powered=true]: bamboo_door[facing=north,half=lower,hinge=right,open=false,powered=false] + bamboo_door[facing=north,half=upper,hinge=left,open=false,powered=true]: bamboo_door[facing=north,half=upper,hinge=left,open=false,powered=false] + bamboo_door[facing=north,half=upper,hinge=right,open=false,powered=true]: bamboo_door[facing=north,half=upper,hinge=right,open=false,powered=false] + bamboo_door[facing=north,half=lower,hinge=left,open=true,powered=true]: bamboo_door[facing=north,half=lower,hinge=left,open=true,powered=false] + bamboo_door[facing=north,half=lower,hinge=right,open=true,powered=true]: bamboo_door[facing=north,half=lower,hinge=right,open=true,powered=false] + bamboo_door[facing=north,half=upper,hinge=left,open=true,powered=true]: bamboo_door[facing=north,half=upper,hinge=left,open=true,powered=false] + bamboo_door[facing=north,half=upper,hinge=right,open=true,powered=true]: bamboo_door[facing=north,half=upper,hinge=right,open=true,powered=false] + bamboo_door[facing=south,half=lower,hinge=left,open=false,powered=true]: bamboo_door[facing=south,half=lower,hinge=left,open=false,powered=false] + bamboo_door[facing=south,half=lower,hinge=right,open=false,powered=true]: bamboo_door[facing=south,half=lower,hinge=right,open=false,powered=false] + bamboo_door[facing=south,half=upper,hinge=left,open=false,powered=true]: bamboo_door[facing=south,half=upper,hinge=left,open=false,powered=false] + bamboo_door[facing=south,half=upper,hinge=right,open=false,powered=true]: bamboo_door[facing=south,half=upper,hinge=right,open=false,powered=false] + bamboo_door[facing=south,half=lower,hinge=left,open=true,powered=true]: bamboo_door[facing=south,half=lower,hinge=left,open=true,powered=false] + bamboo_door[facing=south,half=lower,hinge=right,open=true,powered=true]: bamboo_door[facing=south,half=lower,hinge=right,open=true,powered=false] + bamboo_door[facing=south,half=upper,hinge=left,open=true,powered=true]: bamboo_door[facing=south,half=upper,hinge=left,open=true,powered=false] + bamboo_door[facing=south,half=upper,hinge=right,open=true,powered=true]: bamboo_door[facing=south,half=upper,hinge=right,open=true,powered=false] + bamboo_door[facing=west,half=lower,hinge=left,open=false,powered=true]: bamboo_door[facing=west,half=lower,hinge=left,open=false,powered=false] + bamboo_door[facing=west,half=lower,hinge=right,open=false,powered=true]: bamboo_door[facing=west,half=lower,hinge=right,open=false,powered=false] + bamboo_door[facing=west,half=upper,hinge=left,open=false,powered=true]: bamboo_door[facing=west,half=upper,hinge=left,open=false,powered=false] + bamboo_door[facing=west,half=upper,hinge=right,open=false,powered=true]: bamboo_door[facing=west,half=upper,hinge=right,open=false,powered=false] + bamboo_door[facing=west,half=lower,hinge=left,open=true,powered=true]: bamboo_door[facing=west,half=lower,hinge=left,open=true,powered=false] + bamboo_door[facing=west,half=lower,hinge=right,open=true,powered=true]: bamboo_door[facing=west,half=lower,hinge=right,open=true,powered=false] + bamboo_door[facing=west,half=upper,hinge=left,open=true,powered=true]: bamboo_door[facing=west,half=upper,hinge=left,open=true,powered=false] + bamboo_door[facing=west,half=upper,hinge=right,open=true,powered=true]: bamboo_door[facing=west,half=upper,hinge=right,open=true,powered=false] + crimson_door[facing=east,half=lower,hinge=left,open=false,powered=true]: crimson_door[facing=east,half=lower,hinge=left,open=false,powered=false] + crimson_door[facing=east,half=lower,hinge=right,open=false,powered=true]: crimson_door[facing=east,half=lower,hinge=right,open=false,powered=false] + crimson_door[facing=east,half=upper,hinge=left,open=false,powered=true]: crimson_door[facing=east,half=upper,hinge=left,open=false,powered=false] + crimson_door[facing=east,half=upper,hinge=right,open=false,powered=true]: crimson_door[facing=east,half=upper,hinge=right,open=false,powered=false] + crimson_door[facing=east,half=lower,hinge=left,open=true,powered=true]: crimson_door[facing=east,half=lower,hinge=left,open=true,powered=false] + crimson_door[facing=east,half=lower,hinge=right,open=true,powered=true]: crimson_door[facing=east,half=lower,hinge=right,open=true,powered=false] + crimson_door[facing=east,half=upper,hinge=left,open=true,powered=true]: crimson_door[facing=east,half=upper,hinge=left,open=true,powered=false] + crimson_door[facing=east,half=upper,hinge=right,open=true,powered=true]: crimson_door[facing=east,half=upper,hinge=right,open=true,powered=false] + crimson_door[facing=north,half=lower,hinge=left,open=false,powered=true]: crimson_door[facing=north,half=lower,hinge=left,open=false,powered=false] + crimson_door[facing=north,half=lower,hinge=right,open=false,powered=true]: crimson_door[facing=north,half=lower,hinge=right,open=false,powered=false] + crimson_door[facing=north,half=upper,hinge=left,open=false,powered=true]: crimson_door[facing=north,half=upper,hinge=left,open=false,powered=false] + crimson_door[facing=north,half=upper,hinge=right,open=false,powered=true]: crimson_door[facing=north,half=upper,hinge=right,open=false,powered=false] + crimson_door[facing=north,half=lower,hinge=left,open=true,powered=true]: crimson_door[facing=north,half=lower,hinge=left,open=true,powered=false] + crimson_door[facing=north,half=lower,hinge=right,open=true,powered=true]: crimson_door[facing=north,half=lower,hinge=right,open=true,powered=false] + crimson_door[facing=north,half=upper,hinge=left,open=true,powered=true]: crimson_door[facing=north,half=upper,hinge=left,open=true,powered=false] + crimson_door[facing=north,half=upper,hinge=right,open=true,powered=true]: crimson_door[facing=north,half=upper,hinge=right,open=true,powered=false] + crimson_door[facing=south,half=lower,hinge=left,open=false,powered=true]: crimson_door[facing=south,half=lower,hinge=left,open=false,powered=false] + crimson_door[facing=south,half=lower,hinge=right,open=false,powered=true]: crimson_door[facing=south,half=lower,hinge=right,open=false,powered=false] + crimson_door[facing=south,half=upper,hinge=left,open=false,powered=true]: crimson_door[facing=south,half=upper,hinge=left,open=false,powered=false] + crimson_door[facing=south,half=upper,hinge=right,open=false,powered=true]: crimson_door[facing=south,half=upper,hinge=right,open=false,powered=false] + crimson_door[facing=south,half=lower,hinge=left,open=true,powered=true]: crimson_door[facing=south,half=lower,hinge=left,open=true,powered=false] + crimson_door[facing=south,half=lower,hinge=right,open=true,powered=true]: crimson_door[facing=south,half=lower,hinge=right,open=true,powered=false] + crimson_door[facing=south,half=upper,hinge=left,open=true,powered=true]: crimson_door[facing=south,half=upper,hinge=left,open=true,powered=false] + crimson_door[facing=south,half=upper,hinge=right,open=true,powered=true]: crimson_door[facing=south,half=upper,hinge=right,open=true,powered=false] + crimson_door[facing=west,half=lower,hinge=left,open=false,powered=true]: crimson_door[facing=west,half=lower,hinge=left,open=false,powered=false] + crimson_door[facing=west,half=lower,hinge=right,open=false,powered=true]: crimson_door[facing=west,half=lower,hinge=right,open=false,powered=false] + crimson_door[facing=west,half=upper,hinge=left,open=false,powered=true]: crimson_door[facing=west,half=upper,hinge=left,open=false,powered=false] + crimson_door[facing=west,half=upper,hinge=right,open=false,powered=true]: crimson_door[facing=west,half=upper,hinge=right,open=false,powered=false] + crimson_door[facing=west,half=lower,hinge=left,open=true,powered=true]: crimson_door[facing=west,half=lower,hinge=left,open=true,powered=false] + crimson_door[facing=west,half=lower,hinge=right,open=true,powered=true]: crimson_door[facing=west,half=lower,hinge=right,open=true,powered=false] + crimson_door[facing=west,half=upper,hinge=left,open=true,powered=true]: crimson_door[facing=west,half=upper,hinge=left,open=true,powered=false] + crimson_door[facing=west,half=upper,hinge=right,open=true,powered=true]: crimson_door[facing=west,half=upper,hinge=right,open=true,powered=false] + warped_door[facing=east,half=lower,hinge=left,open=false,powered=true]: warped_door[facing=east,half=lower,hinge=left,open=false,powered=false] + warped_door[facing=east,half=lower,hinge=right,open=false,powered=true]: warped_door[facing=east,half=lower,hinge=right,open=false,powered=false] + warped_door[facing=east,half=upper,hinge=left,open=false,powered=true]: warped_door[facing=east,half=upper,hinge=left,open=false,powered=false] + warped_door[facing=east,half=upper,hinge=right,open=false,powered=true]: warped_door[facing=east,half=upper,hinge=right,open=false,powered=false] + warped_door[facing=east,half=lower,hinge=left,open=true,powered=true]: warped_door[facing=east,half=lower,hinge=left,open=true,powered=false] + warped_door[facing=east,half=lower,hinge=right,open=true,powered=true]: warped_door[facing=east,half=lower,hinge=right,open=true,powered=false] + warped_door[facing=east,half=upper,hinge=left,open=true,powered=true]: warped_door[facing=east,half=upper,hinge=left,open=true,powered=false] + warped_door[facing=east,half=upper,hinge=right,open=true,powered=true]: warped_door[facing=east,half=upper,hinge=right,open=true,powered=false] + warped_door[facing=north,half=lower,hinge=left,open=false,powered=true]: warped_door[facing=north,half=lower,hinge=left,open=false,powered=false] + warped_door[facing=north,half=lower,hinge=right,open=false,powered=true]: warped_door[facing=north,half=lower,hinge=right,open=false,powered=false] + warped_door[facing=north,half=upper,hinge=left,open=false,powered=true]: warped_door[facing=north,half=upper,hinge=left,open=false,powered=false] + warped_door[facing=north,half=upper,hinge=right,open=false,powered=true]: warped_door[facing=north,half=upper,hinge=right,open=false,powered=false] + warped_door[facing=north,half=lower,hinge=left,open=true,powered=true]: warped_door[facing=north,half=lower,hinge=left,open=true,powered=false] + warped_door[facing=north,half=lower,hinge=right,open=true,powered=true]: warped_door[facing=north,half=lower,hinge=right,open=true,powered=false] + warped_door[facing=north,half=upper,hinge=left,open=true,powered=true]: warped_door[facing=north,half=upper,hinge=left,open=true,powered=false] + warped_door[facing=north,half=upper,hinge=right,open=true,powered=true]: warped_door[facing=north,half=upper,hinge=right,open=true,powered=false] + warped_door[facing=south,half=lower,hinge=left,open=false,powered=true]: warped_door[facing=south,half=lower,hinge=left,open=false,powered=false] + warped_door[facing=south,half=lower,hinge=right,open=false,powered=true]: warped_door[facing=south,half=lower,hinge=right,open=false,powered=false] + warped_door[facing=south,half=upper,hinge=left,open=false,powered=true]: warped_door[facing=south,half=upper,hinge=left,open=false,powered=false] + warped_door[facing=south,half=upper,hinge=right,open=false,powered=true]: warped_door[facing=south,half=upper,hinge=right,open=false,powered=false] + warped_door[facing=south,half=lower,hinge=left,open=true,powered=true]: warped_door[facing=south,half=lower,hinge=left,open=true,powered=false] + warped_door[facing=south,half=lower,hinge=right,open=true,powered=true]: warped_door[facing=south,half=lower,hinge=right,open=true,powered=false] + warped_door[facing=south,half=upper,hinge=left,open=true,powered=true]: warped_door[facing=south,half=upper,hinge=left,open=true,powered=false] + warped_door[facing=south,half=upper,hinge=right,open=true,powered=true]: warped_door[facing=south,half=upper,hinge=right,open=true,powered=false] + warped_door[facing=west,half=lower,hinge=left,open=false,powered=true]: warped_door[facing=west,half=lower,hinge=left,open=false,powered=false] + warped_door[facing=west,half=lower,hinge=right,open=false,powered=true]: warped_door[facing=west,half=lower,hinge=right,open=false,powered=false] + warped_door[facing=west,half=upper,hinge=left,open=false,powered=true]: warped_door[facing=west,half=upper,hinge=left,open=false,powered=false] + warped_door[facing=west,half=upper,hinge=right,open=false,powered=true]: warped_door[facing=west,half=upper,hinge=right,open=false,powered=false] + warped_door[facing=west,half=lower,hinge=left,open=true,powered=true]: warped_door[facing=west,half=lower,hinge=left,open=true,powered=false] + warped_door[facing=west,half=lower,hinge=right,open=true,powered=true]: warped_door[facing=west,half=lower,hinge=right,open=true,powered=false] + warped_door[facing=west,half=upper,hinge=left,open=true,powered=true]: warped_door[facing=west,half=upper,hinge=left,open=true,powered=false] + warped_door[facing=west,half=upper,hinge=right,open=true,powered=true]: warped_door[facing=west,half=upper,hinge=right,open=true,powered=false] + iron_door[facing=east,half=lower,hinge=left,open=false,powered=true]: iron_door[facing=east,half=lower,hinge=left,open=false,powered=false] + iron_door[facing=east,half=lower,hinge=right,open=false,powered=true]: iron_door[facing=east,half=lower,hinge=right,open=false,powered=false] + iron_door[facing=east,half=upper,hinge=left,open=false,powered=true]: iron_door[facing=east,half=upper,hinge=left,open=false,powered=false] + iron_door[facing=east,half=upper,hinge=right,open=false,powered=true]: iron_door[facing=east,half=upper,hinge=right,open=false,powered=false] + iron_door[facing=east,half=lower,hinge=left,open=true,powered=true]: iron_door[facing=east,half=lower,hinge=left,open=true,powered=false] + iron_door[facing=east,half=lower,hinge=right,open=true,powered=true]: iron_door[facing=east,half=lower,hinge=right,open=true,powered=false] + iron_door[facing=east,half=upper,hinge=left,open=true,powered=true]: iron_door[facing=east,half=upper,hinge=left,open=true,powered=false] + iron_door[facing=east,half=upper,hinge=right,open=true,powered=true]: iron_door[facing=east,half=upper,hinge=right,open=true,powered=false] + iron_door[facing=north,half=lower,hinge=left,open=false,powered=true]: iron_door[facing=north,half=lower,hinge=left,open=false,powered=false] + iron_door[facing=north,half=lower,hinge=right,open=false,powered=true]: iron_door[facing=north,half=lower,hinge=right,open=false,powered=false] + iron_door[facing=north,half=upper,hinge=left,open=false,powered=true]: iron_door[facing=north,half=upper,hinge=left,open=false,powered=false] + iron_door[facing=north,half=upper,hinge=right,open=false,powered=true]: iron_door[facing=north,half=upper,hinge=right,open=false,powered=false] + iron_door[facing=north,half=lower,hinge=left,open=true,powered=true]: iron_door[facing=north,half=lower,hinge=left,open=true,powered=false] + iron_door[facing=north,half=lower,hinge=right,open=true,powered=true]: iron_door[facing=north,half=lower,hinge=right,open=true,powered=false] + iron_door[facing=north,half=upper,hinge=left,open=true,powered=true]: iron_door[facing=north,half=upper,hinge=left,open=true,powered=false] + iron_door[facing=north,half=upper,hinge=right,open=true,powered=true]: iron_door[facing=north,half=upper,hinge=right,open=true,powered=false] + iron_door[facing=south,half=lower,hinge=left,open=false,powered=true]: iron_door[facing=south,half=lower,hinge=left,open=false,powered=false] + iron_door[facing=south,half=lower,hinge=right,open=false,powered=true]: iron_door[facing=south,half=lower,hinge=right,open=false,powered=false] + iron_door[facing=south,half=upper,hinge=left,open=false,powered=true]: iron_door[facing=south,half=upper,hinge=left,open=false,powered=false] + iron_door[facing=south,half=upper,hinge=right,open=false,powered=true]: iron_door[facing=south,half=upper,hinge=right,open=false,powered=false] + iron_door[facing=south,half=lower,hinge=left,open=true,powered=true]: iron_door[facing=south,half=lower,hinge=left,open=true,powered=false] + iron_door[facing=south,half=lower,hinge=right,open=true,powered=true]: iron_door[facing=south,half=lower,hinge=right,open=true,powered=false] + iron_door[facing=south,half=upper,hinge=left,open=true,powered=true]: iron_door[facing=south,half=upper,hinge=left,open=true,powered=false] + iron_door[facing=south,half=upper,hinge=right,open=true,powered=true]: iron_door[facing=south,half=upper,hinge=right,open=true,powered=false] + iron_door[facing=west,half=lower,hinge=left,open=false,powered=true]: iron_door[facing=west,half=lower,hinge=left,open=false,powered=false] + iron_door[facing=west,half=lower,hinge=right,open=false,powered=true]: iron_door[facing=west,half=lower,hinge=right,open=false,powered=false] + iron_door[facing=west,half=upper,hinge=left,open=false,powered=true]: iron_door[facing=west,half=upper,hinge=left,open=false,powered=false] + iron_door[facing=west,half=upper,hinge=right,open=false,powered=true]: iron_door[facing=west,half=upper,hinge=right,open=false,powered=false] + iron_door[facing=west,half=lower,hinge=left,open=true,powered=true]: iron_door[facing=west,half=lower,hinge=left,open=true,powered=false] + iron_door[facing=west,half=lower,hinge=right,open=true,powered=true]: iron_door[facing=west,half=lower,hinge=right,open=true,powered=false] + iron_door[facing=west,half=upper,hinge=left,open=true,powered=true]: iron_door[facing=west,half=upper,hinge=left,open=true,powered=false] + iron_door[facing=west,half=upper,hinge=right,open=true,powered=true]: iron_door[facing=west,half=upper,hinge=right,open=true,powered=false] + + $$>=1.20.3#door: + copper_door[facing=east,half=lower,hinge=left,open=false,powered=true]: copper_door[facing=east,half=lower,hinge=left,open=false,powered=false] + copper_door[facing=east,half=lower,hinge=right,open=false,powered=true]: copper_door[facing=east,half=lower,hinge=right,open=false,powered=false] + copper_door[facing=east,half=upper,hinge=left,open=false,powered=true]: copper_door[facing=east,half=upper,hinge=left,open=false,powered=false] + copper_door[facing=east,half=upper,hinge=right,open=false,powered=true]: copper_door[facing=east,half=upper,hinge=right,open=false,powered=false] + copper_door[facing=east,half=lower,hinge=left,open=true,powered=true]: copper_door[facing=east,half=lower,hinge=left,open=true,powered=false] + copper_door[facing=east,half=lower,hinge=right,open=true,powered=true]: copper_door[facing=east,half=lower,hinge=right,open=true,powered=false] + copper_door[facing=east,half=upper,hinge=left,open=true,powered=true]: copper_door[facing=east,half=upper,hinge=left,open=true,powered=false] + copper_door[facing=east,half=upper,hinge=right,open=true,powered=true]: copper_door[facing=east,half=upper,hinge=right,open=true,powered=false] + copper_door[facing=north,half=lower,hinge=left,open=false,powered=true]: copper_door[facing=north,half=lower,hinge=left,open=false,powered=false] + copper_door[facing=north,half=lower,hinge=right,open=false,powered=true]: copper_door[facing=north,half=lower,hinge=right,open=false,powered=false] + copper_door[facing=north,half=upper,hinge=left,open=false,powered=true]: copper_door[facing=north,half=upper,hinge=left,open=false,powered=false] + copper_door[facing=north,half=upper,hinge=right,open=false,powered=true]: copper_door[facing=north,half=upper,hinge=right,open=false,powered=false] + copper_door[facing=north,half=lower,hinge=left,open=true,powered=true]: copper_door[facing=north,half=lower,hinge=left,open=true,powered=false] + copper_door[facing=north,half=lower,hinge=right,open=true,powered=true]: copper_door[facing=north,half=lower,hinge=right,open=true,powered=false] + copper_door[facing=north,half=upper,hinge=left,open=true,powered=true]: copper_door[facing=north,half=upper,hinge=left,open=true,powered=false] + copper_door[facing=north,half=upper,hinge=right,open=true,powered=true]: copper_door[facing=north,half=upper,hinge=right,open=true,powered=false] + copper_door[facing=south,half=lower,hinge=left,open=false,powered=true]: copper_door[facing=south,half=lower,hinge=left,open=false,powered=false] + copper_door[facing=south,half=lower,hinge=right,open=false,powered=true]: copper_door[facing=south,half=lower,hinge=right,open=false,powered=false] + copper_door[facing=south,half=upper,hinge=left,open=false,powered=true]: copper_door[facing=south,half=upper,hinge=left,open=false,powered=false] + copper_door[facing=south,half=upper,hinge=right,open=false,powered=true]: copper_door[facing=south,half=upper,hinge=right,open=false,powered=false] + copper_door[facing=south,half=lower,hinge=left,open=true,powered=true]: copper_door[facing=south,half=lower,hinge=left,open=true,powered=false] + copper_door[facing=south,half=lower,hinge=right,open=true,powered=true]: copper_door[facing=south,half=lower,hinge=right,open=true,powered=false] + copper_door[facing=south,half=upper,hinge=left,open=true,powered=true]: copper_door[facing=south,half=upper,hinge=left,open=true,powered=false] + copper_door[facing=south,half=upper,hinge=right,open=true,powered=true]: copper_door[facing=south,half=upper,hinge=right,open=true,powered=false] + copper_door[facing=west,half=lower,hinge=left,open=false,powered=true]: copper_door[facing=west,half=lower,hinge=left,open=false,powered=false] + copper_door[facing=west,half=lower,hinge=right,open=false,powered=true]: copper_door[facing=west,half=lower,hinge=right,open=false,powered=false] + copper_door[facing=west,half=upper,hinge=left,open=false,powered=true]: copper_door[facing=west,half=upper,hinge=left,open=false,powered=false] + copper_door[facing=west,half=upper,hinge=right,open=false,powered=true]: copper_door[facing=west,half=upper,hinge=right,open=false,powered=false] + copper_door[facing=west,half=lower,hinge=left,open=true,powered=true]: copper_door[facing=west,half=lower,hinge=left,open=true,powered=false] + copper_door[facing=west,half=lower,hinge=right,open=true,powered=true]: copper_door[facing=west,half=lower,hinge=right,open=true,powered=false] + copper_door[facing=west,half=upper,hinge=left,open=true,powered=true]: copper_door[facing=west,half=upper,hinge=left,open=true,powered=false] + copper_door[facing=west,half=upper,hinge=right,open=true,powered=true]: copper_door[facing=west,half=upper,hinge=right,open=true,powered=false] + exposed_copper_door[facing=east,half=lower,hinge=left,open=false,powered=true]: exposed_copper_door[facing=east,half=lower,hinge=left,open=false,powered=false] + exposed_copper_door[facing=east,half=lower,hinge=right,open=false,powered=true]: exposed_copper_door[facing=east,half=lower,hinge=right,open=false,powered=false] + exposed_copper_door[facing=east,half=upper,hinge=left,open=false,powered=true]: exposed_copper_door[facing=east,half=upper,hinge=left,open=false,powered=false] + exposed_copper_door[facing=east,half=upper,hinge=right,open=false,powered=true]: exposed_copper_door[facing=east,half=upper,hinge=right,open=false,powered=false] + exposed_copper_door[facing=east,half=lower,hinge=left,open=true,powered=true]: exposed_copper_door[facing=east,half=lower,hinge=left,open=true,powered=false] + exposed_copper_door[facing=east,half=lower,hinge=right,open=true,powered=true]: exposed_copper_door[facing=east,half=lower,hinge=right,open=true,powered=false] + exposed_copper_door[facing=east,half=upper,hinge=left,open=true,powered=true]: exposed_copper_door[facing=east,half=upper,hinge=left,open=true,powered=false] + exposed_copper_door[facing=east,half=upper,hinge=right,open=true,powered=true]: exposed_copper_door[facing=east,half=upper,hinge=right,open=true,powered=false] + exposed_copper_door[facing=north,half=lower,hinge=left,open=false,powered=true]: exposed_copper_door[facing=north,half=lower,hinge=left,open=false,powered=false] + exposed_copper_door[facing=north,half=lower,hinge=right,open=false,powered=true]: exposed_copper_door[facing=north,half=lower,hinge=right,open=false,powered=false] + exposed_copper_door[facing=north,half=upper,hinge=left,open=false,powered=true]: exposed_copper_door[facing=north,half=upper,hinge=left,open=false,powered=false] + exposed_copper_door[facing=north,half=upper,hinge=right,open=false,powered=true]: exposed_copper_door[facing=north,half=upper,hinge=right,open=false,powered=false] + exposed_copper_door[facing=north,half=lower,hinge=left,open=true,powered=true]: exposed_copper_door[facing=north,half=lower,hinge=left,open=true,powered=false] + exposed_copper_door[facing=north,half=lower,hinge=right,open=true,powered=true]: exposed_copper_door[facing=north,half=lower,hinge=right,open=true,powered=false] + exposed_copper_door[facing=north,half=upper,hinge=left,open=true,powered=true]: exposed_copper_door[facing=north,half=upper,hinge=left,open=true,powered=false] + exposed_copper_door[facing=north,half=upper,hinge=right,open=true,powered=true]: exposed_copper_door[facing=north,half=upper,hinge=right,open=true,powered=false] + exposed_copper_door[facing=south,half=lower,hinge=left,open=false,powered=true]: exposed_copper_door[facing=south,half=lower,hinge=left,open=false,powered=false] + exposed_copper_door[facing=south,half=lower,hinge=right,open=false,powered=true]: exposed_copper_door[facing=south,half=lower,hinge=right,open=false,powered=false] + exposed_copper_door[facing=south,half=upper,hinge=left,open=false,powered=true]: exposed_copper_door[facing=south,half=upper,hinge=left,open=false,powered=false] + exposed_copper_door[facing=south,half=upper,hinge=right,open=false,powered=true]: exposed_copper_door[facing=south,half=upper,hinge=right,open=false,powered=false] + exposed_copper_door[facing=south,half=lower,hinge=left,open=true,powered=true]: exposed_copper_door[facing=south,half=lower,hinge=left,open=true,powered=false] + exposed_copper_door[facing=south,half=lower,hinge=right,open=true,powered=true]: exposed_copper_door[facing=south,half=lower,hinge=right,open=true,powered=false] + exposed_copper_door[facing=south,half=upper,hinge=left,open=true,powered=true]: exposed_copper_door[facing=south,half=upper,hinge=left,open=true,powered=false] + exposed_copper_door[facing=south,half=upper,hinge=right,open=true,powered=true]: exposed_copper_door[facing=south,half=upper,hinge=right,open=true,powered=false] + exposed_copper_door[facing=west,half=lower,hinge=left,open=false,powered=true]: exposed_copper_door[facing=west,half=lower,hinge=left,open=false,powered=false] + exposed_copper_door[facing=west,half=lower,hinge=right,open=false,powered=true]: exposed_copper_door[facing=west,half=lower,hinge=right,open=false,powered=false] + exposed_copper_door[facing=west,half=upper,hinge=left,open=false,powered=true]: exposed_copper_door[facing=west,half=upper,hinge=left,open=false,powered=false] + exposed_copper_door[facing=west,half=upper,hinge=right,open=false,powered=true]: exposed_copper_door[facing=west,half=upper,hinge=right,open=false,powered=false] + exposed_copper_door[facing=west,half=lower,hinge=left,open=true,powered=true]: exposed_copper_door[facing=west,half=lower,hinge=left,open=true,powered=false] + exposed_copper_door[facing=west,half=lower,hinge=right,open=true,powered=true]: exposed_copper_door[facing=west,half=lower,hinge=right,open=true,powered=false] + exposed_copper_door[facing=west,half=upper,hinge=left,open=true,powered=true]: exposed_copper_door[facing=west,half=upper,hinge=left,open=true,powered=false] + exposed_copper_door[facing=west,half=upper,hinge=right,open=true,powered=true]: exposed_copper_door[facing=west,half=upper,hinge=right,open=true,powered=false] + weathered_copper_door[facing=east,half=lower,hinge=left,open=false,powered=true]: weathered_copper_door[facing=east,half=lower,hinge=left,open=false,powered=false] + weathered_copper_door[facing=east,half=lower,hinge=right,open=false,powered=true]: weathered_copper_door[facing=east,half=lower,hinge=right,open=false,powered=false] + weathered_copper_door[facing=east,half=upper,hinge=left,open=false,powered=true]: weathered_copper_door[facing=east,half=upper,hinge=left,open=false,powered=false] + weathered_copper_door[facing=east,half=upper,hinge=right,open=false,powered=true]: weathered_copper_door[facing=east,half=upper,hinge=right,open=false,powered=false] + weathered_copper_door[facing=east,half=lower,hinge=left,open=true,powered=true]: weathered_copper_door[facing=east,half=lower,hinge=left,open=true,powered=false] + weathered_copper_door[facing=east,half=lower,hinge=right,open=true,powered=true]: weathered_copper_door[facing=east,half=lower,hinge=right,open=true,powered=false] + weathered_copper_door[facing=east,half=upper,hinge=left,open=true,powered=true]: weathered_copper_door[facing=east,half=upper,hinge=left,open=true,powered=false] + weathered_copper_door[facing=east,half=upper,hinge=right,open=true,powered=true]: weathered_copper_door[facing=east,half=upper,hinge=right,open=true,powered=false] + weathered_copper_door[facing=north,half=lower,hinge=left,open=false,powered=true]: weathered_copper_door[facing=north,half=lower,hinge=left,open=false,powered=false] + weathered_copper_door[facing=north,half=lower,hinge=right,open=false,powered=true]: weathered_copper_door[facing=north,half=lower,hinge=right,open=false,powered=false] + weathered_copper_door[facing=north,half=upper,hinge=left,open=false,powered=true]: weathered_copper_door[facing=north,half=upper,hinge=left,open=false,powered=false] + weathered_copper_door[facing=north,half=upper,hinge=right,open=false,powered=true]: weathered_copper_door[facing=north,half=upper,hinge=right,open=false,powered=false] + weathered_copper_door[facing=north,half=lower,hinge=left,open=true,powered=true]: weathered_copper_door[facing=north,half=lower,hinge=left,open=true,powered=false] + weathered_copper_door[facing=north,half=lower,hinge=right,open=true,powered=true]: weathered_copper_door[facing=north,half=lower,hinge=right,open=true,powered=false] + weathered_copper_door[facing=north,half=upper,hinge=left,open=true,powered=true]: weathered_copper_door[facing=north,half=upper,hinge=left,open=true,powered=false] + weathered_copper_door[facing=north,half=upper,hinge=right,open=true,powered=true]: weathered_copper_door[facing=north,half=upper,hinge=right,open=true,powered=false] + weathered_copper_door[facing=south,half=lower,hinge=left,open=false,powered=true]: weathered_copper_door[facing=south,half=lower,hinge=left,open=false,powered=false] + weathered_copper_door[facing=south,half=lower,hinge=right,open=false,powered=true]: weathered_copper_door[facing=south,half=lower,hinge=right,open=false,powered=false] + weathered_copper_door[facing=south,half=upper,hinge=left,open=false,powered=true]: weathered_copper_door[facing=south,half=upper,hinge=left,open=false,powered=false] + weathered_copper_door[facing=south,half=upper,hinge=right,open=false,powered=true]: weathered_copper_door[facing=south,half=upper,hinge=right,open=false,powered=false] + weathered_copper_door[facing=south,half=lower,hinge=left,open=true,powered=true]: weathered_copper_door[facing=south,half=lower,hinge=left,open=true,powered=false] + weathered_copper_door[facing=south,half=lower,hinge=right,open=true,powered=true]: weathered_copper_door[facing=south,half=lower,hinge=right,open=true,powered=false] + weathered_copper_door[facing=south,half=upper,hinge=left,open=true,powered=true]: weathered_copper_door[facing=south,half=upper,hinge=left,open=true,powered=false] + weathered_copper_door[facing=south,half=upper,hinge=right,open=true,powered=true]: weathered_copper_door[facing=south,half=upper,hinge=right,open=true,powered=false] + weathered_copper_door[facing=west,half=lower,hinge=left,open=false,powered=true]: weathered_copper_door[facing=west,half=lower,hinge=left,open=false,powered=false] + weathered_copper_door[facing=west,half=lower,hinge=right,open=false,powered=true]: weathered_copper_door[facing=west,half=lower,hinge=right,open=false,powered=false] + weathered_copper_door[facing=west,half=upper,hinge=left,open=false,powered=true]: weathered_copper_door[facing=west,half=upper,hinge=left,open=false,powered=false] + weathered_copper_door[facing=west,half=upper,hinge=right,open=false,powered=true]: weathered_copper_door[facing=west,half=upper,hinge=right,open=false,powered=false] + weathered_copper_door[facing=west,half=lower,hinge=left,open=true,powered=true]: weathered_copper_door[facing=west,half=lower,hinge=left,open=true,powered=false] + weathered_copper_door[facing=west,half=lower,hinge=right,open=true,powered=true]: weathered_copper_door[facing=west,half=lower,hinge=right,open=true,powered=false] + weathered_copper_door[facing=west,half=upper,hinge=left,open=true,powered=true]: weathered_copper_door[facing=west,half=upper,hinge=left,open=true,powered=false] + weathered_copper_door[facing=west,half=upper,hinge=right,open=true,powered=true]: weathered_copper_door[facing=west,half=upper,hinge=right,open=true,powered=false] + oxidized_copper_door[facing=east,half=lower,hinge=left,open=false,powered=true]: oxidized_copper_door[facing=east,half=lower,hinge=left,open=false,powered=false] + oxidized_copper_door[facing=east,half=lower,hinge=right,open=false,powered=true]: oxidized_copper_door[facing=east,half=lower,hinge=right,open=false,powered=false] + oxidized_copper_door[facing=east,half=upper,hinge=left,open=false,powered=true]: oxidized_copper_door[facing=east,half=upper,hinge=left,open=false,powered=false] + oxidized_copper_door[facing=east,half=upper,hinge=right,open=false,powered=true]: oxidized_copper_door[facing=east,half=upper,hinge=right,open=false,powered=false] + oxidized_copper_door[facing=east,half=lower,hinge=left,open=true,powered=true]: oxidized_copper_door[facing=east,half=lower,hinge=left,open=true,powered=false] + oxidized_copper_door[facing=east,half=lower,hinge=right,open=true,powered=true]: oxidized_copper_door[facing=east,half=lower,hinge=right,open=true,powered=false] + oxidized_copper_door[facing=east,half=upper,hinge=left,open=true,powered=true]: oxidized_copper_door[facing=east,half=upper,hinge=left,open=true,powered=false] + oxidized_copper_door[facing=east,half=upper,hinge=right,open=true,powered=true]: oxidized_copper_door[facing=east,half=upper,hinge=right,open=true,powered=false] + oxidized_copper_door[facing=north,half=lower,hinge=left,open=false,powered=true]: oxidized_copper_door[facing=north,half=lower,hinge=left,open=false,powered=false] + oxidized_copper_door[facing=north,half=lower,hinge=right,open=false,powered=true]: oxidized_copper_door[facing=north,half=lower,hinge=right,open=false,powered=false] + oxidized_copper_door[facing=north,half=upper,hinge=left,open=false,powered=true]: oxidized_copper_door[facing=north,half=upper,hinge=left,open=false,powered=false] + oxidized_copper_door[facing=north,half=upper,hinge=right,open=false,powered=true]: oxidized_copper_door[facing=north,half=upper,hinge=right,open=false,powered=false] + oxidized_copper_door[facing=north,half=lower,hinge=left,open=true,powered=true]: oxidized_copper_door[facing=north,half=lower,hinge=left,open=true,powered=false] + oxidized_copper_door[facing=north,half=lower,hinge=right,open=true,powered=true]: oxidized_copper_door[facing=north,half=lower,hinge=right,open=true,powered=false] + oxidized_copper_door[facing=north,half=upper,hinge=left,open=true,powered=true]: oxidized_copper_door[facing=north,half=upper,hinge=left,open=true,powered=false] + oxidized_copper_door[facing=north,half=upper,hinge=right,open=true,powered=true]: oxidized_copper_door[facing=north,half=upper,hinge=right,open=true,powered=false] + oxidized_copper_door[facing=south,half=lower,hinge=left,open=false,powered=true]: oxidized_copper_door[facing=south,half=lower,hinge=left,open=false,powered=false] + oxidized_copper_door[facing=south,half=lower,hinge=right,open=false,powered=true]: oxidized_copper_door[facing=south,half=lower,hinge=right,open=false,powered=false] + oxidized_copper_door[facing=south,half=upper,hinge=left,open=false,powered=true]: oxidized_copper_door[facing=south,half=upper,hinge=left,open=false,powered=false] + oxidized_copper_door[facing=south,half=upper,hinge=right,open=false,powered=true]: oxidized_copper_door[facing=south,half=upper,hinge=right,open=false,powered=false] + oxidized_copper_door[facing=south,half=lower,hinge=left,open=true,powered=true]: oxidized_copper_door[facing=south,half=lower,hinge=left,open=true,powered=false] + oxidized_copper_door[facing=south,half=lower,hinge=right,open=true,powered=true]: oxidized_copper_door[facing=south,half=lower,hinge=right,open=true,powered=false] + oxidized_copper_door[facing=south,half=upper,hinge=left,open=true,powered=true]: oxidized_copper_door[facing=south,half=upper,hinge=left,open=true,powered=false] + oxidized_copper_door[facing=south,half=upper,hinge=right,open=true,powered=true]: oxidized_copper_door[facing=south,half=upper,hinge=right,open=true,powered=false] + oxidized_copper_door[facing=west,half=lower,hinge=left,open=false,powered=true]: oxidized_copper_door[facing=west,half=lower,hinge=left,open=false,powered=false] + oxidized_copper_door[facing=west,half=lower,hinge=right,open=false,powered=true]: oxidized_copper_door[facing=west,half=lower,hinge=right,open=false,powered=false] + oxidized_copper_door[facing=west,half=upper,hinge=left,open=false,powered=true]: oxidized_copper_door[facing=west,half=upper,hinge=left,open=false,powered=false] + oxidized_copper_door[facing=west,half=upper,hinge=right,open=false,powered=true]: oxidized_copper_door[facing=west,half=upper,hinge=right,open=false,powered=false] + oxidized_copper_door[facing=west,half=lower,hinge=left,open=true,powered=true]: oxidized_copper_door[facing=west,half=lower,hinge=left,open=true,powered=false] + oxidized_copper_door[facing=west,half=lower,hinge=right,open=true,powered=true]: oxidized_copper_door[facing=west,half=lower,hinge=right,open=true,powered=false] + oxidized_copper_door[facing=west,half=upper,hinge=left,open=true,powered=true]: oxidized_copper_door[facing=west,half=upper,hinge=left,open=true,powered=false] + oxidized_copper_door[facing=west,half=upper,hinge=right,open=true,powered=true]: oxidized_copper_door[facing=west,half=upper,hinge=right,open=true,powered=false] + waxed_copper_door[facing=east,half=lower,hinge=left,open=false,powered=true]: waxed_copper_door[facing=east,half=lower,hinge=left,open=false,powered=false] + waxed_copper_door[facing=east,half=lower,hinge=right,open=false,powered=true]: waxed_copper_door[facing=east,half=lower,hinge=right,open=false,powered=false] + waxed_copper_door[facing=east,half=upper,hinge=left,open=false,powered=true]: waxed_copper_door[facing=east,half=upper,hinge=left,open=false,powered=false] + waxed_copper_door[facing=east,half=upper,hinge=right,open=false,powered=true]: waxed_copper_door[facing=east,half=upper,hinge=right,open=false,powered=false] + waxed_copper_door[facing=east,half=lower,hinge=left,open=true,powered=true]: waxed_copper_door[facing=east,half=lower,hinge=left,open=true,powered=false] + waxed_copper_door[facing=east,half=lower,hinge=right,open=true,powered=true]: waxed_copper_door[facing=east,half=lower,hinge=right,open=true,powered=false] + waxed_copper_door[facing=east,half=upper,hinge=left,open=true,powered=true]: waxed_copper_door[facing=east,half=upper,hinge=left,open=true,powered=false] + waxed_copper_door[facing=east,half=upper,hinge=right,open=true,powered=true]: waxed_copper_door[facing=east,half=upper,hinge=right,open=true,powered=false] + waxed_copper_door[facing=north,half=lower,hinge=left,open=false,powered=true]: waxed_copper_door[facing=north,half=lower,hinge=left,open=false,powered=false] + waxed_copper_door[facing=north,half=lower,hinge=right,open=false,powered=true]: waxed_copper_door[facing=north,half=lower,hinge=right,open=false,powered=false] + waxed_copper_door[facing=north,half=upper,hinge=left,open=false,powered=true]: waxed_copper_door[facing=north,half=upper,hinge=left,open=false,powered=false] + waxed_copper_door[facing=north,half=upper,hinge=right,open=false,powered=true]: waxed_copper_door[facing=north,half=upper,hinge=right,open=false,powered=false] + waxed_copper_door[facing=north,half=lower,hinge=left,open=true,powered=true]: waxed_copper_door[facing=north,half=lower,hinge=left,open=true,powered=false] + waxed_copper_door[facing=north,half=lower,hinge=right,open=true,powered=true]: waxed_copper_door[facing=north,half=lower,hinge=right,open=true,powered=false] + waxed_copper_door[facing=north,half=upper,hinge=left,open=true,powered=true]: waxed_copper_door[facing=north,half=upper,hinge=left,open=true,powered=false] + waxed_copper_door[facing=north,half=upper,hinge=right,open=true,powered=true]: waxed_copper_door[facing=north,half=upper,hinge=right,open=true,powered=false] + waxed_copper_door[facing=south,half=lower,hinge=left,open=false,powered=true]: waxed_copper_door[facing=south,half=lower,hinge=left,open=false,powered=false] + waxed_copper_door[facing=south,half=lower,hinge=right,open=false,powered=true]: waxed_copper_door[facing=south,half=lower,hinge=right,open=false,powered=false] + waxed_copper_door[facing=south,half=upper,hinge=left,open=false,powered=true]: waxed_copper_door[facing=south,half=upper,hinge=left,open=false,powered=false] + waxed_copper_door[facing=south,half=upper,hinge=right,open=false,powered=true]: waxed_copper_door[facing=south,half=upper,hinge=right,open=false,powered=false] + waxed_copper_door[facing=south,half=lower,hinge=left,open=true,powered=true]: waxed_copper_door[facing=south,half=lower,hinge=left,open=true,powered=false] + waxed_copper_door[facing=south,half=lower,hinge=right,open=true,powered=true]: waxed_copper_door[facing=south,half=lower,hinge=right,open=true,powered=false] + waxed_copper_door[facing=south,half=upper,hinge=left,open=true,powered=true]: waxed_copper_door[facing=south,half=upper,hinge=left,open=true,powered=false] + waxed_copper_door[facing=south,half=upper,hinge=right,open=true,powered=true]: waxed_copper_door[facing=south,half=upper,hinge=right,open=true,powered=false] + waxed_copper_door[facing=west,half=lower,hinge=left,open=false,powered=true]: waxed_copper_door[facing=west,half=lower,hinge=left,open=false,powered=false] + waxed_copper_door[facing=west,half=lower,hinge=right,open=false,powered=true]: waxed_copper_door[facing=west,half=lower,hinge=right,open=false,powered=false] + waxed_copper_door[facing=west,half=upper,hinge=left,open=false,powered=true]: waxed_copper_door[facing=west,half=upper,hinge=left,open=false,powered=false] + waxed_copper_door[facing=west,half=upper,hinge=right,open=false,powered=true]: waxed_copper_door[facing=west,half=upper,hinge=right,open=false,powered=false] + waxed_copper_door[facing=west,half=lower,hinge=left,open=true,powered=true]: waxed_copper_door[facing=west,half=lower,hinge=left,open=true,powered=false] + waxed_copper_door[facing=west,half=lower,hinge=right,open=true,powered=true]: waxed_copper_door[facing=west,half=lower,hinge=right,open=true,powered=false] + waxed_copper_door[facing=west,half=upper,hinge=left,open=true,powered=true]: waxed_copper_door[facing=west,half=upper,hinge=left,open=true,powered=false] + waxed_copper_door[facing=west,half=upper,hinge=right,open=true,powered=true]: waxed_copper_door[facing=west,half=upper,hinge=right,open=true,powered=false] + waxed_exposed_copper_door[facing=east,half=lower,hinge=left,open=false,powered=true]: waxed_exposed_copper_door[facing=east,half=lower,hinge=left,open=false,powered=false] + waxed_exposed_copper_door[facing=east,half=lower,hinge=right,open=false,powered=true]: waxed_exposed_copper_door[facing=east,half=lower,hinge=right,open=false,powered=false] + waxed_exposed_copper_door[facing=east,half=upper,hinge=left,open=false,powered=true]: waxed_exposed_copper_door[facing=east,half=upper,hinge=left,open=false,powered=false] + waxed_exposed_copper_door[facing=east,half=upper,hinge=right,open=false,powered=true]: waxed_exposed_copper_door[facing=east,half=upper,hinge=right,open=false,powered=false] + waxed_exposed_copper_door[facing=east,half=lower,hinge=left,open=true,powered=true]: waxed_exposed_copper_door[facing=east,half=lower,hinge=left,open=true,powered=false] + waxed_exposed_copper_door[facing=east,half=lower,hinge=right,open=true,powered=true]: waxed_exposed_copper_door[facing=east,half=lower,hinge=right,open=true,powered=false] + waxed_exposed_copper_door[facing=east,half=upper,hinge=left,open=true,powered=true]: waxed_exposed_copper_door[facing=east,half=upper,hinge=left,open=true,powered=false] + waxed_exposed_copper_door[facing=east,half=upper,hinge=right,open=true,powered=true]: waxed_exposed_copper_door[facing=east,half=upper,hinge=right,open=true,powered=false] + waxed_exposed_copper_door[facing=north,half=lower,hinge=left,open=false,powered=true]: waxed_exposed_copper_door[facing=north,half=lower,hinge=left,open=false,powered=false] + waxed_exposed_copper_door[facing=north,half=lower,hinge=right,open=false,powered=true]: waxed_exposed_copper_door[facing=north,half=lower,hinge=right,open=false,powered=false] + waxed_exposed_copper_door[facing=north,half=upper,hinge=left,open=false,powered=true]: waxed_exposed_copper_door[facing=north,half=upper,hinge=left,open=false,powered=false] + waxed_exposed_copper_door[facing=north,half=upper,hinge=right,open=false,powered=true]: waxed_exposed_copper_door[facing=north,half=upper,hinge=right,open=false,powered=false] + waxed_exposed_copper_door[facing=north,half=lower,hinge=left,open=true,powered=true]: waxed_exposed_copper_door[facing=north,half=lower,hinge=left,open=true,powered=false] + waxed_exposed_copper_door[facing=north,half=lower,hinge=right,open=true,powered=true]: waxed_exposed_copper_door[facing=north,half=lower,hinge=right,open=true,powered=false] + waxed_exposed_copper_door[facing=north,half=upper,hinge=left,open=true,powered=true]: waxed_exposed_copper_door[facing=north,half=upper,hinge=left,open=true,powered=false] + waxed_exposed_copper_door[facing=north,half=upper,hinge=right,open=true,powered=true]: waxed_exposed_copper_door[facing=north,half=upper,hinge=right,open=true,powered=false] + waxed_exposed_copper_door[facing=south,half=lower,hinge=left,open=false,powered=true]: waxed_exposed_copper_door[facing=south,half=lower,hinge=left,open=false,powered=false] + waxed_exposed_copper_door[facing=south,half=lower,hinge=right,open=false,powered=true]: waxed_exposed_copper_door[facing=south,half=lower,hinge=right,open=false,powered=false] + waxed_exposed_copper_door[facing=south,half=upper,hinge=left,open=false,powered=true]: waxed_exposed_copper_door[facing=south,half=upper,hinge=left,open=false,powered=false] + waxed_exposed_copper_door[facing=south,half=upper,hinge=right,open=false,powered=true]: waxed_exposed_copper_door[facing=south,half=upper,hinge=right,open=false,powered=false] + waxed_exposed_copper_door[facing=south,half=lower,hinge=left,open=true,powered=true]: waxed_exposed_copper_door[facing=south,half=lower,hinge=left,open=true,powered=false] + waxed_exposed_copper_door[facing=south,half=lower,hinge=right,open=true,powered=true]: waxed_exposed_copper_door[facing=south,half=lower,hinge=right,open=true,powered=false] + waxed_exposed_copper_door[facing=south,half=upper,hinge=left,open=true,powered=true]: waxed_exposed_copper_door[facing=south,half=upper,hinge=left,open=true,powered=false] + waxed_exposed_copper_door[facing=south,half=upper,hinge=right,open=true,powered=true]: waxed_exposed_copper_door[facing=south,half=upper,hinge=right,open=true,powered=false] + waxed_exposed_copper_door[facing=west,half=lower,hinge=left,open=false,powered=true]: waxed_exposed_copper_door[facing=west,half=lower,hinge=left,open=false,powered=false] + waxed_exposed_copper_door[facing=west,half=lower,hinge=right,open=false,powered=true]: waxed_exposed_copper_door[facing=west,half=lower,hinge=right,open=false,powered=false] + waxed_exposed_copper_door[facing=west,half=upper,hinge=left,open=false,powered=true]: waxed_exposed_copper_door[facing=west,half=upper,hinge=left,open=false,powered=false] + waxed_exposed_copper_door[facing=west,half=upper,hinge=right,open=false,powered=true]: waxed_exposed_copper_door[facing=west,half=upper,hinge=right,open=false,powered=false] + waxed_exposed_copper_door[facing=west,half=lower,hinge=left,open=true,powered=true]: waxed_exposed_copper_door[facing=west,half=lower,hinge=left,open=true,powered=false] + waxed_exposed_copper_door[facing=west,half=lower,hinge=right,open=true,powered=true]: waxed_exposed_copper_door[facing=west,half=lower,hinge=right,open=true,powered=false] + waxed_exposed_copper_door[facing=west,half=upper,hinge=left,open=true,powered=true]: waxed_exposed_copper_door[facing=west,half=upper,hinge=left,open=true,powered=false] + waxed_exposed_copper_door[facing=west,half=upper,hinge=right,open=true,powered=true]: waxed_exposed_copper_door[facing=west,half=upper,hinge=right,open=true,powered=false] + waxed_weathered_copper_door[facing=east,half=lower,hinge=left,open=false,powered=true]: waxed_weathered_copper_door[facing=east,half=lower,hinge=left,open=false,powered=false] + waxed_weathered_copper_door[facing=east,half=lower,hinge=right,open=false,powered=true]: waxed_weathered_copper_door[facing=east,half=lower,hinge=right,open=false,powered=false] + waxed_weathered_copper_door[facing=east,half=upper,hinge=left,open=false,powered=true]: waxed_weathered_copper_door[facing=east,half=upper,hinge=left,open=false,powered=false] + waxed_weathered_copper_door[facing=east,half=upper,hinge=right,open=false,powered=true]: waxed_weathered_copper_door[facing=east,half=upper,hinge=right,open=false,powered=false] + waxed_weathered_copper_door[facing=east,half=lower,hinge=left,open=true,powered=true]: waxed_weathered_copper_door[facing=east,half=lower,hinge=left,open=true,powered=false] + waxed_weathered_copper_door[facing=east,half=lower,hinge=right,open=true,powered=true]: waxed_weathered_copper_door[facing=east,half=lower,hinge=right,open=true,powered=false] + waxed_weathered_copper_door[facing=east,half=upper,hinge=left,open=true,powered=true]: waxed_weathered_copper_door[facing=east,half=upper,hinge=left,open=true,powered=false] + waxed_weathered_copper_door[facing=east,half=upper,hinge=right,open=true,powered=true]: waxed_weathered_copper_door[facing=east,half=upper,hinge=right,open=true,powered=false] + waxed_weathered_copper_door[facing=north,half=lower,hinge=left,open=false,powered=true]: waxed_weathered_copper_door[facing=north,half=lower,hinge=left,open=false,powered=false] + waxed_weathered_copper_door[facing=north,half=lower,hinge=right,open=false,powered=true]: waxed_weathered_copper_door[facing=north,half=lower,hinge=right,open=false,powered=false] + waxed_weathered_copper_door[facing=north,half=upper,hinge=left,open=false,powered=true]: waxed_weathered_copper_door[facing=north,half=upper,hinge=left,open=false,powered=false] + waxed_weathered_copper_door[facing=north,half=upper,hinge=right,open=false,powered=true]: waxed_weathered_copper_door[facing=north,half=upper,hinge=right,open=false,powered=false] + waxed_weathered_copper_door[facing=north,half=lower,hinge=left,open=true,powered=true]: waxed_weathered_copper_door[facing=north,half=lower,hinge=left,open=true,powered=false] + waxed_weathered_copper_door[facing=north,half=lower,hinge=right,open=true,powered=true]: waxed_weathered_copper_door[facing=north,half=lower,hinge=right,open=true,powered=false] + waxed_weathered_copper_door[facing=north,half=upper,hinge=left,open=true,powered=true]: waxed_weathered_copper_door[facing=north,half=upper,hinge=left,open=true,powered=false] + waxed_weathered_copper_door[facing=north,half=upper,hinge=right,open=true,powered=true]: waxed_weathered_copper_door[facing=north,half=upper,hinge=right,open=true,powered=false] + waxed_weathered_copper_door[facing=south,half=lower,hinge=left,open=false,powered=true]: waxed_weathered_copper_door[facing=south,half=lower,hinge=left,open=false,powered=false] + waxed_weathered_copper_door[facing=south,half=lower,hinge=right,open=false,powered=true]: waxed_weathered_copper_door[facing=south,half=lower,hinge=right,open=false,powered=false] + waxed_weathered_copper_door[facing=south,half=upper,hinge=left,open=false,powered=true]: waxed_weathered_copper_door[facing=south,half=upper,hinge=left,open=false,powered=false] + waxed_weathered_copper_door[facing=south,half=upper,hinge=right,open=false,powered=true]: waxed_weathered_copper_door[facing=south,half=upper,hinge=right,open=false,powered=false] + waxed_weathered_copper_door[facing=south,half=lower,hinge=left,open=true,powered=true]: waxed_weathered_copper_door[facing=south,half=lower,hinge=left,open=true,powered=false] + waxed_weathered_copper_door[facing=south,half=lower,hinge=right,open=true,powered=true]: waxed_weathered_copper_door[facing=south,half=lower,hinge=right,open=true,powered=false] + waxed_weathered_copper_door[facing=south,half=upper,hinge=left,open=true,powered=true]: waxed_weathered_copper_door[facing=south,half=upper,hinge=left,open=true,powered=false] + waxed_weathered_copper_door[facing=south,half=upper,hinge=right,open=true,powered=true]: waxed_weathered_copper_door[facing=south,half=upper,hinge=right,open=true,powered=false] + waxed_weathered_copper_door[facing=west,half=lower,hinge=left,open=false,powered=true]: waxed_weathered_copper_door[facing=west,half=lower,hinge=left,open=false,powered=false] + waxed_weathered_copper_door[facing=west,half=lower,hinge=right,open=false,powered=true]: waxed_weathered_copper_door[facing=west,half=lower,hinge=right,open=false,powered=false] + waxed_weathered_copper_door[facing=west,half=upper,hinge=left,open=false,powered=true]: waxed_weathered_copper_door[facing=west,half=upper,hinge=left,open=false,powered=false] + waxed_weathered_copper_door[facing=west,half=upper,hinge=right,open=false,powered=true]: waxed_weathered_copper_door[facing=west,half=upper,hinge=right,open=false,powered=false] + waxed_weathered_copper_door[facing=west,half=lower,hinge=left,open=true,powered=true]: waxed_weathered_copper_door[facing=west,half=lower,hinge=left,open=true,powered=false] + waxed_weathered_copper_door[facing=west,half=lower,hinge=right,open=true,powered=true]: waxed_weathered_copper_door[facing=west,half=lower,hinge=right,open=true,powered=false] + waxed_weathered_copper_door[facing=west,half=upper,hinge=left,open=true,powered=true]: waxed_weathered_copper_door[facing=west,half=upper,hinge=left,open=true,powered=false] + waxed_weathered_copper_door[facing=west,half=upper,hinge=right,open=true,powered=true]: waxed_weathered_copper_door[facing=west,half=upper,hinge=right,open=true,powered=false] + waxed_oxidized_copper_door[facing=east,half=lower,hinge=left,open=false,powered=true]: waxed_oxidized_copper_door[facing=east,half=lower,hinge=left,open=false,powered=false] + waxed_oxidized_copper_door[facing=east,half=lower,hinge=right,open=false,powered=true]: waxed_oxidized_copper_door[facing=east,half=lower,hinge=right,open=false,powered=false] + waxed_oxidized_copper_door[facing=east,half=upper,hinge=left,open=false,powered=true]: waxed_oxidized_copper_door[facing=east,half=upper,hinge=left,open=false,powered=false] + waxed_oxidized_copper_door[facing=east,half=upper,hinge=right,open=false,powered=true]: waxed_oxidized_copper_door[facing=east,half=upper,hinge=right,open=false,powered=false] + waxed_oxidized_copper_door[facing=east,half=lower,hinge=left,open=true,powered=true]: waxed_oxidized_copper_door[facing=east,half=lower,hinge=left,open=true,powered=false] + waxed_oxidized_copper_door[facing=east,half=lower,hinge=right,open=true,powered=true]: waxed_oxidized_copper_door[facing=east,half=lower,hinge=right,open=true,powered=false] + waxed_oxidized_copper_door[facing=east,half=upper,hinge=left,open=true,powered=true]: waxed_oxidized_copper_door[facing=east,half=upper,hinge=left,open=true,powered=false] + waxed_oxidized_copper_door[facing=east,half=upper,hinge=right,open=true,powered=true]: waxed_oxidized_copper_door[facing=east,half=upper,hinge=right,open=true,powered=false] + waxed_oxidized_copper_door[facing=north,half=lower,hinge=left,open=false,powered=true]: waxed_oxidized_copper_door[facing=north,half=lower,hinge=left,open=false,powered=false] + waxed_oxidized_copper_door[facing=north,half=lower,hinge=right,open=false,powered=true]: waxed_oxidized_copper_door[facing=north,half=lower,hinge=right,open=false,powered=false] + waxed_oxidized_copper_door[facing=north,half=upper,hinge=left,open=false,powered=true]: waxed_oxidized_copper_door[facing=north,half=upper,hinge=left,open=false,powered=false] + waxed_oxidized_copper_door[facing=north,half=upper,hinge=right,open=false,powered=true]: waxed_oxidized_copper_door[facing=north,half=upper,hinge=right,open=false,powered=false] + waxed_oxidized_copper_door[facing=north,half=lower,hinge=left,open=true,powered=true]: waxed_oxidized_copper_door[facing=north,half=lower,hinge=left,open=true,powered=false] + waxed_oxidized_copper_door[facing=north,half=lower,hinge=right,open=true,powered=true]: waxed_oxidized_copper_door[facing=north,half=lower,hinge=right,open=true,powered=false] + waxed_oxidized_copper_door[facing=north,half=upper,hinge=left,open=true,powered=true]: waxed_oxidized_copper_door[facing=north,half=upper,hinge=left,open=true,powered=false] + waxed_oxidized_copper_door[facing=north,half=upper,hinge=right,open=true,powered=true]: waxed_oxidized_copper_door[facing=north,half=upper,hinge=right,open=true,powered=false] + waxed_oxidized_copper_door[facing=south,half=lower,hinge=left,open=false,powered=true]: waxed_oxidized_copper_door[facing=south,half=lower,hinge=left,open=false,powered=false] + waxed_oxidized_copper_door[facing=south,half=lower,hinge=right,open=false,powered=true]: waxed_oxidized_copper_door[facing=south,half=lower,hinge=right,open=false,powered=false] + waxed_oxidized_copper_door[facing=south,half=upper,hinge=left,open=false,powered=true]: waxed_oxidized_copper_door[facing=south,half=upper,hinge=left,open=false,powered=false] + waxed_oxidized_copper_door[facing=south,half=upper,hinge=right,open=false,powered=true]: waxed_oxidized_copper_door[facing=south,half=upper,hinge=right,open=false,powered=false] + waxed_oxidized_copper_door[facing=south,half=lower,hinge=left,open=true,powered=true]: waxed_oxidized_copper_door[facing=south,half=lower,hinge=left,open=true,powered=false] + waxed_oxidized_copper_door[facing=south,half=lower,hinge=right,open=true,powered=true]: waxed_oxidized_copper_door[facing=south,half=lower,hinge=right,open=true,powered=false] + waxed_oxidized_copper_door[facing=south,half=upper,hinge=left,open=true,powered=true]: waxed_oxidized_copper_door[facing=south,half=upper,hinge=left,open=true,powered=false] + waxed_oxidized_copper_door[facing=south,half=upper,hinge=right,open=true,powered=true]: waxed_oxidized_copper_door[facing=south,half=upper,hinge=right,open=true,powered=false] + waxed_oxidized_copper_door[facing=west,half=lower,hinge=left,open=false,powered=true]: waxed_oxidized_copper_door[facing=west,half=lower,hinge=left,open=false,powered=false] + waxed_oxidized_copper_door[facing=west,half=lower,hinge=right,open=false,powered=true]: waxed_oxidized_copper_door[facing=west,half=lower,hinge=right,open=false,powered=false] + waxed_oxidized_copper_door[facing=west,half=upper,hinge=left,open=false,powered=true]: waxed_oxidized_copper_door[facing=west,half=upper,hinge=left,open=false,powered=false] + waxed_oxidized_copper_door[facing=west,half=upper,hinge=right,open=false,powered=true]: waxed_oxidized_copper_door[facing=west,half=upper,hinge=right,open=false,powered=false] + waxed_oxidized_copper_door[facing=west,half=lower,hinge=left,open=true,powered=true]: waxed_oxidized_copper_door[facing=west,half=lower,hinge=left,open=true,powered=false] + waxed_oxidized_copper_door[facing=west,half=lower,hinge=right,open=true,powered=true]: waxed_oxidized_copper_door[facing=west,half=lower,hinge=right,open=true,powered=false] + waxed_oxidized_copper_door[facing=west,half=upper,hinge=left,open=true,powered=true]: waxed_oxidized_copper_door[facing=west,half=upper,hinge=left,open=true,powered=false] + waxed_oxidized_copper_door[facing=west,half=upper,hinge=right,open=true,powered=true]: waxed_oxidized_copper_door[facing=west,half=upper,hinge=right,open=true,powered=false] + + $$>=1.21.4#door: + pale_oak_door[facing=east,half=lower,hinge=left,open=false,powered=true]: pale_oak_door[facing=east,half=lower,hinge=left,open=false,powered=false] + pale_oak_door[facing=east,half=lower,hinge=right,open=false,powered=true]: pale_oak_door[facing=east,half=lower,hinge=right,open=false,powered=false] + pale_oak_door[facing=east,half=upper,hinge=left,open=false,powered=true]: pale_oak_door[facing=east,half=upper,hinge=left,open=false,powered=false] + pale_oak_door[facing=east,half=upper,hinge=right,open=false,powered=true]: pale_oak_door[facing=east,half=upper,hinge=right,open=false,powered=false] + pale_oak_door[facing=east,half=lower,hinge=left,open=true,powered=true]: pale_oak_door[facing=east,half=lower,hinge=left,open=true,powered=false] + pale_oak_door[facing=east,half=lower,hinge=right,open=true,powered=true]: pale_oak_door[facing=east,half=lower,hinge=right,open=true,powered=false] + pale_oak_door[facing=east,half=upper,hinge=left,open=true,powered=true]: pale_oak_door[facing=east,half=upper,hinge=left,open=true,powered=false] + pale_oak_door[facing=east,half=upper,hinge=right,open=true,powered=true]: pale_oak_door[facing=east,half=upper,hinge=right,open=true,powered=false] + pale_oak_door[facing=north,half=lower,hinge=left,open=false,powered=true]: pale_oak_door[facing=north,half=lower,hinge=left,open=false,powered=false] + pale_oak_door[facing=north,half=lower,hinge=right,open=false,powered=true]: pale_oak_door[facing=north,half=lower,hinge=right,open=false,powered=false] + pale_oak_door[facing=north,half=upper,hinge=left,open=false,powered=true]: pale_oak_door[facing=north,half=upper,hinge=left,open=false,powered=false] + pale_oak_door[facing=north,half=upper,hinge=right,open=false,powered=true]: pale_oak_door[facing=north,half=upper,hinge=right,open=false,powered=false] + pale_oak_door[facing=north,half=lower,hinge=left,open=true,powered=true]: pale_oak_door[facing=north,half=lower,hinge=left,open=true,powered=false] + pale_oak_door[facing=north,half=lower,hinge=right,open=true,powered=true]: pale_oak_door[facing=north,half=lower,hinge=right,open=true,powered=false] + pale_oak_door[facing=north,half=upper,hinge=left,open=true,powered=true]: pale_oak_door[facing=north,half=upper,hinge=left,open=true,powered=false] + pale_oak_door[facing=north,half=upper,hinge=right,open=true,powered=true]: pale_oak_door[facing=north,half=upper,hinge=right,open=true,powered=false] + pale_oak_door[facing=south,half=lower,hinge=left,open=false,powered=true]: pale_oak_door[facing=south,half=lower,hinge=left,open=false,powered=false] + pale_oak_door[facing=south,half=lower,hinge=right,open=false,powered=true]: pale_oak_door[facing=south,half=lower,hinge=right,open=false,powered=false] + pale_oak_door[facing=south,half=upper,hinge=left,open=false,powered=true]: pale_oak_door[facing=south,half=upper,hinge=left,open=false,powered=false] + pale_oak_door[facing=south,half=upper,hinge=right,open=false,powered=true]: pale_oak_door[facing=south,half=upper,hinge=right,open=false,powered=false] + pale_oak_door[facing=south,half=lower,hinge=left,open=true,powered=true]: pale_oak_door[facing=south,half=lower,hinge=left,open=true,powered=false] + pale_oak_door[facing=south,half=lower,hinge=right,open=true,powered=true]: pale_oak_door[facing=south,half=lower,hinge=right,open=true,powered=false] + pale_oak_door[facing=south,half=upper,hinge=left,open=true,powered=true]: pale_oak_door[facing=south,half=upper,hinge=left,open=true,powered=false] + pale_oak_door[facing=south,half=upper,hinge=right,open=true,powered=true]: pale_oak_door[facing=south,half=upper,hinge=right,open=true,powered=false] + pale_oak_door[facing=west,half=lower,hinge=left,open=false,powered=true]: pale_oak_door[facing=west,half=lower,hinge=left,open=false,powered=false] + pale_oak_door[facing=west,half=lower,hinge=right,open=false,powered=true]: pale_oak_door[facing=west,half=lower,hinge=right,open=false,powered=false] + pale_oak_door[facing=west,half=upper,hinge=left,open=false,powered=true]: pale_oak_door[facing=west,half=upper,hinge=left,open=false,powered=false] + pale_oak_door[facing=west,half=upper,hinge=right,open=false,powered=true]: pale_oak_door[facing=west,half=upper,hinge=right,open=false,powered=false] + pale_oak_door[facing=west,half=lower,hinge=left,open=true,powered=true]: pale_oak_door[facing=west,half=lower,hinge=left,open=true,powered=false] + pale_oak_door[facing=west,half=lower,hinge=right,open=true,powered=true]: pale_oak_door[facing=west,half=lower,hinge=right,open=true,powered=false] + pale_oak_door[facing=west,half=upper,hinge=left,open=true,powered=true]: pale_oak_door[facing=west,half=upper,hinge=left,open=true,powered=false] + pale_oak_door[facing=west,half=upper,hinge=right,open=true,powered=true]: pale_oak_door[facing=west,half=upper,hinge=right,open=true,powered=false] + + #### Fence Gate #### + oak_fence_gate[facing=east,in_wall=false,open=false,powered=true]: oak_fence_gate[facing=east,in_wall=false,open=false,powered=false] + oak_fence_gate[facing=east,in_wall=false,open=true,powered=true]: oak_fence_gate[facing=east,in_wall=false,open=true,powered=false] + oak_fence_gate[facing=east,in_wall=true,open=false,powered=true]: oak_fence_gate[facing=east,in_wall=true,open=false,powered=false] + oak_fence_gate[facing=east,in_wall=true,open=true,powered=true]: oak_fence_gate[facing=east,in_wall=true,open=true,powered=false] + oak_fence_gate[facing=south,in_wall=false,open=false,powered=true]: oak_fence_gate[facing=south,in_wall=false,open=false,powered=false] + oak_fence_gate[facing=south,in_wall=false,open=true,powered=true]: oak_fence_gate[facing=south,in_wall=false,open=true,powered=false] + oak_fence_gate[facing=south,in_wall=true,open=false,powered=true]: oak_fence_gate[facing=south,in_wall=true,open=false,powered=false] + oak_fence_gate[facing=south,in_wall=true,open=true,powered=true]: oak_fence_gate[facing=south,in_wall=true,open=true,powered=false] + oak_fence_gate[facing=west,in_wall=false,open=false,powered=true]: oak_fence_gate[facing=west,in_wall=false,open=false,powered=false] + oak_fence_gate[facing=west,in_wall=false,open=true,powered=true]: oak_fence_gate[facing=west,in_wall=false,open=true,powered=false] + oak_fence_gate[facing=west,in_wall=true,open=false,powered=true]: oak_fence_gate[facing=west,in_wall=true,open=false,powered=false] + oak_fence_gate[facing=west,in_wall=true,open=true,powered=true]: oak_fence_gate[facing=west,in_wall=true,open=true,powered=false] + oak_fence_gate[facing=north,in_wall=false,open=false,powered=true]: oak_fence_gate[facing=north,in_wall=false,open=false,powered=false] + oak_fence_gate[facing=north,in_wall=false,open=true,powered=true]: oak_fence_gate[facing=north,in_wall=false,open=true,powered=false] + oak_fence_gate[facing=north,in_wall=true,open=false,powered=true]: oak_fence_gate[facing=north,in_wall=true,open=false,powered=false] + oak_fence_gate[facing=north,in_wall=true,open=true,powered=true]: oak_fence_gate[facing=north,in_wall=true,open=true,powered=false] + spruce_fence_gate[facing=east,in_wall=false,open=false,powered=true]: spruce_fence_gate[facing=east,in_wall=false,open=false,powered=false] + spruce_fence_gate[facing=east,in_wall=false,open=true,powered=true]: spruce_fence_gate[facing=east,in_wall=false,open=true,powered=false] + spruce_fence_gate[facing=east,in_wall=true,open=false,powered=true]: spruce_fence_gate[facing=east,in_wall=true,open=false,powered=false] + spruce_fence_gate[facing=east,in_wall=true,open=true,powered=true]: spruce_fence_gate[facing=east,in_wall=true,open=true,powered=false] + spruce_fence_gate[facing=south,in_wall=false,open=false,powered=true]: spruce_fence_gate[facing=south,in_wall=false,open=false,powered=false] + spruce_fence_gate[facing=south,in_wall=false,open=true,powered=true]: spruce_fence_gate[facing=south,in_wall=false,open=true,powered=false] + spruce_fence_gate[facing=south,in_wall=true,open=false,powered=true]: spruce_fence_gate[facing=south,in_wall=true,open=false,powered=false] + spruce_fence_gate[facing=south,in_wall=true,open=true,powered=true]: spruce_fence_gate[facing=south,in_wall=true,open=true,powered=false] + spruce_fence_gate[facing=west,in_wall=false,open=false,powered=true]: spruce_fence_gate[facing=west,in_wall=false,open=false,powered=false] + spruce_fence_gate[facing=west,in_wall=false,open=true,powered=true]: spruce_fence_gate[facing=west,in_wall=false,open=true,powered=false] + spruce_fence_gate[facing=west,in_wall=true,open=false,powered=true]: spruce_fence_gate[facing=west,in_wall=true,open=false,powered=false] + spruce_fence_gate[facing=west,in_wall=true,open=true,powered=true]: spruce_fence_gate[facing=west,in_wall=true,open=true,powered=false] + spruce_fence_gate[facing=north,in_wall=false,open=false,powered=true]: spruce_fence_gate[facing=north,in_wall=false,open=false,powered=false] + spruce_fence_gate[facing=north,in_wall=false,open=true,powered=true]: spruce_fence_gate[facing=north,in_wall=false,open=true,powered=false] + spruce_fence_gate[facing=north,in_wall=true,open=false,powered=true]: spruce_fence_gate[facing=north,in_wall=true,open=false,powered=false] + spruce_fence_gate[facing=north,in_wall=true,open=true,powered=true]: spruce_fence_gate[facing=north,in_wall=true,open=true,powered=false] + birch_fence_gate[facing=east,in_wall=false,open=false,powered=true]: birch_fence_gate[facing=east,in_wall=false,open=false,powered=false] + birch_fence_gate[facing=east,in_wall=false,open=true,powered=true]: birch_fence_gate[facing=east,in_wall=false,open=true,powered=false] + birch_fence_gate[facing=east,in_wall=true,open=false,powered=true]: birch_fence_gate[facing=east,in_wall=true,open=false,powered=false] + birch_fence_gate[facing=east,in_wall=true,open=true,powered=true]: birch_fence_gate[facing=east,in_wall=true,open=true,powered=false] + birch_fence_gate[facing=south,in_wall=false,open=false,powered=true]: birch_fence_gate[facing=south,in_wall=false,open=false,powered=false] + birch_fence_gate[facing=south,in_wall=false,open=true,powered=true]: birch_fence_gate[facing=south,in_wall=false,open=true,powered=false] + birch_fence_gate[facing=south,in_wall=true,open=false,powered=true]: birch_fence_gate[facing=south,in_wall=true,open=false,powered=false] + birch_fence_gate[facing=south,in_wall=true,open=true,powered=true]: birch_fence_gate[facing=south,in_wall=true,open=true,powered=false] + birch_fence_gate[facing=west,in_wall=false,open=false,powered=true]: birch_fence_gate[facing=west,in_wall=false,open=false,powered=false] + birch_fence_gate[facing=west,in_wall=false,open=true,powered=true]: birch_fence_gate[facing=west,in_wall=false,open=true,powered=false] + birch_fence_gate[facing=west,in_wall=true,open=false,powered=true]: birch_fence_gate[facing=west,in_wall=true,open=false,powered=false] + birch_fence_gate[facing=west,in_wall=true,open=true,powered=true]: birch_fence_gate[facing=west,in_wall=true,open=true,powered=false] + birch_fence_gate[facing=north,in_wall=false,open=false,powered=true]: birch_fence_gate[facing=north,in_wall=false,open=false,powered=false] + birch_fence_gate[facing=north,in_wall=false,open=true,powered=true]: birch_fence_gate[facing=north,in_wall=false,open=true,powered=false] + birch_fence_gate[facing=north,in_wall=true,open=false,powered=true]: birch_fence_gate[facing=north,in_wall=true,open=false,powered=false] + birch_fence_gate[facing=north,in_wall=true,open=true,powered=true]: birch_fence_gate[facing=north,in_wall=true,open=true,powered=false] + jungle_fence_gate[facing=east,in_wall=false,open=false,powered=true]: jungle_fence_gate[facing=east,in_wall=false,open=false,powered=false] + jungle_fence_gate[facing=east,in_wall=false,open=true,powered=true]: jungle_fence_gate[facing=east,in_wall=false,open=true,powered=false] + jungle_fence_gate[facing=east,in_wall=true,open=false,powered=true]: jungle_fence_gate[facing=east,in_wall=true,open=false,powered=false] + jungle_fence_gate[facing=east,in_wall=true,open=true,powered=true]: jungle_fence_gate[facing=east,in_wall=true,open=true,powered=false] + jungle_fence_gate[facing=south,in_wall=false,open=false,powered=true]: jungle_fence_gate[facing=south,in_wall=false,open=false,powered=false] + jungle_fence_gate[facing=south,in_wall=false,open=true,powered=true]: jungle_fence_gate[facing=south,in_wall=false,open=true,powered=false] + jungle_fence_gate[facing=south,in_wall=true,open=false,powered=true]: jungle_fence_gate[facing=south,in_wall=true,open=false,powered=false] + jungle_fence_gate[facing=south,in_wall=true,open=true,powered=true]: jungle_fence_gate[facing=south,in_wall=true,open=true,powered=false] + jungle_fence_gate[facing=west,in_wall=false,open=false,powered=true]: jungle_fence_gate[facing=west,in_wall=false,open=false,powered=false] + jungle_fence_gate[facing=west,in_wall=false,open=true,powered=true]: jungle_fence_gate[facing=west,in_wall=false,open=true,powered=false] + jungle_fence_gate[facing=west,in_wall=true,open=false,powered=true]: jungle_fence_gate[facing=west,in_wall=true,open=false,powered=false] + jungle_fence_gate[facing=west,in_wall=true,open=true,powered=true]: jungle_fence_gate[facing=west,in_wall=true,open=true,powered=false] + jungle_fence_gate[facing=north,in_wall=false,open=false,powered=true]: jungle_fence_gate[facing=north,in_wall=false,open=false,powered=false] + jungle_fence_gate[facing=north,in_wall=false,open=true,powered=true]: jungle_fence_gate[facing=north,in_wall=false,open=true,powered=false] + jungle_fence_gate[facing=north,in_wall=true,open=false,powered=true]: jungle_fence_gate[facing=north,in_wall=true,open=false,powered=false] + jungle_fence_gate[facing=north,in_wall=true,open=true,powered=true]: jungle_fence_gate[facing=north,in_wall=true,open=true,powered=false] + acacia_fence_gate[facing=east,in_wall=false,open=false,powered=true]: acacia_fence_gate[facing=east,in_wall=false,open=false,powered=false] + acacia_fence_gate[facing=east,in_wall=false,open=true,powered=true]: acacia_fence_gate[facing=east,in_wall=false,open=true,powered=false] + acacia_fence_gate[facing=east,in_wall=true,open=false,powered=true]: acacia_fence_gate[facing=east,in_wall=true,open=false,powered=false] + acacia_fence_gate[facing=east,in_wall=true,open=true,powered=true]: acacia_fence_gate[facing=east,in_wall=true,open=true,powered=false] + acacia_fence_gate[facing=south,in_wall=false,open=false,powered=true]: acacia_fence_gate[facing=south,in_wall=false,open=false,powered=false] + acacia_fence_gate[facing=south,in_wall=false,open=true,powered=true]: acacia_fence_gate[facing=south,in_wall=false,open=true,powered=false] + acacia_fence_gate[facing=south,in_wall=true,open=false,powered=true]: acacia_fence_gate[facing=south,in_wall=true,open=false,powered=false] + acacia_fence_gate[facing=south,in_wall=true,open=true,powered=true]: acacia_fence_gate[facing=south,in_wall=true,open=true,powered=false] + acacia_fence_gate[facing=west,in_wall=false,open=false,powered=true]: acacia_fence_gate[facing=west,in_wall=false,open=false,powered=false] + acacia_fence_gate[facing=west,in_wall=false,open=true,powered=true]: acacia_fence_gate[facing=west,in_wall=false,open=true,powered=false] + acacia_fence_gate[facing=west,in_wall=true,open=false,powered=true]: acacia_fence_gate[facing=west,in_wall=true,open=false,powered=false] + acacia_fence_gate[facing=west,in_wall=true,open=true,powered=true]: acacia_fence_gate[facing=west,in_wall=true,open=true,powered=false] + acacia_fence_gate[facing=north,in_wall=false,open=false,powered=true]: acacia_fence_gate[facing=north,in_wall=false,open=false,powered=false] + acacia_fence_gate[facing=north,in_wall=false,open=true,powered=true]: acacia_fence_gate[facing=north,in_wall=false,open=true,powered=false] + acacia_fence_gate[facing=north,in_wall=true,open=false,powered=true]: acacia_fence_gate[facing=north,in_wall=true,open=false,powered=false] + acacia_fence_gate[facing=north,in_wall=true,open=true,powered=true]: acacia_fence_gate[facing=north,in_wall=true,open=true,powered=false] + dark_oak_fence_gate[facing=east,in_wall=false,open=false,powered=true]: dark_oak_fence_gate[facing=east,in_wall=false,open=false,powered=false] + dark_oak_fence_gate[facing=east,in_wall=false,open=true,powered=true]: dark_oak_fence_gate[facing=east,in_wall=false,open=true,powered=false] + dark_oak_fence_gate[facing=east,in_wall=true,open=false,powered=true]: dark_oak_fence_gate[facing=east,in_wall=true,open=false,powered=false] + dark_oak_fence_gate[facing=east,in_wall=true,open=true,powered=true]: dark_oak_fence_gate[facing=east,in_wall=true,open=true,powered=false] + dark_oak_fence_gate[facing=south,in_wall=false,open=false,powered=true]: dark_oak_fence_gate[facing=south,in_wall=false,open=false,powered=false] + dark_oak_fence_gate[facing=south,in_wall=false,open=true,powered=true]: dark_oak_fence_gate[facing=south,in_wall=false,open=true,powered=false] + dark_oak_fence_gate[facing=south,in_wall=true,open=false,powered=true]: dark_oak_fence_gate[facing=south,in_wall=true,open=false,powered=false] + dark_oak_fence_gate[facing=south,in_wall=true,open=true,powered=true]: dark_oak_fence_gate[facing=south,in_wall=true,open=true,powered=false] + dark_oak_fence_gate[facing=west,in_wall=false,open=false,powered=true]: dark_oak_fence_gate[facing=west,in_wall=false,open=false,powered=false] + dark_oak_fence_gate[facing=west,in_wall=false,open=true,powered=true]: dark_oak_fence_gate[facing=west,in_wall=false,open=true,powered=false] + dark_oak_fence_gate[facing=west,in_wall=true,open=false,powered=true]: dark_oak_fence_gate[facing=west,in_wall=true,open=false,powered=false] + dark_oak_fence_gate[facing=west,in_wall=true,open=true,powered=true]: dark_oak_fence_gate[facing=west,in_wall=true,open=true,powered=false] + dark_oak_fence_gate[facing=north,in_wall=false,open=false,powered=true]: dark_oak_fence_gate[facing=north,in_wall=false,open=false,powered=false] + dark_oak_fence_gate[facing=north,in_wall=false,open=true,powered=true]: dark_oak_fence_gate[facing=north,in_wall=false,open=true,powered=false] + dark_oak_fence_gate[facing=north,in_wall=true,open=false,powered=true]: dark_oak_fence_gate[facing=north,in_wall=true,open=false,powered=false] + dark_oak_fence_gate[facing=north,in_wall=true,open=true,powered=true]: dark_oak_fence_gate[facing=north,in_wall=true,open=true,powered=false] + mangrove_fence_gate[facing=east,in_wall=false,open=false,powered=true]: mangrove_fence_gate[facing=east,in_wall=false,open=false,powered=false] + mangrove_fence_gate[facing=east,in_wall=false,open=true,powered=true]: mangrove_fence_gate[facing=east,in_wall=false,open=true,powered=false] + mangrove_fence_gate[facing=east,in_wall=true,open=false,powered=true]: mangrove_fence_gate[facing=east,in_wall=true,open=false,powered=false] + mangrove_fence_gate[facing=east,in_wall=true,open=true,powered=true]: mangrove_fence_gate[facing=east,in_wall=true,open=true,powered=false] + mangrove_fence_gate[facing=south,in_wall=false,open=false,powered=true]: mangrove_fence_gate[facing=south,in_wall=false,open=false,powered=false] + mangrove_fence_gate[facing=south,in_wall=false,open=true,powered=true]: mangrove_fence_gate[facing=south,in_wall=false,open=true,powered=false] + mangrove_fence_gate[facing=south,in_wall=true,open=false,powered=true]: mangrove_fence_gate[facing=south,in_wall=true,open=false,powered=false] + mangrove_fence_gate[facing=south,in_wall=true,open=true,powered=true]: mangrove_fence_gate[facing=south,in_wall=true,open=true,powered=false] + mangrove_fence_gate[facing=west,in_wall=false,open=false,powered=true]: mangrove_fence_gate[facing=west,in_wall=false,open=false,powered=false] + mangrove_fence_gate[facing=west,in_wall=false,open=true,powered=true]: mangrove_fence_gate[facing=west,in_wall=false,open=true,powered=false] + mangrove_fence_gate[facing=west,in_wall=true,open=false,powered=true]: mangrove_fence_gate[facing=west,in_wall=true,open=false,powered=false] + mangrove_fence_gate[facing=west,in_wall=true,open=true,powered=true]: mangrove_fence_gate[facing=west,in_wall=true,open=true,powered=false] + mangrove_fence_gate[facing=north,in_wall=false,open=false,powered=true]: mangrove_fence_gate[facing=north,in_wall=false,open=false,powered=false] + mangrove_fence_gate[facing=north,in_wall=false,open=true,powered=true]: mangrove_fence_gate[facing=north,in_wall=false,open=true,powered=false] + mangrove_fence_gate[facing=north,in_wall=true,open=false,powered=true]: mangrove_fence_gate[facing=north,in_wall=true,open=false,powered=false] + mangrove_fence_gate[facing=north,in_wall=true,open=true,powered=true]: mangrove_fence_gate[facing=north,in_wall=true,open=true,powered=false] + cherry_fence_gate[facing=east,in_wall=false,open=false,powered=true]: cherry_fence_gate[facing=east,in_wall=false,open=false,powered=false] + cherry_fence_gate[facing=east,in_wall=false,open=true,powered=true]: cherry_fence_gate[facing=east,in_wall=false,open=true,powered=false] + cherry_fence_gate[facing=east,in_wall=true,open=false,powered=true]: cherry_fence_gate[facing=east,in_wall=true,open=false,powered=false] + cherry_fence_gate[facing=east,in_wall=true,open=true,powered=true]: cherry_fence_gate[facing=east,in_wall=true,open=true,powered=false] + cherry_fence_gate[facing=south,in_wall=false,open=false,powered=true]: cherry_fence_gate[facing=south,in_wall=false,open=false,powered=false] + cherry_fence_gate[facing=south,in_wall=false,open=true,powered=true]: cherry_fence_gate[facing=south,in_wall=false,open=true,powered=false] + cherry_fence_gate[facing=south,in_wall=true,open=false,powered=true]: cherry_fence_gate[facing=south,in_wall=true,open=false,powered=false] + cherry_fence_gate[facing=south,in_wall=true,open=true,powered=true]: cherry_fence_gate[facing=south,in_wall=true,open=true,powered=false] + cherry_fence_gate[facing=west,in_wall=false,open=false,powered=true]: cherry_fence_gate[facing=west,in_wall=false,open=false,powered=false] + cherry_fence_gate[facing=west,in_wall=false,open=true,powered=true]: cherry_fence_gate[facing=west,in_wall=false,open=true,powered=false] + cherry_fence_gate[facing=west,in_wall=true,open=false,powered=true]: cherry_fence_gate[facing=west,in_wall=true,open=false,powered=false] + cherry_fence_gate[facing=west,in_wall=true,open=true,powered=true]: cherry_fence_gate[facing=west,in_wall=true,open=true,powered=false] + cherry_fence_gate[facing=north,in_wall=false,open=false,powered=true]: cherry_fence_gate[facing=north,in_wall=false,open=false,powered=false] + cherry_fence_gate[facing=north,in_wall=false,open=true,powered=true]: cherry_fence_gate[facing=north,in_wall=false,open=true,powered=false] + cherry_fence_gate[facing=north,in_wall=true,open=false,powered=true]: cherry_fence_gate[facing=north,in_wall=true,open=false,powered=false] + cherry_fence_gate[facing=north,in_wall=true,open=true,powered=true]: cherry_fence_gate[facing=north,in_wall=true,open=true,powered=false] + bamboo_fence_gate[facing=east,in_wall=false,open=false,powered=true]: bamboo_fence_gate[facing=east,in_wall=false,open=false,powered=false] + bamboo_fence_gate[facing=east,in_wall=false,open=true,powered=true]: bamboo_fence_gate[facing=east,in_wall=false,open=true,powered=false] + bamboo_fence_gate[facing=east,in_wall=true,open=false,powered=true]: bamboo_fence_gate[facing=east,in_wall=true,open=false,powered=false] + bamboo_fence_gate[facing=east,in_wall=true,open=true,powered=true]: bamboo_fence_gate[facing=east,in_wall=true,open=true,powered=false] + bamboo_fence_gate[facing=south,in_wall=false,open=false,powered=true]: bamboo_fence_gate[facing=south,in_wall=false,open=false,powered=false] + bamboo_fence_gate[facing=south,in_wall=false,open=true,powered=true]: bamboo_fence_gate[facing=south,in_wall=false,open=true,powered=false] + bamboo_fence_gate[facing=south,in_wall=true,open=false,powered=true]: bamboo_fence_gate[facing=south,in_wall=true,open=false,powered=false] + bamboo_fence_gate[facing=south,in_wall=true,open=true,powered=true]: bamboo_fence_gate[facing=south,in_wall=true,open=true,powered=false] + bamboo_fence_gate[facing=west,in_wall=false,open=false,powered=true]: bamboo_fence_gate[facing=west,in_wall=false,open=false,powered=false] + bamboo_fence_gate[facing=west,in_wall=false,open=true,powered=true]: bamboo_fence_gate[facing=west,in_wall=false,open=true,powered=false] + bamboo_fence_gate[facing=west,in_wall=true,open=false,powered=true]: bamboo_fence_gate[facing=west,in_wall=true,open=false,powered=false] + bamboo_fence_gate[facing=west,in_wall=true,open=true,powered=true]: bamboo_fence_gate[facing=west,in_wall=true,open=true,powered=false] + bamboo_fence_gate[facing=north,in_wall=false,open=false,powered=true]: bamboo_fence_gate[facing=north,in_wall=false,open=false,powered=false] + bamboo_fence_gate[facing=north,in_wall=false,open=true,powered=true]: bamboo_fence_gate[facing=north,in_wall=false,open=true,powered=false] + bamboo_fence_gate[facing=north,in_wall=true,open=false,powered=true]: bamboo_fence_gate[facing=north,in_wall=true,open=false,powered=false] + bamboo_fence_gate[facing=north,in_wall=true,open=true,powered=true]: bamboo_fence_gate[facing=north,in_wall=true,open=true,powered=false] + crimson_fence_gate[facing=east,in_wall=false,open=false,powered=true]: crimson_fence_gate[facing=east,in_wall=false,open=false,powered=false] + crimson_fence_gate[facing=east,in_wall=false,open=true,powered=true]: crimson_fence_gate[facing=east,in_wall=false,open=true,powered=false] + crimson_fence_gate[facing=east,in_wall=true,open=false,powered=true]: crimson_fence_gate[facing=east,in_wall=true,open=false,powered=false] + crimson_fence_gate[facing=east,in_wall=true,open=true,powered=true]: crimson_fence_gate[facing=east,in_wall=true,open=true,powered=false] + crimson_fence_gate[facing=south,in_wall=false,open=false,powered=true]: crimson_fence_gate[facing=south,in_wall=false,open=false,powered=false] + crimson_fence_gate[facing=south,in_wall=false,open=true,powered=true]: crimson_fence_gate[facing=south,in_wall=false,open=true,powered=false] + crimson_fence_gate[facing=south,in_wall=true,open=false,powered=true]: crimson_fence_gate[facing=south,in_wall=true,open=false,powered=false] + crimson_fence_gate[facing=south,in_wall=true,open=true,powered=true]: crimson_fence_gate[facing=south,in_wall=true,open=true,powered=false] + crimson_fence_gate[facing=west,in_wall=false,open=false,powered=true]: crimson_fence_gate[facing=west,in_wall=false,open=false,powered=false] + crimson_fence_gate[facing=west,in_wall=false,open=true,powered=true]: crimson_fence_gate[facing=west,in_wall=false,open=true,powered=false] + crimson_fence_gate[facing=west,in_wall=true,open=false,powered=true]: crimson_fence_gate[facing=west,in_wall=true,open=false,powered=false] + crimson_fence_gate[facing=west,in_wall=true,open=true,powered=true]: crimson_fence_gate[facing=west,in_wall=true,open=true,powered=false] + crimson_fence_gate[facing=north,in_wall=false,open=false,powered=true]: crimson_fence_gate[facing=north,in_wall=false,open=false,powered=false] + crimson_fence_gate[facing=north,in_wall=false,open=true,powered=true]: crimson_fence_gate[facing=north,in_wall=false,open=true,powered=false] + crimson_fence_gate[facing=north,in_wall=true,open=false,powered=true]: crimson_fence_gate[facing=north,in_wall=true,open=false,powered=false] + crimson_fence_gate[facing=north,in_wall=true,open=true,powered=true]: crimson_fence_gate[facing=north,in_wall=true,open=true,powered=false] + warped_fence_gate[facing=east,in_wall=false,open=false,powered=true]: warped_fence_gate[facing=east,in_wall=false,open=false,powered=false] + warped_fence_gate[facing=east,in_wall=false,open=true,powered=true]: warped_fence_gate[facing=east,in_wall=false,open=true,powered=false] + warped_fence_gate[facing=east,in_wall=true,open=false,powered=true]: warped_fence_gate[facing=east,in_wall=true,open=false,powered=false] + warped_fence_gate[facing=east,in_wall=true,open=true,powered=true]: warped_fence_gate[facing=east,in_wall=true,open=true,powered=false] + warped_fence_gate[facing=south,in_wall=false,open=false,powered=true]: warped_fence_gate[facing=south,in_wall=false,open=false,powered=false] + warped_fence_gate[facing=south,in_wall=false,open=true,powered=true]: warped_fence_gate[facing=south,in_wall=false,open=true,powered=false] + warped_fence_gate[facing=south,in_wall=true,open=false,powered=true]: warped_fence_gate[facing=south,in_wall=true,open=false,powered=false] + warped_fence_gate[facing=south,in_wall=true,open=true,powered=true]: warped_fence_gate[facing=south,in_wall=true,open=true,powered=false] + warped_fence_gate[facing=west,in_wall=false,open=false,powered=true]: warped_fence_gate[facing=west,in_wall=false,open=false,powered=false] + warped_fence_gate[facing=west,in_wall=false,open=true,powered=true]: warped_fence_gate[facing=west,in_wall=false,open=true,powered=false] + warped_fence_gate[facing=west,in_wall=true,open=false,powered=true]: warped_fence_gate[facing=west,in_wall=true,open=false,powered=false] + warped_fence_gate[facing=west,in_wall=true,open=true,powered=true]: warped_fence_gate[facing=west,in_wall=true,open=true,powered=false] + warped_fence_gate[facing=north,in_wall=false,open=false,powered=true]: warped_fence_gate[facing=north,in_wall=false,open=false,powered=false] + warped_fence_gate[facing=north,in_wall=false,open=true,powered=true]: warped_fence_gate[facing=north,in_wall=false,open=true,powered=false] + warped_fence_gate[facing=north,in_wall=true,open=false,powered=true]: warped_fence_gate[facing=north,in_wall=true,open=false,powered=false] + warped_fence_gate[facing=north,in_wall=true,open=true,powered=true]: warped_fence_gate[facing=north,in_wall=true,open=true,powered=false] + + $$>=1.21.4#fence_gate: + pale_oak_fence_gate[facing=east,in_wall=false,open=false,powered=true]: pale_oak_fence_gate[facing=east,in_wall=false,open=false,powered=false] + pale_oak_fence_gate[facing=east,in_wall=false,open=true,powered=true]: pale_oak_fence_gate[facing=east,in_wall=false,open=true,powered=false] + pale_oak_fence_gate[facing=east,in_wall=true,open=false,powered=true]: pale_oak_fence_gate[facing=east,in_wall=true,open=false,powered=false] + pale_oak_fence_gate[facing=east,in_wall=true,open=true,powered=true]: pale_oak_fence_gate[facing=east,in_wall=true,open=true,powered=false] + pale_oak_fence_gate[facing=south,in_wall=false,open=false,powered=true]: pale_oak_fence_gate[facing=south,in_wall=false,open=false,powered=false] + pale_oak_fence_gate[facing=south,in_wall=false,open=true,powered=true]: pale_oak_fence_gate[facing=south,in_wall=false,open=true,powered=false] + pale_oak_fence_gate[facing=south,in_wall=true,open=false,powered=true]: pale_oak_fence_gate[facing=south,in_wall=true,open=false,powered=false] + pale_oak_fence_gate[facing=south,in_wall=true,open=true,powered=true]: pale_oak_fence_gate[facing=south,in_wall=true,open=true,powered=false] + pale_oak_fence_gate[facing=west,in_wall=false,open=false,powered=true]: pale_oak_fence_gate[facing=west,in_wall=false,open=false,powered=false] + pale_oak_fence_gate[facing=west,in_wall=false,open=true,powered=true]: pale_oak_fence_gate[facing=west,in_wall=false,open=true,powered=false] + pale_oak_fence_gate[facing=west,in_wall=true,open=false,powered=true]: pale_oak_fence_gate[facing=west,in_wall=true,open=false,powered=false] + pale_oak_fence_gate[facing=west,in_wall=true,open=true,powered=true]: pale_oak_fence_gate[facing=west,in_wall=true,open=true,powered=false] + pale_oak_fence_gate[facing=north,in_wall=false,open=false,powered=true]: pale_oak_fence_gate[facing=north,in_wall=false,open=false,powered=false] + pale_oak_fence_gate[facing=north,in_wall=false,open=true,powered=true]: pale_oak_fence_gate[facing=north,in_wall=false,open=true,powered=false] + pale_oak_fence_gate[facing=north,in_wall=true,open=false,powered=true]: pale_oak_fence_gate[facing=north,in_wall=true,open=false,powered=false] + pale_oak_fence_gate[facing=north,in_wall=true,open=true,powered=true]: pale_oak_fence_gate[facing=north,in_wall=true,open=true,powered=false] + + #### Slab #### + petrified_oak_slab[type=bottom,waterlogged=false]: oak_slab[type=bottom,waterlogged=false] + petrified_oak_slab[type=top,waterlogged=false]: oak_slab[type=top,waterlogged=false] + petrified_oak_slab[type=double,waterlogged=false]: oak_slab[type=double,waterlogged=false] + petrified_oak_slab[type=bottom,waterlogged=true]: oak_slab[type=bottom,waterlogged=true] + petrified_oak_slab[type=top,waterlogged=true]: oak_slab[type=top,waterlogged=true] + petrified_oak_slab[type=double,waterlogged=true]: oak_slab[type=double,waterlogged=true] + cut_copper_slab[type=bottom,waterlogged=false]: waxed_cut_copper_slab[type=bottom,waterlogged=false] + cut_copper_slab[type=top,waterlogged=false]: waxed_cut_copper_slab[type=top,waterlogged=false] + cut_copper_slab[type=double,waterlogged=false]: waxed_cut_copper_slab[type=double,waterlogged=false] + cut_copper_slab[type=bottom,waterlogged=true]: waxed_cut_copper_slab[type=bottom,waterlogged=true] + cut_copper_slab[type=top,waterlogged=true]: waxed_cut_copper_slab[type=top,waterlogged=true] + cut_copper_slab[type=double,waterlogged=true]: waxed_cut_copper_slab[type=double,waterlogged=true] + exposed_cut_copper_slab[type=bottom,waterlogged=false]: waxed_exposed_cut_copper_slab[type=bottom,waterlogged=false] + exposed_cut_copper_slab[type=top,waterlogged=false]: waxed_exposed_cut_copper_slab[type=top,waterlogged=false] + exposed_cut_copper_slab[type=double,waterlogged=false]: waxed_exposed_cut_copper_slab[type=double,waterlogged=false] + exposed_cut_copper_slab[type=bottom,waterlogged=true]: waxed_exposed_cut_copper_slab[type=bottom,waterlogged=true] + exposed_cut_copper_slab[type=top,waterlogged=true]: waxed_exposed_cut_copper_slab[type=top,waterlogged=true] + exposed_cut_copper_slab[type=double,waterlogged=true]: waxed_exposed_cut_copper_slab[type=double,waterlogged=true] + weathered_cut_copper_slab[type=bottom,waterlogged=false]: waxed_weathered_cut_copper_slab[type=bottom,waterlogged=false] + weathered_cut_copper_slab[type=top,waterlogged=false]: waxed_weathered_cut_copper_slab[type=top,waterlogged=false] + weathered_cut_copper_slab[type=double,waterlogged=false]: waxed_weathered_cut_copper_slab[type=double,waterlogged=false] + weathered_cut_copper_slab[type=bottom,waterlogged=true]: waxed_weathered_cut_copper_slab[type=bottom,waterlogged=true] + weathered_cut_copper_slab[type=top,waterlogged=true]: waxed_weathered_cut_copper_slab[type=top,waterlogged=true] + weathered_cut_copper_slab[type=double,waterlogged=true]: waxed_weathered_cut_copper_slab[type=double,waterlogged=true] + oxidized_cut_copper_slab[type=bottom,waterlogged=false]: waxed_oxidized_cut_copper_slab[type=bottom,waterlogged=false] + oxidized_cut_copper_slab[type=top,waterlogged=false]: waxed_oxidized_cut_copper_slab[type=top,waterlogged=false] + oxidized_cut_copper_slab[type=double,waterlogged=false]: waxed_oxidized_cut_copper_slab[type=double,waterlogged=false] + oxidized_cut_copper_slab[type=bottom,waterlogged=true]: waxed_oxidized_cut_copper_slab[type=bottom,waterlogged=true] + oxidized_cut_copper_slab[type=top,waterlogged=true]: waxed_oxidized_cut_copper_slab[type=top,waterlogged=true] + oxidized_cut_copper_slab[type=double,waterlogged=true]: waxed_oxidized_cut_copper_slab[type=double,waterlogged=true] + + #### Stairs #### + cut_copper_stairs[facing=east,half=bottom,shape=straight,waterlogged=false]: waxed_cut_copper_stairs[facing=east,half=bottom,shape=straight,waterlogged=false] + cut_copper_stairs[facing=east,half=bottom,shape=straight,waterlogged=true]: waxed_cut_copper_stairs[facing=east,half=bottom,shape=straight,waterlogged=true] + cut_copper_stairs[facing=east,half=bottom,shape=inner_left,waterlogged=false]: waxed_cut_copper_stairs[facing=east,half=bottom,shape=inner_left,waterlogged=false] + cut_copper_stairs[facing=east,half=bottom,shape=inner_left,waterlogged=true]: waxed_cut_copper_stairs[facing=east,half=bottom,shape=inner_left,waterlogged=true] + cut_copper_stairs[facing=east,half=bottom,shape=inner_right,waterlogged=false]: waxed_cut_copper_stairs[facing=east,half=bottom,shape=inner_right,waterlogged=false] + cut_copper_stairs[facing=east,half=bottom,shape=inner_right,waterlogged=true]: waxed_cut_copper_stairs[facing=east,half=bottom,shape=inner_right,waterlogged=true] + cut_copper_stairs[facing=east,half=bottom,shape=outer_left,waterlogged=false]: waxed_cut_copper_stairs[facing=east,half=bottom,shape=outer_left,waterlogged=false] + cut_copper_stairs[facing=east,half=bottom,shape=outer_left,waterlogged=true]: waxed_cut_copper_stairs[facing=east,half=bottom,shape=outer_left,waterlogged=true] + cut_copper_stairs[facing=east,half=bottom,shape=outer_right,waterlogged=false]: waxed_cut_copper_stairs[facing=east,half=bottom,shape=outer_right,waterlogged=false] + cut_copper_stairs[facing=east,half=bottom,shape=outer_right,waterlogged=true]: waxed_cut_copper_stairs[facing=east,half=bottom,shape=outer_right,waterlogged=true] + cut_copper_stairs[facing=east,half=top,shape=straight,waterlogged=false]: waxed_cut_copper_stairs[facing=east,half=top,shape=straight,waterlogged=false] + cut_copper_stairs[facing=east,half=top,shape=straight,waterlogged=true]: waxed_cut_copper_stairs[facing=east,half=top,shape=straight,waterlogged=true] + cut_copper_stairs[facing=east,half=top,shape=inner_left,waterlogged=false]: waxed_cut_copper_stairs[facing=east,half=top,shape=inner_left,waterlogged=false] + cut_copper_stairs[facing=east,half=top,shape=inner_left,waterlogged=true]: waxed_cut_copper_stairs[facing=east,half=top,shape=inner_left,waterlogged=true] + cut_copper_stairs[facing=east,half=top,shape=inner_right,waterlogged=false]: waxed_cut_copper_stairs[facing=east,half=top,shape=inner_right,waterlogged=false] + cut_copper_stairs[facing=east,half=top,shape=inner_right,waterlogged=true]: waxed_cut_copper_stairs[facing=east,half=top,shape=inner_right,waterlogged=true] + cut_copper_stairs[facing=east,half=top,shape=outer_left,waterlogged=false]: waxed_cut_copper_stairs[facing=east,half=top,shape=outer_left,waterlogged=false] + cut_copper_stairs[facing=east,half=top,shape=outer_left,waterlogged=true]: waxed_cut_copper_stairs[facing=east,half=top,shape=outer_left,waterlogged=true] + cut_copper_stairs[facing=east,half=top,shape=outer_right,waterlogged=false]: waxed_cut_copper_stairs[facing=east,half=top,shape=outer_right,waterlogged=false] + cut_copper_stairs[facing=east,half=top,shape=outer_right,waterlogged=true]: waxed_cut_copper_stairs[facing=east,half=top,shape=outer_right,waterlogged=true] + cut_copper_stairs[facing=south,half=bottom,shape=straight,waterlogged=false]: waxed_cut_copper_stairs[facing=south,half=bottom,shape=straight,waterlogged=false] + cut_copper_stairs[facing=south,half=bottom,shape=straight,waterlogged=true]: waxed_cut_copper_stairs[facing=south,half=bottom,shape=straight,waterlogged=true] + cut_copper_stairs[facing=south,half=bottom,shape=inner_left,waterlogged=false]: waxed_cut_copper_stairs[facing=south,half=bottom,shape=inner_left,waterlogged=false] + cut_copper_stairs[facing=south,half=bottom,shape=inner_left,waterlogged=true]: waxed_cut_copper_stairs[facing=south,half=bottom,shape=inner_left,waterlogged=true] + cut_copper_stairs[facing=south,half=bottom,shape=inner_right,waterlogged=false]: waxed_cut_copper_stairs[facing=south,half=bottom,shape=inner_right,waterlogged=false] + cut_copper_stairs[facing=south,half=bottom,shape=inner_right,waterlogged=true]: waxed_cut_copper_stairs[facing=south,half=bottom,shape=inner_right,waterlogged=true] + cut_copper_stairs[facing=south,half=bottom,shape=outer_left,waterlogged=false]: waxed_cut_copper_stairs[facing=south,half=bottom,shape=outer_left,waterlogged=false] + cut_copper_stairs[facing=south,half=bottom,shape=outer_left,waterlogged=true]: waxed_cut_copper_stairs[facing=south,half=bottom,shape=outer_left,waterlogged=true] + cut_copper_stairs[facing=south,half=bottom,shape=outer_right,waterlogged=false]: waxed_cut_copper_stairs[facing=south,half=bottom,shape=outer_right,waterlogged=false] + cut_copper_stairs[facing=south,half=bottom,shape=outer_right,waterlogged=true]: waxed_cut_copper_stairs[facing=south,half=bottom,shape=outer_right,waterlogged=true] + cut_copper_stairs[facing=south,half=top,shape=straight,waterlogged=false]: waxed_cut_copper_stairs[facing=south,half=top,shape=straight,waterlogged=false] + cut_copper_stairs[facing=south,half=top,shape=straight,waterlogged=true]: waxed_cut_copper_stairs[facing=south,half=top,shape=straight,waterlogged=true] + cut_copper_stairs[facing=south,half=top,shape=inner_left,waterlogged=false]: waxed_cut_copper_stairs[facing=south,half=top,shape=inner_left,waterlogged=false] + cut_copper_stairs[facing=south,half=top,shape=inner_left,waterlogged=true]: waxed_cut_copper_stairs[facing=south,half=top,shape=inner_left,waterlogged=true] + cut_copper_stairs[facing=south,half=top,shape=inner_right,waterlogged=false]: waxed_cut_copper_stairs[facing=south,half=top,shape=inner_right,waterlogged=false] + cut_copper_stairs[facing=south,half=top,shape=inner_right,waterlogged=true]: waxed_cut_copper_stairs[facing=south,half=top,shape=inner_right,waterlogged=true] + cut_copper_stairs[facing=south,half=top,shape=outer_left,waterlogged=false]: waxed_cut_copper_stairs[facing=south,half=top,shape=outer_left,waterlogged=false] + cut_copper_stairs[facing=south,half=top,shape=outer_left,waterlogged=true]: waxed_cut_copper_stairs[facing=south,half=top,shape=outer_left,waterlogged=true] + cut_copper_stairs[facing=south,half=top,shape=outer_right,waterlogged=false]: waxed_cut_copper_stairs[facing=south,half=top,shape=outer_right,waterlogged=false] + cut_copper_stairs[facing=south,half=top,shape=outer_right,waterlogged=true]: waxed_cut_copper_stairs[facing=south,half=top,shape=outer_right,waterlogged=true] + cut_copper_stairs[facing=west,half=bottom,shape=straight,waterlogged=false]: waxed_cut_copper_stairs[facing=west,half=bottom,shape=straight,waterlogged=false] + cut_copper_stairs[facing=west,half=bottom,shape=straight,waterlogged=true]: waxed_cut_copper_stairs[facing=west,half=bottom,shape=straight,waterlogged=true] + cut_copper_stairs[facing=west,half=bottom,shape=inner_left,waterlogged=false]: waxed_cut_copper_stairs[facing=west,half=bottom,shape=inner_left,waterlogged=false] + cut_copper_stairs[facing=west,half=bottom,shape=inner_left,waterlogged=true]: waxed_cut_copper_stairs[facing=west,half=bottom,shape=inner_left,waterlogged=true] + cut_copper_stairs[facing=west,half=bottom,shape=inner_right,waterlogged=false]: waxed_cut_copper_stairs[facing=west,half=bottom,shape=inner_right,waterlogged=false] + cut_copper_stairs[facing=west,half=bottom,shape=inner_right,waterlogged=true]: waxed_cut_copper_stairs[facing=west,half=bottom,shape=inner_right,waterlogged=true] + cut_copper_stairs[facing=west,half=bottom,shape=outer_left,waterlogged=false]: waxed_cut_copper_stairs[facing=west,half=bottom,shape=outer_left,waterlogged=false] + cut_copper_stairs[facing=west,half=bottom,shape=outer_left,waterlogged=true]: waxed_cut_copper_stairs[facing=west,half=bottom,shape=outer_left,waterlogged=true] + cut_copper_stairs[facing=west,half=bottom,shape=outer_right,waterlogged=false]: waxed_cut_copper_stairs[facing=west,half=bottom,shape=outer_right,waterlogged=false] + cut_copper_stairs[facing=west,half=bottom,shape=outer_right,waterlogged=true]: waxed_cut_copper_stairs[facing=west,half=bottom,shape=outer_right,waterlogged=true] + cut_copper_stairs[facing=west,half=top,shape=straight,waterlogged=false]: waxed_cut_copper_stairs[facing=west,half=top,shape=straight,waterlogged=false] + cut_copper_stairs[facing=west,half=top,shape=straight,waterlogged=true]: waxed_cut_copper_stairs[facing=west,half=top,shape=straight,waterlogged=true] + cut_copper_stairs[facing=west,half=top,shape=inner_left,waterlogged=false]: waxed_cut_copper_stairs[facing=west,half=top,shape=inner_left,waterlogged=false] + cut_copper_stairs[facing=west,half=top,shape=inner_left,waterlogged=true]: waxed_cut_copper_stairs[facing=west,half=top,shape=inner_left,waterlogged=true] + cut_copper_stairs[facing=west,half=top,shape=inner_right,waterlogged=false]: waxed_cut_copper_stairs[facing=west,half=top,shape=inner_right,waterlogged=false] + cut_copper_stairs[facing=west,half=top,shape=inner_right,waterlogged=true]: waxed_cut_copper_stairs[facing=west,half=top,shape=inner_right,waterlogged=true] + cut_copper_stairs[facing=west,half=top,shape=outer_left,waterlogged=false]: waxed_cut_copper_stairs[facing=west,half=top,shape=outer_left,waterlogged=false] + cut_copper_stairs[facing=west,half=top,shape=outer_left,waterlogged=true]: waxed_cut_copper_stairs[facing=west,half=top,shape=outer_left,waterlogged=true] + cut_copper_stairs[facing=west,half=top,shape=outer_right,waterlogged=false]: waxed_cut_copper_stairs[facing=west,half=top,shape=outer_right,waterlogged=false] + cut_copper_stairs[facing=west,half=top,shape=outer_right,waterlogged=true]: waxed_cut_copper_stairs[facing=west,half=top,shape=outer_right,waterlogged=true] + cut_copper_stairs[facing=north,half=bottom,shape=straight,waterlogged=false]: waxed_cut_copper_stairs[facing=north,half=bottom,shape=straight,waterlogged=false] + cut_copper_stairs[facing=north,half=bottom,shape=straight,waterlogged=true]: waxed_cut_copper_stairs[facing=north,half=bottom,shape=straight,waterlogged=true] + cut_copper_stairs[facing=north,half=bottom,shape=inner_left,waterlogged=false]: waxed_cut_copper_stairs[facing=north,half=bottom,shape=inner_left,waterlogged=false] + cut_copper_stairs[facing=north,half=bottom,shape=inner_left,waterlogged=true]: waxed_cut_copper_stairs[facing=north,half=bottom,shape=inner_left,waterlogged=true] + cut_copper_stairs[facing=north,half=bottom,shape=inner_right,waterlogged=false]: waxed_cut_copper_stairs[facing=north,half=bottom,shape=inner_right,waterlogged=false] + cut_copper_stairs[facing=north,half=bottom,shape=inner_right,waterlogged=true]: waxed_cut_copper_stairs[facing=north,half=bottom,shape=inner_right,waterlogged=true] + cut_copper_stairs[facing=north,half=bottom,shape=outer_left,waterlogged=false]: waxed_cut_copper_stairs[facing=north,half=bottom,shape=outer_left,waterlogged=false] + cut_copper_stairs[facing=north,half=bottom,shape=outer_left,waterlogged=true]: waxed_cut_copper_stairs[facing=north,half=bottom,shape=outer_left,waterlogged=true] + cut_copper_stairs[facing=north,half=bottom,shape=outer_right,waterlogged=false]: waxed_cut_copper_stairs[facing=north,half=bottom,shape=outer_right,waterlogged=false] + cut_copper_stairs[facing=north,half=bottom,shape=outer_right,waterlogged=true]: waxed_cut_copper_stairs[facing=north,half=bottom,shape=outer_right,waterlogged=true] + cut_copper_stairs[facing=north,half=top,shape=straight,waterlogged=false]: waxed_cut_copper_stairs[facing=north,half=top,shape=straight,waterlogged=false] + cut_copper_stairs[facing=north,half=top,shape=straight,waterlogged=true]: waxed_cut_copper_stairs[facing=north,half=top,shape=straight,waterlogged=true] + cut_copper_stairs[facing=north,half=top,shape=inner_left,waterlogged=false]: waxed_cut_copper_stairs[facing=north,half=top,shape=inner_left,waterlogged=false] + cut_copper_stairs[facing=north,half=top,shape=inner_left,waterlogged=true]: waxed_cut_copper_stairs[facing=north,half=top,shape=inner_left,waterlogged=true] + cut_copper_stairs[facing=north,half=top,shape=inner_right,waterlogged=false]: waxed_cut_copper_stairs[facing=north,half=top,shape=inner_right,waterlogged=false] + cut_copper_stairs[facing=north,half=top,shape=inner_right,waterlogged=true]: waxed_cut_copper_stairs[facing=north,half=top,shape=inner_right,waterlogged=true] + cut_copper_stairs[facing=north,half=top,shape=outer_left,waterlogged=false]: waxed_cut_copper_stairs[facing=north,half=top,shape=outer_left,waterlogged=false] + cut_copper_stairs[facing=north,half=top,shape=outer_left,waterlogged=true]: waxed_cut_copper_stairs[facing=north,half=top,shape=outer_left,waterlogged=true] + cut_copper_stairs[facing=north,half=top,shape=outer_right,waterlogged=false]: waxed_cut_copper_stairs[facing=north,half=top,shape=outer_right,waterlogged=false] + cut_copper_stairs[facing=north,half=top,shape=outer_right,waterlogged=true]: waxed_cut_copper_stairs[facing=north,half=top,shape=outer_right,waterlogged=true] + exposed_cut_copper_stairs[facing=east,half=bottom,shape=straight,waterlogged=false]: waxed_exposed_cut_copper_stairs[facing=east,half=bottom,shape=straight,waterlogged=false] + exposed_cut_copper_stairs[facing=east,half=bottom,shape=straight,waterlogged=true]: waxed_exposed_cut_copper_stairs[facing=east,half=bottom,shape=straight,waterlogged=true] + exposed_cut_copper_stairs[facing=east,half=bottom,shape=inner_left,waterlogged=false]: waxed_exposed_cut_copper_stairs[facing=east,half=bottom,shape=inner_left,waterlogged=false] + exposed_cut_copper_stairs[facing=east,half=bottom,shape=inner_left,waterlogged=true]: waxed_exposed_cut_copper_stairs[facing=east,half=bottom,shape=inner_left,waterlogged=true] + exposed_cut_copper_stairs[facing=east,half=bottom,shape=inner_right,waterlogged=false]: waxed_exposed_cut_copper_stairs[facing=east,half=bottom,shape=inner_right,waterlogged=false] + exposed_cut_copper_stairs[facing=east,half=bottom,shape=inner_right,waterlogged=true]: waxed_exposed_cut_copper_stairs[facing=east,half=bottom,shape=inner_right,waterlogged=true] + exposed_cut_copper_stairs[facing=east,half=bottom,shape=outer_left,waterlogged=false]: waxed_exposed_cut_copper_stairs[facing=east,half=bottom,shape=outer_left,waterlogged=false] + exposed_cut_copper_stairs[facing=east,half=bottom,shape=outer_left,waterlogged=true]: waxed_exposed_cut_copper_stairs[facing=east,half=bottom,shape=outer_left,waterlogged=true] + exposed_cut_copper_stairs[facing=east,half=bottom,shape=outer_right,waterlogged=false]: waxed_exposed_cut_copper_stairs[facing=east,half=bottom,shape=outer_right,waterlogged=false] + exposed_cut_copper_stairs[facing=east,half=bottom,shape=outer_right,waterlogged=true]: waxed_exposed_cut_copper_stairs[facing=east,half=bottom,shape=outer_right,waterlogged=true] + exposed_cut_copper_stairs[facing=east,half=top,shape=straight,waterlogged=false]: waxed_exposed_cut_copper_stairs[facing=east,half=top,shape=straight,waterlogged=false] + exposed_cut_copper_stairs[facing=east,half=top,shape=straight,waterlogged=true]: waxed_exposed_cut_copper_stairs[facing=east,half=top,shape=straight,waterlogged=true] + exposed_cut_copper_stairs[facing=east,half=top,shape=inner_left,waterlogged=false]: waxed_exposed_cut_copper_stairs[facing=east,half=top,shape=inner_left,waterlogged=false] + exposed_cut_copper_stairs[facing=east,half=top,shape=inner_left,waterlogged=true]: waxed_exposed_cut_copper_stairs[facing=east,half=top,shape=inner_left,waterlogged=true] + exposed_cut_copper_stairs[facing=east,half=top,shape=inner_right,waterlogged=false]: waxed_exposed_cut_copper_stairs[facing=east,half=top,shape=inner_right,waterlogged=false] + exposed_cut_copper_stairs[facing=east,half=top,shape=inner_right,waterlogged=true]: waxed_exposed_cut_copper_stairs[facing=east,half=top,shape=inner_right,waterlogged=true] + exposed_cut_copper_stairs[facing=east,half=top,shape=outer_left,waterlogged=false]: waxed_exposed_cut_copper_stairs[facing=east,half=top,shape=outer_left,waterlogged=false] + exposed_cut_copper_stairs[facing=east,half=top,shape=outer_left,waterlogged=true]: waxed_exposed_cut_copper_stairs[facing=east,half=top,shape=outer_left,waterlogged=true] + exposed_cut_copper_stairs[facing=east,half=top,shape=outer_right,waterlogged=false]: waxed_exposed_cut_copper_stairs[facing=east,half=top,shape=outer_right,waterlogged=false] + exposed_cut_copper_stairs[facing=east,half=top,shape=outer_right,waterlogged=true]: waxed_exposed_cut_copper_stairs[facing=east,half=top,shape=outer_right,waterlogged=true] + exposed_cut_copper_stairs[facing=south,half=bottom,shape=straight,waterlogged=false]: waxed_exposed_cut_copper_stairs[facing=south,half=bottom,shape=straight,waterlogged=false] + exposed_cut_copper_stairs[facing=south,half=bottom,shape=straight,waterlogged=true]: waxed_exposed_cut_copper_stairs[facing=south,half=bottom,shape=straight,waterlogged=true] + exposed_cut_copper_stairs[facing=south,half=bottom,shape=inner_left,waterlogged=false]: waxed_exposed_cut_copper_stairs[facing=south,half=bottom,shape=inner_left,waterlogged=false] + exposed_cut_copper_stairs[facing=south,half=bottom,shape=inner_left,waterlogged=true]: waxed_exposed_cut_copper_stairs[facing=south,half=bottom,shape=inner_left,waterlogged=true] + exposed_cut_copper_stairs[facing=south,half=bottom,shape=inner_right,waterlogged=false]: waxed_exposed_cut_copper_stairs[facing=south,half=bottom,shape=inner_right,waterlogged=false] + exposed_cut_copper_stairs[facing=south,half=bottom,shape=inner_right,waterlogged=true]: waxed_exposed_cut_copper_stairs[facing=south,half=bottom,shape=inner_right,waterlogged=true] + exposed_cut_copper_stairs[facing=south,half=bottom,shape=outer_left,waterlogged=false]: waxed_exposed_cut_copper_stairs[facing=south,half=bottom,shape=outer_left,waterlogged=false] + exposed_cut_copper_stairs[facing=south,half=bottom,shape=outer_left,waterlogged=true]: waxed_exposed_cut_copper_stairs[facing=south,half=bottom,shape=outer_left,waterlogged=true] + exposed_cut_copper_stairs[facing=south,half=bottom,shape=outer_right,waterlogged=false]: waxed_exposed_cut_copper_stairs[facing=south,half=bottom,shape=outer_right,waterlogged=false] + exposed_cut_copper_stairs[facing=south,half=bottom,shape=outer_right,waterlogged=true]: waxed_exposed_cut_copper_stairs[facing=south,half=bottom,shape=outer_right,waterlogged=true] + exposed_cut_copper_stairs[facing=south,half=top,shape=straight,waterlogged=false]: waxed_exposed_cut_copper_stairs[facing=south,half=top,shape=straight,waterlogged=false] + exposed_cut_copper_stairs[facing=south,half=top,shape=straight,waterlogged=true]: waxed_exposed_cut_copper_stairs[facing=south,half=top,shape=straight,waterlogged=true] + exposed_cut_copper_stairs[facing=south,half=top,shape=inner_left,waterlogged=false]: waxed_exposed_cut_copper_stairs[facing=south,half=top,shape=inner_left,waterlogged=false] + exposed_cut_copper_stairs[facing=south,half=top,shape=inner_left,waterlogged=true]: waxed_exposed_cut_copper_stairs[facing=south,half=top,shape=inner_left,waterlogged=true] + exposed_cut_copper_stairs[facing=south,half=top,shape=inner_right,waterlogged=false]: waxed_exposed_cut_copper_stairs[facing=south,half=top,shape=inner_right,waterlogged=false] + exposed_cut_copper_stairs[facing=south,half=top,shape=inner_right,waterlogged=true]: waxed_exposed_cut_copper_stairs[facing=south,half=top,shape=inner_right,waterlogged=true] + exposed_cut_copper_stairs[facing=south,half=top,shape=outer_left,waterlogged=false]: waxed_exposed_cut_copper_stairs[facing=south,half=top,shape=outer_left,waterlogged=false] + exposed_cut_copper_stairs[facing=south,half=top,shape=outer_left,waterlogged=true]: waxed_exposed_cut_copper_stairs[facing=south,half=top,shape=outer_left,waterlogged=true] + exposed_cut_copper_stairs[facing=south,half=top,shape=outer_right,waterlogged=false]: waxed_exposed_cut_copper_stairs[facing=south,half=top,shape=outer_right,waterlogged=false] + exposed_cut_copper_stairs[facing=south,half=top,shape=outer_right,waterlogged=true]: waxed_exposed_cut_copper_stairs[facing=south,half=top,shape=outer_right,waterlogged=true] + exposed_cut_copper_stairs[facing=west,half=bottom,shape=straight,waterlogged=false]: waxed_exposed_cut_copper_stairs[facing=west,half=bottom,shape=straight,waterlogged=false] + exposed_cut_copper_stairs[facing=west,half=bottom,shape=straight,waterlogged=true]: waxed_exposed_cut_copper_stairs[facing=west,half=bottom,shape=straight,waterlogged=true] + exposed_cut_copper_stairs[facing=west,half=bottom,shape=inner_left,waterlogged=false]: waxed_exposed_cut_copper_stairs[facing=west,half=bottom,shape=inner_left,waterlogged=false] + exposed_cut_copper_stairs[facing=west,half=bottom,shape=inner_left,waterlogged=true]: waxed_exposed_cut_copper_stairs[facing=west,half=bottom,shape=inner_left,waterlogged=true] + exposed_cut_copper_stairs[facing=west,half=bottom,shape=inner_right,waterlogged=false]: waxed_exposed_cut_copper_stairs[facing=west,half=bottom,shape=inner_right,waterlogged=false] + exposed_cut_copper_stairs[facing=west,half=bottom,shape=inner_right,waterlogged=true]: waxed_exposed_cut_copper_stairs[facing=west,half=bottom,shape=inner_right,waterlogged=true] + exposed_cut_copper_stairs[facing=west,half=bottom,shape=outer_left,waterlogged=false]: waxed_exposed_cut_copper_stairs[facing=west,half=bottom,shape=outer_left,waterlogged=false] + exposed_cut_copper_stairs[facing=west,half=bottom,shape=outer_left,waterlogged=true]: waxed_exposed_cut_copper_stairs[facing=west,half=bottom,shape=outer_left,waterlogged=true] + exposed_cut_copper_stairs[facing=west,half=bottom,shape=outer_right,waterlogged=false]: waxed_exposed_cut_copper_stairs[facing=west,half=bottom,shape=outer_right,waterlogged=false] + exposed_cut_copper_stairs[facing=west,half=bottom,shape=outer_right,waterlogged=true]: waxed_exposed_cut_copper_stairs[facing=west,half=bottom,shape=outer_right,waterlogged=true] + exposed_cut_copper_stairs[facing=west,half=top,shape=straight,waterlogged=false]: waxed_exposed_cut_copper_stairs[facing=west,half=top,shape=straight,waterlogged=false] + exposed_cut_copper_stairs[facing=west,half=top,shape=straight,waterlogged=true]: waxed_exposed_cut_copper_stairs[facing=west,half=top,shape=straight,waterlogged=true] + exposed_cut_copper_stairs[facing=west,half=top,shape=inner_left,waterlogged=false]: waxed_exposed_cut_copper_stairs[facing=west,half=top,shape=inner_left,waterlogged=false] + exposed_cut_copper_stairs[facing=west,half=top,shape=inner_left,waterlogged=true]: waxed_exposed_cut_copper_stairs[facing=west,half=top,shape=inner_left,waterlogged=true] + exposed_cut_copper_stairs[facing=west,half=top,shape=inner_right,waterlogged=false]: waxed_exposed_cut_copper_stairs[facing=west,half=top,shape=inner_right,waterlogged=false] + exposed_cut_copper_stairs[facing=west,half=top,shape=inner_right,waterlogged=true]: waxed_exposed_cut_copper_stairs[facing=west,half=top,shape=inner_right,waterlogged=true] + exposed_cut_copper_stairs[facing=west,half=top,shape=outer_left,waterlogged=false]: waxed_exposed_cut_copper_stairs[facing=west,half=top,shape=outer_left,waterlogged=false] + exposed_cut_copper_stairs[facing=west,half=top,shape=outer_left,waterlogged=true]: waxed_exposed_cut_copper_stairs[facing=west,half=top,shape=outer_left,waterlogged=true] + exposed_cut_copper_stairs[facing=west,half=top,shape=outer_right,waterlogged=false]: waxed_exposed_cut_copper_stairs[facing=west,half=top,shape=outer_right,waterlogged=false] + exposed_cut_copper_stairs[facing=west,half=top,shape=outer_right,waterlogged=true]: waxed_exposed_cut_copper_stairs[facing=west,half=top,shape=outer_right,waterlogged=true] + exposed_cut_copper_stairs[facing=north,half=bottom,shape=straight,waterlogged=false]: waxed_exposed_cut_copper_stairs[facing=north,half=bottom,shape=straight,waterlogged=false] + exposed_cut_copper_stairs[facing=north,half=bottom,shape=straight,waterlogged=true]: waxed_exposed_cut_copper_stairs[facing=north,half=bottom,shape=straight,waterlogged=true] + exposed_cut_copper_stairs[facing=north,half=bottom,shape=inner_left,waterlogged=false]: waxed_exposed_cut_copper_stairs[facing=north,half=bottom,shape=inner_left,waterlogged=false] + exposed_cut_copper_stairs[facing=north,half=bottom,shape=inner_left,waterlogged=true]: waxed_exposed_cut_copper_stairs[facing=north,half=bottom,shape=inner_left,waterlogged=true] + exposed_cut_copper_stairs[facing=north,half=bottom,shape=inner_right,waterlogged=false]: waxed_exposed_cut_copper_stairs[facing=north,half=bottom,shape=inner_right,waterlogged=false] + exposed_cut_copper_stairs[facing=north,half=bottom,shape=inner_right,waterlogged=true]: waxed_exposed_cut_copper_stairs[facing=north,half=bottom,shape=inner_right,waterlogged=true] + exposed_cut_copper_stairs[facing=north,half=bottom,shape=outer_left,waterlogged=false]: waxed_exposed_cut_copper_stairs[facing=north,half=bottom,shape=outer_left,waterlogged=false] + exposed_cut_copper_stairs[facing=north,half=bottom,shape=outer_left,waterlogged=true]: waxed_exposed_cut_copper_stairs[facing=north,half=bottom,shape=outer_left,waterlogged=true] + exposed_cut_copper_stairs[facing=north,half=bottom,shape=outer_right,waterlogged=false]: waxed_exposed_cut_copper_stairs[facing=north,half=bottom,shape=outer_right,waterlogged=false] + exposed_cut_copper_stairs[facing=north,half=bottom,shape=outer_right,waterlogged=true]: waxed_exposed_cut_copper_stairs[facing=north,half=bottom,shape=outer_right,waterlogged=true] + exposed_cut_copper_stairs[facing=north,half=top,shape=straight,waterlogged=false]: waxed_exposed_cut_copper_stairs[facing=north,half=top,shape=straight,waterlogged=false] + exposed_cut_copper_stairs[facing=north,half=top,shape=straight,waterlogged=true]: waxed_exposed_cut_copper_stairs[facing=north,half=top,shape=straight,waterlogged=true] + exposed_cut_copper_stairs[facing=north,half=top,shape=inner_left,waterlogged=false]: waxed_exposed_cut_copper_stairs[facing=north,half=top,shape=inner_left,waterlogged=false] + exposed_cut_copper_stairs[facing=north,half=top,shape=inner_left,waterlogged=true]: waxed_exposed_cut_copper_stairs[facing=north,half=top,shape=inner_left,waterlogged=true] + exposed_cut_copper_stairs[facing=north,half=top,shape=inner_right,waterlogged=false]: waxed_exposed_cut_copper_stairs[facing=north,half=top,shape=inner_right,waterlogged=false] + exposed_cut_copper_stairs[facing=north,half=top,shape=inner_right,waterlogged=true]: waxed_exposed_cut_copper_stairs[facing=north,half=top,shape=inner_right,waterlogged=true] + exposed_cut_copper_stairs[facing=north,half=top,shape=outer_left,waterlogged=false]: waxed_exposed_cut_copper_stairs[facing=north,half=top,shape=outer_left,waterlogged=false] + exposed_cut_copper_stairs[facing=north,half=top,shape=outer_left,waterlogged=true]: waxed_exposed_cut_copper_stairs[facing=north,half=top,shape=outer_left,waterlogged=true] + exposed_cut_copper_stairs[facing=north,half=top,shape=outer_right,waterlogged=false]: waxed_exposed_cut_copper_stairs[facing=north,half=top,shape=outer_right,waterlogged=false] + exposed_cut_copper_stairs[facing=north,half=top,shape=outer_right,waterlogged=true]: waxed_exposed_cut_copper_stairs[facing=north,half=top,shape=outer_right,waterlogged=true] + weathered_cut_copper_stairs[facing=east,half=bottom,shape=straight,waterlogged=false]: waxed_weathered_cut_copper_stairs[facing=east,half=bottom,shape=straight,waterlogged=false] + weathered_cut_copper_stairs[facing=east,half=bottom,shape=straight,waterlogged=true]: waxed_weathered_cut_copper_stairs[facing=east,half=bottom,shape=straight,waterlogged=true] + weathered_cut_copper_stairs[facing=east,half=bottom,shape=inner_left,waterlogged=false]: waxed_weathered_cut_copper_stairs[facing=east,half=bottom,shape=inner_left,waterlogged=false] + weathered_cut_copper_stairs[facing=east,half=bottom,shape=inner_left,waterlogged=true]: waxed_weathered_cut_copper_stairs[facing=east,half=bottom,shape=inner_left,waterlogged=true] + weathered_cut_copper_stairs[facing=east,half=bottom,shape=inner_right,waterlogged=false]: waxed_weathered_cut_copper_stairs[facing=east,half=bottom,shape=inner_right,waterlogged=false] + weathered_cut_copper_stairs[facing=east,half=bottom,shape=inner_right,waterlogged=true]: waxed_weathered_cut_copper_stairs[facing=east,half=bottom,shape=inner_right,waterlogged=true] + weathered_cut_copper_stairs[facing=east,half=bottom,shape=outer_left,waterlogged=false]: waxed_weathered_cut_copper_stairs[facing=east,half=bottom,shape=outer_left,waterlogged=false] + weathered_cut_copper_stairs[facing=east,half=bottom,shape=outer_left,waterlogged=true]: waxed_weathered_cut_copper_stairs[facing=east,half=bottom,shape=outer_left,waterlogged=true] + weathered_cut_copper_stairs[facing=east,half=bottom,shape=outer_right,waterlogged=false]: waxed_weathered_cut_copper_stairs[facing=east,half=bottom,shape=outer_right,waterlogged=false] + weathered_cut_copper_stairs[facing=east,half=bottom,shape=outer_right,waterlogged=true]: waxed_weathered_cut_copper_stairs[facing=east,half=bottom,shape=outer_right,waterlogged=true] + weathered_cut_copper_stairs[facing=east,half=top,shape=straight,waterlogged=false]: waxed_weathered_cut_copper_stairs[facing=east,half=top,shape=straight,waterlogged=false] + weathered_cut_copper_stairs[facing=east,half=top,shape=straight,waterlogged=true]: waxed_weathered_cut_copper_stairs[facing=east,half=top,shape=straight,waterlogged=true] + weathered_cut_copper_stairs[facing=east,half=top,shape=inner_left,waterlogged=false]: waxed_weathered_cut_copper_stairs[facing=east,half=top,shape=inner_left,waterlogged=false] + weathered_cut_copper_stairs[facing=east,half=top,shape=inner_left,waterlogged=true]: waxed_weathered_cut_copper_stairs[facing=east,half=top,shape=inner_left,waterlogged=true] + weathered_cut_copper_stairs[facing=east,half=top,shape=inner_right,waterlogged=false]: waxed_weathered_cut_copper_stairs[facing=east,half=top,shape=inner_right,waterlogged=false] + weathered_cut_copper_stairs[facing=east,half=top,shape=inner_right,waterlogged=true]: waxed_weathered_cut_copper_stairs[facing=east,half=top,shape=inner_right,waterlogged=true] + weathered_cut_copper_stairs[facing=east,half=top,shape=outer_left,waterlogged=false]: waxed_weathered_cut_copper_stairs[facing=east,half=top,shape=outer_left,waterlogged=false] + weathered_cut_copper_stairs[facing=east,half=top,shape=outer_left,waterlogged=true]: waxed_weathered_cut_copper_stairs[facing=east,half=top,shape=outer_left,waterlogged=true] + weathered_cut_copper_stairs[facing=east,half=top,shape=outer_right,waterlogged=false]: waxed_weathered_cut_copper_stairs[facing=east,half=top,shape=outer_right,waterlogged=false] + weathered_cut_copper_stairs[facing=east,half=top,shape=outer_right,waterlogged=true]: waxed_weathered_cut_copper_stairs[facing=east,half=top,shape=outer_right,waterlogged=true] + weathered_cut_copper_stairs[facing=south,half=bottom,shape=straight,waterlogged=false]: waxed_weathered_cut_copper_stairs[facing=south,half=bottom,shape=straight,waterlogged=false] + weathered_cut_copper_stairs[facing=south,half=bottom,shape=straight,waterlogged=true]: waxed_weathered_cut_copper_stairs[facing=south,half=bottom,shape=straight,waterlogged=true] + weathered_cut_copper_stairs[facing=south,half=bottom,shape=inner_left,waterlogged=false]: waxed_weathered_cut_copper_stairs[facing=south,half=bottom,shape=inner_left,waterlogged=false] + weathered_cut_copper_stairs[facing=south,half=bottom,shape=inner_left,waterlogged=true]: waxed_weathered_cut_copper_stairs[facing=south,half=bottom,shape=inner_left,waterlogged=true] + weathered_cut_copper_stairs[facing=south,half=bottom,shape=inner_right,waterlogged=false]: waxed_weathered_cut_copper_stairs[facing=south,half=bottom,shape=inner_right,waterlogged=false] + weathered_cut_copper_stairs[facing=south,half=bottom,shape=inner_right,waterlogged=true]: waxed_weathered_cut_copper_stairs[facing=south,half=bottom,shape=inner_right,waterlogged=true] + weathered_cut_copper_stairs[facing=south,half=bottom,shape=outer_left,waterlogged=false]: waxed_weathered_cut_copper_stairs[facing=south,half=bottom,shape=outer_left,waterlogged=false] + weathered_cut_copper_stairs[facing=south,half=bottom,shape=outer_left,waterlogged=true]: waxed_weathered_cut_copper_stairs[facing=south,half=bottom,shape=outer_left,waterlogged=true] + weathered_cut_copper_stairs[facing=south,half=bottom,shape=outer_right,waterlogged=false]: waxed_weathered_cut_copper_stairs[facing=south,half=bottom,shape=outer_right,waterlogged=false] + weathered_cut_copper_stairs[facing=south,half=bottom,shape=outer_right,waterlogged=true]: waxed_weathered_cut_copper_stairs[facing=south,half=bottom,shape=outer_right,waterlogged=true] + weathered_cut_copper_stairs[facing=south,half=top,shape=straight,waterlogged=false]: waxed_weathered_cut_copper_stairs[facing=south,half=top,shape=straight,waterlogged=false] + weathered_cut_copper_stairs[facing=south,half=top,shape=straight,waterlogged=true]: waxed_weathered_cut_copper_stairs[facing=south,half=top,shape=straight,waterlogged=true] + weathered_cut_copper_stairs[facing=south,half=top,shape=inner_left,waterlogged=false]: waxed_weathered_cut_copper_stairs[facing=south,half=top,shape=inner_left,waterlogged=false] + weathered_cut_copper_stairs[facing=south,half=top,shape=inner_left,waterlogged=true]: waxed_weathered_cut_copper_stairs[facing=south,half=top,shape=inner_left,waterlogged=true] + weathered_cut_copper_stairs[facing=south,half=top,shape=inner_right,waterlogged=false]: waxed_weathered_cut_copper_stairs[facing=south,half=top,shape=inner_right,waterlogged=false] + weathered_cut_copper_stairs[facing=south,half=top,shape=inner_right,waterlogged=true]: waxed_weathered_cut_copper_stairs[facing=south,half=top,shape=inner_right,waterlogged=true] + weathered_cut_copper_stairs[facing=south,half=top,shape=outer_left,waterlogged=false]: waxed_weathered_cut_copper_stairs[facing=south,half=top,shape=outer_left,waterlogged=false] + weathered_cut_copper_stairs[facing=south,half=top,shape=outer_left,waterlogged=true]: waxed_weathered_cut_copper_stairs[facing=south,half=top,shape=outer_left,waterlogged=true] + weathered_cut_copper_stairs[facing=south,half=top,shape=outer_right,waterlogged=false]: waxed_weathered_cut_copper_stairs[facing=south,half=top,shape=outer_right,waterlogged=false] + weathered_cut_copper_stairs[facing=south,half=top,shape=outer_right,waterlogged=true]: waxed_weathered_cut_copper_stairs[facing=south,half=top,shape=outer_right,waterlogged=true] + weathered_cut_copper_stairs[facing=west,half=bottom,shape=straight,waterlogged=false]: waxed_weathered_cut_copper_stairs[facing=west,half=bottom,shape=straight,waterlogged=false] + weathered_cut_copper_stairs[facing=west,half=bottom,shape=straight,waterlogged=true]: waxed_weathered_cut_copper_stairs[facing=west,half=bottom,shape=straight,waterlogged=true] + weathered_cut_copper_stairs[facing=west,half=bottom,shape=inner_left,waterlogged=false]: waxed_weathered_cut_copper_stairs[facing=west,half=bottom,shape=inner_left,waterlogged=false] + weathered_cut_copper_stairs[facing=west,half=bottom,shape=inner_left,waterlogged=true]: waxed_weathered_cut_copper_stairs[facing=west,half=bottom,shape=inner_left,waterlogged=true] + weathered_cut_copper_stairs[facing=west,half=bottom,shape=inner_right,waterlogged=false]: waxed_weathered_cut_copper_stairs[facing=west,half=bottom,shape=inner_right,waterlogged=false] + weathered_cut_copper_stairs[facing=west,half=bottom,shape=inner_right,waterlogged=true]: waxed_weathered_cut_copper_stairs[facing=west,half=bottom,shape=inner_right,waterlogged=true] + weathered_cut_copper_stairs[facing=west,half=bottom,shape=outer_left,waterlogged=false]: waxed_weathered_cut_copper_stairs[facing=west,half=bottom,shape=outer_left,waterlogged=false] + weathered_cut_copper_stairs[facing=west,half=bottom,shape=outer_left,waterlogged=true]: waxed_weathered_cut_copper_stairs[facing=west,half=bottom,shape=outer_left,waterlogged=true] + weathered_cut_copper_stairs[facing=west,half=bottom,shape=outer_right,waterlogged=false]: waxed_weathered_cut_copper_stairs[facing=west,half=bottom,shape=outer_right,waterlogged=false] + weathered_cut_copper_stairs[facing=west,half=bottom,shape=outer_right,waterlogged=true]: waxed_weathered_cut_copper_stairs[facing=west,half=bottom,shape=outer_right,waterlogged=true] + weathered_cut_copper_stairs[facing=west,half=top,shape=straight,waterlogged=false]: waxed_weathered_cut_copper_stairs[facing=west,half=top,shape=straight,waterlogged=false] + weathered_cut_copper_stairs[facing=west,half=top,shape=straight,waterlogged=true]: waxed_weathered_cut_copper_stairs[facing=west,half=top,shape=straight,waterlogged=true] + weathered_cut_copper_stairs[facing=west,half=top,shape=inner_left,waterlogged=false]: waxed_weathered_cut_copper_stairs[facing=west,half=top,shape=inner_left,waterlogged=false] + weathered_cut_copper_stairs[facing=west,half=top,shape=inner_left,waterlogged=true]: waxed_weathered_cut_copper_stairs[facing=west,half=top,shape=inner_left,waterlogged=true] + weathered_cut_copper_stairs[facing=west,half=top,shape=inner_right,waterlogged=false]: waxed_weathered_cut_copper_stairs[facing=west,half=top,shape=inner_right,waterlogged=false] + weathered_cut_copper_stairs[facing=west,half=top,shape=inner_right,waterlogged=true]: waxed_weathered_cut_copper_stairs[facing=west,half=top,shape=inner_right,waterlogged=true] + weathered_cut_copper_stairs[facing=west,half=top,shape=outer_left,waterlogged=false]: waxed_weathered_cut_copper_stairs[facing=west,half=top,shape=outer_left,waterlogged=false] + weathered_cut_copper_stairs[facing=west,half=top,shape=outer_left,waterlogged=true]: waxed_weathered_cut_copper_stairs[facing=west,half=top,shape=outer_left,waterlogged=true] + weathered_cut_copper_stairs[facing=west,half=top,shape=outer_right,waterlogged=false]: waxed_weathered_cut_copper_stairs[facing=west,half=top,shape=outer_right,waterlogged=false] + weathered_cut_copper_stairs[facing=west,half=top,shape=outer_right,waterlogged=true]: waxed_weathered_cut_copper_stairs[facing=west,half=top,shape=outer_right,waterlogged=true] + weathered_cut_copper_stairs[facing=north,half=bottom,shape=straight,waterlogged=false]: waxed_weathered_cut_copper_stairs[facing=north,half=bottom,shape=straight,waterlogged=false] + weathered_cut_copper_stairs[facing=north,half=bottom,shape=straight,waterlogged=true]: waxed_weathered_cut_copper_stairs[facing=north,half=bottom,shape=straight,waterlogged=true] + weathered_cut_copper_stairs[facing=north,half=bottom,shape=inner_left,waterlogged=false]: waxed_weathered_cut_copper_stairs[facing=north,half=bottom,shape=inner_left,waterlogged=false] + weathered_cut_copper_stairs[facing=north,half=bottom,shape=inner_left,waterlogged=true]: waxed_weathered_cut_copper_stairs[facing=north,half=bottom,shape=inner_left,waterlogged=true] + weathered_cut_copper_stairs[facing=north,half=bottom,shape=inner_right,waterlogged=false]: waxed_weathered_cut_copper_stairs[facing=north,half=bottom,shape=inner_right,waterlogged=false] + weathered_cut_copper_stairs[facing=north,half=bottom,shape=inner_right,waterlogged=true]: waxed_weathered_cut_copper_stairs[facing=north,half=bottom,shape=inner_right,waterlogged=true] + weathered_cut_copper_stairs[facing=north,half=bottom,shape=outer_left,waterlogged=false]: waxed_weathered_cut_copper_stairs[facing=north,half=bottom,shape=outer_left,waterlogged=false] + weathered_cut_copper_stairs[facing=north,half=bottom,shape=outer_left,waterlogged=true]: waxed_weathered_cut_copper_stairs[facing=north,half=bottom,shape=outer_left,waterlogged=true] + weathered_cut_copper_stairs[facing=north,half=bottom,shape=outer_right,waterlogged=false]: waxed_weathered_cut_copper_stairs[facing=north,half=bottom,shape=outer_right,waterlogged=false] + weathered_cut_copper_stairs[facing=north,half=bottom,shape=outer_right,waterlogged=true]: waxed_weathered_cut_copper_stairs[facing=north,half=bottom,shape=outer_right,waterlogged=true] + weathered_cut_copper_stairs[facing=north,half=top,shape=straight,waterlogged=false]: waxed_weathered_cut_copper_stairs[facing=north,half=top,shape=straight,waterlogged=false] + weathered_cut_copper_stairs[facing=north,half=top,shape=straight,waterlogged=true]: waxed_weathered_cut_copper_stairs[facing=north,half=top,shape=straight,waterlogged=true] + weathered_cut_copper_stairs[facing=north,half=top,shape=inner_left,waterlogged=false]: waxed_weathered_cut_copper_stairs[facing=north,half=top,shape=inner_left,waterlogged=false] + weathered_cut_copper_stairs[facing=north,half=top,shape=inner_left,waterlogged=true]: waxed_weathered_cut_copper_stairs[facing=north,half=top,shape=inner_left,waterlogged=true] + weathered_cut_copper_stairs[facing=north,half=top,shape=inner_right,waterlogged=false]: waxed_weathered_cut_copper_stairs[facing=north,half=top,shape=inner_right,waterlogged=false] + weathered_cut_copper_stairs[facing=north,half=top,shape=inner_right,waterlogged=true]: waxed_weathered_cut_copper_stairs[facing=north,half=top,shape=inner_right,waterlogged=true] + weathered_cut_copper_stairs[facing=north,half=top,shape=outer_left,waterlogged=false]: waxed_weathered_cut_copper_stairs[facing=north,half=top,shape=outer_left,waterlogged=false] + weathered_cut_copper_stairs[facing=north,half=top,shape=outer_left,waterlogged=true]: waxed_weathered_cut_copper_stairs[facing=north,half=top,shape=outer_left,waterlogged=true] + weathered_cut_copper_stairs[facing=north,half=top,shape=outer_right,waterlogged=false]: waxed_weathered_cut_copper_stairs[facing=north,half=top,shape=outer_right,waterlogged=false] + weathered_cut_copper_stairs[facing=north,half=top,shape=outer_right,waterlogged=true]: waxed_weathered_cut_copper_stairs[facing=north,half=top,shape=outer_right,waterlogged=true] + oxidized_cut_copper_stairs[facing=east,half=bottom,shape=straight,waterlogged=false]: waxed_oxidized_cut_copper_stairs[facing=east,half=bottom,shape=straight,waterlogged=false] + oxidized_cut_copper_stairs[facing=east,half=bottom,shape=straight,waterlogged=true]: waxed_oxidized_cut_copper_stairs[facing=east,half=bottom,shape=straight,waterlogged=true] + oxidized_cut_copper_stairs[facing=east,half=bottom,shape=inner_left,waterlogged=false]: waxed_oxidized_cut_copper_stairs[facing=east,half=bottom,shape=inner_left,waterlogged=false] + oxidized_cut_copper_stairs[facing=east,half=bottom,shape=inner_left,waterlogged=true]: waxed_oxidized_cut_copper_stairs[facing=east,half=bottom,shape=inner_left,waterlogged=true] + oxidized_cut_copper_stairs[facing=east,half=bottom,shape=inner_right,waterlogged=false]: waxed_oxidized_cut_copper_stairs[facing=east,half=bottom,shape=inner_right,waterlogged=false] + oxidized_cut_copper_stairs[facing=east,half=bottom,shape=inner_right,waterlogged=true]: waxed_oxidized_cut_copper_stairs[facing=east,half=bottom,shape=inner_right,waterlogged=true] + oxidized_cut_copper_stairs[facing=east,half=bottom,shape=outer_left,waterlogged=false]: waxed_oxidized_cut_copper_stairs[facing=east,half=bottom,shape=outer_left,waterlogged=false] + oxidized_cut_copper_stairs[facing=east,half=bottom,shape=outer_left,waterlogged=true]: waxed_oxidized_cut_copper_stairs[facing=east,half=bottom,shape=outer_left,waterlogged=true] + oxidized_cut_copper_stairs[facing=east,half=bottom,shape=outer_right,waterlogged=false]: waxed_oxidized_cut_copper_stairs[facing=east,half=bottom,shape=outer_right,waterlogged=false] + oxidized_cut_copper_stairs[facing=east,half=bottom,shape=outer_right,waterlogged=true]: waxed_oxidized_cut_copper_stairs[facing=east,half=bottom,shape=outer_right,waterlogged=true] + oxidized_cut_copper_stairs[facing=east,half=top,shape=straight,waterlogged=false]: waxed_oxidized_cut_copper_stairs[facing=east,half=top,shape=straight,waterlogged=false] + oxidized_cut_copper_stairs[facing=east,half=top,shape=straight,waterlogged=true]: waxed_oxidized_cut_copper_stairs[facing=east,half=top,shape=straight,waterlogged=true] + oxidized_cut_copper_stairs[facing=east,half=top,shape=inner_left,waterlogged=false]: waxed_oxidized_cut_copper_stairs[facing=east,half=top,shape=inner_left,waterlogged=false] + oxidized_cut_copper_stairs[facing=east,half=top,shape=inner_left,waterlogged=true]: waxed_oxidized_cut_copper_stairs[facing=east,half=top,shape=inner_left,waterlogged=true] + oxidized_cut_copper_stairs[facing=east,half=top,shape=inner_right,waterlogged=false]: waxed_oxidized_cut_copper_stairs[facing=east,half=top,shape=inner_right,waterlogged=false] + oxidized_cut_copper_stairs[facing=east,half=top,shape=inner_right,waterlogged=true]: waxed_oxidized_cut_copper_stairs[facing=east,half=top,shape=inner_right,waterlogged=true] + oxidized_cut_copper_stairs[facing=east,half=top,shape=outer_left,waterlogged=false]: waxed_oxidized_cut_copper_stairs[facing=east,half=top,shape=outer_left,waterlogged=false] + oxidized_cut_copper_stairs[facing=east,half=top,shape=outer_left,waterlogged=true]: waxed_oxidized_cut_copper_stairs[facing=east,half=top,shape=outer_left,waterlogged=true] + oxidized_cut_copper_stairs[facing=east,half=top,shape=outer_right,waterlogged=false]: waxed_oxidized_cut_copper_stairs[facing=east,half=top,shape=outer_right,waterlogged=false] + oxidized_cut_copper_stairs[facing=east,half=top,shape=outer_right,waterlogged=true]: waxed_oxidized_cut_copper_stairs[facing=east,half=top,shape=outer_right,waterlogged=true] + oxidized_cut_copper_stairs[facing=south,half=bottom,shape=straight,waterlogged=false]: waxed_oxidized_cut_copper_stairs[facing=south,half=bottom,shape=straight,waterlogged=false] + oxidized_cut_copper_stairs[facing=south,half=bottom,shape=straight,waterlogged=true]: waxed_oxidized_cut_copper_stairs[facing=south,half=bottom,shape=straight,waterlogged=true] + oxidized_cut_copper_stairs[facing=south,half=bottom,shape=inner_left,waterlogged=false]: waxed_oxidized_cut_copper_stairs[facing=south,half=bottom,shape=inner_left,waterlogged=false] + oxidized_cut_copper_stairs[facing=south,half=bottom,shape=inner_left,waterlogged=true]: waxed_oxidized_cut_copper_stairs[facing=south,half=bottom,shape=inner_left,waterlogged=true] + oxidized_cut_copper_stairs[facing=south,half=bottom,shape=inner_right,waterlogged=false]: waxed_oxidized_cut_copper_stairs[facing=south,half=bottom,shape=inner_right,waterlogged=false] + oxidized_cut_copper_stairs[facing=south,half=bottom,shape=inner_right,waterlogged=true]: waxed_oxidized_cut_copper_stairs[facing=south,half=bottom,shape=inner_right,waterlogged=true] + oxidized_cut_copper_stairs[facing=south,half=bottom,shape=outer_left,waterlogged=false]: waxed_oxidized_cut_copper_stairs[facing=south,half=bottom,shape=outer_left,waterlogged=false] + oxidized_cut_copper_stairs[facing=south,half=bottom,shape=outer_left,waterlogged=true]: waxed_oxidized_cut_copper_stairs[facing=south,half=bottom,shape=outer_left,waterlogged=true] + oxidized_cut_copper_stairs[facing=south,half=bottom,shape=outer_right,waterlogged=false]: waxed_oxidized_cut_copper_stairs[facing=south,half=bottom,shape=outer_right,waterlogged=false] + oxidized_cut_copper_stairs[facing=south,half=bottom,shape=outer_right,waterlogged=true]: waxed_oxidized_cut_copper_stairs[facing=south,half=bottom,shape=outer_right,waterlogged=true] + oxidized_cut_copper_stairs[facing=south,half=top,shape=straight,waterlogged=false]: waxed_oxidized_cut_copper_stairs[facing=south,half=top,shape=straight,waterlogged=false] + oxidized_cut_copper_stairs[facing=south,half=top,shape=straight,waterlogged=true]: waxed_oxidized_cut_copper_stairs[facing=south,half=top,shape=straight,waterlogged=true] + oxidized_cut_copper_stairs[facing=south,half=top,shape=inner_left,waterlogged=false]: waxed_oxidized_cut_copper_stairs[facing=south,half=top,shape=inner_left,waterlogged=false] + oxidized_cut_copper_stairs[facing=south,half=top,shape=inner_left,waterlogged=true]: waxed_oxidized_cut_copper_stairs[facing=south,half=top,shape=inner_left,waterlogged=true] + oxidized_cut_copper_stairs[facing=south,half=top,shape=inner_right,waterlogged=false]: waxed_oxidized_cut_copper_stairs[facing=south,half=top,shape=inner_right,waterlogged=false] + oxidized_cut_copper_stairs[facing=south,half=top,shape=inner_right,waterlogged=true]: waxed_oxidized_cut_copper_stairs[facing=south,half=top,shape=inner_right,waterlogged=true] + oxidized_cut_copper_stairs[facing=south,half=top,shape=outer_left,waterlogged=false]: waxed_oxidized_cut_copper_stairs[facing=south,half=top,shape=outer_left,waterlogged=false] + oxidized_cut_copper_stairs[facing=south,half=top,shape=outer_left,waterlogged=true]: waxed_oxidized_cut_copper_stairs[facing=south,half=top,shape=outer_left,waterlogged=true] + oxidized_cut_copper_stairs[facing=south,half=top,shape=outer_right,waterlogged=false]: waxed_oxidized_cut_copper_stairs[facing=south,half=top,shape=outer_right,waterlogged=false] + oxidized_cut_copper_stairs[facing=south,half=top,shape=outer_right,waterlogged=true]: waxed_oxidized_cut_copper_stairs[facing=south,half=top,shape=outer_right,waterlogged=true] + oxidized_cut_copper_stairs[facing=west,half=bottom,shape=straight,waterlogged=false]: waxed_oxidized_cut_copper_stairs[facing=west,half=bottom,shape=straight,waterlogged=false] + oxidized_cut_copper_stairs[facing=west,half=bottom,shape=straight,waterlogged=true]: waxed_oxidized_cut_copper_stairs[facing=west,half=bottom,shape=straight,waterlogged=true] + oxidized_cut_copper_stairs[facing=west,half=bottom,shape=inner_left,waterlogged=false]: waxed_oxidized_cut_copper_stairs[facing=west,half=bottom,shape=inner_left,waterlogged=false] + oxidized_cut_copper_stairs[facing=west,half=bottom,shape=inner_left,waterlogged=true]: waxed_oxidized_cut_copper_stairs[facing=west,half=bottom,shape=inner_left,waterlogged=true] + oxidized_cut_copper_stairs[facing=west,half=bottom,shape=inner_right,waterlogged=false]: waxed_oxidized_cut_copper_stairs[facing=west,half=bottom,shape=inner_right,waterlogged=false] + oxidized_cut_copper_stairs[facing=west,half=bottom,shape=inner_right,waterlogged=true]: waxed_oxidized_cut_copper_stairs[facing=west,half=bottom,shape=inner_right,waterlogged=true] + oxidized_cut_copper_stairs[facing=west,half=bottom,shape=outer_left,waterlogged=false]: waxed_oxidized_cut_copper_stairs[facing=west,half=bottom,shape=outer_left,waterlogged=false] + oxidized_cut_copper_stairs[facing=west,half=bottom,shape=outer_left,waterlogged=true]: waxed_oxidized_cut_copper_stairs[facing=west,half=bottom,shape=outer_left,waterlogged=true] + oxidized_cut_copper_stairs[facing=west,half=bottom,shape=outer_right,waterlogged=false]: waxed_oxidized_cut_copper_stairs[facing=west,half=bottom,shape=outer_right,waterlogged=false] + oxidized_cut_copper_stairs[facing=west,half=bottom,shape=outer_right,waterlogged=true]: waxed_oxidized_cut_copper_stairs[facing=west,half=bottom,shape=outer_right,waterlogged=true] + oxidized_cut_copper_stairs[facing=west,half=top,shape=straight,waterlogged=false]: waxed_oxidized_cut_copper_stairs[facing=west,half=top,shape=straight,waterlogged=false] + oxidized_cut_copper_stairs[facing=west,half=top,shape=straight,waterlogged=true]: waxed_oxidized_cut_copper_stairs[facing=west,half=top,shape=straight,waterlogged=true] + oxidized_cut_copper_stairs[facing=west,half=top,shape=inner_left,waterlogged=false]: waxed_oxidized_cut_copper_stairs[facing=west,half=top,shape=inner_left,waterlogged=false] + oxidized_cut_copper_stairs[facing=west,half=top,shape=inner_left,waterlogged=true]: waxed_oxidized_cut_copper_stairs[facing=west,half=top,shape=inner_left,waterlogged=true] + oxidized_cut_copper_stairs[facing=west,half=top,shape=inner_right,waterlogged=false]: waxed_oxidized_cut_copper_stairs[facing=west,half=top,shape=inner_right,waterlogged=false] + oxidized_cut_copper_stairs[facing=west,half=top,shape=inner_right,waterlogged=true]: waxed_oxidized_cut_copper_stairs[facing=west,half=top,shape=inner_right,waterlogged=true] + oxidized_cut_copper_stairs[facing=west,half=top,shape=outer_left,waterlogged=false]: waxed_oxidized_cut_copper_stairs[facing=west,half=top,shape=outer_left,waterlogged=false] + oxidized_cut_copper_stairs[facing=west,half=top,shape=outer_left,waterlogged=true]: waxed_oxidized_cut_copper_stairs[facing=west,half=top,shape=outer_left,waterlogged=true] + oxidized_cut_copper_stairs[facing=west,half=top,shape=outer_right,waterlogged=false]: waxed_oxidized_cut_copper_stairs[facing=west,half=top,shape=outer_right,waterlogged=false] + oxidized_cut_copper_stairs[facing=west,half=top,shape=outer_right,waterlogged=true]: waxed_oxidized_cut_copper_stairs[facing=west,half=top,shape=outer_right,waterlogged=true] + oxidized_cut_copper_stairs[facing=north,half=bottom,shape=straight,waterlogged=false]: waxed_oxidized_cut_copper_stairs[facing=north,half=bottom,shape=straight,waterlogged=false] + oxidized_cut_copper_stairs[facing=north,half=bottom,shape=straight,waterlogged=true]: waxed_oxidized_cut_copper_stairs[facing=north,half=bottom,shape=straight,waterlogged=true] + oxidized_cut_copper_stairs[facing=north,half=bottom,shape=inner_left,waterlogged=false]: waxed_oxidized_cut_copper_stairs[facing=north,half=bottom,shape=inner_left,waterlogged=false] + oxidized_cut_copper_stairs[facing=north,half=bottom,shape=inner_left,waterlogged=true]: waxed_oxidized_cut_copper_stairs[facing=north,half=bottom,shape=inner_left,waterlogged=true] + oxidized_cut_copper_stairs[facing=north,half=bottom,shape=inner_right,waterlogged=false]: waxed_oxidized_cut_copper_stairs[facing=north,half=bottom,shape=inner_right,waterlogged=false] + oxidized_cut_copper_stairs[facing=north,half=bottom,shape=inner_right,waterlogged=true]: waxed_oxidized_cut_copper_stairs[facing=north,half=bottom,shape=inner_right,waterlogged=true] + oxidized_cut_copper_stairs[facing=north,half=bottom,shape=outer_left,waterlogged=false]: waxed_oxidized_cut_copper_stairs[facing=north,half=bottom,shape=outer_left,waterlogged=false] + oxidized_cut_copper_stairs[facing=north,half=bottom,shape=outer_left,waterlogged=true]: waxed_oxidized_cut_copper_stairs[facing=north,half=bottom,shape=outer_left,waterlogged=true] + oxidized_cut_copper_stairs[facing=north,half=bottom,shape=outer_right,waterlogged=false]: waxed_oxidized_cut_copper_stairs[facing=north,half=bottom,shape=outer_right,waterlogged=false] + oxidized_cut_copper_stairs[facing=north,half=bottom,shape=outer_right,waterlogged=true]: waxed_oxidized_cut_copper_stairs[facing=north,half=bottom,shape=outer_right,waterlogged=true] + oxidized_cut_copper_stairs[facing=north,half=top,shape=straight,waterlogged=false]: waxed_oxidized_cut_copper_stairs[facing=north,half=top,shape=straight,waterlogged=false] + oxidized_cut_copper_stairs[facing=north,half=top,shape=straight,waterlogged=true]: waxed_oxidized_cut_copper_stairs[facing=north,half=top,shape=straight,waterlogged=true] + oxidized_cut_copper_stairs[facing=north,half=top,shape=inner_left,waterlogged=false]: waxed_oxidized_cut_copper_stairs[facing=north,half=top,shape=inner_left,waterlogged=false] + oxidized_cut_copper_stairs[facing=north,half=top,shape=inner_left,waterlogged=true]: waxed_oxidized_cut_copper_stairs[facing=north,half=top,shape=inner_left,waterlogged=true] + oxidized_cut_copper_stairs[facing=north,half=top,shape=inner_right,waterlogged=false]: waxed_oxidized_cut_copper_stairs[facing=north,half=top,shape=inner_right,waterlogged=false] + oxidized_cut_copper_stairs[facing=north,half=top,shape=inner_right,waterlogged=true]: waxed_oxidized_cut_copper_stairs[facing=north,half=top,shape=inner_right,waterlogged=true] + oxidized_cut_copper_stairs[facing=north,half=top,shape=outer_left,waterlogged=false]: waxed_oxidized_cut_copper_stairs[facing=north,half=top,shape=outer_left,waterlogged=false] + oxidized_cut_copper_stairs[facing=north,half=top,shape=outer_left,waterlogged=true]: waxed_oxidized_cut_copper_stairs[facing=north,half=top,shape=outer_left,waterlogged=true] + oxidized_cut_copper_stairs[facing=north,half=top,shape=outer_right,waterlogged=false]: waxed_oxidized_cut_copper_stairs[facing=north,half=top,shape=outer_right,waterlogged=false] + oxidized_cut_copper_stairs[facing=north,half=top,shape=outer_right,waterlogged=true]: waxed_oxidized_cut_copper_stairs[facing=north,half=top,shape=outer_right,waterlogged=true] + + #### Grate #### + # Suitable for making glass because it is completely transparent + $$>=1.20.3#grate: + copper_grate[waterlogged=false]: waxed_copper_grate[waterlogged=false] + copper_grate[waterlogged=true]: waxed_copper_grate[waterlogged=true] + weathered_copper_grate[waterlogged=false]: waxed_weathered_copper_grate[waterlogged=false] + weathered_copper_grate[waterlogged=true]: waxed_weathered_copper_grate[waterlogged=true] + exposed_copper_grate[waterlogged=false]: waxed_exposed_copper_grate[waterlogged=false] + exposed_copper_grate[waterlogged=true]: waxed_exposed_copper_grate[waterlogged=true] + oxidized_copper_grate[waterlogged=false]: waxed_oxidized_copper_grate[waterlogged=false] + oxidized_copper_grate[waterlogged=true]: waxed_oxidized_copper_grate[waterlogged=true] + + #### Pressure Plate #### + # Triggered pressure plates appear identical, even though they output different signal strengths. + light_weighted_pressure_plate[power=2]: light_weighted_pressure_plate[power=1] + light_weighted_pressure_plate[power=3]: light_weighted_pressure_plate[power=1] + light_weighted_pressure_plate[power=4]: light_weighted_pressure_plate[power=1] + light_weighted_pressure_plate[power=5]: light_weighted_pressure_plate[power=1] + light_weighted_pressure_plate[power=6]: light_weighted_pressure_plate[power=1] + light_weighted_pressure_plate[power=7]: light_weighted_pressure_plate[power=1] + light_weighted_pressure_plate[power=8]: light_weighted_pressure_plate[power=1] + light_weighted_pressure_plate[power=9]: light_weighted_pressure_plate[power=1] + light_weighted_pressure_plate[power=10]: light_weighted_pressure_plate[power=1] + light_weighted_pressure_plate[power=11]: light_weighted_pressure_plate[power=1] + light_weighted_pressure_plate[power=12]: light_weighted_pressure_plate[power=1] + light_weighted_pressure_plate[power=13]: light_weighted_pressure_plate[power=1] + light_weighted_pressure_plate[power=14]: light_weighted_pressure_plate[power=1] + light_weighted_pressure_plate[power=15]: light_weighted_pressure_plate[power=1] + heavy_weighted_pressure_plate[power=2]: heavy_weighted_pressure_plate[power=1] + heavy_weighted_pressure_plate[power=3]: heavy_weighted_pressure_plate[power=1] + heavy_weighted_pressure_plate[power=4]: heavy_weighted_pressure_plate[power=1] + heavy_weighted_pressure_plate[power=5]: heavy_weighted_pressure_plate[power=1] + heavy_weighted_pressure_plate[power=6]: heavy_weighted_pressure_plate[power=1] + heavy_weighted_pressure_plate[power=7]: heavy_weighted_pressure_plate[power=1] + heavy_weighted_pressure_plate[power=8]: heavy_weighted_pressure_plate[power=1] + heavy_weighted_pressure_plate[power=9]: heavy_weighted_pressure_plate[power=1] + heavy_weighted_pressure_plate[power=10]: heavy_weighted_pressure_plate[power=1] + heavy_weighted_pressure_plate[power=11]: heavy_weighted_pressure_plate[power=1] + heavy_weighted_pressure_plate[power=12]: heavy_weighted_pressure_plate[power=1] + heavy_weighted_pressure_plate[power=13]: heavy_weighted_pressure_plate[power=1] + heavy_weighted_pressure_plate[power=14]: heavy_weighted_pressure_plate[power=1] + heavy_weighted_pressure_plate[power=15]: heavy_weighted_pressure_plate[power=1] + + #### Lightning Rod #### + $$>=1.21.9#lightning_rod: + exposed_lightning_rod[facing=down,powered=false,waterlogged=false]: waxed_exposed_lightning_rod[facing=down,powered=false,waterlogged=false] + exposed_lightning_rod[facing=down,powered=false,waterlogged=true]: waxed_exposed_lightning_rod[facing=down,powered=false,waterlogged=true] + exposed_lightning_rod[facing=down,powered=true,waterlogged=false]: waxed_exposed_lightning_rod[facing=down,powered=true,waterlogged=false] + exposed_lightning_rod[facing=down,powered=true,waterlogged=true]: waxed_exposed_lightning_rod[facing=down,powered=true,waterlogged=true] + exposed_lightning_rod[facing=east,powered=false,waterlogged=false]: waxed_exposed_lightning_rod[facing=east,powered=false,waterlogged=false] + exposed_lightning_rod[facing=east,powered=false,waterlogged=true]: waxed_exposed_lightning_rod[facing=east,powered=false,waterlogged=true] + exposed_lightning_rod[facing=east,powered=true,waterlogged=false]: waxed_exposed_lightning_rod[facing=east,powered=true,waterlogged=false] + exposed_lightning_rod[facing=east,powered=true,waterlogged=true]: waxed_exposed_lightning_rod[facing=east,powered=true,waterlogged=true] + exposed_lightning_rod[facing=north,powered=false,waterlogged=false]: waxed_exposed_lightning_rod[facing=north,powered=false,waterlogged=false] + exposed_lightning_rod[facing=north,powered=false,waterlogged=true]: waxed_exposed_lightning_rod[facing=north,powered=false,waterlogged=true] + exposed_lightning_rod[facing=north,powered=true,waterlogged=false]: waxed_exposed_lightning_rod[facing=north,powered=true,waterlogged=false] + exposed_lightning_rod[facing=north,powered=true,waterlogged=true]: waxed_exposed_lightning_rod[facing=north,powered=true,waterlogged=true] + exposed_lightning_rod[facing=south,powered=false,waterlogged=false]: waxed_exposed_lightning_rod[facing=south,powered=false,waterlogged=false] + exposed_lightning_rod[facing=south,powered=false,waterlogged=true]: waxed_exposed_lightning_rod[facing=south,powered=false,waterlogged=true] + exposed_lightning_rod[facing=south,powered=true,waterlogged=false]: waxed_exposed_lightning_rod[facing=south,powered=true,waterlogged=false] + exposed_lightning_rod[facing=south,powered=true,waterlogged=true]: waxed_exposed_lightning_rod[facing=south,powered=true,waterlogged=true] + exposed_lightning_rod[facing=up,powered=false,waterlogged=false]: waxed_exposed_lightning_rod[facing=up,powered=false,waterlogged=false] + exposed_lightning_rod[facing=up,powered=false,waterlogged=true]: waxed_exposed_lightning_rod[facing=up,powered=false,waterlogged=true] + exposed_lightning_rod[facing=up,powered=true,waterlogged=false]: waxed_exposed_lightning_rod[facing=up,powered=true,waterlogged=false] + exposed_lightning_rod[facing=up,powered=true,waterlogged=true]: waxed_exposed_lightning_rod[facing=up,powered=true,waterlogged=true] + exposed_lightning_rod[facing=west,powered=false,waterlogged=false]: waxed_exposed_lightning_rod[facing=west,powered=false,waterlogged=false] + exposed_lightning_rod[facing=west,powered=false,waterlogged=true]: waxed_exposed_lightning_rod[facing=west,powered=false,waterlogged=true] + exposed_lightning_rod[facing=west,powered=true,waterlogged=false]: waxed_exposed_lightning_rod[facing=west,powered=true,waterlogged=false] + exposed_lightning_rod[facing=west,powered=true,waterlogged=true]: waxed_exposed_lightning_rod[facing=west,powered=true,waterlogged=true] + lightning_rod[facing=down,powered=false,waterlogged=false]: waxed_lightning_rod[facing=down,powered=false,waterlogged=false] + lightning_rod[facing=down,powered=false,waterlogged=true]: waxed_lightning_rod[facing=down,powered=false,waterlogged=true] + lightning_rod[facing=down,powered=true,waterlogged=false]: waxed_lightning_rod[facing=down,powered=true,waterlogged=false] + lightning_rod[facing=down,powered=true,waterlogged=true]: waxed_lightning_rod[facing=down,powered=true,waterlogged=true] + lightning_rod[facing=east,powered=false,waterlogged=false]: waxed_lightning_rod[facing=east,powered=false,waterlogged=false] + lightning_rod[facing=east,powered=false,waterlogged=true]: waxed_lightning_rod[facing=east,powered=false,waterlogged=true] + lightning_rod[facing=east,powered=true,waterlogged=false]: waxed_lightning_rod[facing=east,powered=true,waterlogged=false] + lightning_rod[facing=east,powered=true,waterlogged=true]: waxed_lightning_rod[facing=east,powered=true,waterlogged=true] + lightning_rod[facing=north,powered=false,waterlogged=false]: waxed_lightning_rod[facing=north,powered=false,waterlogged=false] + lightning_rod[facing=north,powered=false,waterlogged=true]: waxed_lightning_rod[facing=north,powered=false,waterlogged=true] + lightning_rod[facing=north,powered=true,waterlogged=false]: waxed_lightning_rod[facing=north,powered=true,waterlogged=false] + lightning_rod[facing=north,powered=true,waterlogged=true]: waxed_lightning_rod[facing=north,powered=true,waterlogged=true] + lightning_rod[facing=south,powered=false,waterlogged=false]: waxed_lightning_rod[facing=south,powered=false,waterlogged=false] + lightning_rod[facing=south,powered=false,waterlogged=true]: waxed_lightning_rod[facing=south,powered=false,waterlogged=true] + lightning_rod[facing=south,powered=true,waterlogged=false]: waxed_lightning_rod[facing=south,powered=true,waterlogged=false] + lightning_rod[facing=south,powered=true,waterlogged=true]: waxed_lightning_rod[facing=south,powered=true,waterlogged=true] + lightning_rod[facing=up,powered=false,waterlogged=false]: waxed_lightning_rod[facing=up,powered=false,waterlogged=false] + lightning_rod[facing=up,powered=false,waterlogged=true]: waxed_lightning_rod[facing=up,powered=false,waterlogged=true] + lightning_rod[facing=up,powered=true,waterlogged=false]: waxed_lightning_rod[facing=up,powered=true,waterlogged=false] + lightning_rod[facing=up,powered=true,waterlogged=true]: waxed_lightning_rod[facing=up,powered=true,waterlogged=true] + lightning_rod[facing=west,powered=false,waterlogged=false]: waxed_lightning_rod[facing=west,powered=false,waterlogged=false] + lightning_rod[facing=west,powered=false,waterlogged=true]: waxed_lightning_rod[facing=west,powered=false,waterlogged=true] + lightning_rod[facing=west,powered=true,waterlogged=false]: waxed_lightning_rod[facing=west,powered=true,waterlogged=false] + lightning_rod[facing=west,powered=true,waterlogged=true]: waxed_lightning_rod[facing=west,powered=true,waterlogged=true] + oxidized_lightning_rod[facing=down,powered=false,waterlogged=false]: waxed_oxidized_lightning_rod[facing=down,powered=false,waterlogged=false] + oxidized_lightning_rod[facing=down,powered=false,waterlogged=true]: waxed_oxidized_lightning_rod[facing=down,powered=false,waterlogged=true] + oxidized_lightning_rod[facing=down,powered=true,waterlogged=false]: waxed_oxidized_lightning_rod[facing=down,powered=true,waterlogged=false] + oxidized_lightning_rod[facing=down,powered=true,waterlogged=true]: waxed_oxidized_lightning_rod[facing=down,powered=true,waterlogged=true] + oxidized_lightning_rod[facing=east,powered=false,waterlogged=false]: waxed_oxidized_lightning_rod[facing=east,powered=false,waterlogged=false] + oxidized_lightning_rod[facing=east,powered=false,waterlogged=true]: waxed_oxidized_lightning_rod[facing=east,powered=false,waterlogged=true] + oxidized_lightning_rod[facing=east,powered=true,waterlogged=false]: waxed_oxidized_lightning_rod[facing=east,powered=true,waterlogged=false] + oxidized_lightning_rod[facing=east,powered=true,waterlogged=true]: waxed_oxidized_lightning_rod[facing=east,powered=true,waterlogged=true] + oxidized_lightning_rod[facing=north,powered=false,waterlogged=false]: waxed_oxidized_lightning_rod[facing=north,powered=false,waterlogged=false] + oxidized_lightning_rod[facing=north,powered=false,waterlogged=true]: waxed_oxidized_lightning_rod[facing=north,powered=false,waterlogged=true] + oxidized_lightning_rod[facing=north,powered=true,waterlogged=false]: waxed_oxidized_lightning_rod[facing=north,powered=true,waterlogged=false] + oxidized_lightning_rod[facing=north,powered=true,waterlogged=true]: waxed_oxidized_lightning_rod[facing=north,powered=true,waterlogged=true] + oxidized_lightning_rod[facing=south,powered=false,waterlogged=false]: waxed_oxidized_lightning_rod[facing=south,powered=false,waterlogged=false] + oxidized_lightning_rod[facing=south,powered=false,waterlogged=true]: waxed_oxidized_lightning_rod[facing=south,powered=false,waterlogged=true] + oxidized_lightning_rod[facing=south,powered=true,waterlogged=false]: waxed_oxidized_lightning_rod[facing=south,powered=true,waterlogged=false] + oxidized_lightning_rod[facing=south,powered=true,waterlogged=true]: waxed_oxidized_lightning_rod[facing=south,powered=true,waterlogged=true] + oxidized_lightning_rod[facing=up,powered=false,waterlogged=false]: waxed_oxidized_lightning_rod[facing=up,powered=false,waterlogged=false] + oxidized_lightning_rod[facing=up,powered=false,waterlogged=true]: waxed_oxidized_lightning_rod[facing=up,powered=false,waterlogged=true] + oxidized_lightning_rod[facing=up,powered=true,waterlogged=false]: waxed_oxidized_lightning_rod[facing=up,powered=true,waterlogged=false] + oxidized_lightning_rod[facing=up,powered=true,waterlogged=true]: waxed_oxidized_lightning_rod[facing=up,powered=true,waterlogged=true] + oxidized_lightning_rod[facing=west,powered=false,waterlogged=false]: waxed_oxidized_lightning_rod[facing=west,powered=false,waterlogged=false] + oxidized_lightning_rod[facing=west,powered=false,waterlogged=true]: waxed_oxidized_lightning_rod[facing=west,powered=false,waterlogged=true] + oxidized_lightning_rod[facing=west,powered=true,waterlogged=false]: waxed_oxidized_lightning_rod[facing=west,powered=true,waterlogged=false] + oxidized_lightning_rod[facing=west,powered=true,waterlogged=true]: waxed_oxidized_lightning_rod[facing=west,powered=true,waterlogged=true] + weathered_lightning_rod[facing=down,powered=false,waterlogged=false]: waxed_weathered_lightning_rod[facing=down,powered=false,waterlogged=false] + weathered_lightning_rod[facing=down,powered=false,waterlogged=true]: waxed_weathered_lightning_rod[facing=down,powered=false,waterlogged=true] + weathered_lightning_rod[facing=down,powered=true,waterlogged=false]: waxed_weathered_lightning_rod[facing=down,powered=true,waterlogged=false] + weathered_lightning_rod[facing=down,powered=true,waterlogged=true]: waxed_weathered_lightning_rod[facing=down,powered=true,waterlogged=true] + weathered_lightning_rod[facing=east,powered=false,waterlogged=false]: waxed_weathered_lightning_rod[facing=east,powered=false,waterlogged=false] + weathered_lightning_rod[facing=east,powered=false,waterlogged=true]: waxed_weathered_lightning_rod[facing=east,powered=false,waterlogged=true] + weathered_lightning_rod[facing=east,powered=true,waterlogged=false]: waxed_weathered_lightning_rod[facing=east,powered=true,waterlogged=false] + weathered_lightning_rod[facing=east,powered=true,waterlogged=true]: waxed_weathered_lightning_rod[facing=east,powered=true,waterlogged=true] + weathered_lightning_rod[facing=north,powered=false,waterlogged=false]: waxed_weathered_lightning_rod[facing=north,powered=false,waterlogged=false] + weathered_lightning_rod[facing=north,powered=false,waterlogged=true]: waxed_weathered_lightning_rod[facing=north,powered=false,waterlogged=true] + weathered_lightning_rod[facing=north,powered=true,waterlogged=false]: waxed_weathered_lightning_rod[facing=north,powered=true,waterlogged=false] + weathered_lightning_rod[facing=north,powered=true,waterlogged=true]: waxed_weathered_lightning_rod[facing=north,powered=true,waterlogged=true] + weathered_lightning_rod[facing=south,powered=false,waterlogged=false]: waxed_weathered_lightning_rod[facing=south,powered=false,waterlogged=false] + weathered_lightning_rod[facing=south,powered=false,waterlogged=true]: waxed_weathered_lightning_rod[facing=south,powered=false,waterlogged=true] + weathered_lightning_rod[facing=south,powered=true,waterlogged=false]: waxed_weathered_lightning_rod[facing=south,powered=true,waterlogged=false] + weathered_lightning_rod[facing=south,powered=true,waterlogged=true]: waxed_weathered_lightning_rod[facing=south,powered=true,waterlogged=true] + weathered_lightning_rod[facing=up,powered=false,waterlogged=false]: waxed_weathered_lightning_rod[facing=up,powered=false,waterlogged=false] + weathered_lightning_rod[facing=up,powered=false,waterlogged=true]: waxed_weathered_lightning_rod[facing=up,powered=false,waterlogged=true] + weathered_lightning_rod[facing=up,powered=true,waterlogged=false]: waxed_weathered_lightning_rod[facing=up,powered=true,waterlogged=false] + weathered_lightning_rod[facing=up,powered=true,waterlogged=true]: waxed_weathered_lightning_rod[facing=up,powered=true,waterlogged=true] + weathered_lightning_rod[facing=west,powered=false,waterlogged=false]: waxed_weathered_lightning_rod[facing=west,powered=false,waterlogged=false] + weathered_lightning_rod[facing=west,powered=false,waterlogged=true]: waxed_weathered_lightning_rod[facing=west,powered=false,waterlogged=true] + weathered_lightning_rod[facing=west,powered=true,waterlogged=false]: waxed_weathered_lightning_rod[facing=west,powered=true,waterlogged=false] + weathered_lightning_rod[facing=west,powered=true,waterlogged=true]: waxed_weathered_lightning_rod[facing=west,powered=true,waterlogged=true] + + #### Copper Bars #### + $$>=1.21.9#copper_bars: + copper_bars[east=false,north=false,south=false,west=false,waterlogged=false]: waxed_copper_bars[east=false,north=false,south=false,west=false,waterlogged=false] + copper_bars[east=false,north=false,south=false,west=false,waterlogged=true]: waxed_copper_bars[east=false,north=false,south=false,west=false,waterlogged=true] + copper_bars[east=false,north=false,south=false,west=true,waterlogged=false]: waxed_copper_bars[east=false,north=false,south=false,west=true,waterlogged=false] + copper_bars[east=false,north=false,south=false,west=true,waterlogged=true]: waxed_copper_bars[east=false,north=false,south=false,west=true,waterlogged=true] + copper_bars[east=false,north=false,south=true,west=false,waterlogged=false]: waxed_copper_bars[east=false,north=false,south=true,west=false,waterlogged=false] + copper_bars[east=false,north=false,south=true,west=false,waterlogged=true]: waxed_copper_bars[east=false,north=false,south=true,west=false,waterlogged=true] + copper_bars[east=false,north=false,south=true,west=true,waterlogged=false]: waxed_copper_bars[east=false,north=false,south=true,west=true,waterlogged=false] + copper_bars[east=false,north=false,south=true,west=true,waterlogged=true]: waxed_copper_bars[east=false,north=false,south=true,west=true,waterlogged=true] + copper_bars[east=false,north=true,south=false,west=false,waterlogged=false]: waxed_copper_bars[east=false,north=true,south=false,west=false,waterlogged=false] + copper_bars[east=false,north=true,south=false,west=false,waterlogged=true]: waxed_copper_bars[east=false,north=true,south=false,west=false,waterlogged=true] + copper_bars[east=false,north=true,south=false,west=true,waterlogged=false]: waxed_copper_bars[east=false,north=true,south=false,west=true,waterlogged=false] + copper_bars[east=false,north=true,south=false,west=true,waterlogged=true]: waxed_copper_bars[east=false,north=true,south=false,west=true,waterlogged=true] + copper_bars[east=false,north=true,south=true,west=false,waterlogged=false]: waxed_copper_bars[east=false,north=true,south=true,west=false,waterlogged=false] + copper_bars[east=false,north=true,south=true,west=false,waterlogged=true]: waxed_copper_bars[east=false,north=true,south=true,west=false,waterlogged=true] + copper_bars[east=false,north=true,south=true,west=true,waterlogged=false]: waxed_copper_bars[east=false,north=true,south=true,west=true,waterlogged=false] + copper_bars[east=false,north=true,south=true,west=true,waterlogged=true]: waxed_copper_bars[east=false,north=true,south=true,west=true,waterlogged=true] + copper_bars[east=true,north=false,south=false,west=false,waterlogged=false]: waxed_copper_bars[east=true,north=false,south=false,west=false,waterlogged=false] + copper_bars[east=true,north=false,south=false,west=false,waterlogged=true]: waxed_copper_bars[east=true,north=false,south=false,west=false,waterlogged=true] + copper_bars[east=true,north=false,south=false,west=true,waterlogged=false]: waxed_copper_bars[east=true,north=false,south=false,west=true,waterlogged=false] + copper_bars[east=true,north=false,south=false,west=true,waterlogged=true]: waxed_copper_bars[east=true,north=false,south=false,west=true,waterlogged=true] + copper_bars[east=true,north=false,south=true,west=false,waterlogged=false]: waxed_copper_bars[east=true,north=false,south=true,west=false,waterlogged=false] + copper_bars[east=true,north=false,south=true,west=false,waterlogged=true]: waxed_copper_bars[east=true,north=false,south=true,west=false,waterlogged=true] + copper_bars[east=true,north=false,south=true,west=true,waterlogged=false]: waxed_copper_bars[east=true,north=false,south=true,west=true,waterlogged=false] + copper_bars[east=true,north=false,south=true,west=true,waterlogged=true]: waxed_copper_bars[east=true,north=false,south=true,west=true,waterlogged=true] + copper_bars[east=true,north=true,south=false,west=false,waterlogged=false]: waxed_copper_bars[east=true,north=true,south=false,west=false,waterlogged=false] + copper_bars[east=true,north=true,south=false,west=false,waterlogged=true]: waxed_copper_bars[east=true,north=true,south=false,west=false,waterlogged=true] + copper_bars[east=true,north=true,south=false,west=true,waterlogged=false]: waxed_copper_bars[east=true,north=true,south=false,west=true,waterlogged=false] + copper_bars[east=true,north=true,south=false,west=true,waterlogged=true]: waxed_copper_bars[east=true,north=true,south=false,west=true,waterlogged=true] + copper_bars[east=true,north=true,south=true,west=false,waterlogged=false]: waxed_copper_bars[east=true,north=true,south=true,west=false,waterlogged=false] + copper_bars[east=true,north=true,south=true,west=false,waterlogged=true]: waxed_copper_bars[east=true,north=true,south=true,west=false,waterlogged=true] + copper_bars[east=true,north=true,south=true,west=true,waterlogged=false]: waxed_copper_bars[east=true,north=true,south=true,west=true,waterlogged=false] + copper_bars[east=true,north=true,south=true,west=true,waterlogged=true]: waxed_copper_bars[east=true,north=true,south=true,west=true,waterlogged=true] + exposed_copper_bars[east=false,north=false,south=false,west=false,waterlogged=false]: waxed_exposed_copper_bars[east=false,north=false,south=false,west=false,waterlogged=false] + exposed_copper_bars[east=false,north=false,south=false,west=false,waterlogged=true]: waxed_exposed_copper_bars[east=false,north=false,south=false,west=false,waterlogged=true] + exposed_copper_bars[east=false,north=false,south=false,west=true,waterlogged=false]: waxed_exposed_copper_bars[east=false,north=false,south=false,west=true,waterlogged=false] + exposed_copper_bars[east=false,north=false,south=false,west=true,waterlogged=true]: waxed_exposed_copper_bars[east=false,north=false,south=false,west=true,waterlogged=true] + exposed_copper_bars[east=false,north=false,south=true,west=false,waterlogged=false]: waxed_exposed_copper_bars[east=false,north=false,south=true,west=false,waterlogged=false] + exposed_copper_bars[east=false,north=false,south=true,west=false,waterlogged=true]: waxed_exposed_copper_bars[east=false,north=false,south=true,west=false,waterlogged=true] + exposed_copper_bars[east=false,north=false,south=true,west=true,waterlogged=false]: waxed_exposed_copper_bars[east=false,north=false,south=true,west=true,waterlogged=false] + exposed_copper_bars[east=false,north=false,south=true,west=true,waterlogged=true]: waxed_exposed_copper_bars[east=false,north=false,south=true,west=true,waterlogged=true] + exposed_copper_bars[east=false,north=true,south=false,west=false,waterlogged=false]: waxed_exposed_copper_bars[east=false,north=true,south=false,west=false,waterlogged=false] + exposed_copper_bars[east=false,north=true,south=false,west=false,waterlogged=true]: waxed_exposed_copper_bars[east=false,north=true,south=false,west=false,waterlogged=true] + exposed_copper_bars[east=false,north=true,south=false,west=true,waterlogged=false]: waxed_exposed_copper_bars[east=false,north=true,south=false,west=true,waterlogged=false] + exposed_copper_bars[east=false,north=true,south=false,west=true,waterlogged=true]: waxed_exposed_copper_bars[east=false,north=true,south=false,west=true,waterlogged=true] + exposed_copper_bars[east=false,north=true,south=true,west=false,waterlogged=false]: waxed_exposed_copper_bars[east=false,north=true,south=true,west=false,waterlogged=false] + exposed_copper_bars[east=false,north=true,south=true,west=false,waterlogged=true]: waxed_exposed_copper_bars[east=false,north=true,south=true,west=false,waterlogged=true] + exposed_copper_bars[east=false,north=true,south=true,west=true,waterlogged=false]: waxed_exposed_copper_bars[east=false,north=true,south=true,west=true,waterlogged=false] + exposed_copper_bars[east=false,north=true,south=true,west=true,waterlogged=true]: waxed_exposed_copper_bars[east=false,north=true,south=true,west=true,waterlogged=true] + exposed_copper_bars[east=true,north=false,south=false,west=false,waterlogged=false]: waxed_exposed_copper_bars[east=true,north=false,south=false,west=false,waterlogged=false] + exposed_copper_bars[east=true,north=false,south=false,west=false,waterlogged=true]: waxed_exposed_copper_bars[east=true,north=false,south=false,west=false,waterlogged=true] + exposed_copper_bars[east=true,north=false,south=false,west=true,waterlogged=false]: waxed_exposed_copper_bars[east=true,north=false,south=false,west=true,waterlogged=false] + exposed_copper_bars[east=true,north=false,south=false,west=true,waterlogged=true]: waxed_exposed_copper_bars[east=true,north=false,south=false,west=true,waterlogged=true] + exposed_copper_bars[east=true,north=false,south=true,west=false,waterlogged=false]: waxed_exposed_copper_bars[east=true,north=false,south=true,west=false,waterlogged=false] + exposed_copper_bars[east=true,north=false,south=true,west=false,waterlogged=true]: waxed_exposed_copper_bars[east=true,north=false,south=true,west=false,waterlogged=true] + exposed_copper_bars[east=true,north=false,south=true,west=true,waterlogged=false]: waxed_exposed_copper_bars[east=true,north=false,south=true,west=true,waterlogged=false] + exposed_copper_bars[east=true,north=false,south=true,west=true,waterlogged=true]: waxed_exposed_copper_bars[east=true,north=false,south=true,west=true,waterlogged=true] + exposed_copper_bars[east=true,north=true,south=false,west=false,waterlogged=false]: waxed_exposed_copper_bars[east=true,north=true,south=false,west=false,waterlogged=false] + exposed_copper_bars[east=true,north=true,south=false,west=false,waterlogged=true]: waxed_exposed_copper_bars[east=true,north=true,south=false,west=false,waterlogged=true] + exposed_copper_bars[east=true,north=true,south=false,west=true,waterlogged=false]: waxed_exposed_copper_bars[east=true,north=true,south=false,west=true,waterlogged=false] + exposed_copper_bars[east=true,north=true,south=false,west=true,waterlogged=true]: waxed_exposed_copper_bars[east=true,north=true,south=false,west=true,waterlogged=true] + exposed_copper_bars[east=true,north=true,south=true,west=false,waterlogged=false]: waxed_exposed_copper_bars[east=true,north=true,south=true,west=false,waterlogged=false] + exposed_copper_bars[east=true,north=true,south=true,west=false,waterlogged=true]: waxed_exposed_copper_bars[east=true,north=true,south=true,west=false,waterlogged=true] + exposed_copper_bars[east=true,north=true,south=true,west=true,waterlogged=false]: waxed_exposed_copper_bars[east=true,north=true,south=true,west=true,waterlogged=false] + exposed_copper_bars[east=true,north=true,south=true,west=true,waterlogged=true]: waxed_exposed_copper_bars[east=true,north=true,south=true,west=true,waterlogged=true] + oxidized_copper_bars[east=false,north=false,south=false,west=false,waterlogged=false]: waxed_oxidized_copper_bars[east=false,north=false,south=false,west=false,waterlogged=false] + oxidized_copper_bars[east=false,north=false,south=false,west=false,waterlogged=true]: waxed_oxidized_copper_bars[east=false,north=false,south=false,west=false,waterlogged=true] + oxidized_copper_bars[east=false,north=false,south=false,west=true,waterlogged=false]: waxed_oxidized_copper_bars[east=false,north=false,south=false,west=true,waterlogged=false] + oxidized_copper_bars[east=false,north=false,south=false,west=true,waterlogged=true]: waxed_oxidized_copper_bars[east=false,north=false,south=false,west=true,waterlogged=true] + oxidized_copper_bars[east=false,north=false,south=true,west=false,waterlogged=false]: waxed_oxidized_copper_bars[east=false,north=false,south=true,west=false,waterlogged=false] + oxidized_copper_bars[east=false,north=false,south=true,west=false,waterlogged=true]: waxed_oxidized_copper_bars[east=false,north=false,south=true,west=false,waterlogged=true] + oxidized_copper_bars[east=false,north=false,south=true,west=true,waterlogged=false]: waxed_oxidized_copper_bars[east=false,north=false,south=true,west=true,waterlogged=false] + oxidized_copper_bars[east=false,north=false,south=true,west=true,waterlogged=true]: waxed_oxidized_copper_bars[east=false,north=false,south=true,west=true,waterlogged=true] + oxidized_copper_bars[east=false,north=true,south=false,west=false,waterlogged=false]: waxed_oxidized_copper_bars[east=false,north=true,south=false,west=false,waterlogged=false] + oxidized_copper_bars[east=false,north=true,south=false,west=false,waterlogged=true]: waxed_oxidized_copper_bars[east=false,north=true,south=false,west=false,waterlogged=true] + oxidized_copper_bars[east=false,north=true,south=false,west=true,waterlogged=false]: waxed_oxidized_copper_bars[east=false,north=true,south=false,west=true,waterlogged=false] + oxidized_copper_bars[east=false,north=true,south=false,west=true,waterlogged=true]: waxed_oxidized_copper_bars[east=false,north=true,south=false,west=true,waterlogged=true] + oxidized_copper_bars[east=false,north=true,south=true,west=false,waterlogged=false]: waxed_oxidized_copper_bars[east=false,north=true,south=true,west=false,waterlogged=false] + oxidized_copper_bars[east=false,north=true,south=true,west=false,waterlogged=true]: waxed_oxidized_copper_bars[east=false,north=true,south=true,west=false,waterlogged=true] + oxidized_copper_bars[east=false,north=true,south=true,west=true,waterlogged=false]: waxed_oxidized_copper_bars[east=false,north=true,south=true,west=true,waterlogged=false] + oxidized_copper_bars[east=false,north=true,south=true,west=true,waterlogged=true]: waxed_oxidized_copper_bars[east=false,north=true,south=true,west=true,waterlogged=true] + oxidized_copper_bars[east=true,north=false,south=false,west=false,waterlogged=false]: waxed_oxidized_copper_bars[east=true,north=false,south=false,west=false,waterlogged=false] + oxidized_copper_bars[east=true,north=false,south=false,west=false,waterlogged=true]: waxed_oxidized_copper_bars[east=true,north=false,south=false,west=false,waterlogged=true] + oxidized_copper_bars[east=true,north=false,south=false,west=true,waterlogged=false]: waxed_oxidized_copper_bars[east=true,north=false,south=false,west=true,waterlogged=false] + oxidized_copper_bars[east=true,north=false,south=false,west=true,waterlogged=true]: waxed_oxidized_copper_bars[east=true,north=false,south=false,west=true,waterlogged=true] + oxidized_copper_bars[east=true,north=false,south=true,west=false,waterlogged=false]: waxed_oxidized_copper_bars[east=true,north=false,south=true,west=false,waterlogged=false] + oxidized_copper_bars[east=true,north=false,south=true,west=false,waterlogged=true]: waxed_oxidized_copper_bars[east=true,north=false,south=true,west=false,waterlogged=true] + oxidized_copper_bars[east=true,north=false,south=true,west=true,waterlogged=false]: waxed_oxidized_copper_bars[east=true,north=false,south=true,west=true,waterlogged=false] + oxidized_copper_bars[east=true,north=false,south=true,west=true,waterlogged=true]: waxed_oxidized_copper_bars[east=true,north=false,south=true,west=true,waterlogged=true] + oxidized_copper_bars[east=true,north=true,south=false,west=false,waterlogged=false]: waxed_oxidized_copper_bars[east=true,north=true,south=false,west=false,waterlogged=false] + oxidized_copper_bars[east=true,north=true,south=false,west=false,waterlogged=true]: waxed_oxidized_copper_bars[east=true,north=true,south=false,west=false,waterlogged=true] + oxidized_copper_bars[east=true,north=true,south=false,west=true,waterlogged=false]: waxed_oxidized_copper_bars[east=true,north=true,south=false,west=true,waterlogged=false] + oxidized_copper_bars[east=true,north=true,south=false,west=true,waterlogged=true]: waxed_oxidized_copper_bars[east=true,north=true,south=false,west=true,waterlogged=true] + oxidized_copper_bars[east=true,north=true,south=true,west=false,waterlogged=false]: waxed_oxidized_copper_bars[east=true,north=true,south=true,west=false,waterlogged=false] + oxidized_copper_bars[east=true,north=true,south=true,west=false,waterlogged=true]: waxed_oxidized_copper_bars[east=true,north=true,south=true,west=false,waterlogged=true] + oxidized_copper_bars[east=true,north=true,south=true,west=true,waterlogged=false]: waxed_oxidized_copper_bars[east=true,north=true,south=true,west=true,waterlogged=false] + oxidized_copper_bars[east=true,north=true,south=true,west=true,waterlogged=true]: waxed_oxidized_copper_bars[east=true,north=true,south=true,west=true,waterlogged=true] + weathered_copper_bars[east=false,north=false,south=false,west=false,waterlogged=false]: waxed_weathered_copper_bars[east=false,north=false,south=false,west=false,waterlogged=false] + weathered_copper_bars[east=false,north=false,south=false,west=false,waterlogged=true]: waxed_weathered_copper_bars[east=false,north=false,south=false,west=false,waterlogged=true] + weathered_copper_bars[east=false,north=false,south=false,west=true,waterlogged=false]: waxed_weathered_copper_bars[east=false,north=false,south=false,west=true,waterlogged=false] + weathered_copper_bars[east=false,north=false,south=false,west=true,waterlogged=true]: waxed_weathered_copper_bars[east=false,north=false,south=false,west=true,waterlogged=true] + weathered_copper_bars[east=false,north=false,south=true,west=false,waterlogged=false]: waxed_weathered_copper_bars[east=false,north=false,south=true,west=false,waterlogged=false] + weathered_copper_bars[east=false,north=false,south=true,west=false,waterlogged=true]: waxed_weathered_copper_bars[east=false,north=false,south=true,west=false,waterlogged=true] + weathered_copper_bars[east=false,north=false,south=true,west=true,waterlogged=false]: waxed_weathered_copper_bars[east=false,north=false,south=true,west=true,waterlogged=false] + weathered_copper_bars[east=false,north=false,south=true,west=true,waterlogged=true]: waxed_weathered_copper_bars[east=false,north=false,south=true,west=true,waterlogged=true] + weathered_copper_bars[east=false,north=true,south=false,west=false,waterlogged=false]: waxed_weathered_copper_bars[east=false,north=true,south=false,west=false,waterlogged=false] + weathered_copper_bars[east=false,north=true,south=false,west=false,waterlogged=true]: waxed_weathered_copper_bars[east=false,north=true,south=false,west=false,waterlogged=true] + weathered_copper_bars[east=false,north=true,south=false,west=true,waterlogged=false]: waxed_weathered_copper_bars[east=false,north=true,south=false,west=true,waterlogged=false] + weathered_copper_bars[east=false,north=true,south=false,west=true,waterlogged=true]: waxed_weathered_copper_bars[east=false,north=true,south=false,west=true,waterlogged=true] + weathered_copper_bars[east=false,north=true,south=true,west=false,waterlogged=false]: waxed_weathered_copper_bars[east=false,north=true,south=true,west=false,waterlogged=false] + weathered_copper_bars[east=false,north=true,south=true,west=false,waterlogged=true]: waxed_weathered_copper_bars[east=false,north=true,south=true,west=false,waterlogged=true] + weathered_copper_bars[east=false,north=true,south=true,west=true,waterlogged=false]: waxed_weathered_copper_bars[east=false,north=true,south=true,west=true,waterlogged=false] + weathered_copper_bars[east=false,north=true,south=true,west=true,waterlogged=true]: waxed_weathered_copper_bars[east=false,north=true,south=true,west=true,waterlogged=true] + weathered_copper_bars[east=true,north=false,south=false,west=false,waterlogged=false]: waxed_weathered_copper_bars[east=true,north=false,south=false,west=false,waterlogged=false] + weathered_copper_bars[east=true,north=false,south=false,west=false,waterlogged=true]: waxed_weathered_copper_bars[east=true,north=false,south=false,west=false,waterlogged=true] + weathered_copper_bars[east=true,north=false,south=false,west=true,waterlogged=false]: waxed_weathered_copper_bars[east=true,north=false,south=false,west=true,waterlogged=false] + weathered_copper_bars[east=true,north=false,south=false,west=true,waterlogged=true]: waxed_weathered_copper_bars[east=true,north=false,south=false,west=true,waterlogged=true] + weathered_copper_bars[east=true,north=false,south=true,west=false,waterlogged=false]: waxed_weathered_copper_bars[east=true,north=false,south=true,west=false,waterlogged=false] + weathered_copper_bars[east=true,north=false,south=true,west=false,waterlogged=true]: waxed_weathered_copper_bars[east=true,north=false,south=true,west=false,waterlogged=true] + weathered_copper_bars[east=true,north=false,south=true,west=true,waterlogged=false]: waxed_weathered_copper_bars[east=true,north=false,south=true,west=true,waterlogged=false] + weathered_copper_bars[east=true,north=false,south=true,west=true,waterlogged=true]: waxed_weathered_copper_bars[east=true,north=false,south=true,west=true,waterlogged=true] + weathered_copper_bars[east=true,north=true,south=false,west=false,waterlogged=false]: waxed_weathered_copper_bars[east=true,north=true,south=false,west=false,waterlogged=false] + weathered_copper_bars[east=true,north=true,south=false,west=false,waterlogged=true]: waxed_weathered_copper_bars[east=true,north=true,south=false,west=false,waterlogged=true] + weathered_copper_bars[east=true,north=true,south=false,west=true,waterlogged=false]: waxed_weathered_copper_bars[east=true,north=true,south=false,west=true,waterlogged=false] + weathered_copper_bars[east=true,north=true,south=false,west=true,waterlogged=true]: waxed_weathered_copper_bars[east=true,north=true,south=false,west=true,waterlogged=true] + weathered_copper_bars[east=true,north=true,south=true,west=false,waterlogged=false]: waxed_weathered_copper_bars[east=true,north=true,south=true,west=false,waterlogged=false] + weathered_copper_bars[east=true,north=true,south=true,west=false,waterlogged=true]: waxed_weathered_copper_bars[east=true,north=true,south=true,west=false,waterlogged=true] + weathered_copper_bars[east=true,north=true,south=true,west=true,waterlogged=false]: waxed_weathered_copper_bars[east=true,north=true,south=true,west=true,waterlogged=false] + weathered_copper_bars[east=true,north=true,south=true,west=true,waterlogged=true]: waxed_weathered_copper_bars[east=true,north=true,south=true,west=true,waterlogged=true] + + #### Copper Chain #### + $$>=1.21.9#copper_chain: + copper_chain[axis=x,waterlogged=false]: waxed_copper_chain[axis=x,waterlogged=false] + copper_chain[axis=x,waterlogged=true]: waxed_copper_chain[axis=x,waterlogged=true] + copper_chain[axis=y,waterlogged=false]: waxed_copper_chain[axis=y,waterlogged=false] + copper_chain[axis=y,waterlogged=true]: waxed_copper_chain[axis=y,waterlogged=true] + copper_chain[axis=z,waterlogged=false]: waxed_copper_chain[axis=z,waterlogged=false] + copper_chain[axis=z,waterlogged=true]: waxed_copper_chain[axis=z,waterlogged=true] + exposed_copper_chain[axis=x,waterlogged=false]: waxed_exposed_copper_chain[axis=x,waterlogged=false] + exposed_copper_chain[axis=x,waterlogged=true]: waxed_exposed_copper_chain[axis=x,waterlogged=true] + exposed_copper_chain[axis=y,waterlogged=false]: waxed_exposed_copper_chain[axis=y,waterlogged=false] + exposed_copper_chain[axis=y,waterlogged=true]: waxed_exposed_copper_chain[axis=y,waterlogged=true] + exposed_copper_chain[axis=z,waterlogged=false]: waxed_exposed_copper_chain[axis=z,waterlogged=false] + exposed_copper_chain[axis=z,waterlogged=true]: waxed_exposed_copper_chain[axis=z,waterlogged=true] + oxidized_copper_chain[axis=x,waterlogged=false]: waxed_oxidized_copper_chain[axis=x,waterlogged=false] + oxidized_copper_chain[axis=x,waterlogged=true]: waxed_oxidized_copper_chain[axis=x,waterlogged=true] + oxidized_copper_chain[axis=y,waterlogged=false]: waxed_oxidized_copper_chain[axis=y,waterlogged=false] + oxidized_copper_chain[axis=y,waterlogged=true]: waxed_oxidized_copper_chain[axis=y,waterlogged=true] + oxidized_copper_chain[axis=z,waterlogged=false]: waxed_oxidized_copper_chain[axis=z,waterlogged=false] + oxidized_copper_chain[axis=z,waterlogged=true]: waxed_oxidized_copper_chain[axis=z,waterlogged=true] + weathered_copper_chain[axis=x,waterlogged=false]: waxed_weathered_copper_chain[axis=x,waterlogged=false] + weathered_copper_chain[axis=x,waterlogged=true]: waxed_weathered_copper_chain[axis=x,waterlogged=true] + weathered_copper_chain[axis=y,waterlogged=false]: waxed_weathered_copper_chain[axis=y,waterlogged=false] + weathered_copper_chain[axis=y,waterlogged=true]: waxed_weathered_copper_chain[axis=y,waterlogged=true] + weathered_copper_chain[axis=z,waterlogged=false]: waxed_weathered_copper_chain[axis=z,waterlogged=false] + weathered_copper_chain[axis=z,waterlogged=true]: waxed_weathered_copper_chain[axis=z,waterlogged=true] + + #### Copper Lantern #### + $$>=1.21.9#copper_lantern: + copper_lantern[hanging=false,waterlogged=false]: waxed_copper_lantern[hanging=false,waterlogged=false] + copper_lantern[hanging=false,waterlogged=true]: waxed_copper_lantern[hanging=false,waterlogged=true] + copper_lantern[hanging=true,waterlogged=false]: waxed_copper_lantern[hanging=true,waterlogged=false] + copper_lantern[hanging=true,waterlogged=true]: waxed_copper_lantern[hanging=true,waterlogged=true] + exposed_copper_lantern[hanging=false,waterlogged=false]: waxed_exposed_copper_lantern[hanging=false,waterlogged=false] + exposed_copper_lantern[hanging=false,waterlogged=true]: waxed_exposed_copper_lantern[hanging=false,waterlogged=true] + exposed_copper_lantern[hanging=true,waterlogged=false]: waxed_exposed_copper_lantern[hanging=true,waterlogged=false] + exposed_copper_lantern[hanging=true,waterlogged=true]: waxed_exposed_copper_lantern[hanging=true,waterlogged=true] + oxidized_copper_lantern[hanging=false,waterlogged=false]: waxed_oxidized_copper_lantern[hanging=false,waterlogged=false] + oxidized_copper_lantern[hanging=false,waterlogged=true]: waxed_oxidized_copper_lantern[hanging=false,waterlogged=true] + oxidized_copper_lantern[hanging=true,waterlogged=false]: waxed_oxidized_copper_lantern[hanging=true,waterlogged=false] + oxidized_copper_lantern[hanging=true,waterlogged=true]: waxed_oxidized_copper_lantern[hanging=true,waterlogged=true] + weathered_copper_lantern[hanging=false,waterlogged=false]: waxed_weathered_copper_lantern[hanging=false,waterlogged=false] + weathered_copper_lantern[hanging=false,waterlogged=true]: waxed_weathered_copper_lantern[hanging=false,waterlogged=true] + weathered_copper_lantern[hanging=true,waterlogged=false]: waxed_weathered_copper_lantern[hanging=true,waterlogged=false] + weathered_copper_lantern[hanging=true,waterlogged=true]: waxed_weathered_copper_lantern[hanging=true,waterlogged=true] + + #### Corals #### + # Coral blocks are ideal for creating water blocks or wall-mounted blocks. But you have to sacrifice its dry appearance. + # dead_brain_coral[waterlogged=false]: brain_coral[waterlogged=false] + # dead_brain_coral[waterlogged=true]: brain_coral[waterlogged=true] + # dead_brain_coral_fan[waterlogged=false]: brain_coral_fan[waterlogged=false] + # dead_brain_coral_fan[waterlogged=true]: brain_coral_fan[waterlogged=true] + # dead_brain_coral_wall_fan[waterlogged=false,facing=east]: brain_coral_wall_fan[waterlogged=false,facing=east] + # dead_brain_coral_wall_fan[waterlogged=false,facing=north]: brain_coral_wall_fan[waterlogged=false,facing=north] + # dead_brain_coral_wall_fan[waterlogged=false,facing=south]: brain_coral_wall_fan[waterlogged=false,facing=south] + # dead_brain_coral_wall_fan[waterlogged=false,facing=west]: brain_coral_wall_fan[waterlogged=false,facing=west] + # dead_brain_coral_wall_fan[waterlogged=true,facing=east]: brain_coral_wall_fan[waterlogged=true,facing=east] + # dead_brain_coral_wall_fan[waterlogged=true,facing=north]: brain_coral_wall_fan[waterlogged=true,facing=north] + # dead_brain_coral_wall_fan[waterlogged=true,facing=south]: brain_coral_wall_fan[waterlogged=true,facing=south] + # dead_brain_coral_wall_fan[waterlogged=true,facing=west]: brain_coral_wall_fan[waterlogged=true,facing=west] + # dead_bubble_coral[waterlogged=false]: bubble_coral[waterlogged=false] + # dead_bubble_coral[waterlogged=true]: bubble_coral[waterlogged=true] + # dead_bubble_coral_fan[waterlogged=false]: bubble_coral_fan[waterlogged=false] + # dead_bubble_coral_fan[waterlogged=true]: bubble_coral_fan[waterlogged=true] + # dead_bubble_coral_wall_fan[waterlogged=false,facing=east]: bubble_coral_wall_fan[waterlogged=false,facing=east] + # dead_bubble_coral_wall_fan[waterlogged=false,facing=north]: bubble_coral_wall_fan[waterlogged=false,facing=north] + # dead_bubble_coral_wall_fan[waterlogged=false,facing=south]: bubble_coral_wall_fan[waterlogged=false,facing=south] + # dead_bubble_coral_wall_fan[waterlogged=false,facing=west]: bubble_coral_wall_fan[waterlogged=false,facing=west] + # dead_bubble_coral_wall_fan[waterlogged=true,facing=east]: bubble_coral_wall_fan[waterlogged=true,facing=east] + # dead_bubble_coral_wall_fan[waterlogged=true,facing=north]: bubble_coral_wall_fan[waterlogged=true,facing=north] + # dead_bubble_coral_wall_fan[waterlogged=true,facing=south]: bubble_coral_wall_fan[waterlogged=true,facing=south] + # dead_bubble_coral_wall_fan[waterlogged=true,facing=west]: bubble_coral_wall_fan[waterlogged=true,facing=west] + # dead_fire_coral[waterlogged=false]: fire_coral[waterlogged=false] + # dead_fire_coral[waterlogged=true]: fire_coral[waterlogged=true] + # dead_fire_coral_fan[waterlogged=false]: fire_coral_fan[waterlogged=false] + # dead_fire_coral_fan[waterlogged=true]: fire_coral_fan[waterlogged=true] + # dead_fire_coral_wall_fan[waterlogged=false,facing=east]: fire_coral_wall_fan[waterlogged=false,facing=east] + # dead_fire_coral_wall_fan[waterlogged=false,facing=north]: fire_coral_wall_fan[waterlogged=false,facing=north] + # dead_fire_coral_wall_fan[waterlogged=false,facing=south]: fire_coral_wall_fan[waterlogged=false,facing=south] + # dead_fire_coral_wall_fan[waterlogged=false,facing=west]: fire_coral_wall_fan[waterlogged=false,facing=west] + # dead_fire_coral_wall_fan[waterlogged=true,facing=east]: fire_coral_wall_fan[waterlogged=true,facing=east] + # dead_fire_coral_wall_fan[waterlogged=true,facing=north]: fire_coral_wall_fan[waterlogged=true,facing=north] + # dead_fire_coral_wall_fan[waterlogged=true,facing=south]: fire_coral_wall_fan[waterlogged=true,facing=south] + # dead_fire_coral_wall_fan[waterlogged=true,facing=west]: fire_coral_wall_fan[waterlogged=true,facing=west] + # dead_horn_coral[waterlogged=false]: horn_coral[waterlogged=false] + # dead_horn_coral[waterlogged=true]: horn_coral[waterlogged=true] + # dead_horn_coral_fan[waterlogged=false]: horn_coral_fan[waterlogged=false] + # dead_horn_coral_fan[waterlogged=true]: horn_coral_fan[waterlogged=true] + # dead_horn_coral_wall_fan[waterlogged=false,facing=east]: horn_coral_wall_fan[waterlogged=false,facing=east] + # dead_horn_coral_wall_fan[waterlogged=false,facing=north]: horn_coral_wall_fan[waterlogged=false,facing=north] + # dead_horn_coral_wall_fan[waterlogged=false,facing=south]: horn_coral_wall_fan[waterlogged=false,facing=south] + # dead_horn_coral_wall_fan[waterlogged=false,facing=west]: horn_coral_wall_fan[waterlogged=false,facing=west] + # dead_horn_coral_wall_fan[waterlogged=true,facing=east]: horn_coral_wall_fan[waterlogged=true,facing=east] + # dead_horn_coral_wall_fan[waterlogged=true,facing=north]: horn_coral_wall_fan[waterlogged=true,facing=north] + # dead_horn_coral_wall_fan[waterlogged=true,facing=south]: horn_coral_wall_fan[waterlogged=true,facing=south] + # dead_horn_coral_wall_fan[waterlogged=true,facing=west]: horn_coral_wall_fan[waterlogged=true,facing=west] + # dead_tube_coral[waterlogged=false]: tube_coral[waterlogged=false] + # dead_tube_coral[waterlogged=true]: tube_coral[waterlogged=true] + # dead_tube_coral_fan[waterlogged=false]: tube_coral_fan[waterlogged=false] + # dead_tube_coral_fan[waterlogged=true]: tube_coral_fan[waterlogged=true] + # dead_tube_coral_wall_fan[waterlogged=false,facing=east]: tube_coral_wall_fan[waterlogged=false,facing=east] + # dead_tube_coral_wall_fan[waterlogged=false,facing=north]: tube_coral_wall_fan[waterlogged=false,facing=north] + # dead_tube_coral_wall_fan[waterlogged=false,facing=south]: tube_coral_wall_fan[waterlogged=false,facing=south] + # dead_tube_coral_wall_fan[waterlogged=false,facing=west]: tube_coral_wall_fan[waterlogged=false,facing=west] + # dead_tube_coral_wall_fan[waterlogged=true,facing=east]: tube_coral_wall_fan[waterlogged=true,facing=east] + # dead_tube_coral_wall_fan[waterlogged=true,facing=north]: tube_coral_wall_fan[waterlogged=true,facing=north] + # dead_tube_coral_wall_fan[waterlogged=true,facing=south]: tube_coral_wall_fan[waterlogged=true,facing=south] + # dead_tube_coral_wall_fan[waterlogged=true,facing=west]: tube_coral_wall_fan[waterlogged=true,facing=west] + + #### Chorus Plant #### + # Chorus Plant does support transparent textures, but man... its hitbox is super weird. You're probably better off using leaves. + # chorus_plant[down=true,east=true,north=true,south=true,up=true,west=false]: chorus_plant[down=true,east=true,north=true,south=true,up=true,west=true] + # chorus_plant[down=true,east=true,north=true,south=true,up=false,west=true]: chorus_plant[down=true,east=true,north=true,south=true,up=true,west=true] + # chorus_plant[down=true,east=true,north=true,south=true,up=false,west=false]: chorus_plant[down=true,east=true,north=true,south=true,up=true,west=true] + # chorus_plant[down=true,east=true,north=true,south=false,up=true,west=true]: chorus_plant[down=true,east=true,north=true,south=true,up=true,west=true] + # chorus_plant[down=true,east=true,north=true,south=false,up=true,west=false]: chorus_plant[down=true,east=true,north=true,south=true,up=true,west=true] + # chorus_plant[down=true,east=true,north=true,south=false,up=false,west=true]: chorus_plant[down=true,east=true,north=true,south=true,up=true,west=true] + # chorus_plant[down=true,east=true,north=true,south=false,up=false,west=false]: chorus_plant[down=true,east=true,north=true,south=true,up=true,west=true] + # chorus_plant[down=true,east=true,north=false,south=true,up=true,west=true]: chorus_plant[down=true,east=true,north=true,south=true,up=true,west=true] + # chorus_plant[down=true,east=true,north=false,south=true,up=true,west=false]: chorus_plant[down=true,east=true,north=true,south=true,up=true,west=true] + # chorus_plant[down=true,east=true,north=false,south=true,up=false,west=true]: chorus_plant[down=true,east=true,north=true,south=true,up=true,west=true] + # chorus_plant[down=true,east=true,north=false,south=true,up=false,west=false]: chorus_plant[down=true,east=true,north=true,south=true,up=true,west=true] + # chorus_plant[down=true,east=true,north=false,south=false,up=true,west=true]: chorus_plant[down=true,east=true,north=true,south=true,up=true,west=true] + # chorus_plant[down=true,east=true,north=false,south=false,up=true,west=false]: chorus_plant[down=true,east=true,north=true,south=true,up=true,west=true] + # chorus_plant[down=true,east=true,north=false,south=false,up=false,west=true]: chorus_plant[down=true,east=true,north=true,south=true,up=true,west=true] + # chorus_plant[down=true,east=true,north=false,south=false,up=false,west=false]: chorus_plant[down=true,east=true,north=true,south=true,up=true,west=true] + # chorus_plant[down=true,east=false,north=true,south=true,up=true,west=true]: chorus_plant[down=true,east=true,north=true,south=true,up=true,west=true] + # chorus_plant[down=true,east=false,north=true,south=true,up=true,west=false]: chorus_plant[down=true,east=true,north=true,south=true,up=true,west=true] + # chorus_plant[down=true,east=false,north=true,south=true,up=false,west=true]: chorus_plant[down=true,east=true,north=true,south=true,up=true,west=true] + # chorus_plant[down=true,east=false,north=true,south=true,up=false,west=false]: chorus_plant[down=true,east=true,north=true,south=true,up=true,west=true] + # chorus_plant[down=true,east=false,north=true,south=false,up=true,west=true]: chorus_plant[down=true,east=true,north=true,south=true,up=true,west=true] + # chorus_plant[down=true,east=false,north=true,south=false,up=true,west=false]: chorus_plant[down=true,east=true,north=true,south=true,up=true,west=true] + # chorus_plant[down=true,east=false,north=true,south=false,up=false,west=true]: chorus_plant[down=true,east=true,north=true,south=true,up=true,west=true] + # chorus_plant[down=true,east=false,north=true,south=false,up=false,west=false]: chorus_plant[down=true,east=true,north=true,south=true,up=true,west=true] + # chorus_plant[down=true,east=false,north=false,south=true,up=true,west=true]: chorus_plant[down=true,east=true,north=true,south=true,up=true,west=true] + # chorus_plant[down=true,east=false,north=false,south=true,up=true,west=false]: chorus_plant[down=true,east=true,north=true,south=true,up=true,west=true] + # chorus_plant[down=true,east=false,north=false,south=true,up=false,west=true]: chorus_plant[down=true,east=true,north=true,south=true,up=true,west=true] + # chorus_plant[down=true,east=false,north=false,south=true,up=false,west=false]: chorus_plant[down=true,east=true,north=true,south=true,up=true,west=true] + # chorus_plant[down=true,east=false,north=false,south=false,up=true,west=true]: chorus_plant[down=true,east=true,north=true,south=true,up=true,west=true] + # chorus_plant[down=true,east=false,north=false,south=false,up=true,west=false]: chorus_plant[down=true,east=true,north=true,south=true,up=true,west=true] + # chorus_plant[down=true,east=false,north=false,south=false,up=false,west=true]: chorus_plant[down=true,east=true,north=true,south=true,up=true,west=true] + # chorus_plant[down=true,east=false,north=false,south=false,up=false,west=false]: chorus_plant[down=true,east=true,north=true,south=true,up=true,west=true] + # chorus_plant[down=false,east=true,north=true,south=true,up=true,west=true]: chorus_plant[down=true,east=true,north=true,south=true,up=true,west=true] + # chorus_plant[down=false,east=true,north=true,south=true,up=true,west=false]: chorus_plant[down=true,east=true,north=true,south=true,up=true,west=true] + # chorus_plant[down=false,east=true,north=true,south=true,up=false,west=true]: chorus_plant[down=true,east=true,north=true,south=true,up=true,west=true] + # chorus_plant[down=false,east=true,north=true,south=true,up=false,west=false]: chorus_plant[down=true,east=true,north=true,south=true,up=true,west=true] + # chorus_plant[down=false,east=true,north=true,south=false,up=true,west=true]: chorus_plant[down=true,east=true,north=true,south=true,up=true,west=true] + # chorus_plant[down=false,east=true,north=true,south=false,up=true,west=false]: chorus_plant[down=true,east=true,north=true,south=true,up=true,west=true] + # chorus_plant[down=false,east=true,north=true,south=false,up=false,west=true]: chorus_plant[down=true,east=true,north=true,south=true,up=true,west=true] + # chorus_plant[down=false,east=true,north=true,south=false,up=false,west=false]: chorus_plant[down=true,east=true,north=true,south=true,up=true,west=true] + # chorus_plant[down=false,east=true,north=false,south=true,up=true,west=true]: chorus_plant[down=true,east=true,north=true,south=true,up=true,west=true] + # chorus_plant[down=false,east=true,north=false,south=true,up=true,west=false]: chorus_plant[down=true,east=true,north=true,south=true,up=true,west=true] + # chorus_plant[down=false,east=true,north=false,south=true,up=false,west=true]: chorus_plant[down=true,east=true,north=true,south=true,up=true,west=true] + # chorus_plant[down=false,east=true,north=false,south=true,up=false,west=false]: chorus_plant[down=true,east=true,north=true,south=true,up=true,west=true] + # chorus_plant[down=false,east=true,north=false,south=false,up=true,west=true]: chorus_plant[down=true,east=true,north=true,south=true,up=true,west=true] + # chorus_plant[down=false,east=true,north=false,south=false,up=true,west=false]: chorus_plant[down=true,east=true,north=true,south=true,up=true,west=true] + # chorus_plant[down=false,east=true,north=false,south=false,up=false,west=true]: chorus_plant[down=true,east=true,north=true,south=true,up=true,west=true] + # chorus_plant[down=false,east=true,north=false,south=false,up=false,west=false]: chorus_plant[down=true,east=true,north=true,south=true,up=true,west=true] + # chorus_plant[down=false,east=false,north=true,south=true,up=true,west=true]: chorus_plant[down=true,east=true,north=true,south=true,up=true,west=true] + # chorus_plant[down=false,east=false,north=true,south=true,up=true,west=false]: chorus_plant[down=true,east=true,north=true,south=true,up=true,west=true] + # chorus_plant[down=false,east=false,north=true,south=true,up=false,west=true]: chorus_plant[down=true,east=true,north=true,south=true,up=true,west=true] + # chorus_plant[down=false,east=false,north=true,south=true,up=false,west=false]: chorus_plant[down=true,east=true,north=true,south=true,up=true,west=true] + # chorus_plant[down=false,east=false,north=true,south=false,up=true,west=true]: chorus_plant[down=true,east=true,north=true,south=true,up=true,west=true] + # chorus_plant[down=false,east=false,north=true,south=false,up=true,west=false]: chorus_plant[down=true,east=true,north=true,south=true,up=true,west=true] + # chorus_plant[down=false,east=false,north=true,south=false,up=false,west=true]: chorus_plant[down=true,east=true,north=true,south=true,up=true,west=true] + # chorus_plant[down=false,east=false,north=true,south=false,up=false,west=false]: chorus_plant[down=true,east=true,north=true,south=true,up=true,west=true] + # chorus_plant[down=false,east=false,north=false,south=true,up=true,west=true]: chorus_plant[down=true,east=true,north=true,south=true,up=true,west=true] + # chorus_plant[down=false,east=false,north=false,south=true,up=true,west=false]: chorus_plant[down=true,east=true,north=true,south=true,up=true,west=true] + # chorus_plant[down=false,east=false,north=false,south=true,up=false,west=true]: chorus_plant[down=true,east=true,north=true,south=true,up=true,west=true] + # chorus_plant[down=false,east=false,north=false,south=true,up=false,west=false]: chorus_plant[down=true,east=true,north=true,south=true,up=true,west=true] + # chorus_plant[down=false,east=false,north=false,south=false,up=true,west=true]: chorus_plant[down=true,east=true,north=true,south=true,up=true,west=true] + # chorus_plant[down=false,east=false,north=false,south=false,up=true,west=false]: chorus_plant[down=true,east=true,north=true,south=true,up=true,west=true] + # chorus_plant[down=false,east=false,north=false,south=false,up=false,west=true]: chorus_plant[down=true,east=true,north=true,south=true,up=true,west=true] + # chorus_plant[down=false,east=false,north=false,south=false,up=false,west=false]: chorus_plant[down=true,east=true,north=true,south=true,up=true,west=true] diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/items/internal/configuration/offset_chars.yml b/Plugin/src/test/resources/bedrock-folder/bedrock/items/internal/configuration/offset_chars.yml new file mode 100644 index 00000000..a05bb0ab --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/items/internal/configuration/offset_chars.yml @@ -0,0 +1,253 @@ +images: + internal:neg_1: + height: -3 + ascent: -5000 + font: minecraft:default + file: minecraft:font/offset/space_split.png + char: \uf800 + internal:neg_2: + height: -4 + ascent: -5000 + font: minecraft:default + file: minecraft:font/offset/space_split.png + char: \uf801 + internal:neg_3: + height: -5 + ascent: -5000 + font: minecraft:default + file: minecraft:font/offset/space_split.png + char: \uf802 + internal:neg_4: + height: -6 + ascent: -5000 + font: minecraft:default + file: minecraft:font/offset/space_split.png + char: \uf803 + internal:neg_5: + height: -7 + ascent: -5000 + font: minecraft:default + file: minecraft:font/offset/space_split.png + char: \uf804 + internal:neg_6: + height: -8 + ascent: -5000 + font: minecraft:default + file: minecraft:font/offset/space_split.png + char: \uf805 + internal:neg_7: + height: -9 + ascent: -5000 + font: minecraft:default + file: minecraft:font/offset/space_split.png + char: \uf806 + internal:neg_8: + height: -10 + ascent: -5000 + font: minecraft:default + file: minecraft:font/offset/space_split.png + char: \uf807 + internal:neg_9: + height: -11 + ascent: -5000 + font: minecraft:default + file: minecraft:font/offset/space_split.png + char: \uf808 + internal:neg_10: + height: -12 + ascent: -5000 + font: minecraft:default + file: minecraft:font/offset/space_split.png + char: \uf809 + internal:neg_11: + height: -13 + ascent: -5000 + font: minecraft:default + file: minecraft:font/offset/space_split.png + char: \uf80a + internal:neg_12: + height: -14 + ascent: -5000 + font: minecraft:default + file: minecraft:font/offset/space_split.png + char: \uf80b + internal:neg_13: + height: -15 + ascent: -5000 + font: minecraft:default + file: minecraft:font/offset/space_split.png + char: \uf80c + internal:neg_14: + height: -16 + ascent: -5000 + font: minecraft:default + file: minecraft:font/offset/space_split.png + char: \uf80d + internal:neg_15: + height: -17 + ascent: -5000 + font: minecraft:default + file: minecraft:font/offset/space_split.png + char: \uf80e + internal:neg_16: + height: -18 + ascent: -5000 + font: minecraft:default + file: minecraft:font/offset/space_split.png + char: \uf80f + internal:neg_32: + height: -34 + ascent: -5000 + font: minecraft:default + file: minecraft:font/offset/space_split.png + char: \uf810 + internal:neg_48: + height: -50 + ascent: -5000 + font: minecraft:default + file: minecraft:font/offset/space_split.png + char: \uf811 + internal:neg_64: + height: -66 + ascent: -5000 + font: minecraft:default + file: minecraft:font/offset/space_split.png + char: \uf812 + internal:neg_128: + height: -130 + ascent: -5000 + font: minecraft:default + file: minecraft:font/offset/space_split.png + char: \uf813 + internal:neg_256: + height: -258 + ascent: -5000 + font: minecraft:default + file: minecraft:font/offset/space_split.png + char: \uf814 + internal:pos_1: + height: -1 + ascent: -5000 + font: minecraft:default + file: minecraft:font/offset/space_split.png + char: \uf830 + internal:pos_2: + height: 1 + ascent: -5000 + font: minecraft:default + file: minecraft:font/offset/space_split.png + char: \uf831 + internal:pos_3: + height: 2 + ascent: -5000 + font: minecraft:default + file: minecraft:font/offset/space_split.png + char: \uf832 + internal:pos_4: + height: 3 + ascent: -5000 + font: minecraft:default + file: minecraft:font/offset/space_split.png + char: \uf833 + internal:pos_5: + height: 4 + ascent: -5000 + font: minecraft:default + file: minecraft:font/offset/space_split.png + char: \uf834 + internal:pos_6: + height: 5 + ascent: -5000 + font: minecraft:default + file: minecraft:font/offset/space_split.png + char: \uf835 + internal:pos_7: + height: 6 + ascent: -5000 + font: minecraft:default + file: minecraft:font/offset/space_split.png + char: \uf836 + internal:pos_8: + height: 7 + ascent: -5000 + font: minecraft:default + file: minecraft:font/offset/space_split.png + char: \uf837 + internal:pos_9: + height: 8 + ascent: -5000 + font: minecraft:default + file: minecraft:font/offset/space_split.png + char: \uf838 + internal:pos_10: + height: 9 + ascent: -5000 + font: minecraft:default + file: minecraft:font/offset/space_split.png + char: \uf839 + internal:pos_11: + height: 10 + ascent: -5000 + font: minecraft:default + file: minecraft:font/offset/space_split.png + char: \uf83a + internal:pos_12: + height: 11 + ascent: -5000 + font: minecraft:default + file: minecraft:font/offset/space_split.png + char: \uf83b + internal:pos_13: + height: 12 + ascent: -5000 + font: minecraft:default + file: minecraft:font/offset/space_split.png + char: \uf83c + internal:pos_14: + height: 13 + ascent: -5000 + font: minecraft:default + file: minecraft:font/offset/space_split.png + char: \uf83d + internal:pos_15: + height: 14 + ascent: -5000 + font: minecraft:default + file: minecraft:font/offset/space_split.png + char: \uf83e + internal:pos_16: + height: 15 + ascent: -5000 + font: minecraft:default + file: minecraft:font/offset/space_split.png + char: \uf83f + internal:pos_32: + height: 31 + ascent: -5000 + font: minecraft:default + file: minecraft:font/offset/space_split.png + char: \uf840 + internal:pos_48: + height: 47 + ascent: -5000 + font: minecraft:default + file: minecraft:font/offset/space_split.png + char: \uf841 + internal:pos_64: + height: 63 + ascent: -5000 + font: minecraft:default + file: minecraft:font/offset/space_split.png + char: \uf842 + internal:pos_128: + height: 127 + ascent: -5000 + font: minecraft:default + file: minecraft:font/offset/space_split.png + char: \uf843 + internal:pos_256: + height: 255 + ascent: -5000 + font: minecraft:default + file: minecraft:font/offset/space_split.png + char: \uf844 \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/items/internal/configuration/special.yml b/Plugin/src/test/resources/bedrock-folder/bedrock/items/internal/configuration/special.yml new file mode 100644 index 00000000..a91bac36 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/items/internal/configuration/special.yml @@ -0,0 +1,54 @@ +items: + # When placing tripwires, the client predicts their block states. + # By specifying the state type, we can prevent certain visual issues during placement. + minecraft:string: + client_bound_data: + $$>=1.20.5: + components: + minecraft:block_state: + attached: 'false' + disarmed: 'false' + east: 'true' + north: 'true' + powered: 'true' + south: 'true' + west: 'true' + $$fallback: + nbt: + BlockStateTag: + attached: 'false' + disarmed: 'false' + east: 'true' + north: 'true' + powered: 'true' + south: 'true' + west: 'true' + # The reason is the same as above + minecraft:note_block: + client_bound_data: + $$>=1.20.5: + components: + minecraft:block_state: + instrument: harp + powered: 'false' + note: '0' + $$fallback: + nbt: + BlockStateTag: + instrument: harp + powered: 'false' + note: '0' + # By setting process_written_book_tags for the vanilla item, it can properly handle tags such as & within books. + minecraft:written_book: + client_bound_data: + process_written_book_tags: {} + +blocks: + # For the client to determine if a beacon can activate, it needs the beacon_base_blocks tag to render the beam. + # This allows custom blocks (like note blocks) to work as beacon bases. + # However, whether the beacon actually grants potion effects depends on the block's real tag (server-side check). + minecraft:note_block: + settings: + client_bound_tags: + - minecraft:beacon_base_blocks + - minecraft:mineable/axe \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/items/internal/configuration/translations/de.yml b/Plugin/src/test/resources/bedrock-folder/bedrock/items/internal/configuration/translations/de.yml new file mode 100644 index 00000000..e77b1710 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/items/internal/configuration/translations/de.yml @@ -0,0 +1,15 @@ +translations: + de: + internal.next_page: Nächste Seite + internal.previous_page: Vorherige Seite + internal.return: Zurück zur vorherigen Seite + internal.exit: Verlassen + internal.next_recipe: Nächstes Rezept + internal.previous_recipe: Vorheriges Rezept + internal.get_item: Gegenstand nehmen + internal.get_item.0: Linksklick, um eines zu nehmen + internal.get_item.1: Rechtsklick, um einen Stapel zu nehmen + internal.cooking_info: Rezeptinformationen + internal.cooking_info.0: 'Zeit: Ticks' + internal.cooking_info.1: 'Erfahrung: ' + category.internal.all: Alle Gegenstand diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/items/internal/configuration/translations/en.yml b/Plugin/src/test/resources/bedrock-folder/bedrock/items/internal/configuration/translations/en.yml new file mode 100644 index 00000000..701121df --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/items/internal/configuration/translations/en.yml @@ -0,0 +1,15 @@ +translations: + en: + internal.next_page: Next Page + internal.previous_page: Previous Page + internal.return: Return to Parent Page + internal.exit: Exit + internal.next_recipe: Next Recipe + internal.previous_recipe: Previous Recipe + internal.get_item: Get Item + internal.get_item.0: Left Click to take one + internal.get_item.1: Right Click to take a stack + internal.cooking_info: Recipe Information + internal.cooking_info.0: 'Time: ticks' + internal.cooking_info.1: 'Experience: ' + category.internal.all: All Items diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/items/internal/configuration/translations/fr_fr.yml b/Plugin/src/test/resources/bedrock-folder/bedrock/items/internal/configuration/translations/fr_fr.yml new file mode 100644 index 00000000..78d8d08b --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/items/internal/configuration/translations/fr_fr.yml @@ -0,0 +1,15 @@ +translations: + fr_fr: + internal.next_page: Page Suivante + internal.previous_page: Page Précédente + internal.return: Retour à la Page Précédente + internal.exit: Quitter + internal.next_recipe: Recette Suivante + internal.previous_recipe: Recette Précédente + internal.get_item: Obtenir l'Objet + internal.get_item.0: Clic Gauche pour en prendre un + internal.get_item.1: Clic Droit pour prendre une pile + internal.cooking_info: Informations sur la Recette + internal.cooking_info.0: 'Temps: ticks' + internal.cooking_info.1: 'Expérience: ' + category.internal.all: Tous les objets diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/items/internal/configuration/translations/ko_kr.yml b/Plugin/src/test/resources/bedrock-folder/bedrock/items/internal/configuration/translations/ko_kr.yml new file mode 100644 index 00000000..05203a0f --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/items/internal/configuration/translations/ko_kr.yml @@ -0,0 +1,15 @@ +translations: + ko_kr: + internal.next_page: 다음 페이지 + internal.previous_page: 이전 페이지 + internal.return: 뒤로 가기 + internal.exit: 나가기 + internal.next_recipe: 다음 조합법 + internal.previous_recipe: 이전 조합법 + internal.get_item: 아이템 얻기 + internal.get_item.0: 좌클릭하여 하나 얻기 + internal.get_item.1: 우클릭하여 한 세트 얻기 + internal.cooking_info: 제작 정보 + internal.cooking_info.0: '제작 시간: 틱' + internal.cooking_info.1: '획득 경험치: ' + category.internal.all: 모든 아이템 \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/items/internal/configuration/translations/zh_cn.yml b/Plugin/src/test/resources/bedrock-folder/bedrock/items/internal/configuration/translations/zh_cn.yml new file mode 100644 index 00000000..9f4f3889 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/items/internal/configuration/translations/zh_cn.yml @@ -0,0 +1,15 @@ +translations: + zh_cn: + internal.next_page: 下一页 + internal.previous_page: 上一页 + internal.return: 返回上一级 + internal.exit: 退出 + internal.next_recipe: 下一个配方 + internal.previous_recipe: 上一个配方 + internal.get_item: 获取物品 + internal.get_item.0: 左键单击取一个 + internal.get_item.1: 右键单击取一组 + internal.cooking_info: 配方信息 + internal.cooking_info.0: '时间: 刻' + internal.cooking_info.1: '经验: ' + category.internal.all: 全部物品 diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/items/internal/configuration/translations/zh_hk.yml b/Plugin/src/test/resources/bedrock-folder/bedrock/items/internal/configuration/translations/zh_hk.yml new file mode 100644 index 00000000..1e13b9fd --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/items/internal/configuration/translations/zh_hk.yml @@ -0,0 +1,15 @@ +translations: + zh_hk: + internal.next_page: 下一頁 + internal.previous_page: 上一頁 + internal.return: 返回上一級 + internal.exit: 退出 + internal.next_recipe: 下一個配方 + internal.previous_recipe: 上一個配方 + internal.get_item: 獲取物品 + internal.get_item.0: 左鍵單擊取一個 + internal.get_item.1: 右鍵單擊取一組 + internal.cooking_info: 配方信息 + internal.cooking_info.0: '時間: 刻' + internal.cooking_info.1: '經驗: ' + category.internal.all: 全部物品 diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/items/internal/configuration/translations/zh_tw.yml b/Plugin/src/test/resources/bedrock-folder/bedrock/items/internal/configuration/translations/zh_tw.yml new file mode 100644 index 00000000..892b9bc2 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/items/internal/configuration/translations/zh_tw.yml @@ -0,0 +1,15 @@ +translations: + zh_tw: + internal.next_page: 下一頁 + internal.previous_page: 上一頁 + internal.return: 返回上一級 + internal.exit: 退出 + internal.next_recipe: 下一個配方 + internal.previous_recipe: 上一個配方 + internal.get_item: 獲取物品 + internal.get_item.0: 左鍵單擊取一個 + internal.get_item.1: 右鍵單擊取一組 + internal.cooking_info: 配方資訊 + internal.cooking_info.0: '時間: 刻' + internal.cooking_info.1: '經驗: ' + category.internal.all: 全部物品 diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/items/internal/pack.yml b/Plugin/src/test/resources/bedrock-folder/bedrock/items/internal/pack.yml new file mode 100644 index 00000000..01fa4cfb --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/items/internal/pack.yml @@ -0,0 +1,5 @@ +author: XiaoMoMi +version: 1.0 +description: Internal Assets +namespace: internal +enable: true \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/items/legacy_armor/configuration/chainmail.yml b/Plugin/src/test/resources/bedrock-folder/bedrock/items/legacy_armor/configuration/chainmail.yml new file mode 100644 index 00000000..53ebd978 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/items/legacy_armor/configuration/chainmail.yml @@ -0,0 +1,30 @@ +# Since we removed the chainmail armor textures, we need to add a client-side trim type for the vanilla chainmail armor to make it display properly. +items: + minecraft:chainmail_helmet: + client_bound_data: + trim: + pattern: chainmail + material: custom + hide_tooltip: + - trim + minecraft:chainmail_chestplate: + client_bound_data: + trim: + pattern: chainmail + material: custom + hide_tooltip: + - trim + minecraft:chainmail_leggings: + client_bound_data: + trim: + pattern: chainmail + material: custom + hide_tooltip: + - trim + minecraft:chainmail_boots: + client_bound_data: + trim: + pattern: chainmail + material: custom + hide_tooltip: + - trim \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/items/legacy_armor/pack.yml b/Plugin/src/test/resources/bedrock-folder/bedrock/items/legacy_armor/pack.yml new file mode 100644 index 00000000..fd4ccd10 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/items/legacy_armor/pack.yml @@ -0,0 +1,5 @@ +author: XiaoMoMi +version: 0.0.1 +description: Fix broken vanilla armor +namespace: minecraft +enable: false \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/items/remove_shulker_head/pack.yml b/Plugin/src/test/resources/bedrock-folder/bedrock/items/remove_shulker_head/pack.yml new file mode 100644 index 00000000..90342c12 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/items/remove_shulker_head/pack.yml @@ -0,0 +1,5 @@ +author: XiaoMoMi & jhqwqmc +version: 1.0 +description: Remove Shulker Head for 1.20~1.21.1 +namespace: minecraft +enable: true \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/items/remove_shulker_head/resourcepack/assets/minecraft/shaders/core/rendertype_entity_solid.fsh b/Plugin/src/test/resources/bedrock-folder/bedrock/items/remove_shulker_head/resourcepack/assets/minecraft/shaders/core/rendertype_entity_solid.fsh new file mode 100644 index 00000000..a355276a --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/items/remove_shulker_head/resourcepack/assets/minecraft/shaders/core/rendertype_entity_solid.fsh @@ -0,0 +1,29 @@ +#version 150 + +#moj_import + +uniform sampler2D Sampler0; + +uniform vec4 ColorModulator; +uniform float FogStart; +uniform float FogEnd; +uniform vec4 FogColor; + +in float vertexDistance; +in vec4 vertexColor; +in vec4 lightMapColor; +in vec4 overlayColor; +in vec2 texCoord0; +in vec4 normal; + +out vec4 fragColor; + +void main() { + vec4 color = texture(Sampler0, texCoord0) * vertexColor * ColorModulator; + if (color.a == 0) { + discard; + } + color.rgb = mix(overlayColor.rgb, color.rgb, overlayColor.a); + color *= lightMapColor; + fragColor = linear_fog(color, vertexDistance, FogStart, FogEnd, FogColor); +} diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/items/remove_shulker_head/resourcepack/assets/minecraft/textures/entity/shulker/shulker_white.png b/Plugin/src/test/resources/bedrock-folder/bedrock/items/remove_shulker_head/resourcepack/assets/minecraft/textures/entity/shulker/shulker_white.png new file mode 100644 index 0000000000000000000000000000000000000000..21e5e1a018133857fe3f1a4918ca75ab6944fe4d GIT binary patch literal 1122 zcmV-o1fBbdP)Dzudv0;&FJgwrmL*a)z+)AvhMNm(%9LkuCBMe zzOJ;jvbed}-QM8k<d6W%+lA`i_@$ zT+ENe0000fbW%=J|NsC0|NsC0|NsC0|NsC0|NsC0|NsC0|NsC0|NsC0|NsC0|NsC0 z08;cIhX4QrNJ&INRCwC#R@;)JI1CjAj6<4`Cim{$oplWI{Qnp3kVnfC8f)Lb zEyoHO(Sj8-{3U}J&+c>2E-jSEHfq>yQ^`nDlsJ%)VGhU`60+<$et!0n5hs~Zl1vEU zjY_f;_csGRu}1w}4Ii9DGDx>+8aV7(4e~a~h!_Qs4K*3$ZEADWpfP?sG({Ho{6%h@ zO$Ygi)<(@{viP$Z6&atlIGvg7(yy|CY{me`Py@pg;t4fyyq!gmK1pX85o$7JctRh1 zFij5IM#E=v_z=070({U7yO{hxNdNYeb?-^m-2*+njgQo|fevkZm3a+7cbMX@1Hd@M zJiY_)_yt0Id9RPZ2B3{2#(x2z3&nUPgYLx)UIpk&xEi2+v54J*WBjF&u6-LFzS&5> z>BR2ER{lcY16X{W6G{RN$^;6kYntRFsWC>mp8O*KD`us}14tmwWnyvQ$drF92dD0}eC>_)$rM(N5(Bn+bO2Mwjgl|0*ORM)lXF z{JYfHao7>_zq-7ZVrN0D81^gabIa{p;0k=ZOtSF(BJ+Ez0-s@r-{I{r+Np%)4Fk{X zxjmO - unbreakable: true - remove-components: - - attribute_modifiers - $$>=1.21.2: - equippable: - slot: head - model: - type: minecraft:model - path: minecraft:item/custom/cap - tints: - - type: minecraft:dye - default: -6265536 - - - test:test: - material: elytra - item-model: "test:test" - data: - item-name: <#FF8C00> - components: - custom_model_data: - - 3.0f - model: - type: minecraft:condition - property: minecraft:broken - on-false: - path: minecraft:item/custom/test - generation: - parent: minecraft:item/generated - textures: - layer0: minecraft:item/custom/test - on-true: - path: minecraft:item/custom/broken_test - generation: - parent: minecraft:item/generated - textures: - layer0: minecraft:item/custom/broken_test \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/equipment/flame.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/equipment/flame.json new file mode 100644 index 00000000..0c2bbd6c --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/equipment/flame.json @@ -0,0 +1 @@ +{"layers":{"wings":[{"texture":"flame"}]}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/equipment/topaz.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/equipment/topaz.json new file mode 100644 index 00000000..1191b35f --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/equipment/topaz.json @@ -0,0 +1 @@ +{"layers":{"humanoid":[{"texture":"topaz"}],"humanoid_leggings":[{"texture":"topaz"}]}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/amethyst_standing_torch.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/amethyst_standing_torch.json new file mode 100644 index 00000000..6a96b6bc --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/amethyst_standing_torch.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"model","model":"block/custom/amethyst_torch"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/amethyst_torch.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/amethyst_torch.json new file mode 100644 index 00000000..69c85b46 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/amethyst_torch.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"model","model":"default:item/amethyst_torch"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/amethyst_wall_torch.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/amethyst_wall_torch.json new file mode 100644 index 00000000..3a0db8ff --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/amethyst_wall_torch.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"model","model":"block/custom/amethyst_wall_torch"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/bench.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/bench.json new file mode 100644 index 00000000..e0d8df25 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/bench.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"model","model":"item/custom/bench"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/candelabrum.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/candelabrum.json new file mode 100644 index 00000000..a27073e4 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/candelabrum.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"model","model":"default:item/candelabrum"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/candelabrum_ceiling.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/candelabrum_ceiling.json new file mode 100644 index 00000000..ed88b29f --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/candelabrum_ceiling.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"model","model":"item/custom/candelabrum_ceiling"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/candelabrum_ground.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/candelabrum_ground.json new file mode 100644 index 00000000..b2793399 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/candelabrum_ground.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"model","model":"item/custom/candelabrum_ground"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/candelabrum_lit_ceiling.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/candelabrum_lit_ceiling.json new file mode 100644 index 00000000..821edb63 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/candelabrum_lit_ceiling.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"model","model":"item/custom/candelabrum_lit_ceiling"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/candelabrum_lit_ground.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/candelabrum_lit_ground.json new file mode 100644 index 00000000..90e3ee3b --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/candelabrum_lit_ground.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"model","model":"item/custom/candelabrum_lit_ground"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/candelabrum_lit_wall.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/candelabrum_lit_wall.json new file mode 100644 index 00000000..040cd1f5 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/candelabrum_lit_wall.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"model","model":"item/custom/candelabrum_lit_wall"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/candelabrum_wall.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/candelabrum_wall.json new file mode 100644 index 00000000..74167d2f --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/candelabrum_wall.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"model","model":"item/custom/candelabrum_wall"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/cap.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/cap.json new file mode 100644 index 00000000..0847196c --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/cap.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"model","model":"item/custom/cap","tints":[{"type":"dye","default":-6265536}]}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/chessboard_block.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/chessboard_block.json new file mode 100644 index 00000000..cbf124cc --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/chessboard_block.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"model","model":"block/custom/chessboard_block"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/chinese_lantern.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/chinese_lantern.json new file mode 100644 index 00000000..ad480827 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/chinese_lantern.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"model","model":"block/custom/chinese_lantern"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/copper_coil.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/copper_coil.json new file mode 100644 index 00000000..9ded0667 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/copper_coil.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"model","model":"block/custom/copper_coil"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/deepslate_topaz_ore.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/deepslate_topaz_ore.json new file mode 100644 index 00000000..a8bf01a4 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/deepslate_topaz_ore.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"model","model":"block/custom/deepslate_topaz_ore"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/drawer_block.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/drawer_block.json new file mode 100644 index 00000000..f6f6a9fe --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/drawer_block.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"model","model":"block/custom/drawer_block"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/drill.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/drill.json new file mode 100644 index 00000000..e7529899 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/drill.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"condition","on_true":{"type":"model","model":"item/custom/drill_selected"},"on_false":{"type":"model","model":"item/custom/drill"},"property":"selected"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/ender_pearl_flower_seeds.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/ender_pearl_flower_seeds.json new file mode 100644 index 00000000..fee53eb9 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/ender_pearl_flower_seeds.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"model","model":"default:item/ender_pearl_flower_seeds"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/fairy_flower.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/fairy_flower.json new file mode 100644 index 00000000..f05e6eaa --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/fairy_flower.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"model","model":"default:item/fairy_flower"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/flame_cane.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/flame_cane.json new file mode 100644 index 00000000..757dd7f0 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/flame_cane.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"model","model":"default:item/flame_cane"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/flame_elytra.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/flame_elytra.json new file mode 100644 index 00000000..ce514e72 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/flame_elytra.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"condition","on_true":{"type":"model","model":"default:item/flame_elytra_broken"},"on_false":{"type":"model","model":"default:item/flame_elytra"},"property":"broken"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/flower_basket.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/flower_basket.json new file mode 100644 index 00000000..bef51455 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/flower_basket.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"model","model":"default:item/flower_basket"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/flower_basket_ceiling.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/flower_basket_ceiling.json new file mode 100644 index 00000000..4da9105f --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/flower_basket_ceiling.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"model","model":"item/custom/flower_basket_ceiling"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/flower_basket_ground.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/flower_basket_ground.json new file mode 100644 index 00000000..ca5b23a1 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/flower_basket_ground.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"model","model":"item/custom/flower_basket_ground"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/flower_basket_wall.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/flower_basket_wall.json new file mode 100644 index 00000000..97195a59 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/flower_basket_wall.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"model","model":"item/custom/flower_basket_wall"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/globe.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/globe.json new file mode 100644 index 00000000..917f4bcb --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/globe.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"model","model":"item/custom/globe"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/globe_base.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/globe_base.json new file mode 100644 index 00000000..4060422f --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/globe_base.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"model","model":"item/custom/globe_base"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/globe_earth.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/globe_earth.json new file mode 100644 index 00000000..d60dca8c --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/globe_earth.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"model","model":"item/custom/globe_earth"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/gui_head_size_1.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/gui_head_size_1.json new file mode 100644 index 00000000..21d1b4b8 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/gui_head_size_1.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"special","model":{"type":"player_head"},"base":"item/custom/gui_head_size_1"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/gui_head_size_4.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/gui_head_size_4.json new file mode 100644 index 00000000..bf167640 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/gui_head_size_4.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"special","model":{"type":"player_head"},"base":"item/custom/gui_head_size_4"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/gunpowder_block.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/gunpowder_block.json new file mode 100644 index 00000000..23bf9bd6 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/gunpowder_block.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"model","model":"block/custom/gunpowder_block"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/hami_melon.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/hami_melon.json new file mode 100644 index 00000000..840d083d --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/hami_melon.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"model","model":"block/custom/hami_melon"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/hami_melon_seeds.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/hami_melon_seeds.json new file mode 100644 index 00000000..ecd95628 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/hami_melon_seeds.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"model","model":"default:item/hami_melon_seeds"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/hami_melon_slice.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/hami_melon_slice.json new file mode 100644 index 00000000..5a5c71c0 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/hami_melon_slice.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"model","model":"default:item/hami_melon_slice"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/magma_fruit.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/magma_fruit.json new file mode 100644 index 00000000..9c9c0b7e --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/magma_fruit.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"model","model":"default:item/magma_fruit"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/netherite_anvil.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/netherite_anvil.json new file mode 100644 index 00000000..70016a53 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/netherite_anvil.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"model","model":"block/custom/netherite_anvil"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_button.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_button.json new file mode 100644 index 00000000..7579f0a7 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_button.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"model","model":"block/custom/palm_button"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_button_not_pressed.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_button_not_pressed.json new file mode 100644 index 00000000..d5939b37 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_button_not_pressed.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"model","model":"block/custom/palm_button_not_pressed"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_button_pressed.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_button_pressed.json new file mode 100644 index 00000000..ce56e9fa --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_button_pressed.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"model","model":"block/custom/palm_button_pressed"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_door.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_door.json new file mode 100644 index 00000000..a70d0f5a --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_door.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"model","model":"default:item/palm_door"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_fence.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_fence.json new file mode 100644 index 00000000..08a608df --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_fence.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"model","model":"block/custom/palm_fence_inventory"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_fence_gate.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_fence_gate.json new file mode 100644 index 00000000..6e46947c --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_fence_gate.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"model","model":"block/custom/palm_fence_gate"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_fence_post.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_fence_post.json new file mode 100644 index 00000000..4547d8b0 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_fence_post.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"model","model":"block/custom/palm_fence_post"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_fence_side.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_fence_side.json new file mode 100644 index 00000000..7fe1b701 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_fence_side.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"model","model":"block/custom/palm_fence_side"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_leaves.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_leaves.json new file mode 100644 index 00000000..18f5a62b --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_leaves.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"model","model":"block/custom/palm_leaves","tints":[{"type":"constant","value":-12012712}]}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_log.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_log.json new file mode 100644 index 00000000..48951210 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_log.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"model","model":"block/custom/palm_log"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_planks.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_planks.json new file mode 100644 index 00000000..2c6828f8 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_planks.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"model","model":"block/custom/palm_planks"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_pressure_plate.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_pressure_plate.json new file mode 100644 index 00000000..95cffcea --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_pressure_plate.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"model","model":"block/custom/palm_pressure_plate"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_sapling.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_sapling.json new file mode 100644 index 00000000..5cc66b1c --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_sapling.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"model","model":"default:item/palm_sapling"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_slab.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_slab.json new file mode 100644 index 00000000..8bb176ac --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_slab.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"model","model":"block/custom/palm_slab"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_stairs.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_stairs.json new file mode 100644 index 00000000..01e5680b --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_stairs.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"model","model":"block/custom/palm_stairs"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_trapdoor.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_trapdoor.json new file mode 100644 index 00000000..dd7c94db --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_trapdoor.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"model","model":"block/custom/palm_trapdoor_bottom"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_wood.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_wood.json new file mode 100644 index 00000000..dd3a268d --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_wood.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"model","model":"block/custom/palm_wood"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/pebble.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/pebble.json new file mode 100644 index 00000000..0540fbf6 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/pebble.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"model","model":"default:item/pebble"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/reed.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/reed.json new file mode 100644 index 00000000..972a5db4 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/reed.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"model","model":"default:item/reed"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/safe_block.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/safe_block.json new file mode 100644 index 00000000..62d45c89 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/safe_block.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"model","model":"block/custom/safe_block"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/showcase.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/showcase.json new file mode 100644 index 00000000..8744ce50 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/showcase.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"model","model":"item/custom/showcase"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/sleeper_sofa.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/sleeper_sofa.json new file mode 100644 index 00000000..19fd5962 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/sleeper_sofa.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"model","model":"item/custom/sleeper_sofa","tints":[{"type":"dye","default":-8214477}]}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/sofa.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/sofa.json new file mode 100644 index 00000000..525fe057 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/sofa.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"model","model":"item/custom/sofa","tints":[{"type":"dye","default":-8214477}]}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/sofa_inner.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/sofa_inner.json new file mode 100644 index 00000000..b386a6f3 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/sofa_inner.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"model","model":"item/custom/sofa_inner","tints":[{"type":"dye","default":-8214477}]}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/solid_gunpowder_block.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/solid_gunpowder_block.json new file mode 100644 index 00000000..e3ad6bd1 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/solid_gunpowder_block.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"model","model":"item/custom/solid_gunpowder_block"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/stripped_palm_log.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/stripped_palm_log.json new file mode 100644 index 00000000..c3b4b9a2 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/stripped_palm_log.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"model","model":"block/custom/stripped_palm_log"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/stripped_palm_wood.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/stripped_palm_wood.json new file mode 100644 index 00000000..cc326151 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/stripped_palm_wood.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"model","model":"block/custom/stripped_palm_wood"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/table_lamp.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/table_lamp.json new file mode 100644 index 00000000..da2b3d3b --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/table_lamp.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"model","model":"item/custom/table_lamp"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/table_lamp_on.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/table_lamp_on.json new file mode 100644 index 00000000..fad525df --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/table_lamp_on.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"model","model":"item/custom/table_lamp_on"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/togglable_light_block.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/togglable_light_block.json new file mode 100644 index 00000000..091af4d0 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/togglable_light_block.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"model","model":"default:item/togglable_light_block"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/topaz.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/topaz.json new file mode 100644 index 00000000..13483716 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/topaz.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"model","model":"default:item/topaz"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/topaz_axe.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/topaz_axe.json new file mode 100644 index 00000000..b4e0bf70 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/topaz_axe.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"model","model":"default:item/topaz_axe"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/topaz_boots.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/topaz_boots.json new file mode 100644 index 00000000..accb9c4d --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/topaz_boots.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"select","property":"trim_material","cases":[{"when":"minecraft:gold","model":{"type":"model","model":"default:item/topaz_boots_gold_trim"}},{"when":"minecraft:emerald","model":{"type":"model","model":"default:item/topaz_boots_emerald_trim"}},{"when":"minecraft:quartz","model":{"type":"model","model":"default:item/topaz_boots_quartz_trim"}},{"when":"minecraft:redstone","model":{"type":"model","model":"default:item/topaz_boots_redstone_trim"}},{"when":"minecraft:lapis","model":{"type":"model","model":"default:item/topaz_boots_lapis_trim"}},{"when":"minecraft:diamond","model":{"type":"model","model":"default:item/topaz_boots_diamond_trim"}},{"when":"minecraft:amethyst","model":{"type":"model","model":"default:item/topaz_boots_amethyst_trim"}},{"when":"minecraft:iron","model":{"type":"model","model":"default:item/topaz_boots_iron_trim"}},{"when":"minecraft:copper","model":{"type":"model","model":"default:item/topaz_boots_copper_trim"}},{"when":"minecraft:netherite","model":{"type":"model","model":"default:item/topaz_boots_netherite_trim"}},{"when":"minecraft:resin","model":{"type":"model","model":"default:item/topaz_boots_resin_trim"}}],"fallback":{"type":"model","model":"default:item/topaz_boots"}}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/topaz_bow.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/topaz_bow.json new file mode 100644 index 00000000..d5be09cc --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/topaz_bow.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"condition","on_true":{"type":"range_dispatch","property":"use_duration","entries":[{"threshold":0.65,"model":{"type":"model","model":"default:item/topaz_bow_pulling_1"}},{"threshold":0.9,"model":{"type":"model","model":"default:item/topaz_bow_pulling_2"}}],"scale":0.05,"fallback":{"type":"model","model":"default:item/topaz_bow_pulling_0"}},"on_false":{"type":"model","model":"default:item/topaz_bow"},"property":"using_item"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/topaz_chestplate.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/topaz_chestplate.json new file mode 100644 index 00000000..772f7d58 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/topaz_chestplate.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"select","property":"trim_material","cases":[{"when":"minecraft:gold","model":{"type":"model","model":"default:item/topaz_chestplate_gold_trim"}},{"when":"minecraft:emerald","model":{"type":"model","model":"default:item/topaz_chestplate_emerald_trim"}},{"when":"minecraft:quartz","model":{"type":"model","model":"default:item/topaz_chestplate_quartz_trim"}},{"when":"minecraft:redstone","model":{"type":"model","model":"default:item/topaz_chestplate_redstone_trim"}},{"when":"minecraft:lapis","model":{"type":"model","model":"default:item/topaz_chestplate_lapis_trim"}},{"when":"minecraft:diamond","model":{"type":"model","model":"default:item/topaz_chestplate_diamond_trim"}},{"when":"minecraft:amethyst","model":{"type":"model","model":"default:item/topaz_chestplate_amethyst_trim"}},{"when":"minecraft:iron","model":{"type":"model","model":"default:item/topaz_chestplate_iron_trim"}},{"when":"minecraft:copper","model":{"type":"model","model":"default:item/topaz_chestplate_copper_trim"}},{"when":"minecraft:netherite","model":{"type":"model","model":"default:item/topaz_chestplate_netherite_trim"}},{"when":"minecraft:resin","model":{"type":"model","model":"default:item/topaz_chestplate_resin_trim"}}],"fallback":{"type":"model","model":"default:item/topaz_chestplate"}}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/topaz_crossbow.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/topaz_crossbow.json new file mode 100644 index 00000000..c93c8a68 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/topaz_crossbow.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"select","property":"charge_type","cases":[{"when":"arrow","model":{"type":"model","model":"default:item/topaz_crossbow_arrow"}},{"when":"rocket","model":{"type":"model","model":"default:item/topaz_crossbow_firework"}}],"fallback":{"type":"condition","on_true":{"type":"range_dispatch","property":"crossbow/pull","entries":[{"threshold":0.58,"model":{"type":"model","model":"default:item/topaz_crossbow_pulling_1"}},{"threshold":1.0,"model":{"type":"model","model":"default:item/topaz_crossbow_pulling_2"}}],"fallback":{"type":"model","model":"default:item/topaz_crossbow_pulling_0"}},"on_false":{"type":"model","model":"default:item/topaz_crossbow"},"property":"using_item"}}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/topaz_helmet.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/topaz_helmet.json new file mode 100644 index 00000000..ee76808b --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/topaz_helmet.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"select","property":"trim_material","cases":[{"when":"minecraft:gold","model":{"type":"model","model":"default:item/topaz_helmet_gold_trim"}},{"when":"minecraft:emerald","model":{"type":"model","model":"default:item/topaz_helmet_emerald_trim"}},{"when":"minecraft:quartz","model":{"type":"model","model":"default:item/topaz_helmet_quartz_trim"}},{"when":"minecraft:redstone","model":{"type":"model","model":"default:item/topaz_helmet_redstone_trim"}},{"when":"minecraft:lapis","model":{"type":"model","model":"default:item/topaz_helmet_lapis_trim"}},{"when":"minecraft:diamond","model":{"type":"model","model":"default:item/topaz_helmet_diamond_trim"}},{"when":"minecraft:amethyst","model":{"type":"model","model":"default:item/topaz_helmet_amethyst_trim"}},{"when":"minecraft:iron","model":{"type":"model","model":"default:item/topaz_helmet_iron_trim"}},{"when":"minecraft:copper","model":{"type":"model","model":"default:item/topaz_helmet_copper_trim"}},{"when":"minecraft:netherite","model":{"type":"model","model":"default:item/topaz_helmet_netherite_trim"}},{"when":"minecraft:resin","model":{"type":"model","model":"default:item/topaz_helmet_resin_trim"}}],"fallback":{"type":"model","model":"default:item/topaz_helmet"}}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/topaz_hoe.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/topaz_hoe.json new file mode 100644 index 00000000..de4c49b5 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/topaz_hoe.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"model","model":"default:item/topaz_hoe"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/topaz_leggings.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/topaz_leggings.json new file mode 100644 index 00000000..704c7202 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/topaz_leggings.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"select","property":"trim_material","cases":[{"when":"minecraft:gold","model":{"type":"model","model":"default:item/topaz_leggings_gold_trim"}},{"when":"minecraft:emerald","model":{"type":"model","model":"default:item/topaz_leggings_emerald_trim"}},{"when":"minecraft:quartz","model":{"type":"model","model":"default:item/topaz_leggings_quartz_trim"}},{"when":"minecraft:redstone","model":{"type":"model","model":"default:item/topaz_leggings_redstone_trim"}},{"when":"minecraft:lapis","model":{"type":"model","model":"default:item/topaz_leggings_lapis_trim"}},{"when":"minecraft:diamond","model":{"type":"model","model":"default:item/topaz_leggings_diamond_trim"}},{"when":"minecraft:amethyst","model":{"type":"model","model":"default:item/topaz_leggings_amethyst_trim"}},{"when":"minecraft:iron","model":{"type":"model","model":"default:item/topaz_leggings_iron_trim"}},{"when":"minecraft:copper","model":{"type":"model","model":"default:item/topaz_leggings_copper_trim"}},{"when":"minecraft:netherite","model":{"type":"model","model":"default:item/topaz_leggings_netherite_trim"}},{"when":"minecraft:resin","model":{"type":"model","model":"default:item/topaz_leggings_resin_trim"}}],"fallback":{"type":"model","model":"default:item/topaz_leggings"}}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/topaz_ore.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/topaz_ore.json new file mode 100644 index 00000000..a69b6b2a --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/topaz_ore.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"model","model":"block/custom/topaz_ore"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/topaz_pickaxe.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/topaz_pickaxe.json new file mode 100644 index 00000000..26da314e --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/topaz_pickaxe.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"model","model":"default:item/topaz_pickaxe"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/topaz_rod.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/topaz_rod.json new file mode 100644 index 00000000..eb9ac363 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/topaz_rod.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"condition","on_true":{"type":"model","model":"default:item/topaz_rod_cast"},"on_false":{"type":"model","model":"default:item/topaz_rod"},"property":"fishing_rod/cast"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/topaz_shovel.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/topaz_shovel.json new file mode 100644 index 00000000..4f0373ee --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/topaz_shovel.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"model","model":"default:item/topaz_shovel"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/topaz_spear.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/topaz_spear.json new file mode 100644 index 00000000..fa985788 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/topaz_spear.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"swap_animation_scale":1.95,"model":{"type":"select","property":"display_context","cases":[{"when":["gui","ground","fixed","on_shelf"],"model":{"type":"model","model":"default:item/topaz_spear"}}],"fallback":{"type":"model","model":"default:item/topaz_spear_in_hand"}}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/topaz_sword.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/topaz_sword.json new file mode 100644 index 00000000..abbcf6b1 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/topaz_sword.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"model","model":"default:item/topaz_sword"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/topaz_trident.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/topaz_trident.json new file mode 100644 index 00000000..0bfcc58e --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/topaz_trident.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"select","property":"display_context","cases":[{"when":["gui","ground","fixed","on_shelf"],"model":{"type":"model","model":"item/custom/topaz_trident"}}],"fallback":{"type":"condition","on_true":{"type":"model","model":"item/custom/topaz_trident_throwing"},"on_false":{"type":"model","model":"item/custom/topaz_trident_in_hand"},"property":"using_item"}}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/wooden_chair.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/wooden_chair.json new file mode 100644 index 00000000..8a6b5d1d --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/wooden_chair.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"model","model":"item/custom/wooden_chair"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/amethyst_torch.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/amethyst_torch.json new file mode 100644 index 00000000..abb88334 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/amethyst_torch.json @@ -0,0 +1 @@ +{"parent":"item/generated","textures":{"layer0":"block/custom/amethyst_torch"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/candelabrum.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/candelabrum.json new file mode 100644 index 00000000..8dc91a0e --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/candelabrum.json @@ -0,0 +1 @@ +{"parent":"item/generated","textures":{"layer0":"item/custom/candelabrum_2d"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/ender_pearl_flower_seeds.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/ender_pearl_flower_seeds.json new file mode 100644 index 00000000..31bf4991 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/ender_pearl_flower_seeds.json @@ -0,0 +1 @@ +{"parent":"item/generated","textures":{"layer0":"item/custom/ender_pearl_flower_seeds"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/fairy_flower.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/fairy_flower.json new file mode 100644 index 00000000..4f91d306 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/fairy_flower.json @@ -0,0 +1 @@ +{"parent":"item/generated","textures":{"layer0":"item/custom/fairy_flower"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/flame_cane.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/flame_cane.json new file mode 100644 index 00000000..3c6e9c74 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/flame_cane.json @@ -0,0 +1 @@ +{"parent":"item/generated","textures":{"layer0":"item/custom/flame_cane"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/flame_elytra.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/flame_elytra.json new file mode 100644 index 00000000..52b2c240 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/flame_elytra.json @@ -0,0 +1 @@ +{"parent":"item/generated","textures":{"layer0":"item/custom/flame_elytra"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/flame_elytra_broken.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/flame_elytra_broken.json new file mode 100644 index 00000000..3f03c56d --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/flame_elytra_broken.json @@ -0,0 +1 @@ +{"parent":"item/generated","textures":{"layer0":"item/custom/flame_elytra_broken"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/flower_basket.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/flower_basket.json new file mode 100644 index 00000000..2899e7f9 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/flower_basket.json @@ -0,0 +1 @@ +{"parent":"item/generated","textures":{"layer0":"item/custom/flower_basket_2d"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/hami_melon_seeds.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/hami_melon_seeds.json new file mode 100644 index 00000000..c10bc837 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/hami_melon_seeds.json @@ -0,0 +1 @@ +{"parent":"item/generated","textures":{"layer0":"item/custom/hami_melon_seeds"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/hami_melon_slice.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/hami_melon_slice.json new file mode 100644 index 00000000..dda4bd27 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/hami_melon_slice.json @@ -0,0 +1 @@ +{"parent":"item/generated","textures":{"layer0":"item/custom/hami_melon_slice"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/magma_fruit.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/magma_fruit.json new file mode 100644 index 00000000..253fca26 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/magma_fruit.json @@ -0,0 +1 @@ +{"parent":"item/generated","textures":{"layer0":"item/custom/magma_fruit"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/palm_door.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/palm_door.json new file mode 100644 index 00000000..9d3f0aaf --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/palm_door.json @@ -0,0 +1 @@ +{"parent":"item/generated","textures":{"layer0":"block/custom/palm_door"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/palm_sapling.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/palm_sapling.json new file mode 100644 index 00000000..f5ca0280 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/palm_sapling.json @@ -0,0 +1 @@ +{"parent":"item/generated","textures":{"layer0":"block/custom/palm_sapling"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/pebble.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/pebble.json new file mode 100644 index 00000000..fb5d789a --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/pebble.json @@ -0,0 +1 @@ +{"parent":"item/generated","textures":{"layer0":"item/custom/pebble"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/reed.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/reed.json new file mode 100644 index 00000000..8b49bc00 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/reed.json @@ -0,0 +1 @@ +{"parent":"item/generated","textures":{"layer0":"item/custom/reed"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/togglable_light_block.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/togglable_light_block.json new file mode 100644 index 00000000..1c0ceab5 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/togglable_light_block.json @@ -0,0 +1 @@ +{"parent":"item/generated","textures":{"layer0":"item/light"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz.json new file mode 100644 index 00000000..822d2a90 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz.json @@ -0,0 +1 @@ +{"parent":"item/generated","textures":{"layer0":"item/custom/topaz"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_axe.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_axe.json new file mode 100644 index 00000000..9ea6ce70 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_axe.json @@ -0,0 +1 @@ +{"parent":"item/handheld","textures":{"layer0":"item/custom/topaz_axe"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_boots.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_boots.json new file mode 100644 index 00000000..6f866b4a --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_boots.json @@ -0,0 +1 @@ +{"parent":"item/generated","textures":{"layer0":"item/custom/topaz_boots"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_boots_amethyst_trim.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_boots_amethyst_trim.json new file mode 100644 index 00000000..8898b1fb --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_boots_amethyst_trim.json @@ -0,0 +1 @@ +{"parent":"item/generated","textures":{"layer0":"item/custom/topaz_boots","layer1":"trims/items/boots_trim_amethyst"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_boots_copper_trim.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_boots_copper_trim.json new file mode 100644 index 00000000..5ffece57 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_boots_copper_trim.json @@ -0,0 +1 @@ +{"parent":"item/generated","textures":{"layer0":"item/custom/topaz_boots","layer1":"trims/items/boots_trim_copper"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_boots_diamond_trim.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_boots_diamond_trim.json new file mode 100644 index 00000000..f1d6b32c --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_boots_diamond_trim.json @@ -0,0 +1 @@ +{"parent":"item/generated","textures":{"layer0":"item/custom/topaz_boots","layer1":"trims/items/boots_trim_diamond"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_boots_emerald_trim.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_boots_emerald_trim.json new file mode 100644 index 00000000..57f0cbf1 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_boots_emerald_trim.json @@ -0,0 +1 @@ +{"parent":"item/generated","textures":{"layer0":"item/custom/topaz_boots","layer1":"trims/items/boots_trim_emerald"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_boots_gold_trim.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_boots_gold_trim.json new file mode 100644 index 00000000..2e98da1a --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_boots_gold_trim.json @@ -0,0 +1 @@ +{"parent":"item/generated","textures":{"layer0":"item/custom/topaz_boots","layer1":"trims/items/boots_trim_gold"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_boots_iron_trim.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_boots_iron_trim.json new file mode 100644 index 00000000..f791c717 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_boots_iron_trim.json @@ -0,0 +1 @@ +{"parent":"item/generated","textures":{"layer0":"item/custom/topaz_boots","layer1":"trims/items/boots_trim_iron"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_boots_lapis_trim.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_boots_lapis_trim.json new file mode 100644 index 00000000..63a832b3 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_boots_lapis_trim.json @@ -0,0 +1 @@ +{"parent":"item/generated","textures":{"layer0":"item/custom/topaz_boots","layer1":"trims/items/boots_trim_lapis"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_boots_netherite_trim.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_boots_netherite_trim.json new file mode 100644 index 00000000..453f7eaf --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_boots_netherite_trim.json @@ -0,0 +1 @@ +{"parent":"item/generated","textures":{"layer0":"item/custom/topaz_boots","layer1":"trims/items/boots_trim_netherite"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_boots_quartz_trim.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_boots_quartz_trim.json new file mode 100644 index 00000000..8feb19ec --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_boots_quartz_trim.json @@ -0,0 +1 @@ +{"parent":"item/generated","textures":{"layer0":"item/custom/topaz_boots","layer1":"trims/items/boots_trim_quartz"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_boots_redstone_trim.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_boots_redstone_trim.json new file mode 100644 index 00000000..8d6fec31 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_boots_redstone_trim.json @@ -0,0 +1 @@ +{"parent":"item/generated","textures":{"layer0":"item/custom/topaz_boots","layer1":"trims/items/boots_trim_redstone"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_boots_resin_trim.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_boots_resin_trim.json new file mode 100644 index 00000000..baec8b06 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_boots_resin_trim.json @@ -0,0 +1 @@ +{"parent":"item/generated","textures":{"layer0":"item/custom/topaz_boots","layer1":"trims/items/boots_trim_resin"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_bow.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_bow.json new file mode 100644 index 00000000..2f5ae0fb --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_bow.json @@ -0,0 +1 @@ +{"parent":"item/bow","textures":{"layer0":"item/custom/topaz_bow"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_bow_pulling_0.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_bow_pulling_0.json new file mode 100644 index 00000000..5bdb357f --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_bow_pulling_0.json @@ -0,0 +1 @@ +{"parent":"item/bow_pulling_0","textures":{"layer0":"item/custom/topaz_bow_pulling_0"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_bow_pulling_1.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_bow_pulling_1.json new file mode 100644 index 00000000..05806466 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_bow_pulling_1.json @@ -0,0 +1 @@ +{"parent":"item/bow_pulling_1","textures":{"layer0":"item/custom/topaz_bow_pulling_1"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_bow_pulling_2.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_bow_pulling_2.json new file mode 100644 index 00000000..c6872574 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_bow_pulling_2.json @@ -0,0 +1 @@ +{"parent":"item/bow_pulling_2","textures":{"layer0":"item/custom/topaz_bow_pulling_2"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_chestplate.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_chestplate.json new file mode 100644 index 00000000..9fc58bc9 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_chestplate.json @@ -0,0 +1 @@ +{"parent":"item/generated","textures":{"layer0":"item/custom/topaz_chestplate"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_chestplate_amethyst_trim.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_chestplate_amethyst_trim.json new file mode 100644 index 00000000..db6ab852 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_chestplate_amethyst_trim.json @@ -0,0 +1 @@ +{"parent":"item/generated","textures":{"layer0":"item/custom/topaz_chestplate","layer1":"trims/items/chestplate_trim_amethyst"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_chestplate_copper_trim.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_chestplate_copper_trim.json new file mode 100644 index 00000000..55c9201b --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_chestplate_copper_trim.json @@ -0,0 +1 @@ +{"parent":"item/generated","textures":{"layer0":"item/custom/topaz_chestplate","layer1":"trims/items/chestplate_trim_copper"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_chestplate_diamond_trim.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_chestplate_diamond_trim.json new file mode 100644 index 00000000..fd8344c7 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_chestplate_diamond_trim.json @@ -0,0 +1 @@ +{"parent":"item/generated","textures":{"layer0":"item/custom/topaz_chestplate","layer1":"trims/items/chestplate_trim_diamond"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_chestplate_emerald_trim.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_chestplate_emerald_trim.json new file mode 100644 index 00000000..45e2a99b --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_chestplate_emerald_trim.json @@ -0,0 +1 @@ +{"parent":"item/generated","textures":{"layer0":"item/custom/topaz_chestplate","layer1":"trims/items/chestplate_trim_emerald"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_chestplate_gold_trim.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_chestplate_gold_trim.json new file mode 100644 index 00000000..2f954a15 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_chestplate_gold_trim.json @@ -0,0 +1 @@ +{"parent":"item/generated","textures":{"layer0":"item/custom/topaz_chestplate","layer1":"trims/items/chestplate_trim_gold"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_chestplate_iron_trim.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_chestplate_iron_trim.json new file mode 100644 index 00000000..3f0a191f --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_chestplate_iron_trim.json @@ -0,0 +1 @@ +{"parent":"item/generated","textures":{"layer0":"item/custom/topaz_chestplate","layer1":"trims/items/chestplate_trim_iron"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_chestplate_lapis_trim.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_chestplate_lapis_trim.json new file mode 100644 index 00000000..4a505097 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_chestplate_lapis_trim.json @@ -0,0 +1 @@ +{"parent":"item/generated","textures":{"layer0":"item/custom/topaz_chestplate","layer1":"trims/items/chestplate_trim_lapis"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_chestplate_netherite_trim.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_chestplate_netherite_trim.json new file mode 100644 index 00000000..33436c69 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_chestplate_netherite_trim.json @@ -0,0 +1 @@ +{"parent":"item/generated","textures":{"layer0":"item/custom/topaz_chestplate","layer1":"trims/items/chestplate_trim_netherite"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_chestplate_quartz_trim.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_chestplate_quartz_trim.json new file mode 100644 index 00000000..b8c72e36 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_chestplate_quartz_trim.json @@ -0,0 +1 @@ +{"parent":"item/generated","textures":{"layer0":"item/custom/topaz_chestplate","layer1":"trims/items/chestplate_trim_quartz"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_chestplate_redstone_trim.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_chestplate_redstone_trim.json new file mode 100644 index 00000000..0a41c71a --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_chestplate_redstone_trim.json @@ -0,0 +1 @@ +{"parent":"item/generated","textures":{"layer0":"item/custom/topaz_chestplate","layer1":"trims/items/chestplate_trim_redstone"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_chestplate_resin_trim.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_chestplate_resin_trim.json new file mode 100644 index 00000000..02b1ce92 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_chestplate_resin_trim.json @@ -0,0 +1 @@ +{"parent":"item/generated","textures":{"layer0":"item/custom/topaz_chestplate","layer1":"trims/items/chestplate_trim_resin"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_crossbow.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_crossbow.json new file mode 100644 index 00000000..bf5d5b9f --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_crossbow.json @@ -0,0 +1 @@ +{"parent":"item/crossbow","textures":{"layer0":"item/custom/topaz_crossbow"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_crossbow_arrow.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_crossbow_arrow.json new file mode 100644 index 00000000..e6873a43 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_crossbow_arrow.json @@ -0,0 +1 @@ +{"parent":"item/crossbow_arrow","textures":{"layer0":"item/custom/topaz_crossbow_arrow"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_crossbow_firework.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_crossbow_firework.json new file mode 100644 index 00000000..d941dab1 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_crossbow_firework.json @@ -0,0 +1 @@ +{"parent":"item/crossbow_firework","textures":{"layer0":"item/custom/topaz_crossbow_firework"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_crossbow_pulling_0.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_crossbow_pulling_0.json new file mode 100644 index 00000000..e2262ef6 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_crossbow_pulling_0.json @@ -0,0 +1 @@ +{"parent":"item/crossbow_pulling_0","textures":{"layer0":"item/custom/topaz_crossbow_pulling_0"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_crossbow_pulling_1.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_crossbow_pulling_1.json new file mode 100644 index 00000000..3c253efc --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_crossbow_pulling_1.json @@ -0,0 +1 @@ +{"parent":"item/crossbow_pulling_1","textures":{"layer0":"item/custom/topaz_crossbow_pulling_1"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_crossbow_pulling_2.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_crossbow_pulling_2.json new file mode 100644 index 00000000..28e4c5e1 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_crossbow_pulling_2.json @@ -0,0 +1 @@ +{"parent":"item/crossbow_pulling_2","textures":{"layer0":"item/custom/topaz_crossbow_pulling_2"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_helmet.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_helmet.json new file mode 100644 index 00000000..87687b14 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_helmet.json @@ -0,0 +1 @@ +{"parent":"item/generated","textures":{"layer0":"item/custom/topaz_helmet"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_helmet_amethyst_trim.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_helmet_amethyst_trim.json new file mode 100644 index 00000000..298a5e89 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_helmet_amethyst_trim.json @@ -0,0 +1 @@ +{"parent":"item/generated","textures":{"layer0":"item/custom/topaz_helmet","layer1":"trims/items/helmet_trim_amethyst"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_helmet_copper_trim.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_helmet_copper_trim.json new file mode 100644 index 00000000..bcc1a253 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_helmet_copper_trim.json @@ -0,0 +1 @@ +{"parent":"item/generated","textures":{"layer0":"item/custom/topaz_helmet","layer1":"trims/items/helmet_trim_copper"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_helmet_diamond_trim.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_helmet_diamond_trim.json new file mode 100644 index 00000000..a775834d --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_helmet_diamond_trim.json @@ -0,0 +1 @@ +{"parent":"item/generated","textures":{"layer0":"item/custom/topaz_helmet","layer1":"trims/items/helmet_trim_diamond"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_helmet_emerald_trim.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_helmet_emerald_trim.json new file mode 100644 index 00000000..aef6a289 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_helmet_emerald_trim.json @@ -0,0 +1 @@ +{"parent":"item/generated","textures":{"layer0":"item/custom/topaz_helmet","layer1":"trims/items/helmet_trim_emerald"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_helmet_gold_trim.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_helmet_gold_trim.json new file mode 100644 index 00000000..d5a6828d --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_helmet_gold_trim.json @@ -0,0 +1 @@ +{"parent":"item/generated","textures":{"layer0":"item/custom/topaz_helmet","layer1":"trims/items/helmet_trim_gold"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_helmet_iron_trim.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_helmet_iron_trim.json new file mode 100644 index 00000000..2e8341b8 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_helmet_iron_trim.json @@ -0,0 +1 @@ +{"parent":"item/generated","textures":{"layer0":"item/custom/topaz_helmet","layer1":"trims/items/helmet_trim_iron"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_helmet_lapis_trim.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_helmet_lapis_trim.json new file mode 100644 index 00000000..8e7793ae --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_helmet_lapis_trim.json @@ -0,0 +1 @@ +{"parent":"item/generated","textures":{"layer0":"item/custom/topaz_helmet","layer1":"trims/items/helmet_trim_lapis"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_helmet_netherite_trim.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_helmet_netherite_trim.json new file mode 100644 index 00000000..da4f36da --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_helmet_netherite_trim.json @@ -0,0 +1 @@ +{"parent":"item/generated","textures":{"layer0":"item/custom/topaz_helmet","layer1":"trims/items/helmet_trim_netherite"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_helmet_quartz_trim.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_helmet_quartz_trim.json new file mode 100644 index 00000000..db156b30 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_helmet_quartz_trim.json @@ -0,0 +1 @@ +{"parent":"item/generated","textures":{"layer0":"item/custom/topaz_helmet","layer1":"trims/items/helmet_trim_quartz"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_helmet_redstone_trim.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_helmet_redstone_trim.json new file mode 100644 index 00000000..ae2394ae --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_helmet_redstone_trim.json @@ -0,0 +1 @@ +{"parent":"item/generated","textures":{"layer0":"item/custom/topaz_helmet","layer1":"trims/items/helmet_trim_redstone"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_helmet_resin_trim.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_helmet_resin_trim.json new file mode 100644 index 00000000..837cc4a2 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_helmet_resin_trim.json @@ -0,0 +1 @@ +{"parent":"item/generated","textures":{"layer0":"item/custom/topaz_helmet","layer1":"trims/items/helmet_trim_resin"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_hoe.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_hoe.json new file mode 100644 index 00000000..4152f83d --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_hoe.json @@ -0,0 +1 @@ +{"parent":"item/handheld","textures":{"layer0":"item/custom/topaz_hoe"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_leggings.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_leggings.json new file mode 100644 index 00000000..066d73ed --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_leggings.json @@ -0,0 +1 @@ +{"parent":"item/generated","textures":{"layer0":"item/custom/topaz_leggings"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_leggings_amethyst_trim.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_leggings_amethyst_trim.json new file mode 100644 index 00000000..4e0cc0cf --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_leggings_amethyst_trim.json @@ -0,0 +1 @@ +{"parent":"item/generated","textures":{"layer0":"item/custom/topaz_leggings","layer1":"trims/items/leggings_trim_amethyst"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_leggings_copper_trim.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_leggings_copper_trim.json new file mode 100644 index 00000000..58d5f109 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_leggings_copper_trim.json @@ -0,0 +1 @@ +{"parent":"item/generated","textures":{"layer0":"item/custom/topaz_leggings","layer1":"trims/items/leggings_trim_copper"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_leggings_diamond_trim.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_leggings_diamond_trim.json new file mode 100644 index 00000000..df295874 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_leggings_diamond_trim.json @@ -0,0 +1 @@ +{"parent":"item/generated","textures":{"layer0":"item/custom/topaz_leggings","layer1":"trims/items/leggings_trim_diamond"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_leggings_emerald_trim.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_leggings_emerald_trim.json new file mode 100644 index 00000000..9ee6ab1a --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_leggings_emerald_trim.json @@ -0,0 +1 @@ +{"parent":"item/generated","textures":{"layer0":"item/custom/topaz_leggings","layer1":"trims/items/leggings_trim_emerald"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_leggings_gold_trim.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_leggings_gold_trim.json new file mode 100644 index 00000000..31127678 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_leggings_gold_trim.json @@ -0,0 +1 @@ +{"parent":"item/generated","textures":{"layer0":"item/custom/topaz_leggings","layer1":"trims/items/leggings_trim_gold"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_leggings_iron_trim.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_leggings_iron_trim.json new file mode 100644 index 00000000..18642a21 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_leggings_iron_trim.json @@ -0,0 +1 @@ +{"parent":"item/generated","textures":{"layer0":"item/custom/topaz_leggings","layer1":"trims/items/leggings_trim_iron"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_leggings_lapis_trim.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_leggings_lapis_trim.json new file mode 100644 index 00000000..2b4c893f --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_leggings_lapis_trim.json @@ -0,0 +1 @@ +{"parent":"item/generated","textures":{"layer0":"item/custom/topaz_leggings","layer1":"trims/items/leggings_trim_lapis"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_leggings_netherite_trim.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_leggings_netherite_trim.json new file mode 100644 index 00000000..6187a5d4 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_leggings_netherite_trim.json @@ -0,0 +1 @@ +{"parent":"item/generated","textures":{"layer0":"item/custom/topaz_leggings","layer1":"trims/items/leggings_trim_netherite"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_leggings_quartz_trim.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_leggings_quartz_trim.json new file mode 100644 index 00000000..a7c66c31 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_leggings_quartz_trim.json @@ -0,0 +1 @@ +{"parent":"item/generated","textures":{"layer0":"item/custom/topaz_leggings","layer1":"trims/items/leggings_trim_quartz"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_leggings_redstone_trim.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_leggings_redstone_trim.json new file mode 100644 index 00000000..d48b6dfa --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_leggings_redstone_trim.json @@ -0,0 +1 @@ +{"parent":"item/generated","textures":{"layer0":"item/custom/topaz_leggings","layer1":"trims/items/leggings_trim_redstone"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_leggings_resin_trim.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_leggings_resin_trim.json new file mode 100644 index 00000000..6eddb280 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_leggings_resin_trim.json @@ -0,0 +1 @@ +{"parent":"item/generated","textures":{"layer0":"item/custom/topaz_leggings","layer1":"trims/items/leggings_trim_resin"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_pickaxe.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_pickaxe.json new file mode 100644 index 00000000..e588c070 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_pickaxe.json @@ -0,0 +1 @@ +{"parent":"item/handheld","textures":{"layer0":"item/custom/topaz_pickaxe"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_rod.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_rod.json new file mode 100644 index 00000000..72abdb08 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_rod.json @@ -0,0 +1 @@ +{"parent":"item/fishing_rod","textures":{"layer0":"item/custom/topaz_rod"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_rod_cast.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_rod_cast.json new file mode 100644 index 00000000..6fc89f5c --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_rod_cast.json @@ -0,0 +1 @@ +{"parent":"item/fishing_rod","textures":{"layer0":"item/custom/topaz_rod_cast"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_shovel.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_shovel.json new file mode 100644 index 00000000..8eec2017 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_shovel.json @@ -0,0 +1 @@ +{"parent":"item/handheld","textures":{"layer0":"item/custom/topaz_shovel"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_spear.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_spear.json new file mode 100644 index 00000000..6291f67a --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_spear.json @@ -0,0 +1 @@ +{"parent":"item/generated","textures":{"layer0":"item/custom/topaz_spear"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_spear_in_hand.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_spear_in_hand.json new file mode 100644 index 00000000..fd16a22f --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_spear_in_hand.json @@ -0,0 +1 @@ +{"parent":"item/spear_in_hand","textures":{"layer0":"item/custom/topaz_spear_in_hand"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_sword.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_sword.json new file mode 100644 index 00000000..dad6268c --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_sword.json @@ -0,0 +1 @@ +{"parent":"item/handheld","textures":{"layer0":"item/custom/topaz_sword"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/internal/items/cooking_info.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/internal/items/cooking_info.json new file mode 100644 index 00000000..9e00b4af --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/internal/items/cooking_info.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"model","model":"item/custom/gui/cooking_info"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/internal/items/exit.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/internal/items/exit.json new file mode 100644 index 00000000..29ee59cf --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/internal/items/exit.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"model","model":"item/custom/gui/exit"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/internal/items/get_item.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/internal/items/get_item.json new file mode 100644 index 00000000..a541914f --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/internal/items/get_item.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"model","model":"item/custom/gui/get_item"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/internal/items/next_page_0.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/internal/items/next_page_0.json new file mode 100644 index 00000000..f7c931e2 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/internal/items/next_page_0.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"model","model":"item/custom/gui/next_page_0"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/internal/items/next_page_1.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/internal/items/next_page_1.json new file mode 100644 index 00000000..93e5a56f --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/internal/items/next_page_1.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"model","model":"item/custom/gui/next_page_1"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/internal/items/previous_page_0.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/internal/items/previous_page_0.json new file mode 100644 index 00000000..026f0b5b --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/internal/items/previous_page_0.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"model","model":"item/custom/gui/previous_page_0"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/internal/items/previous_page_1.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/internal/items/previous_page_1.json new file mode 100644 index 00000000..8fca3cfb --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/internal/items/previous_page_1.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"model","model":"item/custom/gui/previous_page_1"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/internal/items/return.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/internal/items/return.json new file mode 100644 index 00000000..239004ab --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/internal/items/return.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"model","model":"item/custom/gui/return"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/blockstates/anvil.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/blockstates/anvil.json new file mode 100644 index 00000000..3339030a --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/blockstates/anvil.json @@ -0,0 +1 @@ +{"variants":{"facing=east":{"model":"block/custom/netherite_anvil","y":90},"facing=north":{"model":"block/custom/netherite_anvil"}}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/blockstates/brown_mushroom_block.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/blockstates/brown_mushroom_block.json new file mode 100644 index 00000000..a96719d7 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/blockstates/brown_mushroom_block.json @@ -0,0 +1 @@ +{"variants":{"down=true,east=true,north=false,south=false,up=true,west=true":{"model":"block/custom/chessboard_block"},"down=true,east=true,north=false,south=false,up=false,west=false":{"model":"block/custom/palm_log"},"down=true,east=false,north=true,south=true,up=false,west=true":{"model":"block/custom/topaz_ore"},"down=true,east=false,north=true,south=false,up=true,west=false":{"model":"block/custom/stripped_palm_log_horizontal","x":90},"down=true,east=false,north=true,south=true,up=true,west=false":{"model":"block/custom/palm_log_horizontal","x":90},"down=true,east=false,north=true,south=true,up=false,west=false":{"model":"block/custom/stripped_palm_log"},"down=true,east=true,north=true,south=true,up=true,west=false":{"model":"block/custom/chinese_lantern"},"down=true,east=true,north=true,south=false,up=false,west=true":{"model":"block/custom/palm_wood_horizontal","x":90},"down=true,east=true,north=true,south=true,up=false,west=true":{"model":"block/custom/gunpowder_block"},"down=true,east=true,north=true,south=false,up=true,west=false":{"model":"block/custom/palm_planks"},"down=true,east=true,north=true,south=false,up=true,west=true":{"model":"block/custom/palm_wood_horizontal","x":90,"y":90},"down=true,east=true,north=false,south=true,up=false,west=false":{"model":"block/custom/chessboard_block","y":180},"down=true,east=true,north=true,south=false,up=false,west=false":{"model":"block/custom/stripped_palm_wood"},"down=true,east=true,north=false,south=true,up=false,west=true":{"model":"block/custom/chessboard_block","y":270},"down=true,east=true,north=false,south=false,up=false,west=true":{"model":"block/custom/solid_gunpowder_block"},"down=true,east=false,north=true,south=false,up=false,west=false":{"model":"block/custom/deepslate_topaz_ore"},"down=true,east=false,north=true,south=false,up=false,west=true":{"model":"block/custom/hami_melon"},"down=true,east=true,north=true,south=true,up=false,west=false":{"model":"block/custom/palm_wood"},"down=true,east=true,north=false,south=true,up=true,west=true":{"model":"block/custom/stripped_palm_wood_horizontal","x":90,"y":90},"down=true,east=false,north=true,south=true,up=true,west=true":{"model":"block/custom/palm_log_horizontal","x":90,"y":90},"down=true,east=true,north=false,south=true,up=true,west=false":{"model":"block/custom/stripped_palm_wood_horizontal","x":90},"down=true,east=true,north=false,south=false,up=true,west=false":{"model":"block/custom/chessboard_block","y":90},"down=true,east=false,north=true,south=false,up=true,west=true":{"model":"block/custom/stripped_palm_log_horizontal","x":90,"y":90}}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/blockstates/cactus.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/blockstates/cactus.json new file mode 100644 index 00000000..a03b695a --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/blockstates/cactus.json @@ -0,0 +1 @@ +{"variants":{"age=2":{"model":"block/custom/copper_coil_on"},"age=1":{"model":"block/custom/copper_coil"}}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/blockstates/cut_copper_stairs.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/blockstates/cut_copper_stairs.json new file mode 100644 index 00000000..10919992 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/blockstates/cut_copper_stairs.json @@ -0,0 +1 @@ +{"variants":{"facing=west,half=bottom,shape=straight,waterlogged=false":{"model":"block/custom/palm_stairs","y":180,"uvlock":true},"facing=west,half=bottom,shape=outer_right,waterlogged=false":{"model":"block/custom/palm_stairs_outer","y":180,"uvlock":true},"facing=south,half=bottom,shape=inner_left,waterlogged=true":{"model":"block/custom/palm_stairs_inner"},"facing=east,half=bottom,shape=outer_right,waterlogged=true":{"model":"block/custom/palm_stairs_outer"},"facing=east,half=top,shape=outer_right,waterlogged=true":{"model":"block/custom/palm_stairs_outer","x":180,"y":90,"uvlock":true},"facing=west,half=bottom,shape=inner_left,waterlogged=false":{"model":"block/custom/palm_stairs_inner","y":90,"uvlock":true},"facing=north,half=bottom,shape=inner_right,waterlogged=false":{"model":"block/custom/palm_stairs_inner","y":270,"uvlock":true},"facing=north,half=top,shape=inner_left,waterlogged=false":{"model":"block/custom/palm_stairs_inner","x":180,"y":270,"uvlock":true},"facing=west,half=top,shape=outer_right,waterlogged=true":{"model":"block/custom/palm_stairs_outer","x":180,"y":270,"uvlock":true},"facing=east,half=top,shape=straight,waterlogged=false":{"model":"block/custom/palm_stairs","x":180,"uvlock":true},"facing=west,half=bottom,shape=straight,waterlogged=true":{"model":"block/custom/palm_stairs","y":180,"uvlock":true},"facing=north,half=bottom,shape=inner_left,waterlogged=true":{"model":"block/custom/palm_stairs_inner","y":180,"uvlock":true},"facing=south,half=bottom,shape=inner_right,waterlogged=false":{"model":"block/custom/palm_stairs_inner","y":90,"uvlock":true},"facing=west,half=bottom,shape=outer_left,waterlogged=false":{"model":"block/custom/palm_stairs_outer","y":90,"uvlock":true},"facing=west,half=top,shape=outer_left,waterlogged=false":{"model":"block/custom/palm_stairs_outer","x":180,"y":180,"uvlock":true},"facing=west,half=top,shape=inner_right,waterlogged=false":{"model":"block/custom/palm_stairs_inner","x":180,"y":270,"uvlock":true},"facing=east,half=top,shape=outer_left,waterlogged=true":{"model":"block/custom/palm_stairs_outer","x":180,"uvlock":true},"facing=north,half=top,shape=outer_left,waterlogged=false":{"model":"block/custom/palm_stairs_outer","x":180,"y":270,"uvlock":true},"facing=north,half=top,shape=inner_right,waterlogged=true":{"model":"block/custom/palm_stairs_inner","x":180,"uvlock":true},"facing=north,half=top,shape=inner_right,waterlogged=false":{"model":"block/custom/palm_stairs_inner","x":180,"uvlock":true},"facing=east,half=bottom,shape=inner_right,waterlogged=true":{"model":"block/custom/palm_stairs_inner"},"facing=north,half=top,shape=outer_left,waterlogged=true":{"model":"block/custom/palm_stairs_outer","x":180,"y":270,"uvlock":true},"facing=west,half=bottom,shape=inner_right,waterlogged=true":{"model":"block/custom/palm_stairs_inner","y":180,"uvlock":true},"facing=west,half=top,shape=inner_right,waterlogged=true":{"model":"block/custom/palm_stairs_inner","x":180,"y":270,"uvlock":true},"facing=west,half=top,shape=outer_left,waterlogged=true":{"model":"block/custom/palm_stairs_outer","x":180,"y":180,"uvlock":true},"facing=west,half=top,shape=inner_left,waterlogged=false":{"model":"block/custom/palm_stairs_inner","x":180,"y":180,"uvlock":true},"facing=north,half=bottom,shape=inner_right,waterlogged=true":{"model":"block/custom/palm_stairs_inner","y":270,"uvlock":true},"facing=south,half=bottom,shape=inner_right,waterlogged=true":{"model":"block/custom/palm_stairs_inner","y":90,"uvlock":true},"facing=north,half=bottom,shape=outer_right,waterlogged=true":{"model":"block/custom/palm_stairs_outer","y":270,"uvlock":true},"facing=east,half=top,shape=outer_right,waterlogged=false":{"model":"block/custom/palm_stairs_outer","x":180,"y":90,"uvlock":true},"facing=south,half=top,shape=inner_left,waterlogged=false":{"model":"block/custom/palm_stairs_inner","x":180,"y":90,"uvlock":true},"facing=south,half=bottom,shape=outer_left,waterlogged=true":{"model":"block/custom/palm_stairs_outer"},"facing=west,half=bottom,shape=inner_left,waterlogged=true":{"model":"block/custom/palm_stairs_inner","y":90,"uvlock":true},"facing=east,half=top,shape=inner_left,waterlogged=false":{"model":"block/custom/palm_stairs_inner","x":180,"uvlock":true},"facing=east,half=bottom,shape=inner_left,waterlogged=false":{"model":"block/custom/palm_stairs_inner","y":270,"uvlock":true},"facing=west,half=bottom,shape=outer_right,waterlogged=true":{"model":"block/custom/palm_stairs_outer","y":180,"uvlock":true},"facing=south,half=top,shape=straight,waterlogged=false":{"model":"block/custom/palm_stairs","x":180,"y":90,"uvlock":true},"facing=north,half=top,shape=outer_right,waterlogged=false":{"model":"block/custom/palm_stairs_outer","x":180,"uvlock":true},"facing=north,half=top,shape=straight,waterlogged=false":{"model":"block/custom/palm_stairs","x":180,"y":270,"uvlock":true},"facing=east,half=top,shape=inner_right,waterlogged=false":{"model":"block/custom/palm_stairs_inner","x":180,"y":90,"uvlock":true},"facing=north,half=bottom,shape=outer_left,waterlogged=true":{"model":"block/custom/palm_stairs_outer","y":180,"uvlock":true},"facing=south,half=top,shape=outer_left,waterlogged=false":{"model":"block/custom/palm_stairs_outer","x":180,"y":90,"uvlock":true},"facing=east,half=bottom,shape=outer_left,waterlogged=true":{"model":"block/custom/palm_stairs_outer","y":270,"uvlock":true},"facing=east,half=bottom,shape=straight,waterlogged=true":{"model":"block/custom/palm_stairs"},"facing=south,half=bottom,shape=straight,waterlogged=true":{"model":"block/custom/palm_stairs","y":90,"uvlock":true},"facing=east,half=top,shape=outer_left,waterlogged=false":{"model":"block/custom/palm_stairs_outer","x":180,"uvlock":true},"facing=west,half=top,shape=outer_right,waterlogged=false":{"model":"block/custom/palm_stairs_outer","x":180,"y":270,"uvlock":true},"facing=north,half=top,shape=inner_left,waterlogged=true":{"model":"block/custom/palm_stairs_inner","x":180,"y":270,"uvlock":true},"facing=north,half=bottom,shape=inner_left,waterlogged=false":{"model":"block/custom/palm_stairs_inner","y":180,"uvlock":true},"facing=south,half=bottom,shape=inner_left,waterlogged=false":{"model":"block/custom/palm_stairs_inner"},"facing=south,half=top,shape=outer_left,waterlogged=true":{"model":"block/custom/palm_stairs_outer","x":180,"y":90,"uvlock":true},"facing=west,half=bottom,shape=outer_left,waterlogged=true":{"model":"block/custom/palm_stairs_outer","y":90,"uvlock":true},"facing=north,half=top,shape=straight,waterlogged=true":{"model":"block/custom/palm_stairs","x":180,"y":270,"uvlock":true},"facing=south,half=top,shape=inner_right,waterlogged=true":{"model":"block/custom/palm_stairs_inner","x":180,"y":180,"uvlock":true},"facing=south,half=top,shape=outer_right,waterlogged=false":{"model":"block/custom/palm_stairs_outer","x":180,"y":180,"uvlock":true},"facing=north,half=bottom,shape=outer_left,waterlogged=false":{"model":"block/custom/palm_stairs_outer","y":180,"uvlock":true},"facing=east,half=bottom,shape=straight,waterlogged=false":{"model":"block/custom/palm_stairs"},"facing=north,half=bottom,shape=straight,waterlogged=true":{"model":"block/custom/palm_stairs","y":270,"uvlock":true},"facing=east,half=top,shape=straight,waterlogged=true":{"model":"block/custom/palm_stairs","x":180,"uvlock":true},"facing=south,half=top,shape=inner_left,waterlogged=true":{"model":"block/custom/palm_stairs_inner","x":180,"y":90,"uvlock":true},"facing=east,half=bottom,shape=outer_right,waterlogged=false":{"model":"block/custom/palm_stairs_outer"},"facing=east,half=bottom,shape=inner_left,waterlogged=true":{"model":"block/custom/palm_stairs_inner","y":270,"uvlock":true},"facing=south,half=bottom,shape=outer_left,waterlogged=false":{"model":"block/custom/palm_stairs_outer"},"facing=east,half=bottom,shape=outer_left,waterlogged=false":{"model":"block/custom/palm_stairs_outer","y":270,"uvlock":true},"facing=west,half=top,shape=straight,waterlogged=true":{"model":"block/custom/palm_stairs","x":180,"y":180,"uvlock":true},"facing=north,half=top,shape=outer_right,waterlogged=true":{"model":"block/custom/palm_stairs_outer","x":180,"uvlock":true},"facing=south,half=bottom,shape=straight,waterlogged=false":{"model":"block/custom/palm_stairs","y":90,"uvlock":true},"facing=south,half=bottom,shape=outer_right,waterlogged=true":{"model":"block/custom/palm_stairs_outer","y":90,"uvlock":true},"facing=west,half=bottom,shape=inner_right,waterlogged=false":{"model":"block/custom/palm_stairs_inner","y":180,"uvlock":true},"facing=south,half=top,shape=straight,waterlogged=true":{"model":"block/custom/palm_stairs","x":180,"y":90,"uvlock":true},"facing=west,half=top,shape=straight,waterlogged=false":{"model":"block/custom/palm_stairs","x":180,"y":180,"uvlock":true},"facing=north,half=bottom,shape=outer_right,waterlogged=false":{"model":"block/custom/palm_stairs_outer","y":270,"uvlock":true},"facing=east,half=top,shape=inner_right,waterlogged=true":{"model":"block/custom/palm_stairs_inner","x":180,"y":90,"uvlock":true},"facing=south,half=top,shape=inner_right,waterlogged=false":{"model":"block/custom/palm_stairs_inner","x":180,"y":180,"uvlock":true},"facing=south,half=top,shape=outer_right,waterlogged=true":{"model":"block/custom/palm_stairs_outer","x":180,"y":180,"uvlock":true},"facing=north,half=bottom,shape=straight,waterlogged=false":{"model":"block/custom/palm_stairs","y":270,"uvlock":true},"facing=east,half=top,shape=inner_left,waterlogged=true":{"model":"block/custom/palm_stairs_inner","x":180,"uvlock":true},"facing=south,half=bottom,shape=outer_right,waterlogged=false":{"model":"block/custom/palm_stairs_outer","y":90,"uvlock":true},"facing=west,half=top,shape=inner_left,waterlogged=true":{"model":"block/custom/palm_stairs_inner","x":180,"y":180,"uvlock":true},"facing=east,half=bottom,shape=inner_right,waterlogged=false":{"model":"block/custom/palm_stairs_inner"}}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/blockstates/light_weighted_pressure_plate.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/blockstates/light_weighted_pressure_plate.json new file mode 100644 index 00000000..6e65eae6 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/blockstates/light_weighted_pressure_plate.json @@ -0,0 +1 @@ +{"variants":{"power=2":{"model":"block/custom/palm_pressure_plate"},"power=3":{"model":"block/custom/palm_pressure_plate_powered"}}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/blockstates/note_block.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/blockstates/note_block.json new file mode 100644 index 00000000..9bd4384b --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/blockstates/note_block.json @@ -0,0 +1 @@ +{"variants":{"instrument=basedrum,note=4,powered=false":{"model":"block/custom/safe_block_open","y":180},"instrument=basedrum,note=0,powered=true":{"model":"block/custom/drawer_block","y":90},"instrument=basedrum,note=1,powered=true":{"model":"block/custom/drawer_block","y":180},"instrument=basedrum,note=2,powered=true":{"model":"block/custom/safe_block","y":90},"instrument=basedrum,note=5,powered=false":{"model":"block/custom/safe_block_open","y":270},"instrument=basedrum,note=1,powered=false":{"model":"block/custom/drawer_block","y":270},"instrument=basedrum,note=5,powered=true":{"model":"block/custom/safe_block","y":270},"instrument=basedrum,note=0,powered=false":{"model":"block/custom/drawer_block"},"instrument=basedrum,note=3,powered=true":{"model":"block/custom/safe_block"},"instrument=basedrum,note=2,powered=false":{"model":"block/custom/safe_block_open","y":90},"instrument=basedrum,note=3,powered=false":{"model":"block/custom/safe_block_open"},"instrument=basedrum,note=4,powered=true":{"model":"block/custom/safe_block","y":180}}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/blockstates/oak_door.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/blockstates/oak_door.json new file mode 100644 index 00000000..4660e202 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/blockstates/oak_door.json @@ -0,0 +1 @@ +{"variants":{"facing=west,half=lower,hinge=right,open=false,powered=true":{"model":"block/custom/palm_door_bottom_right","y":180},"facing=north,half=upper,hinge=left,open=true,powered=true":{"model":"block/custom/palm_door_top_left_open"},"facing=north,half=lower,hinge=right,open=true,powered=true":{"model":"block/custom/palm_door_bottom_right_open","y":180},"facing=south,half=lower,hinge=left,open=true,powered=true":{"model":"block/custom/palm_door_bottom_left_open","y":180},"facing=west,half=lower,hinge=left,open=false,powered=true":{"model":"block/custom/palm_door_bottom_left","y":180},"facing=south,half=lower,hinge=right,open=true,powered=true":{"model":"block/custom/palm_door_bottom_right_open"},"facing=south,half=lower,hinge=right,open=false,powered=true":{"model":"block/custom/palm_door_bottom_right","y":90},"facing=west,half=upper,hinge=right,open=true,powered=true":{"model":"block/custom/palm_door_top_right_open","y":90},"facing=south,half=upper,hinge=left,open=true,powered=true":{"model":"block/custom/palm_door_top_left_open","y":180},"facing=south,half=upper,hinge=right,open=true,powered=true":{"model":"block/custom/palm_door_top_right_open"},"facing=south,half=upper,hinge=right,open=false,powered=true":{"model":"block/custom/palm_door_top_right","y":90},"facing=east,half=upper,hinge=right,open=false,powered=true":{"model":"block/custom/palm_door_top_right"},"facing=west,half=upper,hinge=left,open=true,powered=true":{"model":"block/custom/palm_door_top_left_open","y":270},"facing=south,half=lower,hinge=left,open=false,powered=true":{"model":"block/custom/palm_door_bottom_left","y":90},"facing=west,half=upper,hinge=left,open=false,powered=true":{"model":"block/custom/palm_door_top_left","y":180},"facing=west,half=upper,hinge=right,open=false,powered=true":{"model":"block/custom/palm_door_top_right","y":180},"facing=east,half=lower,hinge=left,open=true,powered=true":{"model":"block/custom/palm_door_bottom_left_open","y":90},"facing=north,half=lower,hinge=right,open=false,powered=true":{"model":"block/custom/palm_door_bottom_right","y":270},"facing=south,half=upper,hinge=left,open=false,powered=true":{"model":"block/custom/palm_door_top_left","y":90},"facing=east,half=upper,hinge=left,open=false,powered=true":{"model":"block/custom/palm_door_top_left"},"facing=north,half=upper,hinge=left,open=false,powered=true":{"model":"block/custom/palm_door_top_left","y":270},"facing=east,half=lower,hinge=left,open=false,powered=true":{"model":"block/custom/palm_door_bottom_left"},"facing=east,half=lower,hinge=right,open=false,powered=true":{"model":"block/custom/palm_door_bottom_right"},"facing=east,half=upper,hinge=right,open=true,powered=true":{"model":"block/custom/palm_door_top_right_open","y":270},"facing=west,half=lower,hinge=left,open=true,powered=true":{"model":"block/custom/palm_door_bottom_left_open","y":270},"facing=north,half=lower,hinge=left,open=true,powered=true":{"model":"block/custom/palm_door_bottom_left_open"},"facing=north,half=upper,hinge=right,open=false,powered=true":{"model":"block/custom/palm_door_top_right","y":270},"facing=east,half=upper,hinge=left,open=true,powered=true":{"model":"block/custom/palm_door_top_left_open","y":90},"facing=west,half=lower,hinge=right,open=true,powered=true":{"model":"block/custom/palm_door_bottom_right_open","y":90},"facing=east,half=lower,hinge=right,open=true,powered=true":{"model":"block/custom/palm_door_bottom_right_open","y":270},"facing=north,half=lower,hinge=left,open=false,powered=true":{"model":"block/custom/palm_door_bottom_left","y":270},"facing=north,half=upper,hinge=right,open=true,powered=true":{"model":"block/custom/palm_door_top_right_open","y":180}}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/blockstates/oak_fence_gate.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/blockstates/oak_fence_gate.json new file mode 100644 index 00000000..7a9c18b1 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/blockstates/oak_fence_gate.json @@ -0,0 +1 @@ +{"variants":{"facing=south,in_wall=false,open=false,powered=true":{"model":"block/custom/palm_fence_gate","uvlock":true},"facing=west,in_wall=false,open=false,powered=true":{"model":"block/custom/palm_fence_gate","y":90,"uvlock":true},"facing=west,in_wall=true,open=false,powered=true":{"model":"block/custom/palm_fence_gate_wall","y":90,"uvlock":true},"facing=north,in_wall=true,open=true,powered=true":{"model":"block/custom/palm_fence_gate_wall_open","y":180,"uvlock":true},"facing=south,in_wall=true,open=false,powered=true":{"model":"block/custom/palm_fence_gate_wall","uvlock":true},"facing=east,in_wall=true,open=true,powered=true":{"model":"block/custom/palm_fence_gate_wall_open","y":270,"uvlock":true},"facing=north,in_wall=false,open=true,powered=true":{"model":"block/custom/palm_fence_gate_open","y":180,"uvlock":true},"facing=east,in_wall=true,open=false,powered=true":{"model":"block/custom/palm_fence_gate_wall","y":270,"uvlock":true},"facing=east,in_wall=false,open=true,powered=true":{"model":"block/custom/palm_fence_gate_open","y":270,"uvlock":true},"facing=west,in_wall=false,open=true,powered=true":{"model":"block/custom/palm_fence_gate_open","y":90,"uvlock":true},"facing=north,in_wall=false,open=false,powered=true":{"model":"block/custom/palm_fence_gate","y":180,"uvlock":true},"facing=east,in_wall=false,open=false,powered=true":{"model":"block/custom/palm_fence_gate","y":270,"uvlock":true},"facing=west,in_wall=true,open=true,powered=true":{"model":"block/custom/palm_fence_gate_wall_open","y":90,"uvlock":true},"facing=north,in_wall=true,open=false,powered=true":{"model":"block/custom/palm_fence_gate_wall","y":180,"uvlock":true},"facing=south,in_wall=true,open=true,powered=true":{"model":"block/custom/palm_fence_gate_wall_open","uvlock":true},"facing=south,in_wall=false,open=true,powered=true":{"model":"block/custom/palm_fence_gate_open","uvlock":true}}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/blockstates/oak_leaves.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/blockstates/oak_leaves.json new file mode 100644 index 00000000..66efc18d --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/blockstates/oak_leaves.json @@ -0,0 +1 @@ +{"variants":{"distance=1,persistent=true,waterlogged=true":{"model":"block/custom/palm_leaves"},"distance=1,persistent=true,waterlogged=false":{"model":"block/custom/palm_leaves"}}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/blockstates/oak_sapling.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/blockstates/oak_sapling.json new file mode 100644 index 00000000..ab63a5c6 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/blockstates/oak_sapling.json @@ -0,0 +1 @@ +{"variants":{"stage=1":{"model":"block/custom/palm_sapling"}}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/blockstates/oak_trapdoor.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/blockstates/oak_trapdoor.json new file mode 100644 index 00000000..71ac2455 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/blockstates/oak_trapdoor.json @@ -0,0 +1 @@ +{"variants":{"facing=east,half=bottom,open=false,powered=true,waterlogged=false":{"model":"block/custom/palm_trapdoor_bottom","y":90},"facing=north,half=top,open=false,powered=true,waterlogged=true":{"model":"block/custom/palm_trapdoor_top"},"facing=north,half=bottom,open=true,powered=true,waterlogged=false":{"model":"block/custom/palm_trapdoor_open"},"facing=south,half=bottom,open=false,powered=true,waterlogged=false":{"model":"block/custom/palm_trapdoor_bottom","y":180},"facing=west,half=top,open=true,powered=true,waterlogged=false":{"model":"block/custom/palm_trapdoor_open","x":180,"y":90},"facing=east,half=bottom,open=true,powered=true,waterlogged=true":{"model":"block/custom/palm_trapdoor_open","y":90},"facing=west,half=bottom,open=false,powered=true,waterlogged=false":{"model":"block/custom/palm_trapdoor_bottom","y":270},"facing=east,half=top,open=false,powered=true,waterlogged=false":{"model":"block/custom/palm_trapdoor_top","y":90},"facing=east,half=bottom,open=true,powered=true,waterlogged=false":{"model":"block/custom/palm_trapdoor_open","y":90},"facing=west,half=top,open=false,powered=true,waterlogged=true":{"model":"block/custom/palm_trapdoor_top","y":270},"facing=north,half=top,open=true,powered=true,waterlogged=true":{"model":"block/custom/palm_trapdoor_open","x":180,"y":180},"facing=south,half=bottom,open=false,powered=true,waterlogged=true":{"model":"block/custom/palm_trapdoor_bottom","y":180},"facing=south,half=top,open=true,powered=true,waterlogged=true":{"model":"block/custom/palm_trapdoor_open","x":180},"facing=west,half=bottom,open=true,powered=true,waterlogged=true":{"model":"block/custom/palm_trapdoor_open","y":270},"facing=north,half=bottom,open=false,powered=true,waterlogged=false":{"model":"block/custom/palm_trapdoor_bottom"},"facing=north,half=top,open=true,powered=true,waterlogged=false":{"model":"block/custom/palm_trapdoor_open","x":180,"y":180},"facing=west,half=bottom,open=false,powered=true,waterlogged=true":{"model":"block/custom/palm_trapdoor_bottom","y":270},"facing=north,half=bottom,open=true,powered=true,waterlogged=true":{"model":"block/custom/palm_trapdoor_open"},"facing=west,half=bottom,open=true,powered=true,waterlogged=false":{"model":"block/custom/palm_trapdoor_open","y":270},"facing=east,half=top,open=true,powered=true,waterlogged=true":{"model":"block/custom/palm_trapdoor_open","x":180,"y":270},"facing=south,half=top,open=false,powered=true,waterlogged=false":{"model":"block/custom/palm_trapdoor_top","y":180},"facing=north,half=bottom,open=false,powered=true,waterlogged=true":{"model":"block/custom/palm_trapdoor_bottom"},"facing=west,half=top,open=false,powered=true,waterlogged=false":{"model":"block/custom/palm_trapdoor_top","y":270},"facing=east,half=top,open=false,powered=true,waterlogged=true":{"model":"block/custom/palm_trapdoor_top","y":90},"facing=east,half=bottom,open=false,powered=true,waterlogged=true":{"model":"block/custom/palm_trapdoor_bottom","y":90},"facing=south,half=bottom,open=true,powered=true,waterlogged=true":{"model":"block/custom/palm_trapdoor_open","y":180},"facing=south,half=bottom,open=true,powered=true,waterlogged=false":{"model":"block/custom/palm_trapdoor_open","y":180},"facing=west,half=top,open=true,powered=true,waterlogged=true":{"model":"block/custom/palm_trapdoor_open","x":180,"y":90},"facing=east,half=top,open=true,powered=true,waterlogged=false":{"model":"block/custom/palm_trapdoor_open","x":180,"y":270},"facing=south,half=top,open=false,powered=true,waterlogged=true":{"model":"block/custom/palm_trapdoor_top","y":180},"facing=north,half=top,open=false,powered=true,waterlogged=false":{"model":"block/custom/palm_trapdoor_top"},"facing=south,half=top,open=true,powered=true,waterlogged=false":{"model":"block/custom/palm_trapdoor_open","x":180}}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/blockstates/petrified_oak_slab.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/blockstates/petrified_oak_slab.json new file mode 100644 index 00000000..51839f7f --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/blockstates/petrified_oak_slab.json @@ -0,0 +1 @@ +{"variants":{"type=bottom,waterlogged=true":{"model":"block/custom/palm_slab"},"type=double,waterlogged=true":{"model":"block/custom/palm_planks"},"type=top,waterlogged=false":{"model":"block/custom/palm_slab_top"},"type=double,waterlogged=false":{"model":"block/custom/palm_planks"},"type=bottom,waterlogged=false":{"model":"block/custom/palm_slab"},"type=top,waterlogged=true":{"model":"block/custom/palm_slab_top"}}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/blockstates/sugar_cane.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/blockstates/sugar_cane.json new file mode 100644 index 00000000..14d5ebd0 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/blockstates/sugar_cane.json @@ -0,0 +1 @@ +{"variants":{"age=5":{"model":"block/custom/magma_plant_stage_2"},"age=4":{"model":"minecraft:block/empty"},"age=3":[{"model":"block/custom/fairy_flower_1","weight":100},{"model":"block/custom/fairy_flower_2","weight":5},{"model":"block/custom/fairy_flower_3","weight":5},{"model":"block/custom/fairy_flower_4","weight":5}],"age=2":{"model":"block/custom/reed"},"age=1":[{"model":"block/custom/flame_cane_1","weight":1},{"model":"block/custom/flame_cane_2","weight":1}],"age=7":{"model":"block/custom/ender_pearl_flower_stage_2"},"age=6":[{"model":"block/custom/magma_plant_stage_3","weight":1},{"model":"block/custom/magma_plant_stage_3","y":90,"weight":1},{"model":"block/custom/magma_plant_stage_3","y":180,"weight":1},{"model":"block/custom/magma_plant_stage_3","y":270,"weight":1}]}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/blockstates/tripwire.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/blockstates/tripwire.json new file mode 100644 index 00000000..e9803031 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/blockstates/tripwire.json @@ -0,0 +1 @@ +{"variants":{"attached=true,disarmed=true,east=true,north=true,powered=false,south=true,west=true":{"model":"block/custom/ender_pearl_flower_stage_0"},"attached=true,disarmed=true,east=true,north=true,powered=true,south=false,west=false":{"model":"block/custom/magma_plant_stage_0"},"attached=true,disarmed=true,east=true,north=true,powered=true,south=false,west=true":[{"model":"block/custom/pebble_2","weight":1},{"model":"block/custom/pebble_2","y":90,"weight":1},{"model":"block/custom/pebble_2","y":180,"weight":1},{"model":"block/custom/pebble_2","y":270,"weight":1}],"attached=false,disarmed=true,east=true,north=true,powered=true,south=false,west=false":{"model":"block/custom/ender_pearl_flower_stage_1"},"attached=false,disarmed=true,east=true,north=true,powered=true,south=false,west=true":{"model":"block/custom/magma_plant_stage_1"},"attached=false,disarmed=true,east=true,north=true,powered=true,south=true,west=false":[{"model":"block/custom/pebble_3","weight":1},{"model":"block/custom/pebble_3","y":90,"weight":1},{"model":"block/custom/pebble_3","y":180,"weight":1},{"model":"block/custom/pebble_3","y":270,"weight":1}],"attached=true,disarmed=true,east=true,north=true,powered=true,south=true,west=false":[{"model":"block/custom/pebble_1","weight":1},{"model":"block/custom/pebble_1","y":90,"weight":1},{"model":"block/custom/pebble_1","y":180,"weight":1},{"model":"block/custom/pebble_1","y":270,"weight":1}]}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/font/default.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/font/default.json new file mode 100644 index 00000000..98932fde --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/font/default.json @@ -0,0 +1 @@ +{"providers":[{"type":"bitmap","height":-3,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf800"]},{"type":"bitmap","height":-4,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf801"]},{"type":"bitmap","height":-5,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf802"]},{"type":"bitmap","height":-6,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf803"]},{"type":"bitmap","height":-7,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf804"]},{"type":"bitmap","height":-8,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf805"]},{"type":"bitmap","height":-9,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf806"]},{"type":"bitmap","height":-10,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf807"]},{"type":"bitmap","height":-11,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf808"]},{"type":"bitmap","height":-12,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf809"]},{"type":"bitmap","height":-13,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf80a"]},{"type":"bitmap","height":-14,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf80b"]},{"type":"bitmap","height":-16,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf80d"]},{"type":"bitmap","height":-15,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf80c"]},{"type":"bitmap","height":-17,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf80e"]},{"type":"bitmap","height":-18,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf80f"]},{"type":"bitmap","height":-34,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf810"]},{"type":"bitmap","height":-50,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf811"]},{"type":"bitmap","height":-66,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf812"]},{"type":"bitmap","height":-130,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf813"]},{"type":"bitmap","height":-258,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf814"]},{"type":"bitmap","height":-1,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf830"]},{"type":"bitmap","height":1,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf831"]},{"type":"bitmap","height":2,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf832"]},{"type":"bitmap","height":3,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf833"]},{"type":"bitmap","height":4,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf834"]},{"type":"bitmap","height":5,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf835"]},{"type":"bitmap","height":6,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf836"]},{"type":"bitmap","height":7,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf837"]},{"type":"bitmap","height":8,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf838"]},{"type":"bitmap","height":9,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf839"]},{"type":"bitmap","height":10,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf83a"]},{"type":"bitmap","height":11,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf83b"]},{"type":"bitmap","height":12,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf83c"]},{"type":"bitmap","height":13,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf83d"]},{"type":"bitmap","height":14,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf83e"]},{"type":"bitmap","height":15,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf83f"]},{"type":"bitmap","height":31,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf840"]},{"type":"bitmap","height":47,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf841"]},{"type":"bitmap","height":63,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf842"]},{"type":"bitmap","height":127,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf843"]},{"type":"bitmap","height":255,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf844"]},{"type":"bitmap","height":11,"ascent":9,"file":"minecraft:font/image/emojis.png","chars":["\ue000\ue001\ue002\ue003","\ue004\ue005\ue006\ue007","\ue008\ue009\ue00a\ue00b","\ue00c\ue00d\ue00e\ue00f"]}]} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/font/gui.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/font/gui.json new file mode 100644 index 00000000..070537f8 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/font/gui.json @@ -0,0 +1 @@ +{"providers":[{"type":"bitmap","height":140,"ascent":18,"file":"minecraft:font/gui/custom/item_browser.png","chars":["\u4e00"]},{"type":"bitmap","height":140,"ascent":18,"file":"minecraft:font/gui/custom/category.png","chars":["\u4e01"]},{"type":"bitmap","height":138,"ascent":16,"file":"minecraft:font/gui/custom/cooking_recipe.png","chars":["\u4e03"]},{"type":"bitmap","height":23,"ascent":20,"file":"minecraft:font/gui/custom/smoking.png","chars":["\u4e05"]},{"type":"bitmap","height":142,"ascent":20,"file":"minecraft:font/gui/custom/crafting_recipe.png","chars":["\u4e02"]},{"type":"bitmap","height":23,"ascent":20,"file":"minecraft:font/gui/custom/blasting.png","chars":["\u4e06"]},{"type":"bitmap","height":23,"ascent":20,"file":"minecraft:font/gui/custom/smelting.png","chars":["\u4e04"]},{"type":"bitmap","height":142,"ascent":20,"file":"minecraft:font/gui/custom/stonecutting_recipe.png","chars":["\u4e08"]},{"type":"bitmap","height":23,"ascent":20,"file":"minecraft:font/gui/custom/campfire.png","chars":["\u4e07"]},{"type":"bitmap","height":142,"ascent":20,"file":"minecraft:font/gui/custom/smithing_transform_recipe.png","chars":["\u4e09"]},{"type":"bitmap","height":142,"ascent":20,"file":"minecraft:font/gui/custom/brewing_recipe.png","chars":["\u4e0a"]},{"type":"bitmap","height":140,"ascent":18,"file":"minecraft:font/gui/custom/no_recipe.png","chars":["\u4e0b"]}]} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/font/uniform.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/font/uniform.json new file mode 100644 index 00000000..98932fde --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/font/uniform.json @@ -0,0 +1 @@ +{"providers":[{"type":"bitmap","height":-3,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf800"]},{"type":"bitmap","height":-4,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf801"]},{"type":"bitmap","height":-5,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf802"]},{"type":"bitmap","height":-6,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf803"]},{"type":"bitmap","height":-7,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf804"]},{"type":"bitmap","height":-8,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf805"]},{"type":"bitmap","height":-9,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf806"]},{"type":"bitmap","height":-10,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf807"]},{"type":"bitmap","height":-11,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf808"]},{"type":"bitmap","height":-12,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf809"]},{"type":"bitmap","height":-13,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf80a"]},{"type":"bitmap","height":-14,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf80b"]},{"type":"bitmap","height":-16,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf80d"]},{"type":"bitmap","height":-15,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf80c"]},{"type":"bitmap","height":-17,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf80e"]},{"type":"bitmap","height":-18,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf80f"]},{"type":"bitmap","height":-34,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf810"]},{"type":"bitmap","height":-50,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf811"]},{"type":"bitmap","height":-66,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf812"]},{"type":"bitmap","height":-130,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf813"]},{"type":"bitmap","height":-258,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf814"]},{"type":"bitmap","height":-1,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf830"]},{"type":"bitmap","height":1,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf831"]},{"type":"bitmap","height":2,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf832"]},{"type":"bitmap","height":3,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf833"]},{"type":"bitmap","height":4,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf834"]},{"type":"bitmap","height":5,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf835"]},{"type":"bitmap","height":6,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf836"]},{"type":"bitmap","height":7,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf837"]},{"type":"bitmap","height":8,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf838"]},{"type":"bitmap","height":9,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf839"]},{"type":"bitmap","height":10,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf83a"]},{"type":"bitmap","height":11,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf83b"]},{"type":"bitmap","height":12,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf83c"]},{"type":"bitmap","height":13,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf83d"]},{"type":"bitmap","height":14,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf83e"]},{"type":"bitmap","height":15,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf83f"]},{"type":"bitmap","height":31,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf840"]},{"type":"bitmap","height":47,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf841"]},{"type":"bitmap","height":63,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf842"]},{"type":"bitmap","height":127,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf843"]},{"type":"bitmap","height":255,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf844"]},{"type":"bitmap","height":11,"ascent":9,"file":"minecraft:font/image/emojis.png","chars":["\ue000\ue001\ue002\ue003","\ue004\ue005\ue006\ue007","\ue008\ue009\ue00a\ue00b","\ue00c\ue00d\ue00e\ue00f"]}]} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/items/arrow.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/items/arrow.json new file mode 100644 index 00000000..3397cc5e --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/items/arrow.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"range_dispatch","property":"custom_model_data","index":0,"entries":[{"threshold":1000.0,"model":{"type":"model","model":"item/custom/gui/next_page_0"}},{"threshold":1001.0,"model":{"type":"model","model":"item/custom/gui/next_page_1"}},{"threshold":1002.0,"model":{"type":"model","model":"item/custom/gui/previous_page_0"}},{"threshold":1003.0,"model":{"type":"model","model":"item/custom/gui/previous_page_1"}},{"threshold":1004.0,"model":{"type":"model","model":"item/custom/gui/return"}},{"threshold":1005.0,"model":{"type":"model","model":"item/custom/gui/get_item"}},{"threshold":1006.0,"model":{"type":"model","model":"item/custom/gui/cooking_info"}},{"threshold":1007.0,"model":{"type":"model","model":"item/custom/gui/exit"}}],"fallback":{"type":"model","model":"item/arrow"}}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/lang/en_us.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/lang/en_us.json new file mode 100644 index 00000000..5d5c63cb --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/lang/en_us.json @@ -0,0 +1 @@ +{"item.default.palm_slab":"Palm Slab","item.default.topaz_axe":"Topaz Axe","item.default.palm_door":"Palm Door","item.default.topaz_chestplate":"Topaz Chestplate","item.default.palm_wood":"Palm Wood","item.default.palm_fence_gate":"Palm Fence Gate","item.default.cap":"Cap","item.default.topaz_crossbow":"Topaz Crossbow","item.default.safe_block":"Safe Block","item.default.topaz_leggings":"Topaz Leggings","item.default.topaz_sword":"Topaz Sword","item.default.palm_leaves":"Palm Leaves","item.default.copper_coil":"Copper Coil","item.default.flame_cane":"Flame Cane","item.default.showcase":"Showcase","item.default.palm_fence":"Palm Fence","item.default.topaz_pickaxe":"Topaz Pickaxe","item.default.globe":"Globe","item.default.bench":"Bench","item.default.table_lamp":"Table Lamp","item.default.pebble":"Pebble","item.default.reed":"Reed","item.default.topaz_bow":"Topaz Bow","item.default.topaz_spear":"Topaz Spear","item.default.topaz":"Topaz","item.default.sofa":"Sofa","item.default.palm_sapling":"Palm Sapling","item.default.palm_stairs":"Palm Stairs","item.default.palm_log":"Palm Log","item.default.stripped_palm_wood":"Stripped Palm Wood","item.default.hami_melon_seeds":"Hami Melon Seeds","item.default.stripped_palm_log":"Stripped Palm Log","item.default.flower_basket":"Flower Basket","item.default.ender_pearl_flower_seeds":"Ender Pearl Flower Seeds","item.default.topaz_hoe":"Topaz Hoe","item.default.fairy_flower":"Fairy Flower","item.default.topaz_rod":"Topaz Rod","item.default.hami_melon_slice":"Hami Melon Slice","item.default.topaz_helmet":"Topaz Helmet","item.default.palm_planks":"Palm Planks","item.default.drawer_block":"Drawer Block","item.default.netherite_anvil":"Netherite Anvil","item.default.topaz_shovel":"Topaz Shovel","item.default.magma_fruit":"Magma Fruit","item.default.togglable_light_block":"Togglable Light Block","item.default.chinese_lantern":"Chinese Lantern","item.default.palm_button":"Palm Button","item.default.wooden_chair":"Wooden Chair","item.default.gunpowder_block":"GunPowder Block","item.default.amethyst_torch":"Amethyst Torch","item.default.drill":"Drill","item.default.palm_trapdoor":"Palm Trapdoor","item.default.solid_gunpowder_block":"Solid GunPowder Block","item.default.candelabrum":"Candelabrum","item.default.topaz_ore":"Topaz Ore","item.default.topaz_boots":"Topaz Boots","item.default.hami_melon":"Hami Melon","item.default.deepslate_topaz_ore":"Deepslate Topaz Ore","item.default.topaz_trident":"Topaz Trident","item.default.palm_pressure_plate":"Palm Pressure Plate","item.default.chessboard_block":"Chessboard Block","item.default.flame_elytra":"Flame Elytra","block.default.amethyst_wall_torch":"Amethyst Torch","block.default.palm_planks":"Palm Planks","block.default.palm_leaves":"Palm Leaves","block.default.chinese_lantern":"Chinese Lantern","block.default.netherite_anvil":"Netherite Anvil","block.default.palm_sapling":"Palm Sapling","block.default.gunpowder_block":"GunPowder Block","block.default.palm_log":"Palm Log","block.default.magma_plant":"Magma Plant","block.default.chessboard_block":"Chessboard Block","block.default.drawer_block":"Drawer Block","block.default.palm_button":"Palm Button","block.default.stripped_palm_wood":"Stripped Palm Wood","block.default.palm_stairs":"Palm Stairs","block.default.togglable_light_block":"Togglable Light Block","block.default.stripped_palm_log":"Stripped Palm Log","block.default.ender_pearl_flower":"Ender Pearl Flower","block.default.amethyst_torch":"Amethyst Torch","block.default.hami_melon":"Hami Melon","block.default.palm_slab":"Palm Slab","block.default.palm_fence":"Palm Fence","block.default.hami_melon_stem":"Hami Melon Stem","block.default.flame_cane":"Flame Cane","block.default.sleeper_sofa":"Sofa","block.default.palm_door":"Palm Door","block.default.palm_wood":"Palm Wood","block.default.palm_fence_gate":"Palm Fence Gate","block.default.fairy_flower":"Fairy Flower","block.default.sofa":"Sofa","block.default.reed":"Reed","block.default.deepslate_topaz_ore":"Deepslate Topaz Ore","block.default.solid_gunpowder_block":"Solid GunPowder Block","block.default.palm_trapdoor":"Palm Trapdoor","block.default.safe_block":"Safe Block","block.default.attached_hami_melon_stem":"Hami Melon Stem","block.default.topaz_ore":"Topaz Ore","block.default.copper_coil":"Copper Coil","furniture.default.globe":"Globe","furniture.default.wooden_chair":"Wooden Chair","furniture.default.showcase":"Showcase","furniture.default.candelabrum":"Candelabrum","furniture.default.bench":"Bench","furniture.default.flower_basket":"Flower Basket"} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/lang/fr_fr.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/lang/fr_fr.json new file mode 100644 index 00000000..63e545a4 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/lang/fr_fr.json @@ -0,0 +1 @@ +{"item.default.palm_slab":"Dalle en Palmier","item.default.topaz_axe":"Hache en Topaze","item.default.palm_door":"Porte en Palmier","item.default.topaz_chestplate":"Plastron en Topaze","item.default.palm_wood":"Bois de Palmier","item.default.palm_fence_gate":"Portail de Barrière en Palmier","item.default.cap":"Casquette","item.default.topaz_crossbow":"Arbalète en Topaze","item.default.safe_block":"Coffre-Fort","item.default.topaz_leggings":"Jambières en Topaze","item.default.topaz_sword":"Épée en Topaze","item.default.palm_leaves":"Feuilles de Palmier","item.default.copper_coil":"Bobine de Cuivre","item.default.flame_cane":"Canne de Flamme","item.default.showcase":"Vitrine","item.default.palm_fence":"Barrière en Palmier","item.default.topaz_pickaxe":"Pioche en Topaze","item.default.globe":"Globe","item.default.bench":"Banc","item.default.table_lamp":"Lampe de Table","item.default.pebble":"Caillou","item.default.reed":"Roseau","item.default.topaz_bow":"Arc en Topaze","item.default.topaz_spear":"Lance en Topaze","item.default.topaz":"Topaze","item.default.sofa":"Canapé","item.default.palm_sapling":"Pousse de Palmier","item.default.palm_stairs":"Escalier en Palmier","item.default.palm_log":"Bois de Palmier","item.default.stripped_palm_wood":"Bois de Palmier Écorcé","item.default.hami_melon_seeds":"Graines de Melon de Hami","item.default.stripped_palm_log":"Bois de Palmier Écorcé","item.default.flower_basket":"Panier de Fleurs","item.default.ender_pearl_flower_seeds":"Graines de Fleur de Perle du Néant","item.default.topaz_hoe":"Houe en Topaze","item.default.fairy_flower":"Fleur Fée","item.default.topaz_rod":"Canne à Topaze","item.default.hami_melon_slice":"Tranche de Melon de Hami","item.default.topaz_helmet":"Casque en Topaze","item.default.palm_planks":"Planches de Palmier","item.default.drawer_block":"Bloc de tiroir","item.default.netherite_anvil":"Enclume en Netherite","item.default.topaz_shovel":"Pelle en Topaze","item.default.magma_fruit":"Fruit de Magma","item.default.togglable_light_block":"Bloc de lumière réglable","item.default.chinese_lantern":"Lanterne Chinoise","item.default.palm_button":"Bouton en Palmier","item.default.wooden_chair":"Chaise en Bois","item.default.gunpowder_block":"Bloc de Poudre à Canon","item.default.amethyst_torch":"Torche en Améthyste","item.default.drill":"La perceuse","item.default.palm_trapdoor":"Trappe en Palmier","item.default.solid_gunpowder_block":"Bloc de Poudre à Canon Solide","item.default.candelabrum":"Candélabre","item.default.topaz_ore":"Minerai de Topaze","item.default.topaz_boots":"Bottes en Topaze","item.default.hami_melon":"Melon de Hami","item.default.deepslate_topaz_ore":"Minerai de Topaze en Schiste Sombre","item.default.topaz_trident":"Trident en Topaze","item.default.palm_pressure_plate":"Plaque de Pression en Palmier","item.default.chessboard_block":"Bloc Damier","item.default.flame_elytra":"Élytres de Flamme","block.default.amethyst_wall_torch":"Torche en Améthyste","block.default.palm_planks":"Planches de Palmier","block.default.palm_leaves":"Feuilles de Palmier","block.default.chinese_lantern":"Lanterne Chinoise","block.default.netherite_anvil":"Enclume en Netherite","block.default.palm_sapling":"Pousse de Palmier","block.default.gunpowder_block":"Bloc de Poudre à Canon","block.default.palm_log":"Bois de Palmier","block.default.magma_plant":"Plante de Magma","block.default.chessboard_block":"Bloc Damier","block.default.drawer_block":"Bloc de tiroir","block.default.palm_button":"Bouton en Palmier","block.default.stripped_palm_wood":"Bois de Palmier Écorcé","block.default.palm_stairs":"Escalier en Palmier","block.default.togglable_light_block":"Bloc de lumière réglable","block.default.stripped_palm_log":"Bois de Palmier Écorcé","block.default.ender_pearl_flower":"Fleur de Perle du Néant","block.default.amethyst_torch":"Torche en Améthyste","block.default.hami_melon":"Melon de Hami","block.default.palm_slab":"Dalle en Palmier","block.default.palm_fence":"Barrière en Palmier","block.default.hami_melon_stem":"Tige de Melon de Hami","block.default.flame_cane":"Canne de Flamme","block.default.sleeper_sofa":"Canapé","block.default.palm_door":"Porte en Palmier","block.default.palm_wood":"Bois de Palmier","block.default.palm_fence_gate":"Portail de Barrière en Palmier","block.default.fairy_flower":"Fleur Fée","block.default.sofa":"Canapé","block.default.reed":"Roseau","block.default.deepslate_topaz_ore":"Minerai de Topaze en Schiste Sombre","block.default.solid_gunpowder_block":"Bloc de Poudre à Canon Solide","block.default.palm_trapdoor":"Trappe en Palmier","block.default.safe_block":"Coffre-Fort","block.default.attached_hami_melon_stem":"Tige de Melon de Hami","block.default.topaz_ore":"Minerai de Topaze","block.default.copper_coil":"Bobine de Cuivre","furniture.default.globe":"Globe","furniture.default.wooden_chair":"Chaise en bois","furniture.default.showcase":"Vitrine","furniture.default.candelabrum":"Candélabre","furniture.default.bench":"Banc","furniture.default.flower_basket":"Panier de fleurs"} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/lang/ko_kr.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/lang/ko_kr.json new file mode 100644 index 00000000..613a7332 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/lang/ko_kr.json @@ -0,0 +1 @@ +{"item.default.palm_slab":"야자나무 반 블록","item.default.topaz_axe":"토파즈 도끼","item.default.palm_door":"야자나무 문","item.default.topaz_chestplate":"토파즈 흉갑","item.default.palm_wood":"야자나무","item.default.palm_fence_gate":"야자나무 울타리 문","item.default.cap":"모자","item.default.topaz_crossbow":"토파즈 석궁","item.default.safe_block":"금고","item.default.topaz_leggings":"토파즈 다리보호구","item.default.topaz_sword":"토파즈 검","item.default.palm_leaves":"야자나무 잎","item.default.copper_coil":"구리 코일","item.default.flame_cane":"화염 지팡이","item.default.showcase":"전시대","item.default.palm_fence":"야자나무 울타리","item.default.topaz_pickaxe":"토파즈 곡괭이","item.default.globe":"지구본","item.default.bench":"벤치","item.default.table_lamp":"테이블 램프","item.default.pebble":"조약돌","item.default.reed":"갈대","item.default.topaz_bow":"토파즈 활","item.default.topaz_spear":"토파즈 창","item.default.topaz":"토파즈","item.default.sofa":"소파","item.default.palm_sapling":"야자나무 묘목","item.default.palm_stairs":"야자나무 계단","item.default.palm_log":"야자나무 원목","item.default.stripped_palm_wood":"껍질 벗긴 야자나무","item.default.hami_melon_seeds":"하미 멜론 씨앗","item.default.stripped_palm_log":"껍질 벗긴 야자나무 원목","item.default.flower_basket":"꽃바구니","item.default.ender_pearl_flower_seeds":"엔더 진주 꽃 씨앗","item.default.topaz_hoe":"토파즈 괭이","item.default.fairy_flower":"요정 꽃","item.default.topaz_rod":"토파즈 지팡이","item.default.hami_melon_slice":"하미 멜론 조각","item.default.topaz_helmet":"토파즈 투구","item.default.palm_planks":"야자나무 판자","item.default.drawer_block":"서랍","item.default.netherite_anvil":"네더라이트 모루","item.default.topaz_shovel":"토파즈 삽","item.default.magma_fruit":"마그마 과일","item.default.togglable_light_block":"빛 조절 블록","item.default.chinese_lantern":"중국식 등불","item.default.palm_button":"야자나무 버튼","item.default.wooden_chair":"나무 의자","item.default.gunpowder_block":"화약 블록","item.default.amethyst_torch":"자수정 횃불","item.default.drill":"드릴","item.default.palm_trapdoor":"야자나무 다락문","item.default.solid_gunpowder_block":"압축 화약 블록","item.default.candelabrum":"촛대","item.default.topaz_ore":"토파즈 원석","item.default.topaz_boots":"토파즈 부츠","item.default.hami_melon":"하미 멜론","item.default.deepslate_topaz_ore":"심층암 토파즈 원석","item.default.topaz_trident":"토파즈 삼지창","item.default.palm_pressure_plate":"야자나무 압력판","item.default.chessboard_block":"체스판 블록","item.default.flame_elytra":"불꽃 겉날개","block.default.amethyst_wall_torch":"자수정 횃불","block.default.palm_planks":"야자나무 판자","block.default.palm_leaves":"야자나무 잎","block.default.chinese_lantern":"중국식 등불","block.default.netherite_anvil":"네더라이트 모루","block.default.palm_sapling":"야자나무 묘목","block.default.gunpowder_block":"화약 블록","block.default.palm_log":"아자나무 원목","block.default.magma_plant":"마그마 식물","block.default.chessboard_block":"체스판 블록","block.default.drawer_block":"서랍","block.default.palm_button":"야자나무 버튼","block.default.stripped_palm_wood":"껍질 벗긴 야자나무","block.default.palm_stairs":"야자나무 계단","block.default.togglable_light_block":"빛 조절 블록","block.default.stripped_palm_log":"껍질 벗긴 야자나무 원목","block.default.ender_pearl_flower":"엔더 진주 꽃","block.default.amethyst_torch":"자수정 횃불","block.default.hami_melon":"하미 멜론","block.default.palm_slab":"야자나무 반 블록","block.default.palm_fence":"야자나무 울타리","block.default.hami_melon_stem":"하미 멜론 줄기","block.default.flame_cane":"화염 지팡이","block.default.sleeper_sofa":"소파","block.default.palm_door":"야자나무 문","block.default.palm_wood":"야자나무","block.default.palm_fence_gate":"야자나무 울타리 문","block.default.fairy_flower":"요정 꽃","block.default.sofa":"소파","block.default.reed":"갈대","block.default.deepslate_topaz_ore":"심층암 토파즈 원석","block.default.solid_gunpowder_block":"압축 화약 블록","block.default.palm_trapdoor":"야자나무 다락문","block.default.safe_block":"금고","block.default.attached_hami_melon_stem":"하미 멜론 줄기","block.default.topaz_ore":"토파즈 원석","block.default.copper_coil":"구리 코일","furniture.default.globe":"지구본","furniture.default.wooden_chair":"나무 의자","furniture.default.showcase":"전시대","furniture.default.candelabrum":"촛대","furniture.default.bench":"벤치","furniture.default.flower_basket":"꽃바구니"} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/lang/zh_cn.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/lang/zh_cn.json new file mode 100644 index 00000000..7f47d8a9 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/lang/zh_cn.json @@ -0,0 +1 @@ +{"item.default.palm_slab":"棕榈木台阶","item.default.topaz_axe":"黄玉斧","item.default.palm_door":"棕榈木门","item.default.topaz_chestplate":"黄玉胸甲","item.default.palm_wood":"棕榈木","item.default.palm_fence_gate":"棕榈木栅栏门","item.default.cap":"鸭舌帽","item.default.topaz_crossbow":"黄玉弩","item.default.safe_block":"保险柜","item.default.topaz_leggings":"黄玉护腿","item.default.topaz_sword":"黄玉剑","item.default.palm_leaves":"棕榈树叶","item.default.copper_coil":"铜线圈","item.default.flame_cane":"烈焰甘蔗","item.default.showcase":"物品展示柜","item.default.palm_fence":"棕榈木栅栏","item.default.topaz_pickaxe":"黄玉镐","item.default.globe":"地球仪","item.default.bench":"长椅","item.default.table_lamp":"台灯","item.default.pebble":"石子","item.default.reed":"芦苇","item.default.topaz_bow":"黄玉弓","item.default.topaz_spear":"黄玉矛","item.default.topaz":"黄玉","item.default.sofa":"沙发","item.default.palm_sapling":"棕榈树苗","item.default.palm_stairs":"棕榈木楼梯","item.default.palm_log":"棕榈原木","item.default.stripped_palm_wood":"去皮棕榈木","item.default.hami_melon_seeds":"哈密瓜种子","item.default.stripped_palm_log":"去皮棕榈原木","item.default.flower_basket":"花篮","item.default.ender_pearl_flower_seeds":"末影珍珠花种子","item.default.topaz_hoe":"黄玉锄","item.default.fairy_flower":"仙灵花","item.default.topaz_rod":"黄玉钓竿","item.default.hami_melon_slice":"哈密瓜片","item.default.topaz_helmet":"黄玉头盔","item.default.palm_planks":"棕榈木板","item.default.drawer_block":"抽屉方块","item.default.netherite_anvil":"下界合金砧","item.default.topaz_shovel":"黄玉锹","item.default.magma_fruit":"岩浆果实","item.default.togglable_light_block":"可调节光源方块","item.default.chinese_lantern":"灯笼","item.default.palm_button":"棕榈木按钮","item.default.wooden_chair":"木椅","item.default.gunpowder_block":"火药粉末","item.default.amethyst_torch":"紫水晶火把","item.default.drill":"钻头","item.default.palm_trapdoor":"棕榈木活板门","item.default.solid_gunpowder_block":"凝固火药块","item.default.candelabrum":"烛台","item.default.topaz_ore":"黄玉矿石","item.default.topaz_boots":"黄玉靴子","item.default.hami_melon":"哈密瓜","item.default.deepslate_topaz_ore":"深层黄玉矿石","item.default.topaz_trident":"黄玉三叉戟","item.default.palm_pressure_plate":"棕榈木压力板","item.default.chessboard_block":"棋盘方块","item.default.flame_elytra":"烈焰鞘翅","block.default.amethyst_wall_torch":"紫水晶火把","block.default.palm_planks":"棕榈木板","block.default.palm_leaves":"棕榈树叶","block.default.chinese_lantern":"灯笼","block.default.netherite_anvil":"下界合金砧","block.default.palm_sapling":"棕榈树苗","block.default.gunpowder_block":"火药粉末","block.default.palm_log":"棕榈原木","block.default.magma_plant":"岩浆植物","block.default.chessboard_block":"棋盘方块","block.default.drawer_block":"抽屉方块","block.default.palm_button":"棕榈木按钮","block.default.stripped_palm_wood":"去皮棕榈木","block.default.palm_stairs":"棕榈木楼梯","block.default.togglable_light_block":"可调节光源方块","block.default.stripped_palm_log":"去皮棕榈原木","block.default.ender_pearl_flower":"末影珍珠花","block.default.amethyst_torch":"紫水晶火把","block.default.hami_melon":"哈密瓜","block.default.palm_slab":"棕榈木台阶","block.default.palm_fence":"棕榈木栅栏","block.default.hami_melon_stem":"哈密瓜茎","block.default.flame_cane":"烈焰甘蔗","block.default.sleeper_sofa":"沙发","block.default.palm_door":"棕榈木门","block.default.palm_wood":"棕榈木","block.default.palm_fence_gate":"棕榈木栅栏门","block.default.fairy_flower":"仙灵花","block.default.sofa":"沙发","block.default.reed":"芦苇","block.default.deepslate_topaz_ore":"深层黄玉矿石","block.default.solid_gunpowder_block":"凝固火药块","block.default.palm_trapdoor":"棕榈木活板门","block.default.safe_block":"保险柜","block.default.attached_hami_melon_stem":"哈密瓜茎","block.default.topaz_ore":"黄玉矿石","block.default.copper_coil":"铜线圈","furniture.default.globe":"地球仪","furniture.default.wooden_chair":"木椅","furniture.default.showcase":"物品展示柜","furniture.default.candelabrum":"烛台","furniture.default.bench":"长椅","furniture.default.flower_basket":"花篮"} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/lang/zh_hk.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/lang/zh_hk.json new file mode 100644 index 00000000..efbdd941 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/lang/zh_hk.json @@ -0,0 +1 @@ +{"item.default.palm_slab":"棕櫚木半磚","item.default.topaz_axe":"黃玉斧頭","item.default.palm_door":"棕櫚木門","item.default.topaz_chestplate":"黃玉胸甲","item.default.palm_wood":"棕櫚木","item.default.palm_fence_gate":"棕櫚木閘門","item.default.cap":"鴨舌帽","item.default.topaz_crossbow":"黃玉弩","item.default.safe_block":"保險櫃","item.default.topaz_leggings":"黃玉護腳","item.default.topaz_sword":"黃玉劍","item.default.palm_leaves":"棕櫚樹葉","item.default.copper_coil":"銅線圈","item.default.flame_cane":"烈焰蔗","item.default.showcase":"物品展示櫃","item.default.palm_fence":"棕櫚木欄杆","item.default.topaz_pickaxe":"黃玉鎬","item.default.globe":"地球儀","item.default.bench":"長椅","item.default.table_lamp":"枱燈","item.default.pebble":"石子","item.default.reed":"蘆葦","item.default.topaz_bow":"黃玉弓","item.default.topaz_spear":"黃玉矛","item.default.topaz":"黃玉","item.default.sofa":"沙發","item.default.palm_sapling":"棕櫚樹苗","item.default.palm_stairs":"棕櫚木樓梯","item.default.palm_log":"棕櫚原木","item.default.stripped_palm_wood":"剝皮棕櫚木","item.default.hami_melon_seeds":"哈密瓜種子","item.default.stripped_palm_log":"剝皮棕櫚原木","item.default.flower_basket":"花籃","item.default.ender_pearl_flower_seeds":"終界珍珠花種子","item.default.topaz_hoe":"黃玉鋤頭","item.default.fairy_flower":"仙靈花","item.default.topaz_rod":"黃玉魚竿","item.default.hami_melon_slice":"哈密瓜片","item.default.topaz_helmet":"黃玉頭盔","item.default.palm_planks":"棕櫚木板","item.default.drawer_block":"抽屜方塊","item.default.netherite_anvil":"地獄合金砧","item.default.topaz_shovel":"黃玉鏟","item.default.magma_fruit":"岩漿果實","item.default.togglable_light_block":"可調節光","item.default.chinese_lantern":"燈籠","item.default.palm_button":"棕櫚木按鈕","item.default.wooden_chair":"木椅","item.default.gunpowder_block":"火藥粉末","item.default.amethyst_torch":"紫水晶火炬","item.default.drill":"鑽頭","item.default.palm_trapdoor":"棕櫚木地板門","item.default.solid_gunpowder_block":"凝固火藥塊","item.default.candelabrum":"燭台","item.default.topaz_ore":"黃玉礦石","item.default.topaz_boots":"黃玉靴","item.default.hami_melon":"哈密瓜","item.default.deepslate_topaz_ore":"深層黃玉礦石","item.default.topaz_trident":"黃玉三叉戟","item.default.palm_pressure_plate":"棕櫚木壓力板","item.default.chessboard_block":"棋盤方塊","item.default.flame_elytra":"烈焰鞘翅","block.default.amethyst_wall_torch":"紫水晶火炬","block.default.palm_planks":"棕櫚木板","block.default.palm_leaves":"棕櫚樹葉","block.default.chinese_lantern":"燈籠","block.default.netherite_anvil":"地獄合金砧","block.default.palm_sapling":"棕櫚樹苗","block.default.gunpowder_block":"火藥粉末","block.default.palm_log":"棕櫚原木","block.default.magma_plant":"岩漿植物","block.default.chessboard_block":"棋盤方塊","block.default.drawer_block":"抽屜方塊","block.default.palm_button":"棕櫚木按鈕","block.default.stripped_palm_wood":"剝皮棕櫚木","block.default.palm_stairs":"棕櫚木樓梯","block.default.togglable_light_block":"可調節光","block.default.stripped_palm_log":"剝皮棕櫚原木","block.default.ender_pearl_flower":"終界珍珠花","block.default.amethyst_torch":"紫水晶火炬","block.default.hami_melon":"哈密瓜","block.default.palm_slab":"棕櫚木半磚","block.default.palm_fence":"棕櫚木欄杆","block.default.hami_melon_stem":"哈密瓜莖","block.default.flame_cane":"烈焰蔗","block.default.sleeper_sofa":"沙發","block.default.palm_door":"棕櫚木門","block.default.palm_wood":"棕櫚木","block.default.palm_fence_gate":"棕櫚木閘門","block.default.fairy_flower":"仙靈花","block.default.sofa":"沙發","block.default.reed":"蘆葦","block.default.deepslate_topaz_ore":"深層黃玉礦石","block.default.solid_gunpowder_block":"凝固火藥塊","block.default.palm_trapdoor":"棕櫚木地板門","block.default.safe_block":"保險櫃","block.default.attached_hami_melon_stem":"哈密瓜莖","block.default.topaz_ore":"黃玉礦石","block.default.copper_coil":"銅線圈","furniture.default.globe":"地球儀","furniture.default.wooden_chair":"木椅","furniture.default.showcase":"物品展示櫃","furniture.default.candelabrum":"燭台","furniture.default.bench":"長椅","furniture.default.flower_basket":"花籃"} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/lang/zh_tw.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/lang/zh_tw.json new file mode 100644 index 00000000..83fbdd2a --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/lang/zh_tw.json @@ -0,0 +1 @@ +{"item.default.palm_slab":"棕櫚木半磚","item.default.topaz_axe":"黃玉斧","item.default.palm_door":"棕櫚木門","item.default.topaz_chestplate":"黃玉胸甲","item.default.palm_wood":"棕櫚木塊","item.default.palm_fence_gate":"棕櫚木柵欄門","item.default.cap":"鴨舌帽","item.default.topaz_crossbow":"黃玉弩","item.default.safe_block":"保險櫃","item.default.topaz_leggings":"黃玉護腿","item.default.topaz_sword":"黃玉劍","item.default.palm_leaves":"棕櫚樹葉","item.default.copper_coil":"銅線圈","item.default.flame_cane":"烈焰甘蔗","item.default.showcase":"物品展示櫃","item.default.palm_fence":"棕櫚木柵欄","item.default.topaz_pickaxe":"黃玉鎬","item.default.globe":"地球儀","item.default.bench":"長椅","item.default.table_lamp":"檯燈","item.default.pebble":"石子","item.default.reed":"蘆葦","item.default.topaz_bow":"黃玉弓","item.default.topaz_spear":"黃玉矛","item.default.topaz":"黃玉","item.default.sofa":"沙發","item.default.palm_sapling":"棕櫚樹苗","item.default.palm_stairs":"棕櫚木階梯","item.default.palm_log":"棕櫚原木","item.default.stripped_palm_wood":"剝皮棕櫚木塊","item.default.hami_melon_seeds":"哈密瓜種子","item.default.stripped_palm_log":"剝皮棕櫚原木","item.default.flower_basket":"花籃","item.default.ender_pearl_flower_seeds":"終界珍珠花種子","item.default.topaz_hoe":"黃玉鋤","item.default.fairy_flower":"仙靈花","item.default.topaz_rod":"黃玉釣竿","item.default.hami_melon_slice":"哈密瓜片","item.default.topaz_helmet":"黃玉頭盔","item.default.palm_planks":"棕櫚木材","item.default.drawer_block":"抽屜方塊","item.default.netherite_anvil":"獄髓砧","item.default.topaz_shovel":"黃玉鏟","item.default.magma_fruit":"岩漿果實","item.default.togglable_light_block":"可調節光源","item.default.chinese_lantern":"燈籠","item.default.palm_button":"棕櫚木按鈕","item.default.wooden_chair":"木椅","item.default.gunpowder_block":"火藥粉末","item.default.amethyst_torch":"紫水晶火把","item.default.drill":"鑽頭","item.default.palm_trapdoor":"棕櫚木地板門","item.default.solid_gunpowder_block":"凝固火藥塊","item.default.candelabrum":"燭臺","item.default.topaz_ore":"黃玉礦石","item.default.topaz_boots":"黃玉靴子","item.default.hami_melon":"哈密瓜","item.default.deepslate_topaz_ore":"深板岩黃玉礦石","item.default.topaz_trident":"黃玉三叉戟","item.default.palm_pressure_plate":"棕櫚木壓力板","item.default.chessboard_block":"棋盤方塊","item.default.flame_elytra":"烈焰鞘翅","block.default.amethyst_wall_torch":"紫水晶火把","block.default.palm_planks":"棕櫚木材","block.default.palm_leaves":"棕櫚樹葉","block.default.chinese_lantern":"燈籠","block.default.netherite_anvil":"獄髓砧","block.default.palm_sapling":"棕櫚樹苗","block.default.gunpowder_block":"火藥粉末","block.default.palm_log":"棕櫚原木","block.default.magma_plant":"岩漿植物","block.default.chessboard_block":"棋盤方塊","block.default.drawer_block":"抽屜方塊","block.default.palm_button":"棕櫚木按鈕","block.default.stripped_palm_wood":"剝皮棕櫚木塊","block.default.palm_stairs":"棕櫚木階梯","block.default.togglable_light_block":"可調節光源","block.default.stripped_palm_log":"剝皮棕櫚原木","block.default.ender_pearl_flower":"終界珍珠花","block.default.amethyst_torch":"紫水晶火把","block.default.hami_melon":"哈密瓜","block.default.palm_slab":"棕櫚木半磚","block.default.palm_fence":"棕櫚木柵欄","block.default.hami_melon_stem":"哈密瓜莖","block.default.flame_cane":"烈焰甘蔗","block.default.sleeper_sofa":"沙發","block.default.palm_door":"棕櫚木門","block.default.palm_wood":"棕櫚木塊","block.default.palm_fence_gate":"棕櫚木柵欄門","block.default.fairy_flower":"仙靈花","block.default.sofa":"沙發","block.default.reed":"蘆葦","block.default.deepslate_topaz_ore":"深層黃玉礦石","block.default.solid_gunpowder_block":"凝固火藥塊","block.default.palm_trapdoor":"棕櫚木地板門","block.default.safe_block":"保險櫃","block.default.attached_hami_melon_stem":"哈密瓜莖","block.default.topaz_ore":"黃玉礦石","block.default.copper_coil":"銅線圈","furniture.default.globe":"地球儀","furniture.default.wooden_chair":"木椅","furniture.default.showcase":"物品展示櫃","furniture.default.candelabrum":"燭臺","furniture.default.bench":"長椅","furniture.default.flower_basket":"花籃"} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/amethyst_torch.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/amethyst_torch.json new file mode 100644 index 00000000..5df92994 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/amethyst_torch.json @@ -0,0 +1 @@ +{"parent":"block/template_torch","textures":{"torch":"block/custom/amethyst_torch"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/amethyst_wall_torch.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/amethyst_wall_torch.json new file mode 100644 index 00000000..c7548972 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/amethyst_wall_torch.json @@ -0,0 +1 @@ +{"parent":"block/template_torch_wall","textures":{"torch":"block/custom/amethyst_torch"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/chessboard_block.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/chessboard_block.json new file mode 100644 index 00000000..e6411784 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/chessboard_block.json @@ -0,0 +1 @@ +{"parent":"block/template_glazed_terracotta","textures":{"pattern":"block/custom/chessboard_block"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/chinese_lantern.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/chinese_lantern.json new file mode 100644 index 00000000..a52acd43 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/chinese_lantern.json @@ -0,0 +1 @@ +{"parent":"block/cube_column","textures":{"end":"block/custom/chinese_lantern_top","side":"block/custom/chinese_lantern"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/copper_coil.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/copper_coil.json new file mode 100644 index 00000000..91d97152 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/copper_coil.json @@ -0,0 +1 @@ +{"parent":"block/cactus","textures":{"particle":"block/custom/copper_coil","bottom":"block/custom/copper_coil","top":"block/custom/copper_coil","side":"block/custom/copper_coil_side"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/copper_coil_on.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/copper_coil_on.json new file mode 100644 index 00000000..4a37bccf --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/copper_coil_on.json @@ -0,0 +1 @@ +{"parent":"block/cactus","textures":{"particle":"block/custom/copper_coil_on","bottom":"block/custom/copper_coil_on","top":"block/custom/copper_coil_on","side":"block/custom/copper_coil_on_side"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/deepslate_topaz_ore.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/deepslate_topaz_ore.json new file mode 100644 index 00000000..254385be --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/deepslate_topaz_ore.json @@ -0,0 +1 @@ +{"parent":"block/cube_all","textures":{"all":"block/custom/deepslate_topaz_ore"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/drawer_block.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/drawer_block.json new file mode 100644 index 00000000..c55844d3 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/drawer_block.json @@ -0,0 +1 @@ +{"parent":"block/cube","textures":{"down":"block/custom/drawer_block_bottom","up":"block/custom/drawer_block_top","north":"block/custom/drawer_block_front","east":"block/custom/drawer_block_side_left","south":"block/custom/drawer_block_back","west":"block/custom/drawer_block_side_right","particle":"block/custom/drawer_block_front"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/ender_pearl_flower_stage_0.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/ender_pearl_flower_stage_0.json new file mode 100644 index 00000000..40f1b4c3 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/ender_pearl_flower_stage_0.json @@ -0,0 +1 @@ +{"parent":"block/cross","textures":{"cross":"block/custom/ender_pearl_flower_stage_0"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/ender_pearl_flower_stage_1.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/ender_pearl_flower_stage_1.json new file mode 100644 index 00000000..8ce5703b --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/ender_pearl_flower_stage_1.json @@ -0,0 +1 @@ +{"parent":"block/cross","textures":{"cross":"block/custom/ender_pearl_flower_stage_1"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/ender_pearl_flower_stage_2.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/ender_pearl_flower_stage_2.json new file mode 100644 index 00000000..41674031 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/ender_pearl_flower_stage_2.json @@ -0,0 +1 @@ +{"parent":"block/cross","textures":{"cross":"block/custom/ender_pearl_flower_stage_2"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/fairy_flower_1.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/fairy_flower_1.json new file mode 100644 index 00000000..e79d4627 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/fairy_flower_1.json @@ -0,0 +1,48 @@ +{ + "textures": { + "0": "block/custom/fairy_flower_1", + "particle": "block/custom/fairy_flower_1" + }, + "elements": [ + { + "from": [3.75, 0, 12.25], + "to": [15.75, 29, 12.25], + "rotation": {"angle": 45, "axis": "y", "origin": [3.75, 0, 12.25]}, + "faces": { + "north": {"uv": [0, 0, 6, 14.5], "texture": "#0"}, + "east": {"uv": [0, 0, 2, 2], "texture": "#0"}, + "south": {"uv": [0, 0, 6, 14.5], "texture": "#0"}, + "west": {"uv": [0, 0, 2, 2], "texture": "#0"}, + "up": {"uv": [0, 0, 2, 2], "texture": "#0"}, + "down": {"uv": [0, 0, 2, 2], "texture": "#0"} + } + }, + { + "from": [3.75, 0, 3.75], + "to": [3.75, 29, 15.75], + "rotation": {"angle": 45, "axis": "y", "origin": [3.75, 0, 3.75]}, + "faces": { + "north": {"uv": [0, 0, 2, 2], "texture": "#0"}, + "east": {"uv": [0, 0, 6, 14.5], "texture": "#0"}, + "south": {"uv": [0, 0, 2, 2], "texture": "#0"}, + "west": {"uv": [0, 0, 6, 14.5], "texture": "#0"}, + "up": {"uv": [0, 0, 2, 2], "rotation": 270, "texture": "#0"}, + "down": {"uv": [0, 0, 2, 2], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [7, 28, 7], + "to": [9, 30, 9], + "rotation": {"angle": 0, "axis": "y", "origin": [7, 28, 7]}, + "shade": false, + "faces": { + "north": {"uv": [15, 0, 16, 1], "texture": "#0"}, + "east": {"uv": [15, 0, 16, 1], "texture": "#0"}, + "south": {"uv": [15, 0, 16, 1], "texture": "#0"}, + "west": {"uv": [15, 0, 16, 1], "texture": "#0"}, + "up": {"uv": [15, 0, 16, 1], "texture": "#0"}, + "down": {"uv": [15, 0, 16, 1], "texture": "#0"} + } + } + ] +} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/fairy_flower_2.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/fairy_flower_2.json new file mode 100644 index 00000000..687d1869 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/fairy_flower_2.json @@ -0,0 +1 @@ +{"parent":"block/custom/fairy_flower_1","textures":{"0":"block/custom/fairy_flower_2"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/fairy_flower_3.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/fairy_flower_3.json new file mode 100644 index 00000000..7f3f182a --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/fairy_flower_3.json @@ -0,0 +1 @@ +{"parent":"block/custom/fairy_flower_1","textures":{"0":"block/custom/fairy_flower_3"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/fairy_flower_4.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/fairy_flower_4.json new file mode 100644 index 00000000..c149b000 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/fairy_flower_4.json @@ -0,0 +1 @@ +{"parent":"block/custom/fairy_flower_1","textures":{"0":"block/custom/fairy_flower_4"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/fence_side.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/fence_side.json new file mode 100644 index 00000000..c41a058e --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/fence_side.json @@ -0,0 +1,29 @@ +{ + "textures": { + "particle": "#texture" + }, + "elements": [ + { + "from": [6.98, 11.98, -0.02], + "to": [9.02, 15.02, 9.02], + "rotation": {"angle": 0, "axis": "y", "origin": [0, 0, 0]}, + "faces": { + "east": {"uv": [0, 1, 9, 4], "texture": "#texture"}, + "west": {"uv": [0, 1, 9, 4], "texture": "#texture"}, + "up": {"uv": [7, 0, 9, 9], "texture": "#texture"}, + "down": {"uv": [7, 0, 9, 9], "texture": "#texture"} + } + }, + { + "from": [6.98, 5.98, -0.02], + "to": [9.02, 9.02, 9.02], + "rotation": {"angle": 0, "axis": "y", "origin": [0, 0, 0]}, + "faces": { + "east": {"uv": [0, 7, 9, 10], "texture": "#texture"}, + "west": {"uv": [0, 7, 9, 10], "texture": "#texture"}, + "up": {"uv": [7, 0, 9, 9], "texture": "#texture"}, + "down": {"uv": [7, 0, 9, 9], "texture": "#texture"} + } + } + ] +} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/flame_cane_1.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/flame_cane_1.json new file mode 100644 index 00000000..7e0f67c2 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/flame_cane_1.json @@ -0,0 +1 @@ +{"parent":"block/sugar_cane","textures":{"cross":"block/custom/flame_cane_1"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/flame_cane_2.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/flame_cane_2.json new file mode 100644 index 00000000..d0d7c4d7 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/flame_cane_2.json @@ -0,0 +1 @@ +{"parent":"block/sugar_cane","textures":{"cross":"block/custom/flame_cane_2"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/gunpowder_block.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/gunpowder_block.json new file mode 100644 index 00000000..e5370aaa --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/gunpowder_block.json @@ -0,0 +1 @@ +{"parent":"block/cube_all","textures":{"all":"block/custom/gunpowder_block"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/hami_melon.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/hami_melon.json new file mode 100644 index 00000000..02d9105f --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/hami_melon.json @@ -0,0 +1 @@ +{"parent":"block/cube_bottom_top","textures":{"bottom":"block/custom/hami_melon_bottom","top":"block/custom/hami_melon_top","side":"block/custom/hami_melon"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/large_mushroom.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/large_mushroom.json new file mode 100644 index 00000000..95171c84 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/large_mushroom.json @@ -0,0 +1,138 @@ +{ + "textures": { + "0": "block/custom/mushroom", + "particle": "block/custom/mushroom" + }, + "elements": [ + { + "from": [8.5, 3, 11.5], + "to": [13.5, 3, 17.5], + "rotation": {"angle": 0, "axis": "y", "origin": [10, 4, 13]}, + "faces": { + "north": {"uv": [0, 0, 2.5, 0], "texture": "#0"}, + "east": {"uv": [0, 0, 3, 0], "texture": "#0"}, + "south": {"uv": [0, 0, 2.5, 0], "texture": "#0"}, + "west": {"uv": [0, 0, 3, 0], "texture": "#0"}, + "up": {"uv": [8, 0, 10.5, 3], "texture": "#0"}, + "down": {"uv": [8, 3, 10.5, 0], "texture": "#0"} + } + }, + { + "from": [9.5, 11, 10.5], + "to": [14.5, 11, 16.5], + "rotation": {"angle": -22.5, "axis": "x", "origin": [12, 11, 16.5]}, + "faces": { + "north": {"uv": [2.5, 0, 0, 0], "texture": "#0"}, + "east": {"uv": [3, 0, 0, 0], "texture": "#0"}, + "south": {"uv": [2.5, 0, 0, 0], "texture": "#0"}, + "west": {"uv": [3, 0, 0, 0], "texture": "#0"}, + "up": {"uv": [8, 0, 5.5, 3], "texture": "#0"}, + "down": {"uv": [8, 3, 5.5, 0], "texture": "#0"} + } + }, + { + "from": [1.5, 7, 10.5], + "to": [6.5, 7, 16.5], + "rotation": {"angle": 0, "axis": "y", "origin": [3, 8, 12]}, + "faces": { + "north": {"uv": [0, 0, 2.5, 0], "texture": "#0"}, + "east": {"uv": [0, 0, 3, 0], "texture": "#0"}, + "south": {"uv": [0, 0, 2.5, 0], "texture": "#0"}, + "west": {"uv": [0, 0, 3, 0], "texture": "#0"}, + "up": {"uv": [5.5, 0, 8, 3], "texture": "#0"}, + "down": {"uv": [5.5, 3, 8, 0], "texture": "#0"} + } + }, + { + "from": [5.5, 9, 14.5], + "to": [5.5, 11, 16.5], + "rotation": {"angle": 45, "axis": "y", "origin": [5.5, 10, 15.5]}, + "faces": { + "north": {"uv": [0, 0, 0, 1], "texture": "#0"}, + "east": {"uv": [2.5, 10, 3.5, 11], "texture": "#0"}, + "south": {"uv": [0, 0, 0, 1], "texture": "#0"}, + "west": {"uv": [3.5, 10, 2.5, 11], "texture": "#0"}, + "up": {"uv": [0, 0, 0, 1], "texture": "#0"}, + "down": {"uv": [0, 0, 0, 1], "texture": "#0"} + } + }, + { + "from": [4.5, 2, 14.5], + "to": [4.5, 4, 16.5], + "rotation": {"angle": -45, "axis": "y", "origin": [4.5, 3, 15.5]}, + "faces": { + "north": {"uv": [0, 0, 0, 1], "texture": "#0"}, + "east": {"uv": [2.5, 10, 3.5, 11], "texture": "#0"}, + "south": {"uv": [0, 0, 0, 1], "texture": "#0"}, + "west": {"uv": [3.5, 10, 2.5, 11], "texture": "#0"}, + "up": {"uv": [0, 0, 0, 1], "texture": "#0"}, + "down": {"uv": [0, 0, 0, 1], "texture": "#0"} + } + }, + { + "from": [9.5, 6, 14.5], + "to": [11.5, 8, 16.5], + "rotation": {"angle": 0, "axis": "y", "origin": [10, 6, 16]}, + "faces": { + "north": {"uv": [3.5, 2, 4.5, 3], "texture": "#0"}, + "east": {"uv": [5.5, 3, 4.5, 4], "texture": "#0"}, + "south": {"uv": [3.5, 4, 4.5, 5], "texture": "#0"}, + "west": {"uv": [4.5, 3, 5.5, 4], "texture": "#0"}, + "up": {"uv": [3.5, 3, 4.5, 4], "texture": "#0"}, + "down": {"uv": [4.5, 2, 5.5, 3], "texture": "#0"} + } + }, + { + "from": [7, 7, 11], + "to": [14, 9, 15], + "rotation": {"angle": 0, "axis": "y", "origin": [7, 7, 11]}, + "faces": { + "north": {"uv": [0, 5, 3.5, 6], "texture": "#0"}, + "east": {"uv": [3.5, 0, 5.5, 1], "texture": "#0"}, + "south": {"uv": [0, 4, 3.5, 5], "texture": "#0"}, + "west": {"uv": [3.5, 1, 5.5, 2], "texture": "#0"}, + "up": {"uv": [3.5, 2, 0, 0], "texture": "#0"}, + "down": {"uv": [3.5, 2, 0, 4], "texture": "#0"} + } + }, + { + "from": [7, 13, 14], + "to": [12, 14, 16], + "rotation": {"angle": 0, "axis": "y", "origin": [7, 13, 14]}, + "faces": { + "north": {"uv": [0, 9, 2.5, 9.5], "texture": "#0"}, + "east": {"uv": [2.5, 11.5, 3.5, 12], "texture": "#0"}, + "south": {"uv": [0, 9.5, 2.5, 10], "texture": "#0"}, + "west": {"uv": [2.5, 11, 3.5, 11.5], "texture": "#0"}, + "up": {"uv": [2.5, 11, 0, 10], "texture": "#0"}, + "down": {"uv": [2.5, 11, 0, 12], "texture": "#0"} + } + }, + { + "from": [3, 11, 13], + "to": [8, 12, 16], + "rotation": {"angle": 0, "axis": "y", "origin": [3, 11, 13]}, + "faces": { + "north": {"uv": [0, 15.5, 2.5, 16], "texture": "#0"}, + "east": {"uv": [2.5, 15, 4, 15.5], "texture": "#0"}, + "south": {"uv": [0, 15, 2.5, 15.5], "texture": "#0"}, + "west": {"uv": [2.5, 15.5, 4, 16], "texture": "#0"}, + "up": {"uv": [2.5, 13.5, 0, 12], "texture": "#0"}, + "down": {"uv": [2.5, 13.5, 0, 15], "texture": "#0"} + } + }, + { + "from": [2, 4, 13], + "to": [7, 5, 16], + "rotation": {"angle": 0, "axis": "y", "origin": [2, 4, 13]}, + "faces": { + "north": {"uv": [0, 15.5, 2.5, 16], "texture": "#0"}, + "east": {"uv": [2.5, 15, 4, 15.5], "texture": "#0"}, + "south": {"uv": [0, 15, 2.5, 15.5], "texture": "#0"}, + "west": {"uv": [2.5, 15.5, 4, 16], "texture": "#0"}, + "up": {"uv": [2.5, 13.5, 0, 12], "texture": "#0"}, + "down": {"uv": [2.5, 13.5, 0, 15], "texture": "#0"} + } + } + ] +} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/magma_plant_stage_0.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/magma_plant_stage_0.json new file mode 100644 index 00000000..69ce63e7 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/magma_plant_stage_0.json @@ -0,0 +1,36 @@ +{ + "textures": { + "0": "block/custom/magma_plant", + "particle": "block/custom/magma_plant" + }, + "elements": [ + { + "from": [8, 0, 0], + "to": [8, 8, 16], + "rotation": {"angle": 45, "axis": "y", "origin": [8, 8, 8]}, + "shade": false, + "faces": { + "north": {"uv": [0, 0, 0, 4], "texture": "#0"}, + "east": {"uv": [0, 4, 8, 8], "texture": "#0"}, + "south": {"uv": [0, 0, 0, 4], "texture": "#0"}, + "west": {"uv": [0, 4, 8, 8], "texture": "#0"}, + "up": {"uv": [0, 4, 0, 0], "texture": "#0"}, + "down": {"uv": [0, 0, 0, 4], "texture": "#0"} + } + }, + { + "from": [8, 0, 0], + "to": [8, 8, 16], + "rotation": {"angle": -45, "axis": "y", "origin": [8, 8, 8]}, + "shade": false, + "faces": { + "north": {"uv": [0, 0, 0, 4], "texture": "#0"}, + "east": {"uv": [0, 4, 8, 8], "texture": "#0"}, + "south": {"uv": [0, 0, 0, 4], "texture": "#0"}, + "west": {"uv": [0, 4, 8, 8], "texture": "#0"}, + "up": {"uv": [0, 4, 0, 0], "texture": "#0"}, + "down": {"uv": [0, 0, 0, 4], "texture": "#0"} + } + } + ] +} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/magma_plant_stage_1.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/magma_plant_stage_1.json new file mode 100644 index 00000000..014cb533 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/magma_plant_stage_1.json @@ -0,0 +1,36 @@ +{ + "textures": { + "0": "block/custom/magma_plant", + "particle": "block/custom/magma_plant" + }, + "elements": [ + { + "from": [8, 0, 0], + "to": [8, 16, 16], + "rotation": {"angle": 45, "axis": "y", "origin": [8, 8, 8]}, + "shade": false, + "faces": { + "north": {"uv": [0, 0, 0, 4], "texture": "#0"}, + "east": {"uv": [16, 0, 8, 8], "texture": "#0"}, + "south": {"uv": [0, 0, 0, 4], "texture": "#0"}, + "west": {"uv": [8, 0, 16, 8], "texture": "#0"}, + "up": {"uv": [0, 4, 0, 0], "texture": "#0"}, + "down": {"uv": [0, 0, 0, 4], "texture": "#0"} + } + }, + { + "from": [0, 0, 8], + "to": [16, 16, 8], + "rotation": {"angle": 45, "axis": "y", "origin": [8, 8, 8]}, + "shade": false, + "faces": { + "north": {"uv": [16, 0, 8, 8], "texture": "#0"}, + "east": {"uv": [0, 0, 0, 4], "texture": "#0"}, + "south": {"uv": [8, 0, 16, 8], "texture": "#0"}, + "west": {"uv": [0, 0, 0, 4], "texture": "#0"}, + "up": {"uv": [0, 4, 0, 0], "rotation": 270, "texture": "#0"}, + "down": {"uv": [0, 0, 0, 4], "rotation": 90, "texture": "#0"} + } + } + ] +} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/magma_plant_stage_2.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/magma_plant_stage_2.json new file mode 100644 index 00000000..702fa678 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/magma_plant_stage_2.json @@ -0,0 +1,36 @@ +{ + "textures": { + "0": "block/custom/magma_plant", + "particle": "block/custom/magma_plant" + }, + "elements": [ + { + "from": [8, 0, 0], + "to": [8, 16, 16], + "rotation": {"angle": 45, "axis": "y", "origin": [8, 8, 8]}, + "shade": false, + "faces": { + "north": {"uv": [0, 0, 0, 4], "texture": "#0"}, + "east": {"uv": [8, 8, 0, 16], "texture": "#0"}, + "south": {"uv": [0, 0, 0, 4], "texture": "#0"}, + "west": {"uv": [0, 8, 8, 16], "texture": "#0"}, + "up": {"uv": [0, 4, 0, 0], "texture": "#0"}, + "down": {"uv": [0, 0, 0, 4], "texture": "#0"} + } + }, + { + "from": [8, 0, 0], + "to": [8, 16, 16], + "rotation": {"angle": -45, "axis": "y", "origin": [8, 8, 8]}, + "shade": false, + "faces": { + "north": {"uv": [0, 0, 0, 4], "texture": "#0"}, + "east": {"uv": [8, 8, 0, 16], "texture": "#0"}, + "south": {"uv": [0, 0, 0, 4], "texture": "#0"}, + "west": {"uv": [0, 8, 8, 16], "texture": "#0"}, + "up": {"uv": [0, 4, 0, 0], "texture": "#0"}, + "down": {"uv": [0, 0, 0, 4], "texture": "#0"} + } + } + ] +} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/magma_plant_stage_3.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/magma_plant_stage_3.json new file mode 100644 index 00000000..871c1cc1 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/magma_plant_stage_3.json @@ -0,0 +1,120 @@ +{ + "textures": { + "0": "block/custom/magma_plant", + "particle": "block/custom/magma_plant" + }, + "elements": [ + { + "from": [6.1, 11.1, 6.1], + "to": [3.9, 8.9, 3.9], + "rotation": {"angle": 0, "axis": "y", "origin": [4, 9, 6]}, + "shade": false, + "faces": { + "north": {"uv": [1, 2, 0, 1], "texture": "#0"}, + "east": {"uv": [1, 2, 0, 1], "texture": "#0"}, + "south": {"uv": [0, 2, 1, 1], "texture": "#0"}, + "west": {"uv": [0, 2, 1, 1], "texture": "#0"}, + "up": {"uv": [1, 2, 0, 1], "texture": "#0"}, + "down": {"uv": [1, 2, 0, 1], "texture": "#0"} + } + }, + { + "from": [4, 9, 4], + "to": [6, 11, 6], + "rotation": {"angle": 0, "axis": "y", "origin": [4, 9, 6]}, + "shade": false, + "faces": { + "north": {"uv": [0, 0, 1, 1], "texture": "#0"}, + "east": {"uv": [1, 0, 2, 1], "texture": "#0"}, + "south": {"uv": [2, 0, 1, 1], "texture": "#0"}, + "west": {"uv": [1, 0, 0, 1], "texture": "#0"}, + "up": {"uv": [2, 1, 3, 0], "texture": "#0"}, + "down": {"uv": [3, 1, 4, 0], "texture": "#0"} + } + }, + { + "from": [11.1, 9.1, 11.1], + "to": [8.9, 6.9, 8.9], + "rotation": {"angle": 0, "axis": "y", "origin": [11, 7, 9]}, + "shade": false, + "faces": { + "north": {"uv": [0, 2, 1, 1], "texture": "#0"}, + "east": {"uv": [0, 2, 1, 1], "texture": "#0"}, + "south": {"uv": [1, 2, 0, 1], "texture": "#0"}, + "west": {"uv": [1, 2, 0, 1], "texture": "#0"}, + "up": {"uv": [0, 1, 1, 2], "texture": "#0"}, + "down": {"uv": [0, 1, 1, 2], "texture": "#0"} + } + }, + { + "from": [9, 7, 9], + "to": [11, 9, 11], + "rotation": {"angle": 0, "axis": "y", "origin": [11, 7, 9]}, + "shade": false, + "faces": { + "north": {"uv": [2, 0, 1, 1], "texture": "#0"}, + "east": {"uv": [1, 0, 0, 1], "texture": "#0"}, + "south": {"uv": [0, 0, 1, 1], "texture": "#0"}, + "west": {"uv": [1, 0, 2, 1], "texture": "#0"}, + "up": {"uv": [3, 0, 2, 1], "texture": "#0"}, + "down": {"uv": [4, 0, 3, 1], "texture": "#0"} + } + }, + { + "from": [6.1, 13.1, 12.1], + "to": [3.9, 10.9, 9.9], + "rotation": {"angle": 0, "axis": "y", "origin": [4, 11, 10]}, + "shade": false, + "faces": { + "north": {"uv": [1, 2, 0, 1], "texture": "#0"}, + "east": {"uv": [0, 2, 1, 1], "texture": "#0"}, + "south": {"uv": [0, 2, 1, 1], "texture": "#0"}, + "west": {"uv": [1, 2, 0, 1], "texture": "#0"}, + "up": {"uv": [1, 1, 0, 2], "texture": "#0"}, + "down": {"uv": [1, 1, 0, 2], "texture": "#0"} + } + }, + { + "from": [4, 11, 10], + "to": [6, 13, 12], + "rotation": {"angle": 0, "axis": "y", "origin": [4, 11, 10]}, + "shade": false, + "faces": { + "north": {"uv": [1, 0, 2, 1], "texture": "#0"}, + "east": {"uv": [2, 0, 1, 1], "texture": "#0"}, + "south": {"uv": [1, 0, 0, 1], "texture": "#0"}, + "west": {"uv": [0, 0, 1, 1], "texture": "#0"}, + "up": {"uv": [2, 0, 3, 1], "texture": "#0"}, + "down": {"uv": [3, 0, 4, 1], "texture": "#0"} + } + }, + { + "from": [8, 0, 0], + "to": [8, 16, 16], + "rotation": {"angle": 45, "axis": "y", "origin": [8, 8, 8]}, + "shade": false, + "faces": { + "north": {"uv": [12, 0, 12, 4], "texture": "#0"}, + "east": {"uv": [16, 8, 8, 16], "texture": "#0"}, + "south": {"uv": [12, 0, 12, 4], "texture": "#0"}, + "west": {"uv": [8, 8, 16, 16], "texture": "#0"}, + "up": {"uv": [12, 4, 12, 0], "texture": "#0"}, + "down": {"uv": [12, 0, 12, 4], "texture": "#0"} + } + }, + { + "from": [8, 0, 0], + "to": [8, 16, 16], + "rotation": {"angle": -45, "axis": "y", "origin": [8, 8, 8]}, + "shade": false, + "faces": { + "north": {"uv": [12, 0, 12, 4], "texture": "#0"}, + "east": {"uv": [16, 8, 8, 16], "texture": "#0"}, + "south": {"uv": [12, 0, 12, 4], "texture": "#0"}, + "west": {"uv": [8, 8, 16, 16], "texture": "#0"}, + "up": {"uv": [12, 4, 12, 0], "texture": "#0"}, + "down": {"uv": [12, 0, 12, 4], "texture": "#0"} + } + } + ] +} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/medium_mushroom.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/medium_mushroom.json new file mode 100644 index 00000000..6f50752f --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/medium_mushroom.json @@ -0,0 +1,73 @@ +{ + "textures": { + "0": "block/custom/mushroom", + "particle": "block/custom/mushroom" + }, + "elements": [ + { + "from": [8.5, 13, 11.5], + "to": [13.5, 13, 17.5], + "rotation": {"angle": -22.5, "axis": "x", "origin": [11, 13, 14.5]}, + "faces": { + "north": {"uv": [2.5, 0, 0, 0], "texture": "#0"}, + "east": {"uv": [3, 0, 0, 0], "texture": "#0"}, + "south": {"uv": [2.5, 0, 0, 0], "texture": "#0"}, + "west": {"uv": [3, 0, 0, 0], "texture": "#0"}, + "up": {"uv": [8, 0, 5.5, 3], "texture": "#0"}, + "down": {"uv": [8, 3, 5.5, 0], "texture": "#0"} + } + }, + { + "from": [8.5, 3, 12.5], + "to": [13.5, 3, 18.5], + "rotation": {"angle": -22.5, "axis": "x", "origin": [11, 3, 15.5]}, + "faces": { + "north": {"uv": [0, 0, 2.5, 0], "texture": "#0"}, + "east": {"uv": [0, 0, 3, 0], "texture": "#0"}, + "south": {"uv": [0, 0, 2.5, 0], "texture": "#0"}, + "west": {"uv": [0, 0, 3, 0], "texture": "#0"}, + "up": {"uv": [8, 0, 10.5, 3], "texture": "#0"}, + "down": {"uv": [8, 3, 10.5, 0], "texture": "#0"} + } + }, + { + "from": [6, 7, 12], + "to": [13, 9, 16], + "rotation": {"angle": 0, "axis": "y", "origin": [6, 7, 12]}, + "faces": { + "north": {"uv": [0, 5, 3.5, 6], "texture": "#0"}, + "east": {"uv": [3.5, 0, 5.5, 1], "texture": "#0"}, + "south": {"uv": [0, 4, 3.5, 5], "texture": "#0"}, + "west": {"uv": [3.5, 1, 5.5, 2], "texture": "#0"}, + "up": {"uv": [3.5, 2, 0, 0], "texture": "#0"}, + "down": {"uv": [3.5, 2, 0, 4], "texture": "#0"} + } + }, + { + "from": [3, 11, 14], + "to": [8, 12, 16], + "rotation": {"angle": 0, "axis": "y", "origin": [3, 11, 14]}, + "faces": { + "north": {"uv": [0, 9, 2.5, 9.5], "texture": "#0"}, + "east": {"uv": [2.5, 11.5, 3.5, 12], "texture": "#0"}, + "south": {"uv": [0, 9.5, 2.5, 10], "texture": "#0"}, + "west": {"uv": [2.5, 11, 3.5, 11.5], "texture": "#0"}, + "up": {"uv": [2.5, 11, 0, 10], "texture": "#0"}, + "down": {"uv": [2.5, 11, 0, 12], "texture": "#0"} + } + }, + { + "from": [3, 4, 13], + "to": [8, 5, 16], + "rotation": {"angle": 0, "axis": "y", "origin": [3, 4, 13]}, + "faces": { + "north": {"uv": [0, 15.5, 2.5, 16], "texture": "#0"}, + "east": {"uv": [2.5, 15, 4, 15.5], "texture": "#0"}, + "south": {"uv": [0, 15, 2.5, 15.5], "texture": "#0"}, + "west": {"uv": [2.5, 15.5, 4, 16], "texture": "#0"}, + "up": {"uv": [2.5, 13.5, 0, 12], "texture": "#0"}, + "down": {"uv": [2.5, 13.5, 0, 15], "texture": "#0"} + } + } + ] +} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/netherite_anvil.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/netherite_anvil.json new file mode 100644 index 00000000..00239865 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/netherite_anvil.json @@ -0,0 +1 @@ +{"parent":"block/anvil","textures":{"top":"block/custom/netherite_anvil_top","body":"block/custom/netherite_anvil","particle":"block/custom/netherite_anvil"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_button.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_button.json new file mode 100644 index 00000000..cb51bb4d --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_button.json @@ -0,0 +1 @@ +{"parent":"block/button_inventory","textures":{"texture":"block/custom/palm_planks"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_button_not_pressed.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_button_not_pressed.json new file mode 100644 index 00000000..da70ad79 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_button_not_pressed.json @@ -0,0 +1 @@ +{"parent":"block/button","textures":{"texture":"block/custom/palm_planks"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_button_pressed.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_button_pressed.json new file mode 100644 index 00000000..8c2e45d6 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_button_pressed.json @@ -0,0 +1 @@ +{"parent":"block/button_pressed","textures":{"texture":"block/custom/palm_planks"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_door_bottom_left.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_door_bottom_left.json new file mode 100644 index 00000000..992ef24f --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_door_bottom_left.json @@ -0,0 +1 @@ +{"parent":"block/door_bottom_left","textures":{"bottom":"block/custom/palm_door_bottom","top":"block/custom/palm_door_top"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_door_bottom_left_open.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_door_bottom_left_open.json new file mode 100644 index 00000000..7329c64c --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_door_bottom_left_open.json @@ -0,0 +1 @@ +{"parent":"block/door_bottom_left_open","textures":{"bottom":"block/custom/palm_door_bottom","top":"block/custom/palm_door_top"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_door_bottom_right.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_door_bottom_right.json new file mode 100644 index 00000000..2d65c05e --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_door_bottom_right.json @@ -0,0 +1 @@ +{"parent":"block/door_bottom_right","textures":{"bottom":"block/custom/palm_door_bottom","top":"block/custom/palm_door_top"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_door_bottom_right_open.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_door_bottom_right_open.json new file mode 100644 index 00000000..69808ded --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_door_bottom_right_open.json @@ -0,0 +1 @@ +{"parent":"block/door_bottom_right_open","textures":{"bottom":"block/custom/palm_door_bottom","top":"block/custom/palm_door_top"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_door_top_left.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_door_top_left.json new file mode 100644 index 00000000..e05c720e --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_door_top_left.json @@ -0,0 +1 @@ +{"parent":"block/door_top_left","textures":{"bottom":"block/custom/palm_door_bottom","top":"block/custom/palm_door_top"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_door_top_left_open.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_door_top_left_open.json new file mode 100644 index 00000000..4a4cde28 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_door_top_left_open.json @@ -0,0 +1 @@ +{"parent":"block/door_top_left_open","textures":{"bottom":"block/custom/palm_door_bottom","top":"block/custom/palm_door_top"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_door_top_right.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_door_top_right.json new file mode 100644 index 00000000..934f3bc6 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_door_top_right.json @@ -0,0 +1 @@ +{"parent":"block/door_top_right","textures":{"bottom":"block/custom/palm_door_bottom","top":"block/custom/palm_door_top"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_door_top_right_open.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_door_top_right_open.json new file mode 100644 index 00000000..96e5d08d --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_door_top_right_open.json @@ -0,0 +1 @@ +{"parent":"block/door_top_right_open","textures":{"bottom":"block/custom/palm_door_bottom","top":"block/custom/palm_door_top"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_fence_gate.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_fence_gate.json new file mode 100644 index 00000000..d42c7e15 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_fence_gate.json @@ -0,0 +1 @@ +{"parent":"block/template_fence_gate","textures":{"texture":"block/custom/palm_planks"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_fence_gate_open.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_fence_gate_open.json new file mode 100644 index 00000000..391bfefb --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_fence_gate_open.json @@ -0,0 +1 @@ +{"parent":"block/template_fence_gate_open","textures":{"texture":"block/custom/palm_planks"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_fence_gate_wall.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_fence_gate_wall.json new file mode 100644 index 00000000..5be2bef9 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_fence_gate_wall.json @@ -0,0 +1 @@ +{"parent":"block/template_fence_gate_wall","textures":{"texture":"block/custom/palm_planks"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_fence_gate_wall_open.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_fence_gate_wall_open.json new file mode 100644 index 00000000..7540c8ca --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_fence_gate_wall_open.json @@ -0,0 +1 @@ +{"parent":"block/template_fence_gate_wall_open","textures":{"texture":"block/custom/palm_planks"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_fence_inventory.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_fence_inventory.json new file mode 100644 index 00000000..c13d2a5c --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_fence_inventory.json @@ -0,0 +1 @@ +{"parent":"block/fence_inventory","textures":{"texture":"block/custom/palm_planks"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_fence_post.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_fence_post.json new file mode 100644 index 00000000..dc8e8a8d --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_fence_post.json @@ -0,0 +1 @@ +{"parent":"block/fence_post","textures":{"texture":"block/custom/palm_planks"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_fence_side.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_fence_side.json new file mode 100644 index 00000000..01274918 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_fence_side.json @@ -0,0 +1 @@ +{"parent":"block/custom/fence_side","textures":{"texture":"block/custom/palm_planks"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_leaves.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_leaves.json new file mode 100644 index 00000000..2a627799 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_leaves.json @@ -0,0 +1 @@ +{"parent":"block/leaves","textures":{"all":"block/custom/palm_leaves"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_log.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_log.json new file mode 100644 index 00000000..a6a73bfd --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_log.json @@ -0,0 +1 @@ +{"parent":"block/cube_column","textures":{"end":"block/custom/palm_log_top","side":"block/custom/palm_log"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_log_horizontal.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_log_horizontal.json new file mode 100644 index 00000000..5ed8170e --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_log_horizontal.json @@ -0,0 +1 @@ +{"parent":"block/cube_column_horizontal","textures":{"end":"block/custom/palm_log_top","side":"block/custom/palm_log"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_planks.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_planks.json new file mode 100644 index 00000000..244a975b --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_planks.json @@ -0,0 +1 @@ +{"parent":"block/cube_all","textures":{"all":"block/custom/palm_planks"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_pressure_plate.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_pressure_plate.json new file mode 100644 index 00000000..7bea0cb7 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_pressure_plate.json @@ -0,0 +1 @@ +{"parent":"block/pressure_plate_up","textures":{"texture":"block/custom/palm_planks"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_pressure_plate_powered.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_pressure_plate_powered.json new file mode 100644 index 00000000..ea55b755 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_pressure_plate_powered.json @@ -0,0 +1 @@ +{"parent":"block/pressure_plate_down","textures":{"texture":"block/custom/palm_planks"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_sapling.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_sapling.json new file mode 100644 index 00000000..adbde51a --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_sapling.json @@ -0,0 +1 @@ +{"parent":"block/cross","textures":{"cross":"block/custom/palm_sapling"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_slab.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_slab.json new file mode 100644 index 00000000..174457a5 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_slab.json @@ -0,0 +1 @@ +{"parent":"block/slab","textures":{"bottom":"block/custom/palm_planks","side":"block/custom/palm_planks","top":"block/custom/palm_planks"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_slab_top.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_slab_top.json new file mode 100644 index 00000000..0266afd7 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_slab_top.json @@ -0,0 +1 @@ +{"parent":"block/slab_top","textures":{"bottom":"block/custom/palm_planks","side":"block/custom/palm_planks","top":"block/custom/palm_planks"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_stairs.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_stairs.json new file mode 100644 index 00000000..28625dff --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_stairs.json @@ -0,0 +1 @@ +{"parent":"block/stairs","textures":{"bottom":"block/custom/palm_planks","side":"block/custom/palm_planks","top":"block/custom/palm_planks"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_stairs_inner.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_stairs_inner.json new file mode 100644 index 00000000..0e6c0d02 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_stairs_inner.json @@ -0,0 +1 @@ +{"parent":"block/inner_stairs","textures":{"bottom":"block/custom/palm_planks","side":"block/custom/palm_planks","top":"block/custom/palm_planks"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_stairs_outer.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_stairs_outer.json new file mode 100644 index 00000000..ca6d9b40 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_stairs_outer.json @@ -0,0 +1 @@ +{"parent":"block/outer_stairs","textures":{"bottom":"block/custom/palm_planks","side":"block/custom/palm_planks","top":"block/custom/palm_planks"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_trapdoor_bottom.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_trapdoor_bottom.json new file mode 100644 index 00000000..d6e5d66e --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_trapdoor_bottom.json @@ -0,0 +1 @@ +{"parent":"block/template_orientable_trapdoor_bottom","textures":{"texture":"block/custom/palm_trapdoor"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_trapdoor_open.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_trapdoor_open.json new file mode 100644 index 00000000..aae966c8 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_trapdoor_open.json @@ -0,0 +1 @@ +{"parent":"block/template_orientable_trapdoor_open","textures":{"texture":"block/custom/palm_trapdoor"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_trapdoor_top.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_trapdoor_top.json new file mode 100644 index 00000000..7bf09d32 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_trapdoor_top.json @@ -0,0 +1 @@ +{"parent":"block/template_orientable_trapdoor_top","textures":{"texture":"block/custom/palm_trapdoor"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_wood.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_wood.json new file mode 100644 index 00000000..1f43a5b1 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_wood.json @@ -0,0 +1 @@ +{"parent":"block/cube_column","textures":{"end":"block/custom/palm_log","side":"block/custom/palm_log"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_wood_horizontal.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_wood_horizontal.json new file mode 100644 index 00000000..b5eb0f93 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_wood_horizontal.json @@ -0,0 +1 @@ +{"parent":"block/cube_column_horizontal","textures":{"end":"block/custom/palm_log","side":"block/custom/palm_log"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/pebble_1.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/pebble_1.json new file mode 100644 index 00000000..df5bbce2 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/pebble_1.json @@ -0,0 +1,34 @@ +{ + "textures": { + "0": "block/custom/pebble", + "particle": "block/custom/pebble" + }, + "elements": [ + { + "from": [4, -0.99, 5], + "to": [7, 1.01, 8], + "rotation": {"angle": 0, "axis": "y", "origin": [4, 0, 5]}, + "faces": { + "north": {"uv": [5, 1.5, 6.5, 2.5], "texture": "#0"}, + "east": {"uv": [5, 2.5, 6.5, 3.5], "texture": "#0"}, + "south": {"uv": [5, 3.5, 6.5, 4.5], "texture": "#0"}, + "west": {"uv": [5, 4.5, 6.5, 5.5], "texture": "#0"}, + "up": {"uv": [1.5, 6.5, 0, 5], "texture": "#0"}, + "down": {"uv": [6.5, 0, 5, 1.5], "texture": "#0"} + } + }, + { + "from": [6, -1, 6], + "to": [11, 2, 11], + "rotation": {"angle": 0, "axis": "y", "origin": [6, 0, 6]}, + "faces": { + "north": {"uv": [2.5, 0, 5, 1.5], "texture": "#0"}, + "east": {"uv": [2.5, 1.5, 5, 3], "texture": "#0"}, + "south": {"uv": [2.5, 3, 5, 4.5], "texture": "#0"}, + "west": {"uv": [2.5, 4.5, 5, 6], "texture": "#0"}, + "up": {"uv": [2.5, 2.5, 0, 0], "texture": "#0"}, + "down": {"uv": [2.5, 2.5, 0, 5], "texture": "#0"} + } + } + ] +} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/pebble_2.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/pebble_2.json new file mode 100644 index 00000000..7bc0f078 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/pebble_2.json @@ -0,0 +1,47 @@ +{ + "textures": { + "0": "block/custom/pebble", + "particle": "block/custom/pebble" + }, + "elements": [ + { + "from": [2.01, -0.99, 8.01], + "to": [4.99, 2.99, 10.99], + "rotation": {"angle": 45, "axis": "z", "origin": [3.5, 1.5, 9.5]}, + "faces": { + "north": {"uv": [12, 4, 13.5, 6], "texture": "#0"}, + "east": {"uv": [2.5, 6, 4, 8], "texture": "#0"}, + "south": {"uv": [4, 6, 5.5, 8], "texture": "#0"}, + "west": {"uv": [5.5, 6, 7, 8], "texture": "#0"}, + "up": {"uv": [16, 6, 14.5, 4.5], "texture": "#0"}, + "down": {"uv": [16, 6, 14.5, 7.5], "texture": "#0"} + } + }, + { + "from": [8, 0, 5], + "to": [12, 3, 9], + "rotation": {"angle": 0, "axis": "y", "origin": [5, 0, 6]}, + "faces": { + "north": {"uv": [14, 3, 16, 4.5], "texture": "#0"}, + "east": {"uv": [7, 7, 9, 8.5], "texture": "#0"}, + "south": {"uv": [14, 0, 16, 1.5], "texture": "#0"}, + "west": {"uv": [14, 1.5, 16, 3], "texture": "#0"}, + "up": {"uv": [14, 2, 12, 0], "texture": "#0"}, + "down": {"uv": [14, 2, 12, 4], "texture": "#0"} + } + }, + { + "from": [4.99, -0.01, 6.99], + "to": [10.01, 4.01, 12.01], + "rotation": {"angle": 0, "axis": "y", "origin": [5, 0, 6]}, + "faces": { + "north": {"uv": [9.5, 0, 12, 2], "texture": "#0"}, + "east": {"uv": [9.5, 2, 12, 4], "texture": "#0"}, + "south": {"uv": [9.5, 4, 12, 6], "texture": "#0"}, + "west": {"uv": [7, 5, 9.5, 7], "texture": "#0"}, + "up": {"uv": [9.5, 2.5, 7, 0], "texture": "#0"}, + "down": {"uv": [9.5, 2.5, 7, 5], "texture": "#0"} + } + } + ] +} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/pebble_3.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/pebble_3.json new file mode 100644 index 00000000..14e45b86 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/pebble_3.json @@ -0,0 +1,47 @@ +{ + "textures": { + "0": "block/custom/pebble", + "particle": "block/custom/pebble" + }, + "elements": [ + { + "from": [6, 0, 9], + "to": [11, 2, 14], + "rotation": {"angle": 0, "axis": "y", "origin": [15, 0, 1]}, + "faces": { + "north": {"uv": [15, 13.5, 16, 16], "rotation": 90, "texture": "#0"}, + "east": {"uv": [6.5, 9, 9, 10], "texture": "#0"}, + "south": {"uv": [11.5, 9, 14, 10], "texture": "#0"}, + "west": {"uv": [15, 16, 14, 13.5], "rotation": 90, "texture": "#0"}, + "up": {"uv": [12, 9, 9.5, 6.5], "texture": "#0"}, + "down": {"uv": [14.5, 6.5, 12, 9], "texture": "#0"} + } + }, + { + "from": [7, 0, 4], + "to": [12, 4, 9], + "rotation": {"angle": 0, "axis": "y", "origin": [-1, 0, 1]}, + "faces": { + "north": {"uv": [9, 11.5, 11.5, 13.5], "texture": "#0"}, + "east": {"uv": [11.5, 10, 14, 12], "texture": "#0"}, + "south": {"uv": [11.5, 12, 14, 14], "texture": "#0"}, + "west": {"uv": [11.5, 14, 14, 16], "texture": "#0"}, + "up": {"uv": [11.5, 16, 9, 13.5], "texture": "#0"}, + "down": {"uv": [11.5, 9, 9, 11.5], "texture": "#0"} + } + }, + { + "from": [3, 0, 6], + "to": [9, 8, 12], + "rotation": {"angle": 22.5, "axis": "z", "origin": [7, 3.5, 9]}, + "faces": { + "north": {"uv": [0, 8, 3, 12], "texture": "#0"}, + "east": {"uv": [3, 8, 6, 12], "texture": "#0"}, + "south": {"uv": [0, 12, 3, 16], "texture": "#0"}, + "west": {"uv": [3, 12, 6, 16], "texture": "#0"}, + "up": {"uv": [9, 13, 6, 10], "texture": "#0"}, + "down": {"uv": [9, 13, 6, 16], "texture": "#0"} + } + } + ] +} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/reed.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/reed.json new file mode 100644 index 00000000..5f872fc8 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/reed.json @@ -0,0 +1,37 @@ +{ + "ambientocclusion": false, + "textures": { + "0": "block/custom/reed", + "particle": "block/custom/reed" + }, + "elements": [ + { + "from": [-0.5, -3, 0.25], + "to": [19.5, 29, 0.25], + "shade": false, + "rotation": {"angle": -45, "axis": "y", "origin": [-0.5, -3, 2.25]}, + "faces": { + "north": {"uv": [0, 0, 10, 16], "texture": "#0"}, + "east": {"uv": [0, 0, 0, 16], "texture": "#0"}, + "south": {"uv": [0, 0, 10, 16], "texture": "#0"}, + "west": {"uv": [0, 0, 0, 16], "texture": "#0"}, + "up": {"uv": [0, 0, 0, 10], "rotation": 270, "texture": "#0"}, + "down": {"uv": [0, 0, 0, 10], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [2, -3, 14.75], + "to": [22, 29, 14.75], + "shade": false, + "rotation": {"angle": 45, "axis": "y", "origin": [2, -3, 16.75]}, + "faces": { + "north": {"uv": [0, 0, 10, 16], "texture": "#0"}, + "east": {"uv": [0, 0, 0, 16], "texture": "#0"}, + "south": {"uv": [0, 0, 10, 16], "texture": "#0"}, + "west": {"uv": [0, 0, 0, 16], "texture": "#0"}, + "up": {"uv": [0, 0, 0, 10], "rotation": 270, "texture": "#0"}, + "down": {"uv": [0, 0, 0, 10], "rotation": 90, "texture": "#0"} + } + } + ] +} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/safe_block.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/safe_block.json new file mode 100644 index 00000000..0b63d714 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/safe_block.json @@ -0,0 +1 @@ +{"parent":"block/orientable","textures":{"bottom":"block/custom/safe_block_bottom","front":"block/custom/safe_block_front","side":"block/custom/safe_block_side","top":"block/custom/safe_block_top"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/safe_block_open.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/safe_block_open.json new file mode 100644 index 00000000..a89ff1f8 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/safe_block_open.json @@ -0,0 +1 @@ +{"parent":"block/orientable","textures":{"bottom":"block/custom/safe_block_bottom","side":"block/custom/safe_block_side","top":"block/custom/safe_block_top","front":"block/custom/safe_block_front_open"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/small_mushroom.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/small_mushroom.json new file mode 100644 index 00000000..a48e42e2 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/small_mushroom.json @@ -0,0 +1,61 @@ +{ + "texture_size": [32, 32], + "textures": { + "0": "block/custom/mushroom", + "particle": "block/custom/mushroom" + }, + "elements": [ + { + "from": [9.5, 3, 11.5], + "to": [14.5, 3, 17.5], + "rotation": {"angle": 0, "axis": "y", "origin": [12, 3, 14.5]}, + "faces": { + "north": {"uv": [2.5, 0, 0, 0], "texture": "#0"}, + "east": {"uv": [3, 0, 0, 0], "texture": "#0"}, + "south": {"uv": [2.5, 0, 0, 0], "texture": "#0"}, + "west": {"uv": [3, 0, 0, 0], "texture": "#0"}, + "up": {"uv": [8, 0, 5.5, 3], "texture": "#0"}, + "down": {"uv": [8, 3, 5.5, 0], "texture": "#0"} + } + }, + { + "from": [2.5, 11, 10.5], + "to": [7.5, 11, 16.5], + "rotation": {"angle": -22.5, "axis": "x", "origin": [5, 11, 16.5]}, + "faces": { + "north": {"uv": [0, 0, 2.5, 0], "texture": "#0"}, + "east": {"uv": [0, 0, 3, 0], "texture": "#0"}, + "south": {"uv": [0, 0, 2.5, 0], "texture": "#0"}, + "west": {"uv": [0, 0, 3, 0], "texture": "#0"}, + "up": {"uv": [5.5, 0, 8, 3], "texture": "#0"}, + "down": {"uv": [5.5, 3, 8, 0], "texture": "#0"} + } + }, + { + "from": [3, 4, 14], + "to": [8, 5, 16], + "rotation": {"angle": 0, "axis": "y", "origin": [3, 4, 14]}, + "faces": { + "north": {"uv": [0, 9, 2.5, 9.5], "texture": "#0"}, + "east": {"uv": [2.5, 11.5, 3.5, 12], "texture": "#0"}, + "south": {"uv": [0, 9.5, 2.5, 10], "texture": "#0"}, + "west": {"uv": [2.5, 11, 3.5, 11.5], "texture": "#0"}, + "up": {"uv": [2.5, 11, 0, 10], "texture": "#0"}, + "down": {"uv": [2.5, 11, 0, 12], "texture": "#0"} + } + }, + { + "from": [6, 7, 13], + "to": [13, 9, 17], + "rotation": {"angle": 0, "axis": "y", "origin": [6, 7, 13]}, + "faces": { + "north": {"uv": [0, 5, 3.5, 6], "texture": "#0"}, + "east": {"uv": [3.5, 0, 5.5, 1], "texture": "#0"}, + "south": {"uv": [0, 4, 3.5, 5], "texture": "#0"}, + "west": {"uv": [3.5, 1, 5.5, 2], "texture": "#0"}, + "up": {"uv": [3.5, 2, 0, 0], "texture": "#0"}, + "down": {"uv": [3.5, 2, 0, 4], "texture": "#0"} + } + } + ] +} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/solid_gunpowder_block.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/solid_gunpowder_block.json new file mode 100644 index 00000000..d77d8fd2 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/solid_gunpowder_block.json @@ -0,0 +1 @@ +{"parent":"block/cube_all","textures":{"all":"block/custom/solid_gunpowder_block"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/stripped_palm_log.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/stripped_palm_log.json new file mode 100644 index 00000000..5659a17f --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/stripped_palm_log.json @@ -0,0 +1 @@ +{"parent":"block/cube_column","textures":{"end":"block/custom/stripped_palm_log_top","side":"block/custom/stripped_palm_log"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/stripped_palm_log_horizontal.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/stripped_palm_log_horizontal.json new file mode 100644 index 00000000..2052b053 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/stripped_palm_log_horizontal.json @@ -0,0 +1 @@ +{"parent":"block/cube_column_horizontal","textures":{"end":"block/custom/stripped_palm_log_top","side":"block/custom/stripped_palm_log"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/stripped_palm_wood.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/stripped_palm_wood.json new file mode 100644 index 00000000..5c0aadd4 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/stripped_palm_wood.json @@ -0,0 +1 @@ +{"parent":"block/cube_column","textures":{"end":"block/custom/stripped_palm_log","side":"block/custom/stripped_palm_log"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/stripped_palm_wood_horizontal.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/stripped_palm_wood_horizontal.json new file mode 100644 index 00000000..b4172e3a --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/stripped_palm_wood_horizontal.json @@ -0,0 +1 @@ +{"parent":"block/cube_column_horizontal","textures":{"end":"block/custom/stripped_palm_log","side":"block/custom/stripped_palm_log"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/topaz_ore.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/topaz_ore.json new file mode 100644 index 00000000..15395918 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/topaz_ore.json @@ -0,0 +1 @@ +{"parent":"block/cube_all","textures":{"all":"block/custom/topaz_ore"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/empty.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/empty.json new file mode 100644 index 00000000..872e7b9d --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/empty.json @@ -0,0 +1 @@ +{"textures":{"particle":"block/empty"},"elements":[{"from":[0,0,0],"to":[0,0,0],"color":0,"faces":{"north":{"uv":[0,0,0,0],"texture":"#particle"},"east":{"uv":[0,0,0,0],"texture":"#particle"},"south":{"uv":[0,0,0,0],"texture":"#particle"},"west":{"uv":[0,0,0,0],"texture":"#particle"},"up":{"uv":[0,0,0,0],"texture":"#particle"},"down":{"uv":[0,0,0,0],"texture":"#particle"}}}]} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/bench.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/bench.json new file mode 100644 index 00000000..881f11a5 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/bench.json @@ -0,0 +1,253 @@ +{ + "textures": { + "0": "item/custom/bench", + "particle": "item/custom/bench" + }, + "elements": [ + { + "from": [-8, 0, 1], + "to": [-6, 7, 3], + "faces": { + "north": {"uv": [7, 10.25, 7.5, 12], "texture": "#0"}, + "east": {"uv": [7.5, 10.25, 8, 12], "texture": "#0"}, + "south": {"uv": [8, 10.25, 8.5, 12], "texture": "#0"}, + "west": {"uv": [8.5, 10.25, 9, 12], "texture": "#0"}, + "up": {"uv": [10.5, 6.75, 10, 6.25], "texture": "#0"}, + "down": {"uv": [10.5, 6.75, 10, 7.25], "texture": "#0"} + } + }, + { + "from": [22, 0, 1], + "to": [24, 7, 3], + "rotation": {"angle": 0, "axis": "y", "origin": [16, 0, 0]}, + "faces": { + "north": {"uv": [7.5, 10.25, 7, 12], "texture": "#0"}, + "east": {"uv": [9, 10.25, 8.5, 12], "texture": "#0"}, + "south": {"uv": [8.5, 10.25, 8, 12], "texture": "#0"}, + "west": {"uv": [8, 10.25, 7.5, 12], "texture": "#0"}, + "up": {"uv": [10, 6.75, 10.5, 6.25], "texture": "#0"}, + "down": {"uv": [10, 6.75, 10.5, 7.25], "texture": "#0"} + } + }, + { + "from": [22, 0, 13], + "to": [24, 7, 15], + "rotation": {"angle": 0, "axis": "y", "origin": [16, 0, 16]}, + "faces": { + "north": {"uv": [8, 10.25, 8.5, 12], "texture": "#0"}, + "east": {"uv": [8.5, 10.25, 9, 12], "texture": "#0"}, + "south": {"uv": [7, 10.25, 7.5, 12], "texture": "#0"}, + "west": {"uv": [7.5, 10.25, 8, 12], "texture": "#0"}, + "up": {"uv": [10, 6.25, 10.5, 6.75], "texture": "#0"}, + "down": {"uv": [10, 7.25, 10.5, 6.75], "texture": "#0"} + } + }, + { + "from": [-8, 0, 13], + "to": [-6, 7, 15], + "rotation": {"angle": 0, "axis": "y", "origin": [0, 0, 16]}, + "faces": { + "north": {"uv": [8.5, 10.25, 8, 12], "texture": "#0"}, + "east": {"uv": [8, 10.25, 7.5, 12], "texture": "#0"}, + "south": {"uv": [7.5, 10.25, 7, 12], "texture": "#0"}, + "west": {"uv": [9, 10.25, 8.5, 12], "texture": "#0"}, + "up": {"uv": [10.5, 6.25, 10, 6.75], "texture": "#0"}, + "down": {"uv": [10.5, 7.25, 10, 6.75], "texture": "#0"} + } + }, + { + "from": [-8, 13, 1], + "to": [-6, 15, 13], + "faces": { + "north": {"uv": [12.25, 9.25, 12.75, 9.75], "texture": "#0"}, + "east": {"uv": [13, 5.75, 10, 6.25], "texture": "#0"}, + "south": {"uv": [12.25, 9.75, 12.75, 10.25], "texture": "#0"}, + "west": {"uv": [10, 5.75, 13, 6.25], "texture": "#0"}, + "up": {"uv": [2.5, 13.25, 2, 10.25], "texture": "#0"}, + "down": {"uv": [3, 10.25, 2.5, 13.25], "texture": "#0"} + } + }, + { + "from": [-7, 9, 1], + "to": [-7, 13, 13], + "faces": { + "north": {"uv": [0, 0, 0, 1], "texture": "#0"}, + "east": {"uv": [7, 4.25, 10, 5.25], "texture": "#0"}, + "south": {"uv": [0, 0, 0, 1], "texture": "#0"}, + "west": {"uv": [7, 4.25, 10, 5.25], "texture": "#0"}, + "up": {"uv": [0, 3, 0, 0], "texture": "#0"}, + "down": {"uv": [0, 0, 0, 3], "texture": "#0"} + } + }, + { + "from": [-8, 9, 13], + "to": [-6, 21, 15], + "faces": { + "north": {"uv": [5, 10.25, 5.5, 13.25], "texture": "#0"}, + "east": {"uv": [5.5, 10.25, 6, 13.25], "texture": "#0"}, + "south": {"uv": [6, 10.25, 6.5, 13.25], "texture": "#0"}, + "west": {"uv": [6.5, 10.25, 7, 13.25], "texture": "#0"}, + "up": {"uv": [12.75, 11.75, 12.25, 11.25], "texture": "#0"}, + "down": {"uv": [12.75, 11.75, 12.25, 12.25], "texture": "#0"} + } + }, + { + "from": [-6, 8, 14], + "to": [22, 22, 14], + "faces": { + "north": {"uv": [0, 0, 7, 3.5], "texture": "#0"}, + "east": {"uv": [0, 0, 0, 3.5], "texture": "#0"}, + "south": {"uv": [0, 3.5, 7, 7], "texture": "#0"}, + "west": {"uv": [0, 0, 0, 3.5], "texture": "#0"}, + "up": {"uv": [7, 0, 0, 0], "texture": "#0"}, + "down": {"uv": [7, 0, 0, 0], "texture": "#0"} + } + }, + { + "from": [-8, 7, 0], + "to": [-6, 9, 15], + "faces": { + "north": {"uv": [12.25, 12.25, 12.75, 12.75], "texture": "#0"}, + "east": {"uv": [10, 3.25, 13.75, 3.75], "texture": "#0"}, + "south": {"uv": [12.5, 6.25, 13, 6.75], "texture": "#0"}, + "west": {"uv": [10, 3.75, 13.75, 4.25], "texture": "#0"}, + "up": {"uv": [0.5, 14, 0, 10.25], "texture": "#0"}, + "down": {"uv": [1, 10.25, 0.5, 14], "texture": "#0"} + } + }, + { + "from": [22, 7, 0], + "to": [24, 9, 15], + "rotation": {"angle": 0, "axis": "y", "origin": [16, 0, 0]}, + "faces": { + "north": {"uv": [12.75, 12.25, 12.25, 12.75], "texture": "#0"}, + "east": {"uv": [13.75, 3.75, 10, 4.25], "texture": "#0"}, + "south": {"uv": [13, 6.25, 12.5, 6.75], "texture": "#0"}, + "west": {"uv": [13.75, 3.25, 10, 3.75], "texture": "#0"}, + "up": {"uv": [0, 14, 0.5, 10.25], "texture": "#0"}, + "down": {"uv": [0.5, 10.25, 1, 14], "texture": "#0"} + } + }, + { + "from": [22, 13, 1], + "to": [24, 15, 13], + "rotation": {"angle": 0, "axis": "y", "origin": [16, 0, 0]}, + "faces": { + "north": {"uv": [12.75, 9.25, 12.25, 9.75], "texture": "#0"}, + "east": {"uv": [13, 5.75, 10, 6.25], "texture": "#0"}, + "south": {"uv": [12.75, 9.75, 12.25, 10.25], "texture": "#0"}, + "west": {"uv": [10, 5.75, 13, 6.25], "texture": "#0"}, + "up": {"uv": [2, 13.25, 2.5, 10.25], "texture": "#0"}, + "down": {"uv": [2.5, 10.25, 3, 13.25], "texture": "#0"} + } + }, + { + "from": [23, 9, 1], + "to": [23, 13, 13], + "rotation": {"angle": 0, "axis": "y", "origin": [16, 0, 0]}, + "faces": { + "north": {"uv": [0, 0, 0, 1], "texture": "#0"}, + "east": {"uv": [10, 4.25, 7, 5.25], "texture": "#0"}, + "south": {"uv": [0, 0, 0, 1], "texture": "#0"}, + "west": {"uv": [10, 4.25, 7, 5.25], "texture": "#0"}, + "up": {"uv": [0, 3, 0, 0], "texture": "#0"}, + "down": {"uv": [0, 0, 0, 3], "texture": "#0"} + } + }, + { + "from": [22, 9, 13], + "to": [24, 21, 15], + "rotation": {"angle": 0, "axis": "y", "origin": [16, 0, 0]}, + "faces": { + "north": {"uv": [5.5, 10.25, 5, 13.25], "texture": "#0"}, + "east": {"uv": [7, 10.25, 6.5, 13.25], "texture": "#0"}, + "south": {"uv": [6.5, 10.25, 6, 13.25], "texture": "#0"}, + "west": {"uv": [6, 10.25, 5.5, 13.25], "texture": "#0"}, + "up": {"uv": [12.25, 11.75, 12.75, 11.25], "texture": "#0"}, + "down": {"uv": [12.25, 11.75, 12.75, 12.25], "texture": "#0"} + } + }, + { + "from": [-7, 3, 3], + "to": [-7, 7, 12], + "faces": { + "north": {"uv": [0, 0, 0, 1], "texture": "#0"}, + "east": {"uv": [7, 8.25, 9.25, 9.25], "texture": "#0"}, + "south": {"uv": [0, 0, 0, 1], "texture": "#0"}, + "west": {"uv": [7, 8.25, 9.25, 9.25], "texture": "#0"}, + "up": {"uv": [0, 2.25, 0, 0], "texture": "#0"}, + "down": {"uv": [0, 0, 0, 2.25], "texture": "#0"} + } + }, + { + "from": [23, 3, 3], + "to": [23, 7, 12], + "rotation": {"angle": 0, "axis": "y", "origin": [16, 0, 0]}, + "faces": { + "north": {"uv": [0, 0, 0, 1], "texture": "#0"}, + "east": {"uv": [9.25, 8.25, 7, 9.25], "texture": "#0"}, + "south": {"uv": [0, 0, 0, 1], "texture": "#0"}, + "west": {"uv": [9.25, 8.25, 7, 9.25], "texture": "#0"}, + "up": {"uv": [0, 2.25, 0, 0], "texture": "#0"}, + "down": {"uv": [0, 0, 0, 2.25], "texture": "#0"} + } + }, + { + "from": [-6, 8, 1], + "to": [22, 8, 14], + "faces": { + "north": {"uv": [0, 0, 7, 0], "texture": "#0"}, + "east": {"uv": [0, 0, 3.25, 0], "texture": "#0"}, + "south": {"uv": [0, 0, 7, 0], "texture": "#0"}, + "west": {"uv": [0, 0, 3.25, 0], "texture": "#0"}, + "up": {"uv": [7, 10.25, 0, 7], "texture": "#0"}, + "down": {"uv": [7, 7, 0, 10.25], "texture": "#0"} + } + } + ], + "gui_light": "front", + "display": { + "thirdperson_righthand": { + "rotation": [60, 145, 0], + "translation": [0, 1.25, 0], + "scale": [0.5, 0.5, 0.5] + }, + "thirdperson_lefthand": { + "rotation": [60, 145, 0], + "translation": [0, 1.25, 0], + "scale": [0.5, 0.5, 0.5] + }, + "firstperson_righthand": { + "rotation": [0, 111, 0], + "translation": [0.5, 3, 0], + "scale": [0.5, 0.5, 0.5] + }, + "firstperson_lefthand": { + "rotation": [0, 111, 0], + "translation": [0.5, 3, 0], + "scale": [0.5, 0.5, 0.5] + }, + "ground": { + "translation": [0, 3.25, 0], + "scale": [0.3, 0.3, 0.3] + }, + "gui": { + "rotation": [25, 138, 0], + "translation": [0, -1, 0], + "scale": [0.4, 0.4, 0.4] + }, + "fixed": { + "rotation": [0, 90, 0], + "translation": [0, 0, 6], + "scale": [0.5, 0.5, 0.5] + } + }, + "groups": [ + { + "name": "group", + "origin": [0, 0, 0], + "color": 0, + "children": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] + } + ] +} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/candelabrum_ceiling.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/candelabrum_ceiling.json new file mode 100644 index 00000000..ab5699b6 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/candelabrum_ceiling.json @@ -0,0 +1,230 @@ +{ + "textures": { + "0": "item/custom/candelabrum", + "1": "item/custom/candelabrum_flame", + "particle": "item/custom/candelabrum" + }, + "elements": [ + { + "from": [4, 14, 4], + "to": [12, 16, 12], + "rotation": {"angle": 0, "axis": "y", "origin": [4, 14, 4]}, + "faces": { + "north": {"uv": [8.5, 4.5, 12.5, 5.5], "texture": "#0"}, + "east": {"uv": [8.5, 4.5, 12.5, 5.5], "texture": "#0"}, + "south": {"uv": [8.5, 4.5, 12.5, 5.5], "texture": "#0"}, + "west": {"uv": [8.5, 4.5, 12.5, 5.5], "texture": "#0"}, + "up": {"uv": [9, 6, 13, 10], "texture": "#0"}, + "down": {"uv": [5, 6, 9, 10], "texture": "#0"} + } + }, + { + "from": [8, 2, 0], + "to": [8, 14, 16], + "rotation": {"angle": -45, "axis": "y", "origin": [8, 8, 8]}, + "faces": { + "north": {"uv": [0, 0, 0, 12], "texture": "#0"}, + "east": {"uv": [0, 10, 8, 16], "texture": "#0"}, + "south": {"uv": [0, 0, 0, 12], "texture": "#0"}, + "west": {"uv": [0, 10, 8, 16], "texture": "#0"}, + "up": {"uv": [0, 0, 0, 16], "texture": "#0"}, + "down": {"uv": [0, 0, 0, 16], "texture": "#0"} + } + }, + { + "from": [8, 2, 0], + "to": [8, 14, 16], + "rotation": {"angle": 45, "axis": "y", "origin": [8, 8, 8]}, + "faces": { + "north": {"uv": [0, 0, 0, 12], "texture": "#0"}, + "east": {"uv": [0, 10, 8, 16], "texture": "#0"}, + "south": {"uv": [0, 0, 0, 12], "texture": "#0"}, + "west": {"uv": [0, 10, 8, 16], "texture": "#0"}, + "up": {"uv": [0, 0, 0, 16], "texture": "#0"}, + "down": {"uv": [0, 0, 0, 16], "texture": "#0"} + } + }, + { + "from": [11, 5, 11], + "to": [13, 9, 13], + "rotation": {"angle": 0, "axis": "y", "origin": [12, 7, 12]}, + "faces": { + "north": {"uv": [11, 14, 12, 16], "texture": "#0"}, + "east": {"uv": [12, 14, 11, 16], "texture": "#0"}, + "south": {"uv": [11, 14, 12, 16], "texture": "#0"}, + "west": {"uv": [12, 14, 11, 16], "texture": "#0"}, + "up": {"uv": [16, 12, 15, 11], "rotation": 90, "texture": "#0"}, + "down": {"uv": [15, 13, 16, 12], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [10.8, 4.8, 10.8], + "to": [13.2, 9.2, 13.2], + "rotation": {"angle": 0, "axis": "y", "origin": [12, 7, 12]}, + "faces": { + "north": {"uv": [10, 14, 11, 16], "texture": "#0"}, + "east": {"uv": [13, 14, 12, 16], "texture": "#0"}, + "south": {"uv": [12, 14, 13, 16], "texture": "#0"}, + "west": {"uv": [11, 14, 10, 16], "texture": "#0"}, + "up": {"uv": [14, 16, 13, 15], "texture": "#0"}, + "down": {"uv": [14, 14, 13, 15], "texture": "#0"} + } + }, + { + "from": [10.5, 9, 12], + "to": [13.5, 14, 12], + "rotation": {"angle": 45, "axis": "y", "origin": [12, 11.5, 12]}, + "faces": { + "north": {"uv": [3, 0, 6, 5], "texture": "#1"}, + "east": {"uv": [3, 0, 3, 5], "texture": "#1"}, + "south": {"uv": [6, 0, 3, 5], "texture": "#1"}, + "west": {"uv": [3, 0, 3, 5], "texture": "#1"}, + "up": {"uv": [3, 0, 0, 0], "texture": "#1"}, + "down": {"uv": [3, 0, 0, 0], "texture": "#1"} + } + }, + { + "from": [2.8, 4.8, 10.8], + "to": [5.2, 9.2, 13.2], + "rotation": {"angle": 0, "axis": "y", "origin": [4, 7, 12]}, + "faces": { + "north": {"uv": [11, 14, 10, 16], "texture": "#0"}, + "east": {"uv": [10, 14, 11, 16], "texture": "#0"}, + "south": {"uv": [13, 14, 12, 16], "texture": "#0"}, + "west": {"uv": [12, 14, 13, 16], "texture": "#0"}, + "up": {"uv": [13, 16, 14, 15], "texture": "#0"}, + "down": {"uv": [13, 14, 14, 15], "texture": "#0"} + } + }, + { + "from": [3, 5, 11], + "to": [5, 9, 13], + "rotation": {"angle": 0, "axis": "y", "origin": [4, 7, 12]}, + "faces": { + "north": {"uv": [12, 14, 11, 16], "texture": "#0"}, + "east": {"uv": [11, 14, 12, 16], "texture": "#0"}, + "south": {"uv": [12, 14, 11, 16], "texture": "#0"}, + "west": {"uv": [11, 14, 12, 16], "texture": "#0"}, + "up": {"uv": [16, 11, 15, 12], "rotation": 90, "texture": "#0"}, + "down": {"uv": [15, 12, 16, 13], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [2.5, 9, 12], + "to": [5.5, 14, 12], + "rotation": {"angle": -45, "axis": "y", "origin": [4, 11.5, 12]}, + "faces": { + "north": {"uv": [6, 0, 3, 5], "texture": "#1"}, + "east": {"uv": [3, 0, 3, 5], "texture": "#1"}, + "south": {"uv": [3, 0, 6, 5], "texture": "#1"}, + "west": {"uv": [3, 0, 3, 5], "texture": "#1"}, + "up": {"uv": [0, 0, 3, 0], "texture": "#1"}, + "down": {"uv": [0, 0, 3, 0], "texture": "#1"} + } + }, + { + "from": [2.8, 4.8, 2.8], + "to": [5.2, 9.2, 5.2], + "rotation": {"angle": 0, "axis": "y", "origin": [4, 7, 4]}, + "faces": { + "north": {"uv": [12, 14, 13, 16], "texture": "#0"}, + "east": {"uv": [11, 14, 10, 16], "texture": "#0"}, + "south": {"uv": [10, 14, 11, 16], "texture": "#0"}, + "west": {"uv": [13, 14, 12, 16], "texture": "#0"}, + "up": {"uv": [13, 15, 14, 16], "texture": "#0"}, + "down": {"uv": [13, 15, 14, 14], "texture": "#0"} + } + }, + { + "from": [3, 5, 3], + "to": [5, 9, 5], + "rotation": {"angle": 0, "axis": "y", "origin": [4, 7, 4]}, + "faces": { + "north": {"uv": [11, 14, 12, 16], "texture": "#0"}, + "east": {"uv": [12, 14, 11, 16], "texture": "#0"}, + "south": {"uv": [11, 14, 12, 16], "texture": "#0"}, + "west": {"uv": [12, 14, 11, 16], "texture": "#0"}, + "up": {"uv": [15, 11, 16, 12], "rotation": 90, "texture": "#0"}, + "down": {"uv": [16, 12, 15, 13], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [2.5, 9, 4], + "to": [5.5, 14, 4], + "rotation": {"angle": 45, "axis": "y", "origin": [4, 11.5, 4]}, + "faces": { + "north": {"uv": [6, 0, 3, 5], "texture": "#1"}, + "east": {"uv": [3, 0, 3, 5], "texture": "#1"}, + "south": {"uv": [3, 0, 6, 5], "texture": "#1"}, + "west": {"uv": [3, 0, 3, 5], "texture": "#1"}, + "up": {"uv": [0, 0, 3, 0], "texture": "#1"}, + "down": {"uv": [0, 0, 3, 0], "texture": "#1"} + } + }, + { + "from": [11, 5, 3], + "to": [13, 9, 5], + "rotation": {"angle": 0, "axis": "y", "origin": [12, 7, 4]}, + "faces": { + "north": {"uv": [12, 14, 11, 16], "texture": "#0"}, + "east": {"uv": [11, 14, 12, 16], "texture": "#0"}, + "south": {"uv": [12, 14, 11, 16], "texture": "#0"}, + "west": {"uv": [11, 14, 12, 16], "texture": "#0"}, + "up": {"uv": [15, 12, 16, 11], "rotation": 90, "texture": "#0"}, + "down": {"uv": [16, 13, 15, 12], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [10.8, 4.8, 2.8], + "to": [13.2, 9.2, 5.2], + "rotation": {"angle": 0, "axis": "y", "origin": [12, 7, 4]}, + "faces": { + "north": {"uv": [13, 14, 12, 16], "texture": "#0"}, + "east": {"uv": [12, 14, 13, 16], "texture": "#0"}, + "south": {"uv": [11, 14, 10, 16], "texture": "#0"}, + "west": {"uv": [10, 14, 11, 16], "texture": "#0"}, + "up": {"uv": [14, 15, 13, 16], "texture": "#0"}, + "down": {"uv": [14, 15, 13, 14], "texture": "#0"} + } + }, + { + "from": [10.5, 9, 4], + "to": [13.5, 14, 4], + "rotation": {"angle": -45, "axis": "y", "origin": [12, 11.5, 4]}, + "faces": { + "north": {"uv": [3, 0, 6, 5], "texture": "#1"}, + "east": {"uv": [3, 0, 3, 5], "texture": "#1"}, + "south": {"uv": [6, 0, 3, 5], "texture": "#1"}, + "west": {"uv": [3, 0, 3, 5], "texture": "#1"}, + "up": {"uv": [3, 0, 0, 0], "texture": "#1"}, + "down": {"uv": [3, 0, 0, 0], "texture": "#1"} + } + } + ], + "display": { + "thirdperson_righthand": { + "rotation": [60, -34, 0], + "translation": [-0.5, 0.5, -1], + "scale": [0.5, 0.5, 0.5] + }, + "thirdperson_lefthand": { + "rotation": [60, -34, 0], + "translation": [-0.5, 0.5, -1], + "scale": [0.5, 0.5, 0.5] + }, + "ground": { + "translation": [0, 2.75, 0], + "scale": [0.5, 0.5, 0.5] + }, + "gui": { + "rotation": [25, 135, 0], + "translation": [0, -1, 0], + "scale": [0.9, 0.9, 0.9] + }, + "fixed": { + "rotation": [90, 0, 0], + "translation": [0, 0, -16], + "scale": [2, 2, 2] + } + } +} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/candelabrum_ground.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/candelabrum_ground.json new file mode 100644 index 00000000..afb99f7b --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/candelabrum_ground.json @@ -0,0 +1,191 @@ +{ + "textures": { + "0": "item/custom/candelabrum", + "1": "item/custom/candelabrum_flame", + "particle": "item/custom/candelabrum" + }, + "elements": [ + { + "from": [7, 6, 7], + "to": [9, 12, 9], + "rotation": {"angle": 0, "axis": "y", "origin": [7, 6, 7]}, + "faces": { + "north": {"uv": [15, 13, 16, 16], "texture": "#0"}, + "east": {"uv": [16, 13, 15, 16], "texture": "#0"}, + "south": {"uv": [15, 13, 16, 16], "texture": "#0"}, + "west": {"uv": [16, 13, 15, 16], "texture": "#0"}, + "up": {"uv": [16, 12, 15, 11], "rotation": 90, "texture": "#0"}, + "down": {"uv": [15, 13, 16, 12], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [6.8, 5.8, 6.8], + "to": [9.2, 12.2, 9.2], + "rotation": {"angle": 0, "axis": "y", "origin": [7, 6, 7]}, + "faces": { + "north": {"uv": [13, 11, 14, 14], "texture": "#0"}, + "east": {"uv": [14, 11, 13, 14], "texture": "#0"}, + "south": {"uv": [13, 11, 14, 14], "texture": "#0"}, + "west": {"uv": [14, 11, 13, 14], "texture": "#0"}, + "up": {"uv": [14, 16, 13, 15], "texture": "#0"}, + "down": {"uv": [14, 14, 13, 15], "texture": "#0"} + } + }, + { + "from": [12, 5, 7], + "to": [14, 9, 9], + "rotation": {"angle": 45, "axis": "y", "origin": [13, 7, 8]}, + "faces": { + "north": {"uv": [11, 14, 12, 16], "texture": "#0"}, + "east": {"uv": [12, 14, 11, 16], "texture": "#0"}, + "south": {"uv": [11, 14, 12, 16], "texture": "#0"}, + "west": {"uv": [12, 14, 11, 16], "texture": "#0"}, + "up": {"uv": [16, 12, 15, 11], "rotation": 90, "texture": "#0"}, + "down": {"uv": [15, 13, 16, 12], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [1.8, 4.8, 6.8], + "to": [4.2, 9.2, 9.2], + "rotation": {"angle": -45, "axis": "y", "origin": [3, 7, 8]}, + "faces": { + "north": {"uv": [11, 14, 10, 16], "texture": "#0"}, + "east": {"uv": [10, 14, 11, 16], "texture": "#0"}, + "south": {"uv": [13, 14, 12, 16], "texture": "#0"}, + "west": {"uv": [12, 14, 13, 16], "texture": "#0"}, + "up": {"uv": [13, 16, 14, 15], "texture": "#0"}, + "down": {"uv": [13, 14, 14, 15], "texture": "#0"} + } + }, + { + "from": [11.8, 4.8, 6.8], + "to": [14.2, 9.2, 9.2], + "rotation": {"angle": 45, "axis": "y", "origin": [13, 7, 8]}, + "faces": { + "north": {"uv": [10, 14, 11, 16], "texture": "#0"}, + "east": {"uv": [13, 14, 12, 16], "texture": "#0"}, + "south": {"uv": [12, 14, 13, 16], "texture": "#0"}, + "west": {"uv": [11, 14, 10, 16], "texture": "#0"}, + "up": {"uv": [14, 16, 13, 15], "texture": "#0"}, + "down": {"uv": [14, 14, 13, 15], "texture": "#0"} + } + }, + { + "from": [2, 5, 7], + "to": [4, 9, 9], + "rotation": {"angle": -45, "axis": "y", "origin": [3, 7, 8]}, + "faces": { + "north": {"uv": [12, 14, 11, 16], "texture": "#0"}, + "east": {"uv": [11, 14, 12, 16], "texture": "#0"}, + "south": {"uv": [12, 14, 11, 16], "texture": "#0"}, + "west": {"uv": [11, 14, 12, 16], "texture": "#0"}, + "up": {"uv": [16, 11, 15, 12], "rotation": 90, "texture": "#0"}, + "down": {"uv": [15, 12, 16, 13], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [7, 1, 7], + "to": [9, 6, 9], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 3.5, 8]}, + "faces": { + "north": {"uv": [15, 13.5, 14, 16], "texture": "#0"}, + "east": {"uv": [14, 13.5, 15, 16], "texture": "#0"}, + "south": {"uv": [15, 13.5, 14, 16], "texture": "#0"}, + "west": {"uv": [14, 13.5, 15, 16], "texture": "#0"}, + "up": {"uv": [15, 12.5, 14, 11.5], "rotation": 270, "texture": "#0"}, + "down": {"uv": [15, 12.5, 14, 13.5], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [3, 1, 8], + "to": [13, 6, 8], + "rotation": {"angle": 0, "axis": "y", "origin": [3, 1, 7]}, + "faces": { + "north": {"uv": [13.5, 5, 16, 10], "rotation": 90, "texture": "#0"}, + "east": {"uv": [0, 0, 0, 2], "texture": "#0"}, + "south": {"uv": [13.5, 10, 16, 5], "rotation": 90, "texture": "#0"}, + "west": {"uv": [0, 0, 0, 2], "texture": "#0"}, + "up": {"uv": [5, 0, 0, 0], "texture": "#0"}, + "down": {"uv": [5, 0, 0, 0], "texture": "#0"} + } + }, + { + "from": [3, 0, 3], + "to": [13, 1, 13], + "rotation": {"angle": 0, "axis": "y", "origin": [3, 0, 3]}, + "faces": { + "north": {"uv": [8.5, 5.5, 13.5, 6], "texture": "#0"}, + "east": {"uv": [8.5, 5.5, 13.5, 6], "texture": "#0"}, + "south": {"uv": [8.5, 5.5, 13.5, 6], "texture": "#0"}, + "west": {"uv": [8.5, 5.5, 13.5, 6], "texture": "#0"}, + "up": {"uv": [5, 5, 0, 0], "texture": "#0"}, + "down": {"uv": [5, 5, 0, 10], "texture": "#0"} + } + }, + { + "from": [6.5, 12, 8], + "to": [9.5, 17, 8], + "rotation": {"angle": 0, "axis": "y", "origin": [7, 12, 8]}, + "faces": { + "north": {"uv": [3, 0, 6, 5], "texture": "#1"}, + "east": {"uv": [3, 0, 3, 5], "texture": "#1"}, + "south": {"uv": [6, 0, 3, 5], "texture": "#1"}, + "west": {"uv": [3, 0, 3, 5], "texture": "#1"}, + "up": {"uv": [3, 0, 0, 0], "texture": "#1"}, + "down": {"uv": [3, 0, 0, 0], "texture": "#1"} + } + }, + { + "from": [1.5, 9, 8], + "to": [4.5, 14, 8], + "rotation": {"angle": 45, "axis": "y", "origin": [3, 11.5, 8]}, + "faces": { + "north": {"uv": [3, 0, 6, 5], "texture": "#1"}, + "east": {"uv": [3, 0, 3, 5], "texture": "#1"}, + "south": {"uv": [6, 0, 3, 5], "texture": "#1"}, + "west": {"uv": [3, 0, 3, 5], "texture": "#1"}, + "up": {"uv": [3, 0, 0, 0], "texture": "#1"}, + "down": {"uv": [3, 0, 0, 0], "texture": "#1"} + } + }, + { + "from": [11.5, 9, 8], + "to": [14.5, 14, 8], + "rotation": {"angle": -45, "axis": "y", "origin": [13, 11.5, 8]}, + "faces": { + "north": {"uv": [6, 0, 3, 5], "texture": "#1"}, + "east": {"uv": [3, 0, 3, 5], "texture": "#1"}, + "south": {"uv": [3, 0, 6, 5], "texture": "#1"}, + "west": {"uv": [3, 0, 3, 5], "texture": "#1"}, + "up": {"uv": [0, 0, 3, 0], "texture": "#1"}, + "down": {"uv": [0, 0, 3, 0], "texture": "#1"} + } + } + ], + "display": { + "thirdperson_righthand": { + "rotation": [60, -34, 0], + "translation": [-0.5, 3, 1.75], + "scale": [0.5, 0.5, 0.5] + }, + "thirdperson_lefthand": { + "rotation": [60, -34, 0], + "translation": [-0.5, 3, 1.75], + "scale": [0.5, 0.5, 0.5] + }, + "ground": { + "translation": [0, 2.75, 0], + "scale": [0.5, 0.5, 0.5] + }, + "gui": { + "rotation": [25, -35, 0], + "translation": [0.25, 2, 0], + "scale": [0.9, 0.9, 0.9] + }, + "fixed": { + "rotation": [-90, 0, 0], + "translation": [0, 0, -16], + "scale": [2, 2, 2] + } + } +} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/candelabrum_lit_ceiling.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/candelabrum_lit_ceiling.json new file mode 100644 index 00000000..19a7e90c --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/candelabrum_lit_ceiling.json @@ -0,0 +1,230 @@ +{ + "textures": { + "0": "item/custom/candelabrum", + "1": "item/custom/candelabrum_flame", + "particle": "item/custom/candelabrum" + }, + "elements": [ + { + "from": [4, 14, 4], + "to": [12, 16, 12], + "rotation": {"angle": 0, "axis": "y", "origin": [4, 14, 4]}, + "faces": { + "north": {"uv": [8.5, 4.5, 12.5, 5.5], "texture": "#0"}, + "east": {"uv": [8.5, 4.5, 12.5, 5.5], "texture": "#0"}, + "south": {"uv": [8.5, 4.5, 12.5, 5.5], "texture": "#0"}, + "west": {"uv": [8.5, 4.5, 12.5, 5.5], "texture": "#0"}, + "up": {"uv": [9, 6, 13, 10], "texture": "#0"}, + "down": {"uv": [5, 6, 9, 10], "texture": "#0"} + } + }, + { + "from": [8, 2, 0], + "to": [8, 14, 16], + "rotation": {"angle": -45, "axis": "y", "origin": [8, 8, 8]}, + "faces": { + "north": {"uv": [0, 0, 0, 12], "texture": "#0"}, + "east": {"uv": [0, 10, 8, 16], "texture": "#0"}, + "south": {"uv": [0, 0, 0, 12], "texture": "#0"}, + "west": {"uv": [0, 10, 8, 16], "texture": "#0"}, + "up": {"uv": [0, 0, 0, 16], "texture": "#0"}, + "down": {"uv": [0, 0, 0, 16], "texture": "#0"} + } + }, + { + "from": [8, 2, 0], + "to": [8, 14, 16], + "rotation": {"angle": 45, "axis": "y", "origin": [8, 8, 8]}, + "faces": { + "north": {"uv": [0, 0, 0, 12], "texture": "#0"}, + "east": {"uv": [0, 10, 8, 16], "texture": "#0"}, + "south": {"uv": [0, 0, 0, 12], "texture": "#0"}, + "west": {"uv": [0, 10, 8, 16], "texture": "#0"}, + "up": {"uv": [0, 0, 0, 16], "texture": "#0"}, + "down": {"uv": [0, 0, 0, 16], "texture": "#0"} + } + }, + { + "from": [11, 5, 11], + "to": [13, 9, 13], + "rotation": {"angle": 0, "axis": "y", "origin": [12, 7, 12]}, + "faces": { + "north": {"uv": [11, 14, 12, 16], "texture": "#0"}, + "east": {"uv": [12, 14, 11, 16], "texture": "#0"}, + "south": {"uv": [11, 14, 12, 16], "texture": "#0"}, + "west": {"uv": [12, 14, 11, 16], "texture": "#0"}, + "up": {"uv": [16, 12, 15, 11], "rotation": 90, "texture": "#0"}, + "down": {"uv": [15, 13, 16, 12], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [10.8, 4.8, 10.8], + "to": [13.2, 9.2, 13.2], + "rotation": {"angle": 0, "axis": "y", "origin": [12, 7, 12]}, + "faces": { + "north": {"uv": [10, 14, 11, 16], "texture": "#0"}, + "east": {"uv": [13, 14, 12, 16], "texture": "#0"}, + "south": {"uv": [12, 14, 13, 16], "texture": "#0"}, + "west": {"uv": [11, 14, 10, 16], "texture": "#0"}, + "up": {"uv": [14, 16, 13, 15], "texture": "#0"}, + "down": {"uv": [14, 14, 13, 15], "texture": "#0"} + } + }, + { + "from": [10.5, 9, 12], + "to": [13.5, 14, 12], + "rotation": {"angle": 45, "axis": "y", "origin": [12, 11.5, 12]}, + "faces": { + "north": {"uv": [0, 0, 3, 5], "texture": "#1"}, + "east": {"uv": [0, 0, 0, 5], "texture": "#1"}, + "south": {"uv": [3, 0, 0, 5], "texture": "#1"}, + "west": {"uv": [0, 0, 0, 5], "texture": "#1"}, + "up": {"uv": [3, 0, 0, 0], "texture": "#1"}, + "down": {"uv": [3, 0, 0, 0], "texture": "#1"} + } + }, + { + "from": [2.8, 4.8, 10.8], + "to": [5.2, 9.2, 13.2], + "rotation": {"angle": 0, "axis": "y", "origin": [4, 7, 12]}, + "faces": { + "north": {"uv": [11, 14, 10, 16], "texture": "#0"}, + "east": {"uv": [10, 14, 11, 16], "texture": "#0"}, + "south": {"uv": [13, 14, 12, 16], "texture": "#0"}, + "west": {"uv": [12, 14, 13, 16], "texture": "#0"}, + "up": {"uv": [13, 16, 14, 15], "texture": "#0"}, + "down": {"uv": [13, 14, 14, 15], "texture": "#0"} + } + }, + { + "from": [3, 5, 11], + "to": [5, 9, 13], + "rotation": {"angle": 0, "axis": "y", "origin": [4, 7, 12]}, + "faces": { + "north": {"uv": [12, 14, 11, 16], "texture": "#0"}, + "east": {"uv": [11, 14, 12, 16], "texture": "#0"}, + "south": {"uv": [12, 14, 11, 16], "texture": "#0"}, + "west": {"uv": [11, 14, 12, 16], "texture": "#0"}, + "up": {"uv": [16, 11, 15, 12], "rotation": 90, "texture": "#0"}, + "down": {"uv": [15, 12, 16, 13], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [2.5, 9, 12], + "to": [5.5, 14, 12], + "rotation": {"angle": -45, "axis": "y", "origin": [4, 11.5, 12]}, + "faces": { + "north": {"uv": [3, 0, 0, 5], "texture": "#1"}, + "east": {"uv": [0, 0, 0, 5], "texture": "#1"}, + "south": {"uv": [0, 0, 3, 5], "texture": "#1"}, + "west": {"uv": [0, 0, 0, 5], "texture": "#1"}, + "up": {"uv": [0, 0, 3, 0], "texture": "#1"}, + "down": {"uv": [0, 0, 3, 0], "texture": "#1"} + } + }, + { + "from": [2.8, 4.8, 2.8], + "to": [5.2, 9.2, 5.2], + "rotation": {"angle": 0, "axis": "y", "origin": [4, 7, 4]}, + "faces": { + "north": {"uv": [12, 14, 13, 16], "texture": "#0"}, + "east": {"uv": [11, 14, 10, 16], "texture": "#0"}, + "south": {"uv": [10, 14, 11, 16], "texture": "#0"}, + "west": {"uv": [13, 14, 12, 16], "texture": "#0"}, + "up": {"uv": [13, 15, 14, 16], "texture": "#0"}, + "down": {"uv": [13, 15, 14, 14], "texture": "#0"} + } + }, + { + "from": [3, 5, 3], + "to": [5, 9, 5], + "rotation": {"angle": 0, "axis": "y", "origin": [4, 7, 4]}, + "faces": { + "north": {"uv": [11, 14, 12, 16], "texture": "#0"}, + "east": {"uv": [12, 14, 11, 16], "texture": "#0"}, + "south": {"uv": [11, 14, 12, 16], "texture": "#0"}, + "west": {"uv": [12, 14, 11, 16], "texture": "#0"}, + "up": {"uv": [15, 11, 16, 12], "rotation": 90, "texture": "#0"}, + "down": {"uv": [16, 12, 15, 13], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [2.5, 9, 4], + "to": [5.5, 14, 4], + "rotation": {"angle": 45, "axis": "y", "origin": [4, 11.5, 4]}, + "faces": { + "north": {"uv": [3, 0, 0, 5], "texture": "#1"}, + "east": {"uv": [0, 0, 0, 5], "texture": "#1"}, + "south": {"uv": [0, 0, 3, 5], "texture": "#1"}, + "west": {"uv": [0, 0, 0, 5], "texture": "#1"}, + "up": {"uv": [0, 0, 3, 0], "texture": "#1"}, + "down": {"uv": [0, 0, 3, 0], "texture": "#1"} + } + }, + { + "from": [11, 5, 3], + "to": [13, 9, 5], + "rotation": {"angle": 0, "axis": "y", "origin": [12, 7, 4]}, + "faces": { + "north": {"uv": [12, 14, 11, 16], "texture": "#0"}, + "east": {"uv": [11, 14, 12, 16], "texture": "#0"}, + "south": {"uv": [12, 14, 11, 16], "texture": "#0"}, + "west": {"uv": [11, 14, 12, 16], "texture": "#0"}, + "up": {"uv": [15, 12, 16, 11], "rotation": 90, "texture": "#0"}, + "down": {"uv": [16, 13, 15, 12], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [10.8, 4.8, 2.8], + "to": [13.2, 9.2, 5.2], + "rotation": {"angle": 0, "axis": "y", "origin": [12, 7, 4]}, + "faces": { + "north": {"uv": [13, 14, 12, 16], "texture": "#0"}, + "east": {"uv": [12, 14, 13, 16], "texture": "#0"}, + "south": {"uv": [11, 14, 10, 16], "texture": "#0"}, + "west": {"uv": [10, 14, 11, 16], "texture": "#0"}, + "up": {"uv": [14, 15, 13, 16], "texture": "#0"}, + "down": {"uv": [14, 15, 13, 14], "texture": "#0"} + } + }, + { + "from": [10.5, 9, 4], + "to": [13.5, 14, 4], + "rotation": {"angle": -45, "axis": "y", "origin": [12, 11.5, 4]}, + "faces": { + "north": {"uv": [0, 0, 3, 5], "texture": "#1"}, + "east": {"uv": [0, 0, 0, 5], "texture": "#1"}, + "south": {"uv": [3, 0, 0, 5], "texture": "#1"}, + "west": {"uv": [0, 0, 0, 5], "texture": "#1"}, + "up": {"uv": [3, 0, 0, 0], "texture": "#1"}, + "down": {"uv": [3, 0, 0, 0], "texture": "#1"} + } + } + ], + "display": { + "thirdperson_righthand": { + "rotation": [60, -34, 0], + "translation": [-0.5, 0.5, -1], + "scale": [0.5, 0.5, 0.5] + }, + "thirdperson_lefthand": { + "rotation": [60, -34, 0], + "translation": [-0.5, 0.5, -1], + "scale": [0.5, 0.5, 0.5] + }, + "ground": { + "translation": [0, 2.75, 0], + "scale": [0.5, 0.5, 0.5] + }, + "gui": { + "rotation": [25, 135, 0], + "translation": [0, -1, 0], + "scale": [0.9, 0.9, 0.9] + }, + "fixed": { + "rotation": [90, 0, 0], + "translation": [0, 0, -16], + "scale": [2, 2, 2] + } + } +} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/candelabrum_lit_ground.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/candelabrum_lit_ground.json new file mode 100644 index 00000000..677b4fdc --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/candelabrum_lit_ground.json @@ -0,0 +1,191 @@ +{ + "textures": { + "0": "item/custom/candelabrum", + "1": "item/custom/candelabrum_flame", + "particle": "item/custom/candelabrum" + }, + "elements": [ + { + "from": [7, 6, 7], + "to": [9, 12, 9], + "rotation": {"angle": 0, "axis": "y", "origin": [7, 6, 7]}, + "faces": { + "north": {"uv": [15, 13, 16, 16], "texture": "#0"}, + "east": {"uv": [16, 13, 15, 16], "texture": "#0"}, + "south": {"uv": [15, 13, 16, 16], "texture": "#0"}, + "west": {"uv": [16, 13, 15, 16], "texture": "#0"}, + "up": {"uv": [16, 12, 15, 11], "rotation": 90, "texture": "#0"}, + "down": {"uv": [15, 13, 16, 12], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [6.8, 5.8, 6.8], + "to": [9.2, 12.2, 9.2], + "rotation": {"angle": 0, "axis": "y", "origin": [7, 6, 7]}, + "faces": { + "north": {"uv": [13, 11, 14, 14], "texture": "#0"}, + "east": {"uv": [14, 11, 13, 14], "texture": "#0"}, + "south": {"uv": [13, 11, 14, 14], "texture": "#0"}, + "west": {"uv": [14, 11, 13, 14], "texture": "#0"}, + "up": {"uv": [14, 16, 13, 15], "texture": "#0"}, + "down": {"uv": [14, 14, 13, 15], "texture": "#0"} + } + }, + { + "from": [12, 5, 7], + "to": [14, 9, 9], + "rotation": {"angle": 45, "axis": "y", "origin": [13, 7, 8]}, + "faces": { + "north": {"uv": [11, 14, 12, 16], "texture": "#0"}, + "east": {"uv": [12, 14, 11, 16], "texture": "#0"}, + "south": {"uv": [11, 14, 12, 16], "texture": "#0"}, + "west": {"uv": [12, 14, 11, 16], "texture": "#0"}, + "up": {"uv": [16, 12, 15, 11], "rotation": 90, "texture": "#0"}, + "down": {"uv": [15, 13, 16, 12], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [1.8, 4.8, 6.8], + "to": [4.2, 9.2, 9.2], + "rotation": {"angle": -45, "axis": "y", "origin": [3, 7, 8]}, + "faces": { + "north": {"uv": [11, 14, 10, 16], "texture": "#0"}, + "east": {"uv": [10, 14, 11, 16], "texture": "#0"}, + "south": {"uv": [13, 14, 12, 16], "texture": "#0"}, + "west": {"uv": [12, 14, 13, 16], "texture": "#0"}, + "up": {"uv": [13, 16, 14, 15], "texture": "#0"}, + "down": {"uv": [13, 14, 14, 15], "texture": "#0"} + } + }, + { + "from": [11.8, 4.8, 6.8], + "to": [14.2, 9.2, 9.2], + "rotation": {"angle": 45, "axis": "y", "origin": [13, 7, 8]}, + "faces": { + "north": {"uv": [10, 14, 11, 16], "texture": "#0"}, + "east": {"uv": [13, 14, 12, 16], "texture": "#0"}, + "south": {"uv": [12, 14, 13, 16], "texture": "#0"}, + "west": {"uv": [11, 14, 10, 16], "texture": "#0"}, + "up": {"uv": [14, 16, 13, 15], "texture": "#0"}, + "down": {"uv": [14, 14, 13, 15], "texture": "#0"} + } + }, + { + "from": [2, 5, 7], + "to": [4, 9, 9], + "rotation": {"angle": -45, "axis": "y", "origin": [3, 7, 8]}, + "faces": { + "north": {"uv": [12, 14, 11, 16], "texture": "#0"}, + "east": {"uv": [11, 14, 12, 16], "texture": "#0"}, + "south": {"uv": [12, 14, 11, 16], "texture": "#0"}, + "west": {"uv": [11, 14, 12, 16], "texture": "#0"}, + "up": {"uv": [16, 11, 15, 12], "rotation": 90, "texture": "#0"}, + "down": {"uv": [15, 12, 16, 13], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [7, 1, 7], + "to": [9, 6, 9], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 3.5, 8]}, + "faces": { + "north": {"uv": [15, 13.5, 14, 16], "texture": "#0"}, + "east": {"uv": [14, 13.5, 15, 16], "texture": "#0"}, + "south": {"uv": [15, 13.5, 14, 16], "texture": "#0"}, + "west": {"uv": [14, 13.5, 15, 16], "texture": "#0"}, + "up": {"uv": [15, 12.5, 14, 11.5], "rotation": 270, "texture": "#0"}, + "down": {"uv": [15, 12.5, 14, 13.5], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [3, 1, 8], + "to": [13, 6, 8], + "rotation": {"angle": 0, "axis": "y", "origin": [3, 1, 7]}, + "faces": { + "north": {"uv": [13.5, 5, 16, 10], "rotation": 90, "texture": "#0"}, + "east": {"uv": [0, 0, 0, 2], "texture": "#0"}, + "south": {"uv": [13.5, 10, 16, 5], "rotation": 90, "texture": "#0"}, + "west": {"uv": [0, 0, 0, 2], "texture": "#0"}, + "up": {"uv": [5, 0, 0, 0], "texture": "#0"}, + "down": {"uv": [5, 0, 0, 0], "texture": "#0"} + } + }, + { + "from": [3, 0, 3], + "to": [13, 1, 13], + "rotation": {"angle": 0, "axis": "y", "origin": [3, 0, 3]}, + "faces": { + "north": {"uv": [8.5, 5.5, 13.5, 6], "texture": "#0"}, + "east": {"uv": [8.5, 5.5, 13.5, 6], "texture": "#0"}, + "south": {"uv": [8.5, 5.5, 13.5, 6], "texture": "#0"}, + "west": {"uv": [8.5, 5.5, 13.5, 6], "texture": "#0"}, + "up": {"uv": [5, 5, 0, 0], "texture": "#0"}, + "down": {"uv": [5, 5, 0, 10], "texture": "#0"} + } + }, + { + "from": [6.5, 12, 8], + "to": [9.5, 17, 8], + "rotation": {"angle": 0, "axis": "y", "origin": [7, 12, 8]}, + "faces": { + "north": {"uv": [0, 0, 3, 5], "texture": "#1"}, + "east": {"uv": [0, 0, 0, 5], "texture": "#1"}, + "south": {"uv": [3, 0, 0, 5], "texture": "#1"}, + "west": {"uv": [0, 0, 0, 5], "texture": "#1"}, + "up": {"uv": [3, 0, 0, 0], "texture": "#1"}, + "down": {"uv": [3, 0, 0, 0], "texture": "#1"} + } + }, + { + "from": [1.5, 9, 8], + "to": [4.5, 14, 8], + "rotation": {"angle": 45, "axis": "y", "origin": [3, 11.5, 8]}, + "faces": { + "north": {"uv": [0, 0, 3, 5], "texture": "#1"}, + "east": {"uv": [0, 0, 0, 5], "texture": "#1"}, + "south": {"uv": [3, 0, 0, 5], "texture": "#1"}, + "west": {"uv": [0, 0, 0, 5], "texture": "#1"}, + "up": {"uv": [3, 0, 0, 0], "texture": "#1"}, + "down": {"uv": [3, 0, 0, 0], "texture": "#1"} + } + }, + { + "from": [11.5, 9, 8], + "to": [14.5, 14, 8], + "rotation": {"angle": -45, "axis": "y", "origin": [13, 11.5, 8]}, + "faces": { + "north": {"uv": [3, 0, 0, 5], "texture": "#1"}, + "east": {"uv": [0, 0, 0, 5], "texture": "#1"}, + "south": {"uv": [0, 0, 3, 5], "texture": "#1"}, + "west": {"uv": [0, 0, 0, 5], "texture": "#1"}, + "up": {"uv": [0, 0, 3, 0], "texture": "#1"}, + "down": {"uv": [0, 0, 3, 0], "texture": "#1"} + } + } + ], + "display": { + "thirdperson_righthand": { + "rotation": [60, -34, 0], + "translation": [-0.5, 3, 1.75], + "scale": [0.5, 0.5, 0.5] + }, + "thirdperson_lefthand": { + "rotation": [60, -34, 0], + "translation": [-0.5, 3, 1.75], + "scale": [0.5, 0.5, 0.5] + }, + "ground": { + "translation": [0, 2.75, 0], + "scale": [0.5, 0.5, 0.5] + }, + "gui": { + "rotation": [25, -35, 0], + "translation": [0.25, 2, 0], + "scale": [0.9, 0.9, 0.9] + }, + "fixed": { + "rotation": [-90, 0, 0], + "translation": [0, 0, -16], + "scale": [2, 2, 2] + } + } +} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/candelabrum_lit_wall.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/candelabrum_lit_wall.json new file mode 100644 index 00000000..ac824017 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/candelabrum_lit_wall.json @@ -0,0 +1,138 @@ +{ + "textures": { + "0": "item/custom/candelabrum", + "1": "item/custom/candelabrum_flame", + "particle": "item/custom/candelabrum" + }, + "elements": [ + { + "from": [5, 5, 15], + "to": [11, 11, 16], + "rotation": {"angle": 0, "axis": "y", "origin": [5, 5, 15]}, + "faces": { + "north": {"uv": [5, 3, 8, 6], "texture": "#0"}, + "east": {"uv": [8, 0, 8.5, 3], "texture": "#0"}, + "south": {"uv": [5, 0, 8, 3], "texture": "#0"}, + "west": {"uv": [8, 0, 8.5, 3], "texture": "#0"}, + "up": {"uv": [8.5, 0, 9, 3], "rotation": 90, "texture": "#0"}, + "down": {"uv": [8, 3, 8.5, 6], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [8, 3, 8], + "to": [8, 11, 16], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 3, 8]}, + "faces": { + "north": {"uv": [0, 0, 0, 8], "texture": "#0"}, + "east": {"uv": [12, 0, 16, 4], "texture": "#0"}, + "south": {"uv": [0, 0, 0, 8], "texture": "#0"}, + "west": {"uv": [16, 0, 12, 4], "texture": "#0"}, + "up": {"uv": [0, 0, 0, 8], "texture": "#0"}, + "down": {"uv": [0, 0, 0, 8], "texture": "#0"} + } + }, + { + "from": [6.8, 6.8, 6.8], + "to": [9.2, 13.2, 9.2], + "rotation": {"angle": 45, "axis": "y", "origin": [8, 10, 8]}, + "faces": { + "north": {"uv": [13, 11, 14, 14], "texture": "#0"}, + "east": {"uv": [14, 11, 13, 14], "texture": "#0"}, + "south": {"uv": [12, 11, 13, 14], "texture": "#0"}, + "west": {"uv": [13, 11, 12, 14], "texture": "#0"}, + "up": {"uv": [14, 16, 13, 15], "texture": "#0"}, + "down": {"uv": [13, 15, 14, 14], "rotation": 270, "texture": "#0"} + } + }, + { + "from": [6.7, 3.7, 6.7], + "to": [9.3, 10.3, 9.3], + "rotation": {"angle": 45, "axis": "y", "origin": [8, 7, 8]}, + "faces": { + "north": {"uv": [11, 11, 12, 14], "texture": "#0"}, + "east": {"uv": [12, 11, 11, 14], "texture": "#0"}, + "south": {"uv": [10, 11, 11, 14], "texture": "#0"}, + "west": {"uv": [11, 11, 10, 14], "texture": "#0"}, + "up": {"uv": [10, 16, 9, 15], "texture": "#0"}, + "down": {"uv": [9, 15, 10, 14], "rotation": 270, "texture": "#0"} + } + }, + { + "from": [10.12843, 10.3, 11.3], + "to": [7.52843, 3.7, 8.7], + "rotation": {"angle": -45, "axis": "y", "origin": [10.82843, 1, 8]}, + "faces": { + "north": {"uv": [9, 14, 8, 11], "texture": "#0"}, + "east": {"uv": [9, 14, 10, 11], "texture": "#0"}, + "south": {"uv": [10, 14, 9, 11], "texture": "#0"}, + "west": {"uv": [8, 14, 9, 11], "texture": "#0"}, + "up": {"uv": [9, 15, 10, 14], "rotation": 270, "texture": "#0"}, + "down": {"uv": [10, 16, 9, 15], "texture": "#0"} + } + }, + { + "from": [7, 7, 7], + "to": [9, 13, 9], + "rotation": {"angle": 45, "axis": "y", "origin": [8, 10, 8]}, + "faces": { + "north": {"uv": [15, 13, 16, 16], "texture": "#0"}, + "east": {"uv": [16, 13, 15, 16], "texture": "#0"}, + "south": {"uv": [15, 13, 16, 16], "texture": "#0"}, + "west": {"uv": [16, 13, 15, 16], "texture": "#0"}, + "up": {"uv": [16, 12, 15, 11], "rotation": 90, "texture": "#0"}, + "down": {"uv": [15, 13, 16, 12], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [6.5, 13, 8], + "to": [9.5, 18, 8], + "rotation": {"angle": -45, "axis": "y", "origin": [8, 15.5, 8]}, + "faces": { + "north": {"uv": [0, 0, 3, 5], "texture": "#1"}, + "east": {"uv": [0, 0, 0, 5], "texture": "#1"}, + "south": {"uv": [3, 0, 0, 5], "texture": "#1"}, + "west": {"uv": [0, 0, 0, 5], "texture": "#1"}, + "up": {"uv": [3, 0, 0, 0], "texture": "#1"}, + "down": {"uv": [3, 0, 0, 0], "texture": "#1"} + } + }, + { + "from": [6.5, 13, 8], + "to": [9.5, 18, 8], + "rotation": {"angle": 45, "axis": "y", "origin": [8, 15.5, 8]}, + "faces": { + "north": {"uv": [0, 0, 3, 5], "texture": "#1"}, + "east": {"uv": [0, 0, 0, 5], "texture": "#1"}, + "south": {"uv": [3, 0, 0, 5], "texture": "#1"}, + "west": {"uv": [0, 0, 0, 5], "texture": "#1"}, + "up": {"uv": [3, 0, 0, 0], "texture": "#1"}, + "down": {"uv": [3, 0, 0, 0], "texture": "#1"} + } + } + ], + "display": { + "thirdperson_righthand": { + "rotation": [60, -34, 0], + "translation": [1.75, 3, -1.25], + "scale": [0.5, 0.5, 0.5] + }, + "thirdperson_lefthand": { + "rotation": [60, -34, 0], + "translation": [1.75, 3, -1.25], + "scale": [0.5, 0.5, 0.5] + }, + "ground": { + "translation": [0, 2.75, 0], + "scale": [0.5, 0.5, 0.5] + }, + "gui": { + "rotation": [25, 135, 0], + "translation": [-2, -1, 0], + "scale": [0.9, 0.9, 0.9] + }, + "fixed": { + "translation": [0, 0, -16], + "scale": [2, 2, 2] + } + } +} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/candelabrum_wall.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/candelabrum_wall.json new file mode 100644 index 00000000..53b845f0 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/candelabrum_wall.json @@ -0,0 +1,138 @@ +{ + "textures": { + "0": "item/custom/candelabrum", + "1": "item/custom/candelabrum_flame", + "particle": "item/custom/candelabrum" + }, + "elements": [ + { + "from": [5, 5, 15], + "to": [11, 11, 16], + "rotation": {"angle": 0, "axis": "y", "origin": [5, 5, 15]}, + "faces": { + "north": {"uv": [5, 3, 8, 6], "texture": "#0"}, + "east": {"uv": [8, 0, 8.5, 3], "texture": "#0"}, + "south": {"uv": [5, 0, 8, 3], "texture": "#0"}, + "west": {"uv": [8, 0, 8.5, 3], "texture": "#0"}, + "up": {"uv": [8.5, 0, 9, 3], "rotation": 90, "texture": "#0"}, + "down": {"uv": [8, 3, 8.5, 6], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [8, 3, 8], + "to": [8, 11, 16], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 3, 8]}, + "faces": { + "north": {"uv": [0, 0, 0, 8], "texture": "#0"}, + "east": {"uv": [12, 0, 16, 4], "texture": "#0"}, + "south": {"uv": [0, 0, 0, 8], "texture": "#0"}, + "west": {"uv": [16, 0, 12, 4], "texture": "#0"}, + "up": {"uv": [0, 0, 0, 8], "texture": "#0"}, + "down": {"uv": [0, 0, 0, 8], "texture": "#0"} + } + }, + { + "from": [6.8, 6.8, 6.8], + "to": [9.2, 13.2, 9.2], + "rotation": {"angle": 45, "axis": "y", "origin": [8, 10, 8]}, + "faces": { + "north": {"uv": [13, 11, 14, 14], "texture": "#0"}, + "east": {"uv": [14, 11, 13, 14], "texture": "#0"}, + "south": {"uv": [12, 11, 13, 14], "texture": "#0"}, + "west": {"uv": [13, 11, 12, 14], "texture": "#0"}, + "up": {"uv": [14, 16, 13, 15], "texture": "#0"}, + "down": {"uv": [13, 15, 14, 14], "rotation": 270, "texture": "#0"} + } + }, + { + "from": [6.7, 3.7, 6.7], + "to": [9.3, 10.3, 9.3], + "rotation": {"angle": 45, "axis": "y", "origin": [8, 7, 8]}, + "faces": { + "north": {"uv": [11, 11, 12, 14], "texture": "#0"}, + "east": {"uv": [12, 11, 11, 14], "texture": "#0"}, + "south": {"uv": [10, 11, 11, 14], "texture": "#0"}, + "west": {"uv": [11, 11, 10, 14], "texture": "#0"}, + "up": {"uv": [10, 16, 9, 15], "texture": "#0"}, + "down": {"uv": [9, 15, 10, 14], "rotation": 270, "texture": "#0"} + } + }, + { + "from": [10.12843, 10.3, 11.3], + "to": [7.52843, 3.7, 8.7], + "rotation": {"angle": -45, "axis": "y", "origin": [10.82843, 1, 8]}, + "faces": { + "north": {"uv": [9, 14, 8, 11], "texture": "#0"}, + "east": {"uv": [9, 14, 10, 11], "texture": "#0"}, + "south": {"uv": [10, 14, 9, 11], "texture": "#0"}, + "west": {"uv": [8, 14, 9, 11], "texture": "#0"}, + "up": {"uv": [9, 15, 10, 14], "rotation": 270, "texture": "#0"}, + "down": {"uv": [10, 16, 9, 15], "texture": "#0"} + } + }, + { + "from": [7, 7, 7], + "to": [9, 13, 9], + "rotation": {"angle": 45, "axis": "y", "origin": [8, 10, 8]}, + "faces": { + "north": {"uv": [15, 13, 16, 16], "texture": "#0"}, + "east": {"uv": [16, 13, 15, 16], "texture": "#0"}, + "south": {"uv": [15, 13, 16, 16], "texture": "#0"}, + "west": {"uv": [16, 13, 15, 16], "texture": "#0"}, + "up": {"uv": [16, 12, 15, 11], "rotation": 90, "texture": "#0"}, + "down": {"uv": [15, 13, 16, 12], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [6.5, 13, 8], + "to": [9.5, 18, 8], + "rotation": {"angle": -45, "axis": "y", "origin": [8, 15.5, 8]}, + "faces": { + "north": {"uv": [3, 0, 6, 5], "texture": "#1"}, + "east": {"uv": [0, 0, 0, 5], "texture": "#1"}, + "south": {"uv": [6, 0, 3, 5], "texture": "#1"}, + "west": {"uv": [0, 0, 0, 5], "texture": "#1"}, + "up": {"uv": [3, 0, 0, 0], "texture": "#1"}, + "down": {"uv": [3, 0, 0, 0], "texture": "#1"} + } + }, + { + "from": [6.5, 13, 8], + "to": [9.5, 18, 8], + "rotation": {"angle": 45, "axis": "y", "origin": [8, 15.5, 8]}, + "faces": { + "north": {"uv": [3, 0, 6, 5], "texture": "#1"}, + "east": {"uv": [0, 0, 0, 5], "texture": "#1"}, + "south": {"uv": [6, 0, 3, 5], "texture": "#1"}, + "west": {"uv": [0, 0, 0, 5], "texture": "#1"}, + "up": {"uv": [3, 0, 0, 0], "texture": "#1"}, + "down": {"uv": [3, 0, 0, 0], "texture": "#1"} + } + } + ], + "display": { + "thirdperson_righthand": { + "rotation": [60, -34, 0], + "translation": [1.75, 3, -1.25], + "scale": [0.5, 0.5, 0.5] + }, + "thirdperson_lefthand": { + "rotation": [60, -34, 0], + "translation": [1.75, 3, -1.25], + "scale": [0.5, 0.5, 0.5] + }, + "ground": { + "translation": [0, 2.75, 0], + "scale": [0.5, 0.5, 0.5] + }, + "gui": { + "rotation": [25, 135, 0], + "translation": [-2, -1, 0], + "scale": [0.9, 0.9, 0.9] + }, + "fixed": { + "translation": [0, 0, -16], + "scale": [2, 2, 2] + } + } +} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/cap.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/cap.json new file mode 100644 index 00000000..2ab8bff7 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/cap.json @@ -0,0 +1,84 @@ +{ + "texture_size": [32, 32], + "textures": { + "0": "item/custom/cap", + "particle": "item/custom/cap" + }, + "elements": [ + { + "from": [3.5, 0, -5], + "to": [12.5, 0, 4], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 0, 8]}, + "faces": { + "north": {"uv": [0, 0, 4.5, 0], "texture": "#0"}, + "east": {"uv": [0, 0, 4.5, 0], "texture": "#0"}, + "south": {"uv": [0, 0, 4.5, 0], "texture": "#0"}, + "west": {"uv": [0, 0, 4.5, 0], "texture": "#0"}, + "up": {"uv": [4.5, 4.5, 0, 0], "texture": "#0", "tintindex": 0}, + "down": {"uv": [4.5, 0, 0, 4.5], "texture": "#0", "tintindex": 0} + } + }, + { + "from": [3.3, -0.2, 3.8], + "to": [12.7, 4.2, 13.2], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 0, 8]}, + "faces": { + "north": {"uv": [2.5, 14, 7, 16], "texture": "#0", "tintindex": 0}, + "east": {"uv": [16, 14, 11.5, 16], "texture": "#0", "tintindex": 0}, + "south": {"uv": [11.5, 12, 16, 14], "texture": "#0", "tintindex": 0}, + "west": {"uv": [11.5, 14, 16, 16], "texture": "#0", "tintindex": 0}, + "up": {"uv": [11.5, 16, 7, 11.5], "texture": "#0", "tintindex": 0}, + "down": {"uv": [11.5, 11.5, 7, 16], "texture": "#0", "tintindex": 0} + } + }, + { + "from": [3.5, 0, 4], + "to": [12.5, 4, 13], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 0, 8]}, + "faces": { + "north": {"uv": [0, 9, 4.5, 11], "texture": "#0", "tintindex": 0}, + "east": {"uv": [13.5, 4, 9, 6], "texture": "#0", "tintindex": 0}, + "south": {"uv": [9, 2, 13.5, 4], "texture": "#0", "tintindex": 0}, + "west": {"uv": [9, 4, 13.5, 6], "texture": "#0", "tintindex": 0}, + "up": {"uv": [9, 4.5, 4.5, 0], "texture": "#0", "tintindex": 0}, + "down": {"uv": [9, 4.5, 4.5, 9], "texture": "#0", "tintindex": 0} + } + } + ], + "gui_light": "front", + "display": { + "thirdperson_righthand": { + "rotation": [45, 49, 0], + "translation": [0, 4.5, 2.25], + "scale": [0.5, 0.5, 0.5] + }, + "thirdperson_lefthand": { + "rotation": [45, 49, 0], + "translation": [0, 4.5, 2.25], + "scale": [0.5, 0.5, 0.5] + }, + "firstperson_righthand": { + "rotation": [0, 34, 0], + "translation": [5.25, 4.75, 0], + "scale": [0.75, 0.75, 0.75] + }, + "firstperson_lefthand": { + "rotation": [0, 34, 0], + "translation": [5.25, 4.75, 0], + "scale": [0.75, 0.75, 0.75] + }, + "ground": { + "translation": [0, 4.5, 0], + "scale": [0.75, 0.75, 0.75] + }, + "gui": { + "rotation": [35, 135, 0], + "translation": [0.5, 4.5, 0], + "scale": [0.9, 0.9, 0.9] + }, + "head": { + "translation": [0, 15, -1], + "scale": [1.75, 1.75, 1.75] + } + } +} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/drill.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/drill.json new file mode 100644 index 00000000..b59f4b98 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/drill.json @@ -0,0 +1 @@ +{"parent":"item/handheld","textures":{"layer0":"item/custom/drill"},"display":{"thirdperson_righthand":{"rotation":[0.0,-90.0,25.0],"translation":[0.0,0.5,-2.0],"scale":[0.85,0.85,0.85]},"thirdperson_lefthand":{"rotation":[0.0,90.0,-25.0],"translation":[0.0,0.5,-2.0],"scale":[0.85,0.85,0.85]}}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/drill_selected.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/drill_selected.json new file mode 100644 index 00000000..db126ee3 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/drill_selected.json @@ -0,0 +1 @@ +{"parent":"item/handheld","textures":{"layer0":"item/custom/drill_selected"},"display":{"thirdperson_righthand":{"rotation":[0.0,-90.0,25.0],"translation":[0.0,0.5,-2.0],"scale":[0.85,0.85,0.85]},"thirdperson_lefthand":{"rotation":[0.0,90.0,-25.0],"translation":[0.0,0.5,-2.0],"scale":[0.85,0.85,0.85]}}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/flower_basket_ceiling.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/flower_basket_ceiling.json new file mode 100644 index 00000000..0066e341 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/flower_basket_ceiling.json @@ -0,0 +1,284 @@ +{ + "textures": { + "1": "item/custom/flower_basket", + "particle": "item/custom/flower_basket" + }, + "elements": [ + { + "from": [2, 7, -1], + "to": [14, 7, 11], + "rotation": {"angle": 45, "axis": "x", "origin": [8, 7, 5]}, + "faces": { + "north": {"uv": [0, 0, 4, 0], "texture": "#1"}, + "east": {"uv": [0, 0, 4, 0], "texture": "#1"}, + "south": {"uv": [0, 0, 4, 0], "texture": "#1"}, + "west": {"uv": [0, 0, 4, 0], "texture": "#1"}, + "up": {"uv": [0, 16, 4, 12], "texture": "#1"}, + "down": {"uv": [0, 12, 4, 16], "texture": "#1"} + } + }, + { + "from": [2, 4, 12.5], + "to": [14, 16, 12.5], + "rotation": {"angle": -22.5, "axis": "x", "origin": [8, 10, 12.5]}, + "faces": { + "north": {"uv": [8, 8, 4, 12], "texture": "#1"}, + "east": {"uv": [8, 8, 4, 12], "texture": "#1"}, + "south": {"uv": [4, 8, 8, 12], "texture": "#1"}, + "west": {"uv": [8, 8, 4, 12], "texture": "#1"}, + "up": {"uv": [4, 8, 8, 12], "texture": "#1"}, + "down": {"uv": [4, 12, 8, 8], "texture": "#1"} + } + }, + { + "from": [2, 7, 5], + "to": [14, 7, 17], + "rotation": {"angle": -45, "axis": "x", "origin": [8, 7, 11]}, + "faces": { + "north": {"uv": [4, 0, 0, 0], "texture": "#1"}, + "east": {"uv": [4, 0, 0, 0], "texture": "#1"}, + "south": {"uv": [4, 0, 0, 0], "texture": "#1"}, + "west": {"uv": [4, 0, 0, 0], "texture": "#1"}, + "up": {"uv": [0, 12, 4, 16], "texture": "#1"}, + "down": {"uv": [0, 16, 4, 12], "texture": "#1"} + } + }, + { + "from": [-1, 7, 2], + "to": [11, 7, 14], + "rotation": {"angle": -45, "axis": "z", "origin": [5, 7, 8]}, + "faces": { + "north": {"uv": [0, 0, 4, 0], "texture": "#1"}, + "east": {"uv": [0, 0, 4, 0], "texture": "#1"}, + "south": {"uv": [0, 0, 4, 0], "texture": "#1"}, + "west": {"uv": [0, 0, 4, 0], "texture": "#1"}, + "up": {"uv": [4, 16, 0, 12], "rotation": 270, "texture": "#1"}, + "down": {"uv": [0, 16, 4, 12], "rotation": 270, "texture": "#1"} + } + }, + { + "from": [5, 7, 2], + "to": [17, 7, 14], + "rotation": {"angle": 45, "axis": "z", "origin": [11, 7, 8]}, + "faces": { + "north": {"uv": [4, 0, 0, 0], "texture": "#1"}, + "east": {"uv": [4, 0, 0, 0], "texture": "#1"}, + "south": {"uv": [4, 0, 0, 0], "texture": "#1"}, + "west": {"uv": [4, 0, 0, 0], "texture": "#1"}, + "up": {"uv": [4, 12, 0, 16], "rotation": 270, "texture": "#1"}, + "down": {"uv": [0, 12, 4, 16], "rotation": 270, "texture": "#1"} + } + }, + { + "from": [12.5, 4, 2], + "to": [12.5, 16, 14], + "rotation": {"angle": 22.5, "axis": "z", "origin": [12.5, 10, 8]}, + "faces": { + "north": {"uv": [8, 8, 4, 12], "texture": "#1"}, + "east": {"uv": [4, 8, 8, 12], "texture": "#1"}, + "south": {"uv": [8, 8, 4, 12], "texture": "#1"}, + "west": {"uv": [8, 8, 4, 12], "texture": "#1"}, + "up": {"uv": [4, 8, 0, 12], "rotation": 270, "texture": "#1"}, + "down": {"uv": [0, 8, 4, 12], "rotation": 270, "texture": "#1"} + } + }, + { + "from": [3.5, 7.75, 3.5], + "to": [12.5, 9.25, 12.5], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 7.1875, 8]}, + "faces": { + "north": {"uv": [10.5, 15.5, 13.5, 16], "texture": "#1"}, + "east": {"uv": [10.5, 15.5, 13.5, 16], "texture": "#1"}, + "south": {"uv": [10.5, 15.5, 13.5, 16], "texture": "#1"}, + "west": {"uv": [10.5, 15.5, 13.5, 16], "texture": "#1"}, + "up": {"uv": [13.5, 12.5, 10.5, 9.5], "texture": "#1"}, + "down": {"uv": [13.5, 12.5, 10.5, 15.5], "texture": "#1"} + } + }, + { + "from": [4.1, 5.35, 4.1], + "to": [11.9, 9.4, 11.9], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 8.6875, 8]}, + "faces": { + "north": {"uv": [13.5, 8.5, 16, 9.75], "texture": "#1"}, + "east": {"uv": [13.5, 8.5, 16, 9.75], "texture": "#1"}, + "south": {"uv": [13.5, 8.5, 16, 9.75], "texture": "#1"}, + "west": {"uv": [13.5, 8.5, 16, 9.75], "texture": "#1"}, + "up": {"uv": [16, 8.5, 13.5, 6], "texture": "#1"}, + "down": {"uv": [16, 3.5, 13.5, 6], "texture": "#1"} + } + }, + { + "from": [8, 1, 0.5], + "to": [8, 13, 15.5], + "rotation": {"angle": 45, "axis": "y", "origin": [8, 7, 8]}, + "faces": { + "north": {"uv": [0, 4, 0, 0], "texture": "#1"}, + "east": {"uv": [0, 4, 4, 0], "texture": "#1"}, + "south": {"uv": [0, 4, 0, 0], "texture": "#1"}, + "west": {"uv": [4, 4, 0, 0], "texture": "#1"}, + "up": {"uv": [0, 4, 0, 0], "texture": "#1"}, + "down": {"uv": [0, 4, 0, 0], "texture": "#1"} + } + }, + { + "from": [8, 1, 0.5], + "to": [8, 13, 15.5], + "rotation": {"angle": -45, "axis": "y", "origin": [8, 7, 8]}, + "faces": { + "north": {"uv": [0, 4, 0, 0], "texture": "#1"}, + "east": {"uv": [0, 4, 4, 0], "texture": "#1"}, + "south": {"uv": [0, 4, 0, 0], "texture": "#1"}, + "west": {"uv": [4, 4, 0, 0], "texture": "#1"}, + "up": {"uv": [0, 4, 0, 0], "texture": "#1"}, + "down": {"uv": [0, 4, 0, 0], "texture": "#1"} + } + }, + { + "from": [8, 1, 0.5], + "to": [8, 13, 15.5], + "rotation": {"angle": -45, "axis": "y", "origin": [8, 7, 8]}, + "faces": { + "north": {"uv": [0, 4, 0, 0], "texture": "#1"}, + "east": {"uv": [4, 4, 8, 0], "texture": "#1"}, + "south": {"uv": [0, 4, 0, 0], "texture": "#1"}, + "west": {"uv": [8, 4, 4, 0], "texture": "#1"}, + "up": {"uv": [0, 4, 0, 0], "texture": "#1"}, + "down": {"uv": [0, 4, 0, 0], "texture": "#1"} + } + }, + { + "from": [8, 1, 0.5], + "to": [8, 13, 15.5], + "rotation": {"angle": 45, "axis": "y", "origin": [8, 7, 8]}, + "faces": { + "north": {"uv": [0, 4, 0, 0], "texture": "#1"}, + "east": {"uv": [4, 4, 8, 0], "texture": "#1"}, + "south": {"uv": [0, 4, 0, 0], "texture": "#1"}, + "west": {"uv": [8, 4, 4, 0], "texture": "#1"}, + "up": {"uv": [0, 4, 0, 0], "texture": "#1"}, + "down": {"uv": [0, 4, 0, 0], "texture": "#1"} + } + }, + { + "from": [3.5, 4, 2], + "to": [3.5, 16, 14], + "rotation": {"angle": -22.5, "axis": "z", "origin": [3.5, 10, 8]}, + "faces": { + "north": {"uv": [4, 8, 8, 12], "texture": "#1"}, + "east": {"uv": [4, 8, 8, 12], "texture": "#1"}, + "south": {"uv": [4, 8, 8, 12], "texture": "#1"}, + "west": {"uv": [8, 8, 4, 12], "texture": "#1"}, + "up": {"uv": [4, 12, 0, 8], "rotation": 270, "texture": "#1"}, + "down": {"uv": [0, 12, 4, 8], "rotation": 270, "texture": "#1"} + } + }, + { + "from": [-1, 6.25, 2], + "to": [11, 6.25, 14], + "rotation": {"angle": -45, "axis": "z", "origin": [5, 6.25, 8]}, + "faces": { + "north": {"uv": [0, 0, 4, 0], "texture": "#1"}, + "east": {"uv": [0, 0, 4, 0], "texture": "#1"}, + "south": {"uv": [0, 0, 4, 0], "texture": "#1"}, + "west": {"uv": [0, 0, 4, 0], "texture": "#1"}, + "up": {"uv": [10, 8, 6, 4], "rotation": 270, "texture": "#1"}, + "down": {"uv": [6, 8, 10, 4], "rotation": 270, "texture": "#1"} + } + }, + { + "from": [5, 6.25, 2], + "to": [17, 6.25, 14], + "rotation": {"angle": 45, "axis": "z", "origin": [11, 6.25, 8]}, + "faces": { + "north": {"uv": [4, 0, 0, 0], "texture": "#1"}, + "east": {"uv": [4, 0, 0, 0], "texture": "#1"}, + "south": {"uv": [4, 0, 0, 0], "texture": "#1"}, + "west": {"uv": [4, 0, 0, 0], "texture": "#1"}, + "up": {"uv": [10, 4, 6, 8], "rotation": 270, "texture": "#1"}, + "down": {"uv": [6, 4, 10, 8], "rotation": 270, "texture": "#1"} + } + }, + { + "from": [2, 6.25, -1], + "to": [14, 6.25, 11], + "rotation": {"angle": 45, "axis": "x", "origin": [8, 6.25, 5]}, + "faces": { + "north": {"uv": [0, 0, 4, 0], "texture": "#1"}, + "east": {"uv": [0, 0, 4, 0], "texture": "#1"}, + "south": {"uv": [0, 0, 4, 0], "texture": "#1"}, + "west": {"uv": [0, 0, 4, 0], "texture": "#1"}, + "up": {"uv": [6, 8, 10, 4], "texture": "#1"}, + "down": {"uv": [6, 4, 10, 8], "texture": "#1"} + } + }, + { + "from": [2, 6.25, 5], + "to": [14, 6.25, 17], + "rotation": {"angle": -45, "axis": "x", "origin": [8, 6.25, 11]}, + "faces": { + "north": {"uv": [4, 0, 0, 0], "texture": "#1"}, + "east": {"uv": [4, 0, 0, 0], "texture": "#1"}, + "south": {"uv": [4, 0, 0, 0], "texture": "#1"}, + "west": {"uv": [4, 0, 0, 0], "texture": "#1"}, + "up": {"uv": [6, 4, 10, 8], "texture": "#1"}, + "down": {"uv": [6, 8, 10, 4], "texture": "#1"} + } + }, + { + "from": [2, 4, 3.5], + "to": [14, 16, 3.5], + "rotation": {"angle": 22.5, "axis": "x", "origin": [8, 10, 3.5]}, + "faces": { + "north": {"uv": [8, 8, 4, 12], "texture": "#1"}, + "east": {"uv": [4, 8, 8, 12], "texture": "#1"}, + "south": {"uv": [4, 8, 8, 12], "texture": "#1"}, + "west": {"uv": [4, 8, 8, 12], "texture": "#1"}, + "up": {"uv": [4, 12, 8, 8], "texture": "#1"}, + "down": {"uv": [4, 8, 8, 12], "texture": "#1"} + } + } + ], + "display": { + "thirdperson_righthand": { + "rotation": [60, -34, 0], + "translation": [-0.5, 3, 1], + "scale": [0.5, 0.5, 0.5] + }, + "thirdperson_lefthand": { + "rotation": [60, -34, 0], + "translation": [-0.5, 3, 1], + "scale": [0.5, 0.5, 0.5] + }, + "firstperson_righthand": { + "rotation": [0, 45, 0], + "translation": [3.5, 0, 0] + }, + "firstperson_lefthand": { + "rotation": [0, 45, 0], + "translation": [3.5, 0, 0] + }, + "ground": { + "translation": [0, 3.25, 0], + "scale": [0.5, 0.5, 0.5] + }, + "gui": { + "rotation": [25, 135, 0], + "translation": [0, -0.25, 0], + "scale": [0.9, 0.9, 0.9] + }, + "fixed": { + "rotation": [90, 0, 0], + "translation": [0, 0, -15], + "scale": [2, 2, 2] + } + }, + "groups": [ + { + "name": "bone3", + "origin": [-3, 4, -3], + "color": 0, + "children": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17] + } + ] +} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/flower_basket_ground.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/flower_basket_ground.json new file mode 100644 index 00000000..60c60096 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/flower_basket_ground.json @@ -0,0 +1,206 @@ +{ + "textures": { + "0": "item/custom/flower_basket", + "particle": "item/custom/flower_basket" + }, + "elements": [ + { + "from": [2, 6.75, -1], + "to": [14, 6.75, 11], + "rotation": {"angle": -45, "axis": "x", "origin": [8, 6.75, 5]}, + "faces": { + "north": {"uv": [0, 0, 4, 0], "texture": "#0"}, + "east": {"uv": [0, 0, 4, 0], "texture": "#0"}, + "south": {"uv": [0, 0, 4, 0], "texture": "#0"}, + "west": {"uv": [0, 0, 4, 0], "texture": "#0"}, + "up": {"uv": [0, 16, 4, 12], "texture": "#0"}, + "down": {"uv": [0, 12, 4, 16], "texture": "#0"} + } + }, + { + "from": [2, 8.25, -1], + "to": [14, 8.25, 11], + "rotation": {"angle": -45, "axis": "x", "origin": [8, 8.25, 5]}, + "faces": { + "north": {"uv": [0, 0, 4, 0], "texture": "#0"}, + "east": {"uv": [0, 0, 4, 0], "texture": "#0"}, + "south": {"uv": [0, 0, 4, 0], "texture": "#0"}, + "west": {"uv": [0, 0, 4, 0], "texture": "#0"}, + "up": {"uv": [0, 12, 4, 8], "texture": "#0"}, + "down": {"uv": [0, 8, 4, 12], "texture": "#0"} + } + }, + { + "from": [2, 8.25, 5], + "to": [14, 8.25, 17], + "rotation": {"angle": 45, "axis": "x", "origin": [8, 8.25, 11]}, + "faces": { + "north": {"uv": [4, 0, 0, 0], "texture": "#0"}, + "east": {"uv": [4, 0, 0, 0], "texture": "#0"}, + "south": {"uv": [4, 0, 0, 0], "texture": "#0"}, + "west": {"uv": [4, 0, 0, 0], "texture": "#0"}, + "up": {"uv": [0, 8, 4, 12], "texture": "#0"}, + "down": {"uv": [0, 12, 4, 8], "texture": "#0"} + } + }, + { + "from": [2, 6.75, 5], + "to": [14, 6.75, 17], + "rotation": {"angle": 45, "axis": "x", "origin": [8, 6.75, 11]}, + "faces": { + "north": {"uv": [4, 0, 0, 0], "texture": "#0"}, + "east": {"uv": [4, 0, 0, 0], "texture": "#0"}, + "south": {"uv": [4, 0, 0, 0], "texture": "#0"}, + "west": {"uv": [4, 0, 0, 0], "texture": "#0"}, + "up": {"uv": [0, 12, 4, 16], "texture": "#0"}, + "down": {"uv": [0, 16, 4, 12], "texture": "#0"} + } + }, + { + "from": [-1, 6.75, 2], + "to": [11, 6.75, 14], + "rotation": {"angle": 45, "axis": "z", "origin": [5, 6.75, 8]}, + "faces": { + "north": {"uv": [0, 0, 4, 0], "texture": "#0"}, + "east": {"uv": [0, 0, 4, 0], "texture": "#0"}, + "south": {"uv": [0, 0, 4, 0], "texture": "#0"}, + "west": {"uv": [0, 0, 4, 0], "texture": "#0"}, + "up": {"uv": [4, 16, 0, 12], "rotation": 270, "texture": "#0"}, + "down": {"uv": [0, 16, 4, 12], "rotation": 270, "texture": "#0"} + } + }, + { + "from": [5, 6.75, 2], + "to": [17, 6.75, 14], + "rotation": {"angle": -45, "axis": "z", "origin": [11, 6.75, 8]}, + "faces": { + "north": {"uv": [4, 0, 0, 0], "texture": "#0"}, + "east": {"uv": [4, 0, 0, 0], "texture": "#0"}, + "south": {"uv": [4, 0, 0, 0], "texture": "#0"}, + "west": {"uv": [4, 0, 0, 0], "texture": "#0"}, + "up": {"uv": [4, 12, 0, 16], "rotation": 270, "texture": "#0"}, + "down": {"uv": [0, 12, 4, 16], "rotation": 270, "texture": "#0"} + } + }, + { + "from": [5, 8.25, 2], + "to": [17, 8.25, 14], + "rotation": {"angle": -45, "axis": "z", "origin": [11, 8.25, 8]}, + "faces": { + "north": {"uv": [4, 0, 0, 0], "texture": "#0"}, + "east": {"uv": [4, 0, 0, 0], "texture": "#0"}, + "south": {"uv": [4, 0, 0, 0], "texture": "#0"}, + "west": {"uv": [4, 0, 0, 0], "texture": "#0"}, + "up": {"uv": [4, 8, 0, 12], "rotation": 270, "texture": "#0"}, + "down": {"uv": [0, 8, 4, 12], "rotation": 270, "texture": "#0"} + } + }, + { + "from": [-1, 8.25, 2], + "to": [11, 8.25, 14], + "rotation": {"angle": 45, "axis": "z", "origin": [5, 8.25, 8]}, + "faces": { + "north": {"uv": [0, 0, 4, 0], "texture": "#0"}, + "east": {"uv": [0, 0, 4, 0], "texture": "#0"}, + "south": {"uv": [0, 0, 4, 0], "texture": "#0"}, + "west": {"uv": [0, 0, 4, 0], "texture": "#0"}, + "up": {"uv": [4, 12, 0, 8], "rotation": 270, "texture": "#0"}, + "down": {"uv": [0, 12, 4, 8], "rotation": 270, "texture": "#0"} + } + }, + { + "from": [3.5, 3.75, 3.5], + "to": [12.5, 5.25, 12.5], + "rotation": {"angle": 0, "axis": "y", "origin": [4.25, 3.75, 4.25]}, + "faces": { + "north": {"uv": [10.5, 15.5, 13.5, 16], "texture": "#0"}, + "east": {"uv": [10.5, 15.5, 13.5, 16], "texture": "#0"}, + "south": {"uv": [10.5, 15.5, 13.5, 16], "texture": "#0"}, + "west": {"uv": [10.5, 15.5, 13.5, 16], "texture": "#0"}, + "up": {"uv": [13.5, 12.5, 10.5, 9.5], "texture": "#0"}, + "down": {"uv": [13.5, 12.5, 10.5, 15.5], "texture": "#0"} + } + }, + { + "from": [4.25, 0, 4.25], + "to": [11.75, 3.75, 11.75], + "rotation": {"angle": 0, "axis": "y", "origin": [5, 0, 5]}, + "faces": { + "north": {"uv": [13.5, 14.75, 16, 16], "texture": "#0"}, + "east": {"uv": [13.5, 14.75, 16, 16], "texture": "#0"}, + "south": {"uv": [13.5, 14.75, 16, 16], "texture": "#0"}, + "west": {"uv": [13.5, 14.75, 16, 16], "texture": "#0"}, + "up": {"uv": [16, 14.75, 13.5, 12.25], "texture": "#0"}, + "down": {"uv": [16, 9.75, 13.5, 12.25], "texture": "#0"} + } + }, + { + "from": [8, 0, 0.5], + "to": [8, 12, 15.5], + "rotation": {"angle": 45, "axis": "y", "origin": [8, 6, 8]}, + "faces": { + "north": {"uv": [0, 0, 0, 4], "texture": "#0"}, + "east": {"uv": [0, 0, 4, 4], "texture": "#0"}, + "south": {"uv": [0, 0, 0, 4], "texture": "#0"}, + "west": {"uv": [4, 0, 0, 4], "texture": "#0"}, + "up": {"uv": [0, 0, 0, 4], "texture": "#0"}, + "down": {"uv": [0, 0, 0, 4], "texture": "#0"} + } + }, + { + "from": [8, 0, 0.5], + "to": [8, 12, 15.5], + "rotation": {"angle": -45, "axis": "y", "origin": [8, 6, 8]}, + "faces": { + "north": {"uv": [0, 0, 0, 4], "texture": "#0"}, + "east": {"uv": [0, 0, 4, 4], "texture": "#0"}, + "south": {"uv": [0, 0, 0, 4], "texture": "#0"}, + "west": {"uv": [4, 0, 0, 4], "texture": "#0"}, + "up": {"uv": [0, 0, 0, 4], "texture": "#0"}, + "down": {"uv": [0, 0, 0, 4], "texture": "#0"} + } + } + ], + "display": { + "thirdperson_righthand": { + "rotation": [60, -34, 0], + "translation": [-0.5, 3, 1], + "scale": [0.5, 0.5, 0.5] + }, + "thirdperson_lefthand": { + "rotation": [60, -34, 0], + "translation": [-0.5, 3, 1], + "scale": [0.5, 0.5, 0.5] + }, + "firstperson_righthand": { + "rotation": [0, 45, 0], + "translation": [3.5, 0, 0] + }, + "firstperson_lefthand": { + "rotation": [0, 45, 0], + "translation": [3.5, 0, 0] + }, + "ground": { + "translation": [0, 3.25, 0], + "scale": [0.5, 0.5, 0.5] + }, + "gui": { + "rotation": [25, -40, 0], + "translation": [-0.25, 2, 0], + "scale": [0.9, 0.9, 0.9] + }, + "fixed": { + "rotation": [-90, 0, 0], + "translation": [0, 0, -16], + "scale": [2, 2, 2] + } + }, + "groups": [ + { + "name": "bone", + "origin": [-3, 0, -3], + "color": 0, + "children": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11] + } + ] +} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/flower_basket_wall.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/flower_basket_wall.json new file mode 100644 index 00000000..d0329c16 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/flower_basket_wall.json @@ -0,0 +1,232 @@ +{ + "textures": { + "0": "item/custom/flower_basket", + "particle": "item/custom/flower_basket" + }, + "elements": [ + { + "from": [5, 11.5625, 2.56625], + "to": [17, 11.5625, 11.56625], + "rotation": {"angle": -45, "axis": "z", "origin": [11, 11.5625, 8.56625]}, + "faces": { + "north": {"uv": [0, 0, 4, 0], "texture": "#0"}, + "east": {"uv": [0, 0, 4, 0], "texture": "#0"}, + "south": {"uv": [0, 0, 4, 0], "texture": "#0"}, + "west": {"uv": [0, 0, 4, 0], "texture": "#0"}, + "up": {"uv": [3, 4, 0, 8], "rotation": 270, "texture": "#0"}, + "down": {"uv": [3, 8, 0, 4], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [5, 10.0625, 2.56625], + "to": [17, 10.0625, 11.56625], + "rotation": {"angle": -45, "axis": "z", "origin": [11, 10.0625, 8.56625]}, + "faces": { + "north": {"uv": [0, 0, 4, 0], "texture": "#0"}, + "east": {"uv": [0, 0, 4, 0], "texture": "#0"}, + "south": {"uv": [0, 0, 4, 0], "texture": "#0"}, + "west": {"uv": [0, 0, 4, 0], "texture": "#0"}, + "up": {"uv": [6, 4, 3, 8], "rotation": 270, "texture": "#0"}, + "down": {"uv": [6, 8, 3, 4], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [-1, 11.5625, 2.56625], + "to": [11, 11.5625, 11.56625], + "rotation": {"angle": 45, "axis": "z", "origin": [5, 11.5625, 8.56625]}, + "faces": { + "north": {"uv": [4, 0, 0, 0], "texture": "#0"}, + "east": {"uv": [4, 0, 0, 0], "texture": "#0"}, + "south": {"uv": [4, 0, 0, 0], "texture": "#0"}, + "west": {"uv": [4, 0, 0, 0], "texture": "#0"}, + "up": {"uv": [3, 8, 0, 4], "rotation": 270, "texture": "#0"}, + "down": {"uv": [3, 4, 0, 8], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [-1, 10.0625, 2.56625], + "to": [11, 10.0625, 11.56625], + "rotation": {"angle": 45, "axis": "z", "origin": [5, 10.0625, 8.56625]}, + "faces": { + "north": {"uv": [4, 0, 0, 0], "texture": "#0"}, + "east": {"uv": [4, 0, 0, 0], "texture": "#0"}, + "south": {"uv": [4, 0, 0, 0], "texture": "#0"}, + "west": {"uv": [4, 0, 0, 0], "texture": "#0"}, + "up": {"uv": [6, 8, 3, 4], "rotation": 270, "texture": "#0"}, + "down": {"uv": [6, 4, 3, 8], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [2, 10.0625, -0.43375], + "to": [14, 10.0625, 11.56625], + "rotation": {"angle": -45, "axis": "x", "origin": [8, 10.0625, 5.56625]}, + "faces": { + "north": {"uv": [4, 0, 0, 0], "texture": "#0"}, + "east": {"uv": [4, 0, 0, 0], "texture": "#0"}, + "south": {"uv": [4, 0, 0, 0], "texture": "#0"}, + "west": {"uv": [4, 0, 0, 0], "texture": "#0"}, + "up": {"uv": [4, 12, 0, 16], "rotation": 180, "texture": "#0"}, + "down": {"uv": [0, 12, 4, 16], "texture": "#0"} + } + }, + { + "from": [2, 10.0625, 2.56625], + "to": [14, 10.0625, 14.56625], + "rotation": {"angle": 45, "axis": "x", "origin": [8, 10.0625, 8.56625]}, + "faces": { + "north": {"uv": [0, 0, 4, 0], "texture": "#0"}, + "east": {"uv": [0, 0, 4, 0], "texture": "#0"}, + "south": {"uv": [0, 0, 4, 0], "texture": "#0"}, + "west": {"uv": [0, 0, 4, 0], "texture": "#0"}, + "up": {"uv": [4, 16, 0, 12], "rotation": 180, "texture": "#0"}, + "down": {"uv": [0, 16, 4, 12], "texture": "#0"} + } + }, + { + "from": [2, 11.5625, 1.81625], + "to": [14, 11.5625, 13.81625], + "rotation": {"angle": 45, "axis": "x", "origin": [8, 11.5625, 7.81625]}, + "faces": { + "north": {"uv": [0, 0, 4, 0], "texture": "#0"}, + "east": {"uv": [0, 0, 4, 0], "texture": "#0"}, + "south": {"uv": [0, 0, 4, 0], "texture": "#0"}, + "west": {"uv": [0, 0, 4, 0], "texture": "#0"}, + "up": {"uv": [4, 12, 0, 8], "rotation": 180, "texture": "#0"}, + "down": {"uv": [0, 12, 4, 8], "texture": "#0"} + } + }, + { + "from": [2, 11.5625, 0.31625], + "to": [14, 11.5625, 12.31625], + "rotation": {"angle": -45, "axis": "x", "origin": [8, 11.5625, 6.31625]}, + "faces": { + "north": {"uv": [4, 0, 0, 0], "texture": "#0"}, + "east": {"uv": [4, 0, 0, 0], "texture": "#0"}, + "south": {"uv": [4, 0, 0, 0], "texture": "#0"}, + "west": {"uv": [4, 0, 0, 0], "texture": "#0"}, + "up": {"uv": [4, 8, 0, 12], "rotation": 180, "texture": "#0"}, + "down": {"uv": [0, 8, 4, 12], "texture": "#0"} + } + }, + { + "from": [3.5, 7.0625, 4.06625], + "to": [12.5, 8.5625, 10.06625], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 6.5, 8.56625]}, + "faces": { + "north": {"uv": [13.5, 15.5, 10.5, 16], "texture": "#0"}, + "east": {"uv": [9, 15.5, 7, 16], "texture": "#0"}, + "south": {"uv": [13.5, 15.5, 10.5, 16], "texture": "#0"}, + "west": {"uv": [9, 15.5, 7, 16], "texture": "#0"}, + "up": {"uv": [11.5, 6.5, 13.5, 3.5], "rotation": 270, "texture": "#0"}, + "down": {"uv": [11.5, 6.5, 13.5, 9.5], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [4.25, 3.3125, 4.81625], + "to": [11.75, 7.0625, 9.31625], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 6.5, 8.56625]}, + "faces": { + "north": {"uv": [16, 14.75, 13.5, 16], "texture": "#0"}, + "east": {"uv": [10.5, 14.75, 9, 16], "texture": "#0"}, + "south": {"uv": [16, 14.75, 13.5, 16], "texture": "#0"}, + "west": {"uv": [10.5, 14.75, 9, 16], "texture": "#0"}, + "up": {"uv": [8, 14.75, 10.5, 12.25], "rotation": 270, "texture": "#0"}, + "down": {"uv": [9, 9.75, 10.5, 12.25], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [4.1, 3.1625, 4.66625], + "to": [11.9, 7.2125, 9.46625], + "rotation": {"angle": 0, "axis": "y", "origin": [8, 6.5, 8.56625]}, + "faces": { + "north": {"uv": [16, 8.5, 13.5, 9.75], "texture": "#0"}, + "east": {"uv": [14.5, 8.5, 16, 9.75], "texture": "#0"}, + "south": {"uv": [16, 8.5, 13.5, 9.75], "texture": "#0"}, + "west": {"uv": [16, 8.5, 14.5, 9.75], "texture": "#0"}, + "up": {"uv": [13.5, 8.5, 16, 6], "rotation": 270, "texture": "#0"}, + "down": {"uv": [15, 3.5, 13.5, 6], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [0.5, 3.3125, 7.06625], + "to": [15.5, 15.3125, 7.06625], + "rotation": {"angle": -22.5, "axis": "y", "origin": [8, 9.3125, 7.06625]}, + "faces": { + "north": {"uv": [0, 0, 4, 4], "texture": "#0"}, + "east": {"uv": [0, 0, 0, 4], "texture": "#0"}, + "south": {"uv": [4, 0, 0, 4], "texture": "#0"}, + "west": {"uv": [0, 0, 0, 4], "texture": "#0"}, + "up": {"uv": [0, 0, 0, 4], "rotation": 270, "texture": "#0"}, + "down": {"uv": [0, 0, 0, 4], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [0.5, 3.3125, 7.06625], + "to": [15.5, 15.3125, 7.06625], + "rotation": {"angle": 22.5, "axis": "y", "origin": [8, 9.3125, 7.06625]}, + "faces": { + "north": {"uv": [0, 0, 4, 4], "texture": "#0"}, + "east": {"uv": [0, 0, 0, 4], "texture": "#0"}, + "south": {"uv": [4, 0, 0, 4], "texture": "#0"}, + "west": {"uv": [0, 0, 0, 4], "texture": "#0"}, + "up": {"uv": [0, 0, 0, 4], "rotation": 270, "texture": "#0"}, + "down": {"uv": [0, 0, 0, 4], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [5, 3.3125, 9.30875], + "to": [11, 5.5625, 11.55875], + "rotation": {"angle": 0, "axis": "y", "origin": [5.75, 3.3125, 10.06625]}, + "faces": { + "north": {"uv": [16, 0.75, 14, 1.5], "texture": "#0"}, + "east": {"uv": [13.25, 2.75, 14, 3.5], "texture": "#0"}, + "south": {"uv": [16, 0, 14, 0.75], "texture": "#0"}, + "west": {"uv": [14, 2.75, 13.25, 3.5], "texture": "#0"}, + "up": {"uv": [13.25, 0, 12.5, 2], "rotation": 270, "texture": "#0"}, + "down": {"uv": [14, 0, 13.25, 2], "rotation": 90, "texture": "#0"} + } + } + ], + "display": { + "thirdperson_righthand": { + "rotation": [60, -34, 0], + "translation": [-0.5, 3, 1], + "scale": [0.5, 0.5, 0.5] + }, + "thirdperson_lefthand": { + "rotation": [60, -34, 0], + "translation": [-0.5, 3, 1], + "scale": [0.5, 0.5, 0.5] + }, + "firstperson_righthand": { + "rotation": [0, 45, 0], + "translation": [3.5, 0, 0] + }, + "firstperson_lefthand": { + "rotation": [0, 45, 0], + "translation": [3.5, 0, 0] + }, + "ground": { + "translation": [0, 3.25, 0], + "scale": [0.5, 0.5, 0.5] + }, + "gui": { + "rotation": [25, 135, 0], + "translation": [-0.25, 2, 0], + "scale": [0.9, 0.9, 0.9] + }, + "fixed": { + "rotation": [-90, 0, 0], + "translation": [0, 0, -16], + "scale": [2, 2, 2] + } + }, + "groups": [ + { + "name": "bone2", + "origin": [-5, 5.3125, -3.30125], + "color": 0, + "children": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13] + } + ] +} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/globe.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/globe.json new file mode 100644 index 00000000..5d1f2d78 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/globe.json @@ -0,0 +1,164 @@ +{ + "format_version": "1.21.11", + "credit": "Made with Blockbench", + "textures": { + "0": "item/custom/globe", + "particle": "item/custom/globe" + }, + "elements": [ + { + "from": [3, 18, 3], + "to": [13, 8, 13], + "rotation": {"angle": 0, "axis": "y", "origin": [3, 8, 3]}, + "faces": { + "north": {"uv": [6, 5, 11, 0], "texture": "#0"}, + "east": {"uv": [6, 10, 11, 5], "texture": "#0"}, + "south": {"uv": [6, 15, 11, 10], "texture": "#0"}, + "west": {"uv": [11, 5, 16, 0], "texture": "#0"}, + "up": {"uv": [16, 15, 11, 10], "texture": "#0"}, + "down": {"uv": [16, 5, 11, 10], "texture": "#0"} + } + }, + { + "from": [2.99, 7.99, 2.99], + "to": [13.01, 18.01, 13.01], + "rotation": {"angle": 0, "axis": "y", "origin": [3, 8, 3]}, + "faces": { + "north": {"uv": [6, 0, 11, 5], "texture": "#0"}, + "east": {"uv": [6, 5, 11, 10], "texture": "#0"}, + "south": {"uv": [6, 10, 11, 15], "texture": "#0"}, + "west": {"uv": [11, 0, 16, 5], "texture": "#0"}, + "up": {"uv": [16, 10, 11, 5], "texture": "#0"}, + "down": {"uv": [16, 10, 11, 15], "texture": "#0"} + } + }, + { + "from": [13.25, 18.25, 13.25], + "to": [2.75, 7.75, 2.75], + "rotation": {"angle": 0, "axis": "y", "origin": [13, 18, 13]}, + "faces": { + "north": {"uv": [9, 15, 10, 16], "texture": "#0"}, + "east": {"uv": [9, 15, 10, 16], "texture": "#0"}, + "south": {"uv": [9, 15, 10, 16], "texture": "#0"}, + "west": {"uv": [9, 15, 10, 16], "texture": "#0"}, + "up": {"uv": [9, 15, 10, 16], "texture": "#0"}, + "down": {"uv": [9, 15, 10, 16], "texture": "#0"} + } + }, + { + "from": [13.5, 18.5, 13.5], + "to": [2.5, 7.5, 2.5], + "rotation": {"angle": 0, "axis": "y", "origin": [13, 18, 13]}, + "faces": { + "north": {"uv": [8, 15, 9, 16], "texture": "#0"}, + "east": {"uv": [8, 15, 9, 16], "texture": "#0"}, + "south": {"uv": [8, 15, 9, 16], "texture": "#0"}, + "west": {"uv": [8, 15, 9, 16], "texture": "#0"}, + "up": {"uv": [8, 15, 9, 16], "texture": "#0"}, + "down": {"uv": [8, 15, 9, 16], "texture": "#0"} + } + }, + { + "from": [11, 2, 2], + "to": [11, 6, 14], + "rotation": {"angle": -45, "axis": "z", "origin": [11, 2, 8]}, + "faces": { + "north": {"uv": [0, 0, 0, 2], "texture": "#0"}, + "east": {"uv": [6, 12, 0, 14], "texture": "#0"}, + "south": {"uv": [0, 0, 0, 2], "texture": "#0"}, + "west": {"uv": [0, 12, 6, 14], "texture": "#0"}, + "up": {"uv": [0, 12, 6, 12], "rotation": 270, "texture": "#0"}, + "down": {"uv": [0, 12, 6, 12], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [5, 2, 2], + "to": [5, 6, 14], + "rotation": {"angle": 45, "axis": "z", "origin": [5, 2, 8]}, + "faces": { + "north": {"uv": [0, 0, 0, 2], "texture": "#0"}, + "east": {"uv": [6, 12, 0, 14], "texture": "#0"}, + "south": {"uv": [0, 0, 0, 2], "texture": "#0"}, + "west": {"uv": [0, 12, 6, 14], "texture": "#0"}, + "up": {"uv": [0, 12, 6, 12], "rotation": 270, "texture": "#0"}, + "down": {"uv": [0, 12, 6, 12], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [2, 2, 11], + "to": [14, 6, 11], + "rotation": {"angle": 45, "axis": "x", "origin": [8, 2, 11]}, + "faces": { + "north": {"uv": [0, 12, 6, 14], "texture": "#0"}, + "east": {"uv": [0, 0, 0, 2], "texture": "#0"}, + "south": {"uv": [6, 12, 0, 14], "texture": "#0"}, + "west": {"uv": [0, 0, 0, 2], "texture": "#0"}, + "up": {"uv": [0, 12, 6, 12], "texture": "#0"}, + "down": {"uv": [0, 12, 6, 12], "texture": "#0"} + } + }, + { + "from": [2, 2, 5], + "to": [14, 6, 5], + "rotation": {"angle": -45, "axis": "x", "origin": [8, 2, 5]}, + "faces": { + "north": {"uv": [0, 12, 6, 14], "texture": "#0"}, + "east": {"uv": [0, 0, 0, 2], "texture": "#0"}, + "south": {"uv": [6, 12, 0, 14], "texture": "#0"}, + "west": {"uv": [0, 0, 0, 2], "texture": "#0"}, + "up": {"uv": [0, 12, 6, 12], "texture": "#0"}, + "down": {"uv": [0, 12, 6, 12], "texture": "#0"} + } + }, + { + "from": [2, 0, 2], + "to": [14, 2, 14], + "rotation": {"angle": 0, "axis": "y", "origin": [2, 0, 2]}, + "faces": { + "north": {"uv": [10, 15, 16, 16], "texture": "#0"}, + "east": {"uv": [10, 15, 16, 16], "texture": "#0"}, + "south": {"uv": [10, 15, 16, 16], "texture": "#0"}, + "west": {"uv": [10, 15, 16, 16], "texture": "#0"}, + "up": {"uv": [6, 6, 0, 0], "texture": "#0"}, + "down": {"uv": [6, 6, 0, 12], "texture": "#0"} + } + } + ], + "gui_light": "front", + "display": { + "thirdperson_righthand": { + "rotation": [60, -34, 0], + "translation": [-0.5, 3, 0.25], + "scale": [0.45, 0.45, 0.45] + }, + "thirdperson_lefthand": { + "rotation": [60, -34, 0], + "translation": [-0.5, 3, 0.25], + "scale": [0.45, 0.45, 0.45] + }, + "firstperson_righthand": { + "rotation": [0, -45, 0], + "translation": [0.5, 0.5, 0], + "scale": [0.5, 0.5, 0.5] + }, + "firstperson_lefthand": { + "rotation": [0, -45, 0], + "translation": [0.5, 0.5, 0], + "scale": [0.5, 0.5, 0.5] + }, + "ground": { + "translation": [0, 3.5, 0], + "scale": [0.5, 0.5, 0.5] + }, + "gui": { + "rotation": [25, -40, 0], + "translation": [0, -0.5, 0], + "scale": [0.6, 0.6, 0.6] + }, + "fixed": { + "rotation": [-90, 0, 0], + "translation": [2, 0, -16], + "scale": [2, 2, 2] + } + } +} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/globe_base.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/globe_base.json new file mode 100644 index 00000000..d2ac210f --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/globe_base.json @@ -0,0 +1,109 @@ +{ + "textures": { + "0": "item/custom/globe", + "particle": "item/custom/globe" + }, + "elements": [ + { + "from": [11, 2, 2], + "to": [11, 6, 14], + "rotation": {"angle": -45, "axis": "z", "origin": [11, 2, 8]}, + "faces": { + "north": {"uv": [0, 0, 0, 2], "texture": "#0"}, + "east": {"uv": [6, 12, 0, 14], "texture": "#0"}, + "south": {"uv": [0, 0, 0, 2], "texture": "#0"}, + "west": {"uv": [0, 12, 6, 14], "texture": "#0"}, + "up": {"uv": [0, 12, 6, 12], "rotation": 270, "texture": "#0"}, + "down": {"uv": [0, 12, 6, 12], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [5, 2, 2], + "to": [5, 6, 14], + "rotation": {"angle": 45, "axis": "z", "origin": [5, 2, 8]}, + "faces": { + "north": {"uv": [0, 0, 0, 2], "texture": "#0"}, + "east": {"uv": [6, 12, 0, 14], "texture": "#0"}, + "south": {"uv": [0, 0, 0, 2], "texture": "#0"}, + "west": {"uv": [0, 12, 6, 14], "texture": "#0"}, + "up": {"uv": [0, 12, 6, 12], "rotation": 270, "texture": "#0"}, + "down": {"uv": [0, 12, 6, 12], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [2, 2, 11], + "to": [14, 6, 11], + "rotation": {"angle": 45, "axis": "x", "origin": [8, 2, 11]}, + "faces": { + "north": {"uv": [0, 12, 6, 14], "texture": "#0"}, + "east": {"uv": [0, 0, 0, 2], "texture": "#0"}, + "south": {"uv": [6, 12, 0, 14], "texture": "#0"}, + "west": {"uv": [0, 0, 0, 2], "texture": "#0"}, + "up": {"uv": [0, 12, 6, 12], "texture": "#0"}, + "down": {"uv": [0, 12, 6, 12], "texture": "#0"} + } + }, + { + "from": [2, 2, 5], + "to": [14, 6, 5], + "rotation": {"angle": -45, "axis": "x", "origin": [8, 2, 5]}, + "faces": { + "north": {"uv": [0, 12, 6, 14], "texture": "#0"}, + "east": {"uv": [0, 0, 0, 2], "texture": "#0"}, + "south": {"uv": [6, 12, 0, 14], "texture": "#0"}, + "west": {"uv": [0, 0, 0, 2], "texture": "#0"}, + "up": {"uv": [0, 12, 6, 12], "texture": "#0"}, + "down": {"uv": [0, 12, 6, 12], "texture": "#0"} + } + }, + { + "from": [2, 0, 2], + "to": [14, 2, 14], + "rotation": {"angle": 0, "axis": "y", "origin": [2, 0, 2]}, + "faces": { + "north": {"uv": [10, 15, 16, 16], "texture": "#0"}, + "east": {"uv": [10, 15, 16, 16], "texture": "#0"}, + "south": {"uv": [10, 15, 16, 16], "texture": "#0"}, + "west": {"uv": [10, 15, 16, 16], "texture": "#0"}, + "up": {"uv": [6, 6, 0, 0], "texture": "#0"}, + "down": {"uv": [6, 6, 0, 12], "texture": "#0"} + } + } + ], + "display": { + "thirdperson_righthand": { + "rotation": [60, -34, 0], + "translation": [-0.5, 3, 0.25], + "scale": [0.45, 0.45, 0.45] + }, + "thirdperson_lefthand": { + "rotation": [60, -34, 0], + "translation": [-0.5, 3, 0.25], + "scale": [0.45, 0.45, 0.45] + }, + "firstperson_righthand": { + "rotation": [0, -45, 0], + "translation": [0.5, 0.5, 0], + "scale": [0.5, 0.5, 0.5] + }, + "firstperson_lefthand": { + "rotation": [0, -45, 0], + "translation": [0.5, 0.5, 0], + "scale": [0.5, 0.5, 0.5] + }, + "ground": { + "translation": [0, 3.5, 0], + "scale": [0.5, 0.5, 0.5] + }, + "gui": { + "rotation": [25, -40, 0], + "translation": [0, 0.75, 0], + "scale": [0.6, 0.6, 0.6] + }, + "fixed": { + "rotation": [-90, 0, 0], + "translation": [2, 0, -16], + "scale": [2, 2, 2] + } + } +} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/globe_earth.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/globe_earth.json new file mode 100644 index 00000000..6ad2ffde --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/globe_earth.json @@ -0,0 +1,95 @@ +{ + "textures": { + "0": "item/custom/globe", + "particle": "item/custom/globe" + }, + "elements": [ + { + "from": [3, 18, 3], + "to": [13, 8, 13], + "rotation": {"angle": 0, "axis": "y", "origin": [3, 8, 3]}, + "faces": { + "north": {"uv": [6, 5, 11, 0], "texture": "#0"}, + "east": {"uv": [6, 10, 11, 5], "texture": "#0"}, + "south": {"uv": [6, 15, 11, 10], "texture": "#0"}, + "west": {"uv": [11, 5, 16, 0], "texture": "#0"}, + "up": {"uv": [16, 15, 11, 10], "texture": "#0"}, + "down": {"uv": [16, 5, 11, 10], "texture": "#0"} + } + }, + { + "from": [2.99, 7.99, 2.99], + "to": [13.01, 18.01, 13.01], + "rotation": {"angle": 0, "axis": "y", "origin": [3, 8, 3]}, + "faces": { + "north": {"uv": [6, 0, 11, 5], "texture": "#0"}, + "east": {"uv": [6, 5, 11, 10], "texture": "#0"}, + "south": {"uv": [6, 10, 11, 15], "texture": "#0"}, + "west": {"uv": [11, 0, 16, 5], "texture": "#0"}, + "up": {"uv": [16, 10, 11, 5], "texture": "#0"}, + "down": {"uv": [16, 10, 11, 15], "texture": "#0"} + } + }, + { + "from": [13.25, 18.25, 13.25], + "to": [2.75, 7.75, 2.75], + "rotation": {"angle": 0, "axis": "y", "origin": [13, 18, 13]}, + "faces": { + "north": {"uv": [9, 15, 10, 16], "texture": "#0"}, + "east": {"uv": [9, 15, 10, 16], "texture": "#0"}, + "south": {"uv": [9, 15, 10, 16], "texture": "#0"}, + "west": {"uv": [9, 15, 10, 16], "texture": "#0"}, + "up": {"uv": [9, 15, 10, 16], "texture": "#0"}, + "down": {"uv": [9, 15, 10, 16], "texture": "#0"} + } + }, + { + "from": [13.5, 18.5, 13.5], + "to": [2.5, 7.5, 2.5], + "rotation": {"angle": 0, "axis": "y", "origin": [13, 18, 13]}, + "faces": { + "north": {"uv": [8, 15, 9, 16], "texture": "#0"}, + "east": {"uv": [8, 15, 9, 16], "texture": "#0"}, + "south": {"uv": [8, 15, 9, 16], "texture": "#0"}, + "west": {"uv": [8, 15, 9, 16], "texture": "#0"}, + "up": {"uv": [8, 15, 9, 16], "texture": "#0"}, + "down": {"uv": [8, 15, 9, 16], "texture": "#0"} + } + } + ], + "display": { + "thirdperson_righthand": { + "rotation": [60, -34, 0], + "translation": [-0.5, 3, 0.25], + "scale": [0.45, 0.45, 0.45] + }, + "thirdperson_lefthand": { + "rotation": [60, -34, 0], + "translation": [-0.5, 3, 0.25], + "scale": [0.45, 0.45, 0.45] + }, + "firstperson_righthand": { + "rotation": [0, -45, 0], + "translation": [0.5, 0.5, 0], + "scale": [0.5, 0.5, 0.5] + }, + "firstperson_lefthand": { + "rotation": [0, -45, 0], + "translation": [0.5, 0.5, 0], + "scale": [0.5, 0.5, 0.5] + }, + "ground": { + "translation": [0, 3.5, 0] + }, + "gui": { + "rotation": [25, -40, 0], + "translation": [0, -2.75, 0], + "scale": [0.6, 0.6, 0.6] + }, + "fixed": { + "rotation": [-90, 0, 0], + "translation": [2, 0, -16], + "scale": [2, 2, 2] + } + } +} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/gui/cooking_info.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/gui/cooking_info.json new file mode 100644 index 00000000..5915b824 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/gui/cooking_info.json @@ -0,0 +1 @@ +{"parent":"item/generated","textures":{"layer0":"item/custom/gui/cooking_info"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/gui/exit.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/gui/exit.json new file mode 100644 index 00000000..fcf6b8be --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/gui/exit.json @@ -0,0 +1 @@ +{"parent":"item/generated","textures":{"layer0":"item/custom/gui/exit"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/gui/get_item.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/gui/get_item.json new file mode 100644 index 00000000..dc616f80 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/gui/get_item.json @@ -0,0 +1 @@ +{"parent":"item/generated","textures":{"layer0":"item/custom/gui/get_item"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/gui/next_page_0.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/gui/next_page_0.json new file mode 100644 index 00000000..b18592f1 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/gui/next_page_0.json @@ -0,0 +1 @@ +{"parent":"item/generated","textures":{"layer0":"item/custom/gui/next_page_0"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/gui/next_page_1.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/gui/next_page_1.json new file mode 100644 index 00000000..068c771e --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/gui/next_page_1.json @@ -0,0 +1 @@ +{"parent":"item/generated","textures":{"layer0":"item/custom/gui/next_page_1"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/gui/previous_page_0.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/gui/previous_page_0.json new file mode 100644 index 00000000..091e5a5c --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/gui/previous_page_0.json @@ -0,0 +1 @@ +{"parent":"item/generated","textures":{"layer0":"item/custom/gui/previous_page_0"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/gui/previous_page_1.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/gui/previous_page_1.json new file mode 100644 index 00000000..3b0bc1eb --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/gui/previous_page_1.json @@ -0,0 +1 @@ +{"parent":"item/generated","textures":{"layer0":"item/custom/gui/previous_page_1"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/gui/return.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/gui/return.json new file mode 100644 index 00000000..f9c0ef83 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/gui/return.json @@ -0,0 +1 @@ +{"parent":"item/generated","textures":{"layer0":"item/custom/gui/return"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/gui_head_size_1.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/gui_head_size_1.json new file mode 100644 index 00000000..945ddb74 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/gui_head_size_1.json @@ -0,0 +1 @@ +{"parent":"item/template_skull","display":{"gui":{"translation":[0.0,8.0,0.0],"scale":[2.0,2.0,2.0]}},"gui_light":"front"} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/gui_head_size_4.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/gui_head_size_4.json new file mode 100644 index 00000000..1dc92ebe --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/gui_head_size_4.json @@ -0,0 +1 @@ +{"parent":"item/template_skull","display":{"gui":{"translation":[9.0,7.0,0.0],"scale":[4.0,4.0,4.0]}},"gui_light":"front"} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/showcase.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/showcase.json new file mode 100644 index 00000000..efebcdf5 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/showcase.json @@ -0,0 +1,78 @@ +{ + "textures": { + "0": "item/custom/showcase", + "particle": "item/custom/showcase" + }, + "elements": [ + { + "from": [1.99, 1.99, 1.99], + "to": [14.01, 14.01, 14.01], + "rotation": {"angle": 0, "axis": "y", "origin": [2, 14, 2]}, + "faces": { + "north": {"uv": [0, 0, 6, 6], "texture": "#0"}, + "east": {"uv": [0, 0, 6, 6], "texture": "#0"}, + "south": {"uv": [0, 0, 6, 6], "texture": "#0"}, + "west": {"uv": [0, 0, 6, 6], "texture": "#0"}, + "up": {"uv": [6, 12, 0, 6], "texture": "#0"}, + "down": {"uv": [16, 13, 13, 16], "texture": "#0"} + } + }, + { + "from": [2, 14, 2], + "to": [14, 2, 14], + "rotation": {"angle": 0, "axis": "y", "origin": [2, 2, 2]}, + "faces": { + "north": {"uv": [0, 6, 6, 0], "texture": "#0"}, + "east": {"uv": [0, 6, 6, 0], "texture": "#0"}, + "south": {"uv": [0, 6, 6, 0], "texture": "#0"}, + "west": {"uv": [0, 6, 6, 0], "texture": "#0"}, + "up": {"uv": [16, 16, 13, 13], "texture": "#0"}, + "down": {"uv": [6, 6, 0, 12], "texture": "#0"} + } + }, + { + "from": [2, 0, 2], + "to": [14, 2, 14], + "rotation": {"angle": 0, "axis": "y", "origin": [2, 0, 2]}, + "faces": { + "north": {"uv": [10, 12, 16, 13], "texture": "#0"}, + "east": {"uv": [10, 12, 16, 13], "texture": "#0"}, + "south": {"uv": [10, 12, 16, 13], "texture": "#0"}, + "west": {"uv": [10, 12, 16, 13], "texture": "#0"}, + "up": {"uv": [16, 12, 10, 6], "texture": "#0"}, + "down": {"uv": [16, 0, 10, 6], "texture": "#0"} + } + } + ], + "display": { + "thirdperson_righthand": { + "rotation": [65, 0, 0], + "translation": [0, 3.25, 0.75], + "scale": [0.5, 0.5, 0.5] + }, + "thirdperson_lefthand": { + "rotation": [65, 0, 0], + "translation": [0, 3.25, 0.75], + "scale": [0.5, 0.5, 0.5] + }, + "firstperson_righthand": { + "scale": [0.7, 0.7, 0.7] + }, + "firstperson_lefthand": { + "scale": [0.7, 0.7, 0.7] + }, + "ground": { + "translation": [0, 3.25, 0], + "scale": [0.4, 0.4, 0.4] + }, + "gui": { + "rotation": [25, -40, 0], + "translation": [0, 0.25, 0], + "scale": [0.7, 0.7, 0.7] + }, + "fixed": { + "translation": [0, 0, 1.5], + "scale": [0.5, 0.5, 0.5] + } + } +} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/sleeper_sofa.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/sleeper_sofa.json new file mode 100644 index 00000000..04364706 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/sleeper_sofa.json @@ -0,0 +1,113 @@ +{ + "credit": "Made with Blockbench", + "textures": { + "0": "item/custom/sofa", + "particle": "item/custom/sofa" + }, + "elements": [ + { + "from": [-0.025, 2.975, -0.025], + "to": [16.025, 9.025, 16.025], + "faces": { + "north": {"uv": [4, 11.5, 8, 13], "texture": "#0", "tintindex": 0}, + "east": {"uv": [8, 11.5, 4, 13], "texture": "#0", "tintindex": 0}, + "south": {"uv": [4, 11.5, 8, 13], "texture": "#0", "tintindex": 0}, + "west": {"uv": [4, 11.5, 8, 13], "texture": "#0", "tintindex": 0}, + "up": {"uv": [4, 4, 0, 0], "texture": "#0", "tintindex": 0}, + "down": {"uv": [4, 12, 0, 16], "texture": "#0", "tintindex": 0} + } + }, + { + "from": [-0.005, -0.005, 12.995], + "to": [3.005, 3.005, 16.005], + "faces": { + "north": {"uv": [15.5, 15.25, 15, 16], "texture": "#0"}, + "east": {"uv": [15.5, 15.25, 15, 16], "texture": "#0"}, + "south": {"uv": [15, 15.25, 14.5, 16], "texture": "#0"}, + "west": {"uv": [14.5, 15.25, 15, 16], "texture": "#0"}, + "up": {"uv": [16, 15, 15.5, 15.5], "texture": "#0"}, + "down": {"uv": [16, 16, 15.5, 15.5], "texture": "#0"} + } + }, + { + "from": [12.995, -0.005, 12.995], + "to": [16.005, 3.005, 16.005], + "faces": { + "north": {"uv": [15, 15.25, 15.5, 16], "texture": "#0"}, + "east": {"uv": [15, 15.25, 14.5, 16], "texture": "#0"}, + "south": {"uv": [14.5, 15.25, 15, 16], "texture": "#0"}, + "west": {"uv": [15, 15.25, 15.5, 16], "texture": "#0"}, + "up": {"uv": [15.5, 15, 16, 15.5], "texture": "#0"}, + "down": {"uv": [15.5, 16, 16, 15.5], "texture": "#0"} + } + }, + { + "from": [12.995, -0.005, -0.005], + "to": [16.005, 3.005, 3.005], + "faces": { + "north": {"uv": [15, 15.25, 14.5, 16], "texture": "#0"}, + "east": {"uv": [14.5, 15.25, 15, 16], "texture": "#0"}, + "south": {"uv": [15.5, 15.25, 15, 16], "texture": "#0"}, + "west": {"uv": [15.5, 15.25, 15, 16], "texture": "#0"}, + "up": {"uv": [15.5, 15.5, 16, 15], "texture": "#0"}, + "down": {"uv": [15.5, 15.5, 16, 16], "texture": "#0"} + } + }, + { + "from": [-0.005, -0.005, -0.005], + "to": [3.005, 3.005, 3.005], + "faces": { + "north": {"uv": [14.5, 15.25, 15, 16], "texture": "#0"}, + "east": {"uv": [15, 15.25, 15.5, 16], "texture": "#0"}, + "south": {"uv": [15, 15.25, 15.5, 16], "texture": "#0"}, + "west": {"uv": [15, 15.25, 14.5, 16], "texture": "#0"}, + "up": {"uv": [16, 15.5, 15.5, 15], "texture": "#0"}, + "down": {"uv": [16, 15.5, 15.5, 16], "texture": "#0"} + } + } + ], + "display": { + "thirdperson_righthand": { + "rotation": [60, -34, 0], + "translation": [-0.5, 3, 0.25], + "scale": [0.25, 0.25, 0.25] + }, + "thirdperson_lefthand": { + "rotation": [60, -34, 0], + "translation": [-0.5, 3, 0.25], + "scale": [0.25, 0.25, 0.25] + }, + "firstperson_righthand": { + "rotation": [0, -180, 0], + "translation": [0.5, 0.5, 0], + "scale": [0.5, 0.5, 0.5] + }, + "firstperson_lefthand": { + "rotation": [0, -180, 0], + "translation": [0.5, 0.5, 0], + "scale": [0.5, 0.5, 0.5] + }, + "ground": { + "translation": [0, 2.75, 0], + "scale": [0.35, 0.35, 0.35] + }, + "gui": { + "rotation": [25, -135, 0], + "translation": [0.25, -1, 0], + "scale": [0.5, 0.5, 0.5] + }, + "fixed": { + "rotation": [-90, 0, 0], + "translation": [0, 0, -16], + "scale": [2, 2, 2] + } + }, + "groups": [ + { + "name": "group", + "origin": [0, 0, 0], + "color": 0, + "children": [0, 1, 2, 3, 4] + } + ] +} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/sofa.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/sofa.json new file mode 100644 index 00000000..b241eacb --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/sofa.json @@ -0,0 +1,122 @@ +{ + "textures": { + "0": "item/custom/sofa", + "particle": "item/custom/sofa" + }, + "elements": [ + { + "from": [0.02, 6.02, 12.02], + "to": [15.98, 19.98, 15.98], + "rotation": {"angle": 22.5, "axis": "x", "origin": [7, 8, 14]}, + "faces": { + "north": {"uv": [9, 8.5, 13, 12], "texture": "#0", "tintindex": 0}, + "east": {"uv": [8, 12.5, 9, 16], "texture": "#0", "tintindex": 0}, + "south": {"uv": [9, 12.5, 13, 16], "texture": "#0", "tintindex": 0}, + "west": {"uv": [9, 12.5, 8, 16], "texture": "#0", "tintindex": 0}, + "up": {"uv": [9, 12, 8, 8.5], "rotation": 90, "texture": "#0", "tintindex": 0}, + "down": {"uv": [7.75, 10.5, 4.25, 11.5], "texture": "#0", "tintindex": 0} + } + }, + { + "from": [0, 3, 0], + "to": [16, 9, 16], + "rotation": {"angle": 0, "axis": "y", "origin": [0, 2, 0]}, + "faces": { + "north": {"uv": [4, 11.5, 8, 13], "texture": "#0", "tintindex": 0}, + "east": {"uv": [8, 14.5, 4, 16], "texture": "#0", "tintindex": 0}, + "south": {"uv": [4, 13, 8, 14.5], "texture": "#0", "tintindex": 0}, + "west": {"uv": [4, 14.5, 8, 16], "texture": "#0", "tintindex": 0}, + "up": {"uv": [4, 12, 0, 8], "texture": "#0", "tintindex": 0}, + "down": {"uv": [4, 12, 0, 16], "texture": "#0", "tintindex": 0} + } + }, + { + "from": [1, 0, 13], + "to": [3, 3, 15], + "rotation": {"angle": 0, "axis": "y", "origin": [1, 0, 15]}, + "faces": { + "north": {"uv": [15.5, 15.25, 15, 16], "texture": "#0"}, + "east": {"uv": [15.5, 15.25, 15, 16], "texture": "#0"}, + "south": {"uv": [15, 15.25, 14.5, 16], "texture": "#0"}, + "west": {"uv": [14.5, 15.25, 15, 16], "texture": "#0"}, + "up": {"uv": [16, 15, 15.5, 15.5], "texture": "#0"}, + "down": {"uv": [16, 16, 15.5, 15.5], "texture": "#0"} + } + }, + { + "from": [13, 0, 13], + "to": [15, 3, 15], + "rotation": {"angle": 0, "axis": "y", "origin": [15, 0, 15]}, + "faces": { + "north": {"uv": [15, 15.25, 15.5, 16], "texture": "#0"}, + "east": {"uv": [15, 15.25, 14.5, 16], "texture": "#0"}, + "south": {"uv": [14.5, 15.25, 15, 16], "texture": "#0"}, + "west": {"uv": [15, 15.25, 15.5, 16], "texture": "#0"}, + "up": {"uv": [15.5, 15, 16, 15.5], "texture": "#0"}, + "down": {"uv": [15.5, 16, 16, 15.5], "texture": "#0"} + } + }, + { + "from": [13, 0, 1], + "to": [15, 3, 3], + "rotation": {"angle": 0, "axis": "y", "origin": [15, 0, 1]}, + "faces": { + "north": {"uv": [15, 15.25, 14.5, 16], "texture": "#0"}, + "east": {"uv": [14.5, 15.25, 15, 16], "texture": "#0"}, + "south": {"uv": [15.5, 15.25, 15, 16], "texture": "#0"}, + "west": {"uv": [15.5, 15.25, 15, 16], "texture": "#0"}, + "up": {"uv": [15.5, 15.5, 16, 15], "texture": "#0"}, + "down": {"uv": [15.5, 15.5, 16, 16], "texture": "#0"} + } + }, + { + "from": [1, 0, 1], + "to": [3, 3, 3], + "rotation": {"angle": 0, "axis": "y", "origin": [1, 0, 1]}, + "faces": { + "north": {"uv": [14.5, 15.25, 15, 16], "texture": "#0"}, + "east": {"uv": [15, 15.25, 15.5, 16], "texture": "#0"}, + "south": {"uv": [15, 15.25, 15.5, 16], "texture": "#0"}, + "west": {"uv": [15, 15.25, 14.5, 16], "texture": "#0"}, + "up": {"uv": [16, 15.5, 15.5, 15], "texture": "#0"}, + "down": {"uv": [16, 15.5, 15.5, 16], "texture": "#0"} + } + } + ], + "display": { + "thirdperson_righthand": { + "rotation": [60, -34, 0], + "translation": [-0.5, 3, 0.25], + "scale": [0.25, 0.25, 0.25] + }, + "thirdperson_lefthand": { + "rotation": [60, -34, 0], + "translation": [-0.5, 3, 0.25], + "scale": [0.25, 0.25, 0.25] + }, + "firstperson_righthand": { + "rotation": [0, -180, 0], + "translation": [0.5, 0.5, 0], + "scale": [0.5, 0.5, 0.5] + }, + "firstperson_lefthand": { + "rotation": [0, -180, 0], + "translation": [0.5, 0.5, 0], + "scale": [0.5, 0.5, 0.5] + }, + "ground": { + "translation": [0, 2.75, 0], + "scale": [0.35, 0.35, 0.35] + }, + "gui": { + "rotation": [25, -135, 0], + "translation": [0.5, -1, 0], + "scale": [0.5, 0.5, 0.5] + }, + "fixed": { + "rotation": [-90, 0, 0], + "translation": [0, 0, -16], + "scale": [2, 2, 2] + } + } +} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/sofa_inner.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/sofa_inner.json new file mode 100644 index 00000000..692d34fc --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/sofa_inner.json @@ -0,0 +1,135 @@ +{ + "textures": { + "0": "item/custom/sofa", + "particle": "item/custom/sofa" + }, + "elements": [ + { + "from": [0.02, 6.02, 0.02], + "to": [3.98, 19.98, 15.98], + "rotation": {"angle": 22.5, "axis": "z", "origin": [2, 8, 8]}, + "faces": { + "north": {"uv": [9, 12.5, 8, 16], "texture": "#0", "tintindex": 0}, + "east": {"uv": [9, 8.5, 13, 12], "texture": "#0", "tintindex": 0}, + "south": {"uv": [8, 12.5, 9, 16], "texture": "#0", "tintindex": 0}, + "west": {"uv": [13, 12.5, 9, 16], "texture": "#0", "tintindex": 0}, + "up": {"uv": [8, 12, 9, 8.5], "texture": "#0", "tintindex": 0}, + "down": {"uv": [4.25, 11.5, 7.75, 10.5], "rotation": 90, "texture": "#0", "tintindex": 0} + } + }, + { + "from": [0.02, 6.02, 12.02], + "to": [15.98, 19.98, 15.98], + "rotation": {"angle": 22.5, "axis": "x", "origin": [7, 8, 14]}, + "faces": { + "north": {"uv": [13, 8.5, 9, 12], "texture": "#0", "tintindex": 0}, + "east": {"uv": [8, 12.5, 9, 16], "texture": "#0", "tintindex": 0}, + "south": {"uv": [9, 12.5, 13, 16], "texture": "#0", "tintindex": 0}, + "west": {"uv": [9, 12.5, 8, 16], "texture": "#0", "tintindex": 0}, + "up": {"uv": [9, 12, 8, 8.5], "rotation": 90, "texture": "#0", "tintindex": 0}, + "down": {"uv": [7.75, 10.5, 4.25, 11.5], "texture": "#0", "tintindex": 0} + } + }, + { + "from": [0, 3, 0], + "to": [16, 9, 16], + "rotation": {"angle": 0, "axis": "y", "origin": [0, 2, 0]}, + "faces": { + "north": {"uv": [4, 14.5, 8, 16], "texture": "#0", "tintindex": 0}, + "east": {"uv": [8, 14.5, 4, 16], "texture": "#0", "tintindex": 0}, + "south": {"uv": [4, 13, 8, 14.5], "texture": "#0", "tintindex": 0}, + "west": {"uv": [4, 14.5, 8, 16], "texture": "#0", "tintindex": 0}, + "up": {"uv": [4, 8, 0, 4], "texture": "#0", "tintindex": 0}, + "down": {"uv": [4, 12, 0, 16], "texture": "#0", "tintindex": 0} + } + }, + { + "from": [1, 0, 13], + "to": [3, 3, 15], + "rotation": {"angle": 0, "axis": "y", "origin": [1, 0, 15]}, + "faces": { + "north": {"uv": [15.5, 15.25, 15, 16], "texture": "#0"}, + "east": {"uv": [15.5, 15.25, 15, 16], "texture": "#0"}, + "south": {"uv": [15, 15.25, 14.5, 16], "texture": "#0"}, + "west": {"uv": [14.5, 15.25, 15, 16], "texture": "#0"}, + "up": {"uv": [16, 15, 15.5, 15.5], "texture": "#0"}, + "down": {"uv": [16, 16, 15.5, 15.5], "texture": "#0"} + } + }, + { + "from": [13, 0, 13], + "to": [15, 3, 15], + "rotation": {"angle": 0, "axis": "y", "origin": [15, 0, 15]}, + "faces": { + "north": {"uv": [15, 15.25, 15.5, 16], "texture": "#0"}, + "east": {"uv": [15, 15.25, 14.5, 16], "texture": "#0"}, + "south": {"uv": [14.5, 15.25, 15, 16], "texture": "#0"}, + "west": {"uv": [15, 15.25, 15.5, 16], "texture": "#0"}, + "up": {"uv": [15.5, 15, 16, 15.5], "texture": "#0"}, + "down": {"uv": [15.5, 16, 16, 15.5], "texture": "#0"} + } + }, + { + "from": [13, 0, 1], + "to": [15, 3, 3], + "rotation": {"angle": 0, "axis": "y", "origin": [15, 0, 1]}, + "faces": { + "north": {"uv": [15, 15.25, 14.5, 16], "texture": "#0"}, + "east": {"uv": [14.5, 15.25, 15, 16], "texture": "#0"}, + "south": {"uv": [15.5, 15.25, 15, 16], "texture": "#0"}, + "west": {"uv": [15.5, 15.25, 15, 16], "texture": "#0"}, + "up": {"uv": [15.5, 15.5, 16, 15], "texture": "#0"}, + "down": {"uv": [15.5, 15.5, 16, 16], "texture": "#0"} + } + }, + { + "from": [1, 0, 1], + "to": [3, 3, 3], + "rotation": {"angle": 0, "axis": "y", "origin": [1, 0, 1]}, + "faces": { + "north": {"uv": [14.5, 15.25, 15, 16], "texture": "#0"}, + "east": {"uv": [15, 15.25, 15.5, 16], "texture": "#0"}, + "south": {"uv": [15, 15.25, 15.5, 16], "texture": "#0"}, + "west": {"uv": [15, 15.25, 14.5, 16], "texture": "#0"}, + "up": {"uv": [16, 15.5, 15.5, 15], "texture": "#0"}, + "down": {"uv": [16, 15.5, 15.5, 16], "texture": "#0"} + } + } + ], + "display": { + "thirdperson_righthand": { + "rotation": [60, -180, 0], + "translation": [-0.5, 3, 0.25], + "scale": [0.25, 0.25, 0.25] + }, + "thirdperson_lefthand": { + "rotation": [60, 0, 0], + "translation": [-0.5, 3, 0.25], + "scale": [0.25, 0.25, 0.25] + }, + "firstperson_righthand": { + "rotation": [0, -180, 0], + "translation": [0.5, 0.5, 0], + "scale": [0.5, 0.5, 0.5] + }, + "firstperson_lefthand": { + "rotation": [0, 90, 0], + "translation": [0.5, 0.5, 0], + "scale": [0.5, 0.5, 0.5] + }, + "ground": { + "translation": [0, 2.75, 0], + "scale": [0.35, 0.35, 0.35] + }, + "gui": { + "rotation": [25, -135, 0], + "translation": [0.25, -1, 0], + "scale": [0.5, 0.5, 0.5] + }, + "fixed": { + "rotation": [-90, 0, 0], + "translation": [0, 0, -16], + "scale": [2, 2, 2] + } + } +} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/solid_gunpowder_block.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/solid_gunpowder_block.json new file mode 100644 index 00000000..2ecb9934 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/solid_gunpowder_block.json @@ -0,0 +1 @@ +{"parent":"block/custom/solid_gunpowder_block"} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/table_lamp.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/table_lamp.json new file mode 100644 index 00000000..32067b78 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/table_lamp.json @@ -0,0 +1,121 @@ +{ + "textures": { + "0": "item/custom/table_lamp", + "particle": "item/custom/table_lamp" + }, + "elements": [ + { + "from": [3, 0, 3], + "to": [13, 1, 13], + "rotation": {"angle": 0, "axis": "y", "origin": [3, 0, 3]}, + "faces": { + "north": {"uv": [0, 10, 5, 10.5], "texture": "#0"}, + "east": {"uv": [0, 10, 5, 10.5], "texture": "#0"}, + "south": {"uv": [0, 10, 5, 10.5], "texture": "#0"}, + "west": {"uv": [0, 10, 5, 10.5], "texture": "#0"}, + "up": {"uv": [5, 5, 0, 0], "texture": "#0"}, + "down": {"uv": [5, 5, 0, 10], "texture": "#0"} + } + }, + { + "from": [9, 1, 6], + "to": [9, 10, 10], + "rotation": {"angle": -22.5, "axis": "z", "origin": [9, 1, 10]}, + "faces": { + "north": {"uv": [0, 0, 0, 4.5], "texture": "#0"}, + "east": {"uv": [5, 0, 7, 4.5], "texture": "#0"}, + "south": {"uv": [0, 0, 0, 4.5], "texture": "#0"}, + "west": {"uv": [7, 0, 5, 4.5], "texture": "#0"}, + "up": {"uv": [0, 2, 0, 0], "texture": "#0"}, + "down": {"uv": [0, 0, 0, 2], "texture": "#0"} + } + }, + { + "from": [12, 6, 6], + "to": [12, 15, 10], + "rotation": {"angle": 45, "axis": "z", "origin": [12, 8, 10]}, + "faces": { + "north": {"uv": [0, 0, 0, 4.5], "texture": "#0"}, + "east": {"uv": [5, 4.5, 7, 9], "texture": "#0"}, + "south": {"uv": [0, 0, 0, 4.5], "texture": "#0"}, + "west": {"uv": [5, 4.5, 7, 9], "texture": "#0"}, + "up": {"uv": [0, 2, 0, 0], "texture": "#0"}, + "down": {"uv": [0, 0, 0, 2], "texture": "#0"} + } + }, + { + "from": [5.05096, 10.77888, 6], + "to": [9.05096, 14.77888, 10], + "rotation": {"angle": 22.5, "axis": "z", "origin": [5.80096, 12.77888, 8]}, + "faces": { + "north": {"uv": [14, 0, 16, 2], "texture": "#0"}, + "east": {"uv": [12, 0, 14, 2], "texture": "#0"}, + "south": {"uv": [16, 0, 14, 2], "texture": "#0"}, + "west": {"uv": [14, 2, 16, 4], "texture": "#0"}, + "up": {"uv": [14, 4, 12, 2], "texture": "#0"}, + "down": {"uv": [14, 4, 12, 6], "texture": "#0"} + } + }, + { + "from": [4.05096, 9.77888, 5], + "to": [5.05096, 15.77888, 11], + "rotation": {"angle": 22.5, "axis": "z", "origin": [5.80096, 12.77888, 8]}, + "faces": { + "north": {"uv": [11, 0, 11.5, 3], "texture": "#0"}, + "east": {"uv": [7, 0, 10, 3], "texture": "#0"}, + "south": {"uv": [11, 0, 11.5, 3], "texture": "#0"}, + "west": {"uv": [7, 3, 10, 6], "texture": "#0"}, + "up": {"uv": [11, 3, 10.5, 0], "texture": "#0"}, + "down": {"uv": [10.5, 0, 10, 3], "texture": "#0"} + } + }, + { + "from": [4.97484, 10.16157, 5], + "to": [3.97484, 16.16157, 11], + "rotation": {"angle": 22.5, "axis": "z", "origin": [6.72484, 13.16157, 8]}, + "faces": { + "north": {"uv": [11, 0, 11.5, 3], "texture": "#0"}, + "east": {"uv": [7, 3, 10, 6], "texture": "#0"}, + "south": {"uv": [11, 0, 11.5, 3], "texture": "#0"}, + "west": {"uv": [7, 0, 10, 3], "texture": "#0"}, + "up": {"uv": [11, 3, 10.5, 0], "texture": "#0"}, + "down": {"uv": [10.5, 0, 10, 3], "texture": "#0"} + } + } + ], + "gui_light": "front", + "display": { + "thirdperson_righthand": { + "rotation": [60, 45, 0], + "translation": [0, 1.25, 0], + "scale": [0.5, 0.5, 0.5] + }, + "thirdperson_lefthand": { + "rotation": [60, 45, 0], + "translation": [0, 1.25, 0], + "scale": [0.5, 0.5, 0.5] + }, + "firstperson_righthand": { + "rotation": [0, 22, 0], + "translation": [0.5, 3, 0], + "scale": [0.5, 0.5, 0.5] + }, + "firstperson_lefthand": { + "rotation": [0, -161, 0], + "translation": [0.5, 3, 0], + "scale": [0.5, 0.5, 0.5] + }, + "ground": { + "translation": [0, 3.25, 0], + "scale": [0.5, 0.5, 0.5] + }, + "gui": { + "rotation": [25, 51, 0], + "translation": [0, 0.25, 0], + "scale": [0.65, 0.65, 0.65] + }, + "fixed": { + "scale": [0.8, 0.8, 0.8] + } + } +} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/table_lamp_on.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/table_lamp_on.json new file mode 100644 index 00000000..ee62ca5e --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/table_lamp_on.json @@ -0,0 +1 @@ +{"parent":"item/custom/table_lamp","textures":{"0":"item/custom/table_lamp_on"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/topaz_trident.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/topaz_trident.json new file mode 100644 index 00000000..0e9c997e --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/topaz_trident.json @@ -0,0 +1 @@ +{"parent":"item/generated","textures":{"layer0":"item/custom/topaz_trident"}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/topaz_trident_in_hand.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/topaz_trident_in_hand.json new file mode 100644 index 00000000..984b06ef --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/topaz_trident_in_hand.json @@ -0,0 +1,107 @@ +{ + "textures": { + "0": "item/custom/topaz_trident_3d", + "particle": "item/custom/topaz_trident_3d" + }, + "elements": [ + { + "from": [7.75, -5.5, 7.75], + "to": [8.25, 10, 8.25], + "rotation": {"angle": 0, "axis": "y", "origin": [4, -5.5, 4]}, + "faces": { + "north": {"uv": [10.5, 0.5, 11, 16], "texture": "#0"}, + "east": {"uv": [10.5, 0.5, 11, 16], "texture": "#0"}, + "south": {"uv": [10.5, 0.5, 11, 16], "texture": "#0"}, + "west": {"uv": [10.5, 0.5, 11, 16], "texture": "#0"}, + "up": {"uv": [3, 0, 3.5, 0.5], "texture": "#0"}, + "down": {"uv": [0.5, 15.5, 1, 16], "texture": "#0"} + } + }, + { + "from": [7.25, 7, 7.75], + "to": [7.75, 8, 8.25], + "rotation": {"angle": 0, "axis": "y", "origin": [4, -5.5, 4]}, + "faces": { + "north": {"uv": [11, 2.5, 11.5, 3.5], "texture": "#0"}, + "east": {"uv": [11, 2.5, 11.5, 3.5], "texture": "#0"}, + "south": {"uv": [11, 2.5, 11.5, 3.5], "texture": "#0"}, + "west": {"uv": [11, 2.5, 11.5, 3.5], "texture": "#0"}, + "up": {"uv": [11, 2.5, 11.5, 3], "texture": "#0"}, + "down": {"uv": [11, 3, 11.5, 3.5], "texture": "#0"} + } + }, + { + "from": [6.75, 7.5, 7.75], + "to": [7.25, 9.5, 8.25], + "rotation": {"angle": 0, "axis": "y", "origin": [4, -5.5, 4]}, + "faces": { + "north": {"uv": [11.5, 1, 12, 3], "texture": "#0"}, + "east": {"uv": [11.5, 1, 12, 3], "texture": "#0"}, + "south": {"uv": [11.5, 1, 12, 3], "texture": "#0"}, + "west": {"uv": [11.5, 1, 12, 3], "texture": "#0"}, + "up": {"uv": [11.5, 1, 12, 1.5], "texture": "#0"}, + "down": {"uv": [11.5, 2.5, 12, 3], "texture": "#0"} + } + }, + { + "from": [8.75, 7.5, 7.75], + "to": [9.25, 9.5, 8.25], + "rotation": {"angle": 0, "axis": "y", "origin": [4, -5.5, 4]}, + "faces": { + "north": {"uv": [11.5, 1, 12, 3], "texture": "#0"}, + "east": {"uv": [11.5, 1, 12, 3], "texture": "#0"}, + "south": {"uv": [11.5, 1, 12, 3], "texture": "#0"}, + "west": {"uv": [11.5, 1, 12, 3], "texture": "#0"}, + "up": {"uv": [11.5, 1, 12, 1.5], "texture": "#0"}, + "down": {"uv": [11.5, 2.5, 12, 3], "texture": "#0"} + } + }, + { + "from": [8.25, 7, 7.75], + "to": [8.75, 8, 8.25], + "rotation": {"angle": 0, "axis": "y", "origin": [4, -5.5, 4]}, + "faces": { + "north": {"uv": [11, 2.5, 11.5, 3.5], "texture": "#0"}, + "east": {"uv": [11, 2.5, 11.5, 3.5], "texture": "#0"}, + "south": {"uv": [11, 2.5, 11.5, 3.5], "texture": "#0"}, + "west": {"uv": [11, 2.5, 11.5, 3.5], "texture": "#0"}, + "up": {"uv": [11, 2.5, 11.5, 3], "texture": "#0"}, + "down": {"uv": [11, 3, 11.5, 3.5], "texture": "#0"} + } + } + ], + "gui_light": "front", + "display": { + "thirdperson_righthand": { + "rotation": [0, 60, 0], + "translation": [0.25, 9, 1.5], + "scale": [2, 2, 2] + }, + "thirdperson_lefthand": { + "rotation": [0, 60, 0], + "translation": [0.25, 9, 1.5], + "scale": [2, 2, 2] + }, + "firstperson_righthand": { + "rotation": [0, -90, 25], + "translation": [-2.5, 7.5, 4.75] + }, + "firstperson_lefthand": { + "rotation": [0, 90, -25], + "translation": [-2.5, 7.5, 4.75] + }, + "ground": { + "rotation": [0, 0, 45], + "translation": [-2, 2, 0], + "scale": [0.5, 0.5, 0.5] + }, + "gui": { + "rotation": [0, 0, -45], + "translation": [5, 5, 0], + "scale": [1.25, 1.25, 1.25] + }, + "fixed": { + "translation": [0, 6, 0] + } + } +} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/topaz_trident_throwing.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/topaz_trident_throwing.json new file mode 100644 index 00000000..6e8a181f --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/topaz_trident_throwing.json @@ -0,0 +1,109 @@ +{ + "textures": { + "0": "item/custom/topaz_trident_3d", + "particle": "item/custom/topaz_trident_3d" + }, + "elements": [ + { + "from": [7.75, -5.5, 7.75], + "to": [8.25, 10, 8.25], + "rotation": {"angle": 0, "axis": "y", "origin": [4, -5.5, 4]}, + "faces": { + "north": {"uv": [10.5, 0.5, 11, 16], "texture": "#0"}, + "east": {"uv": [10.5, 0.5, 11, 16], "texture": "#0"}, + "south": {"uv": [10.5, 0.5, 11, 16], "texture": "#0"}, + "west": {"uv": [10.5, 0.5, 11, 16], "texture": "#0"}, + "up": {"uv": [3, 0, 3.5, 0.5], "texture": "#0"}, + "down": {"uv": [0.5, 15.5, 1, 16], "texture": "#0"} + } + }, + { + "from": [7.25, 7, 7.75], + "to": [7.75, 8, 8.25], + "rotation": {"angle": 0, "axis": "y", "origin": [4, -5.5, 4]}, + "faces": { + "north": {"uv": [11, 2.5, 11.5, 3.5], "texture": "#0"}, + "east": {"uv": [11, 2.5, 11.5, 3.5], "texture": "#0"}, + "south": {"uv": [11, 2.5, 11.5, 3.5], "texture": "#0"}, + "west": {"uv": [11, 2.5, 11.5, 3.5], "texture": "#0"}, + "up": {"uv": [11, 2.5, 11.5, 3], "texture": "#0"}, + "down": {"uv": [11, 3, 11.5, 3.5], "texture": "#0"} + } + }, + { + "from": [6.75, 7.5, 7.75], + "to": [7.25, 9.5, 8.25], + "rotation": {"angle": 0, "axis": "y", "origin": [4, -5.5, 4]}, + "faces": { + "north": {"uv": [11.5, 1, 12, 3], "texture": "#0"}, + "east": {"uv": [11.5, 1, 12, 3], "texture": "#0"}, + "south": {"uv": [11.5, 1, 12, 3], "texture": "#0"}, + "west": {"uv": [11.5, 1, 12, 3], "texture": "#0"}, + "up": {"uv": [11.5, 1, 12, 1.5], "texture": "#0"}, + "down": {"uv": [11.5, 2.5, 12, 3], "texture": "#0"} + } + }, + { + "from": [8.75, 7.5, 7.75], + "to": [9.25, 9.5, 8.25], + "rotation": {"angle": 0, "axis": "y", "origin": [4, -5.5, 4]}, + "faces": { + "north": {"uv": [11.5, 1, 12, 3], "texture": "#0"}, + "east": {"uv": [11.5, 1, 12, 3], "texture": "#0"}, + "south": {"uv": [11.5, 1, 12, 3], "texture": "#0"}, + "west": {"uv": [11.5, 1, 12, 3], "texture": "#0"}, + "up": {"uv": [11.5, 1, 12, 1.5], "texture": "#0"}, + "down": {"uv": [11.5, 2.5, 12, 3], "texture": "#0"} + } + }, + { + "from": [8.25, 7, 7.75], + "to": [8.75, 8, 8.25], + "rotation": {"angle": 0, "axis": "y", "origin": [4, -5.5, 4]}, + "faces": { + "north": {"uv": [11, 2.5, 11.5, 3.5], "texture": "#0"}, + "east": {"uv": [11, 2.5, 11.5, 3.5], "texture": "#0"}, + "south": {"uv": [11, 2.5, 11.5, 3.5], "texture": "#0"}, + "west": {"uv": [11, 2.5, 11.5, 3.5], "texture": "#0"}, + "up": {"uv": [11, 2.5, 11.5, 3], "texture": "#0"}, + "down": {"uv": [11, 3, 11.5, 3.5], "texture": "#0"} + } + } + ], + "gui_light": "front", + "display": { + "thirdperson_righthand": { + "rotation": [0, 90, 180], + "translation": [0.25, -9, 1.5], + "scale": [2, 2, 2] + }, + "thirdperson_lefthand": { + "rotation": [0, 90, 180], + "translation": [0.25, -9, 1.5], + "scale": [2, 2, 2] + }, + "firstperson_righthand": { + "rotation": [0, -90, 25], + "translation": [0.75, -5, -0.75], + "scale": [0.5, 0.5, 0.5] + }, + "firstperson_lefthand": { + "rotation": [0, 90, -25], + "translation": [0.75, -5, -0.75], + "scale": [0.5, 0.5, 0.5] + }, + "ground": { + "rotation": [0, 0, 45], + "translation": [-2, 2, 0], + "scale": [0.5, 0.5, 0.5] + }, + "gui": { + "rotation": [0, 0, -45], + "translation": [5, 5, 0], + "scale": [1.25, 1.25, 1.25] + }, + "fixed": { + "translation": [0, 6, 0] + } + } +} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/wooden_chair.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/wooden_chair.json new file mode 100644 index 00000000..81e73f92 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/wooden_chair.json @@ -0,0 +1,162 @@ +{ + "textures": { + "0": "item/custom/wooden_chair", + "particle": "item/custom/wooden_chair" + }, + "elements": [ + { + "from": [3.75, -0.25, 3.75], + "to": [5.25, 7.25, 5.25], + "rotation": {"angle": 0, "axis": "y", "origin": [4.5, 4, 4.5]}, + "faces": { + "north": {"uv": [15.5, 0.5, 16, 4], "texture": "#0"}, + "east": {"uv": [15, 0.5, 15.5, 4], "texture": "#0"}, + "south": {"uv": [15, 0.5, 15.5, 4], "texture": "#0"}, + "west": {"uv": [15.5, 0.5, 16, 4], "texture": "#0"}, + "up": {"uv": [16, 0.5, 15.5, 0], "texture": "#0"}, + "down": {"uv": [15.5, 0, 15, 0.5], "texture": "#0"} + } + }, + { + "from": [10.75, -0.25, 3.75], + "to": [12.25, 7.25, 5.25], + "rotation": {"angle": 0, "axis": "y", "origin": [11.5, 3.5, 4.5]}, + "faces": { + "north": {"uv": [16, 0.5, 15.5, 4], "texture": "#0"}, + "east": {"uv": [16, 0.5, 15.5, 4], "texture": "#0"}, + "south": {"uv": [15.5, 0.5, 15, 4], "texture": "#0"}, + "west": {"uv": [15.5, 0.5, 15, 4], "texture": "#0"}, + "up": {"uv": [15.5, 0.5, 16, 0], "texture": "#0"}, + "down": {"uv": [15, 0, 15.5, 0.5], "texture": "#0"} + } + }, + { + "from": [10.75, -0.25, 10.75], + "to": [12.25, 7.25, 12.25], + "rotation": {"angle": 0, "axis": "y", "origin": [11.5, 4, 11.5]}, + "faces": { + "north": {"uv": [15, 0.5, 15.5, 4], "texture": "#0"}, + "east": {"uv": [15.5, 0.5, 16, 4], "texture": "#0"}, + "south": {"uv": [15.5, 0.5, 16, 4], "texture": "#0"}, + "west": {"uv": [15, 0.5, 15.5, 4], "texture": "#0"}, + "up": {"uv": [15.5, 0, 16, 0.5], "texture": "#0"}, + "down": {"uv": [15, 0.5, 15.5, 0], "texture": "#0"} + } + }, + { + "from": [3.75, -0.25, 10.75], + "to": [5.25, 7.25, 12.25], + "rotation": {"angle": 0, "axis": "y", "origin": [4.5, 4, 11.5]}, + "faces": { + "north": {"uv": [15.5, 0.5, 15, 4], "texture": "#0"}, + "east": {"uv": [15.5, 0.5, 15, 4], "texture": "#0"}, + "south": {"uv": [16, 0.5, 15.5, 4], "texture": "#0"}, + "west": {"uv": [16, 0.5, 15.5, 4], "texture": "#0"}, + "up": {"uv": [16, 0, 15.5, 0.5], "texture": "#0"}, + "down": {"uv": [15.5, 0.5, 15, 0], "texture": "#0"} + } + }, + { + "from": [4, 9, 12], + "to": [12, 17, 12], + "rotation": {"angle": 0, "axis": "y", "origin": [4, 9, 14]}, + "faces": { + "north": {"uv": [4, 5, 0, 9], "texture": "#0"}, + "east": {"uv": [0, 0, 0, 4], "texture": "#0"}, + "south": {"uv": [0, 5, 4, 9], "texture": "#0"}, + "west": {"uv": [0, 0, 0, 4], "texture": "#0"}, + "up": {"uv": [4, 0, 0, 0], "texture": "#0"}, + "down": {"uv": [4, 0, 0, 0], "texture": "#0"} + } + }, + { + "from": [4, 16.5, 11.5], + "to": [12, 18.5, 12.5], + "rotation": {"angle": 0, "axis": "y", "origin": [4, 17, 14]}, + "faces": { + "north": {"uv": [8, 5, 4, 6], "texture": "#0"}, + "east": {"uv": [8, 5, 8.5, 6], "texture": "#0"}, + "south": {"uv": [4, 5, 8, 6], "texture": "#0"}, + "west": {"uv": [8, 5, 8.5, 6], "texture": "#0"}, + "up": {"uv": [8, 7, 4, 6.5], "texture": "#0"}, + "down": {"uv": [8, 6, 4, 6.5], "texture": "#0"} + } + }, + { + "from": [3, 9, 11], + "to": [4, 19, 13], + "rotation": {"angle": 0, "axis": "y", "origin": [3, 9, 13]}, + "faces": { + "north": {"uv": [0.5, 11, 1, 16], "texture": "#0"}, + "east": {"uv": [2, 11, 3, 16], "texture": "#0"}, + "south": {"uv": [0, 11, 0.5, 16], "texture": "#0"}, + "west": {"uv": [1, 11, 2, 16], "texture": "#0"}, + "up": {"uv": [2, 11, 1, 10.5], "rotation": 90, "texture": "#0"}, + "down": {"uv": [2, 11, 3, 10.5], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [12, 9, 11], + "to": [13, 19, 13], + "rotation": {"angle": 0, "axis": "y", "origin": [13, 9, 13]}, + "faces": { + "north": {"uv": [1, 11, 0.5, 16], "texture": "#0"}, + "east": {"uv": [2, 11, 1, 16], "texture": "#0"}, + "south": {"uv": [0.5, 11, 0, 16], "texture": "#0"}, + "west": {"uv": [3, 11, 2, 16], "texture": "#0"}, + "up": {"uv": [2, 10.5, 1, 11], "rotation": 90, "texture": "#0"}, + "down": {"uv": [2, 10.5, 3, 11], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [3, 7, 3], + "to": [13, 9, 13], + "rotation": {"angle": 0, "axis": "y", "origin": [3, 7, 5]}, + "faces": { + "north": {"uv": [10, 2, 15, 3], "texture": "#0"}, + "east": {"uv": [10, 0, 15, 1], "texture": "#0"}, + "south": {"uv": [10, 1, 15, 2], "texture": "#0"}, + "west": {"uv": [15, 0, 10, 1], "texture": "#0"}, + "up": {"uv": [5, 5, 0, 0], "texture": "#0"}, + "down": {"uv": [10, 0, 5, 5], "texture": "#0"} + } + } + ], + "gui_light": "front", + "display": { + "thirdperson_righthand": { + "rotation": [60, 145, 0], + "translation": [0, 1.25, 0], + "scale": [0.5, 0.5, 0.5] + }, + "thirdperson_lefthand": { + "rotation": [60, 145, 0], + "translation": [0, 1.25, 0], + "scale": [0.5, 0.5, 0.5] + }, + "firstperson_righthand": { + "rotation": [0, 111, 0], + "translation": [0.5, 3, 0], + "scale": [0.5, 0.5, 0.5] + }, + "firstperson_lefthand": { + "rotation": [0, 111, 0], + "translation": [0.5, 3, 0], + "scale": [0.5, 0.5, 0.5] + }, + "ground": { + "translation": [0, 3.25, 0], + "scale": [0.5, 0.5, 0.5] + }, + "gui": { + "rotation": [25, 138, 0], + "translation": [0, -1, 0], + "scale": [0.65, 0.65, 0.65] + }, + "fixed": { + "rotation": [0, 90, 0], + "translation": [0, 0, 1.5], + "scale": [0.8, 0.8, 0.8] + } + } +} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/particles/tinted_leaves.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/particles/tinted_leaves.json new file mode 100644 index 00000000..90f72c23 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/particles/tinted_leaves.json @@ -0,0 +1 @@ +{"textures":["empty"]} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/shaders/core/rendertype_entity_solid.fsh b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/shaders/core/rendertype_entity_solid.fsh new file mode 100644 index 00000000..a355276a --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/shaders/core/rendertype_entity_solid.fsh @@ -0,0 +1,29 @@ +#version 150 + +#moj_import + +uniform sampler2D Sampler0; + +uniform vec4 ColorModulator; +uniform float FogStart; +uniform float FogEnd; +uniform vec4 FogColor; + +in float vertexDistance; +in vec4 vertexColor; +in vec4 lightMapColor; +in vec4 overlayColor; +in vec2 texCoord0; +in vec4 normal; + +out vec4 fragColor; + +void main() { + vec4 color = texture(Sampler0, texCoord0) * vertexColor * ColorModulator; + if (color.a == 0) { + discard; + } + color.rgb = mix(overlayColor.rgb, color.rgb, overlayColor.a); + color *= lightMapColor; + fragColor = linear_fog(color, vertexDistance, FogStart, FogEnd, FogColor); +} diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/sounds.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/sounds.json new file mode 100644 index 00000000..5039fc99 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/sounds.json @@ -0,0 +1,677 @@ +{ + "block.wool.place":{ + "sounds":[ + "internal/silence" + ], + "replace":true + }, + "replaced.block.wool.place":{ + "sounds":[ + "dig/cloth1", + "dig/cloth2", + "dig/cloth3", + "dig/cloth4" + ], + "subtitle":"subtitles.block.generic.place" + }, + "block.copper.place":{ + "sounds":[ + "internal/silence" + ], + "replace":true + }, + "replaced.block.copper.place":{ + "sounds":[ + "block/copper/break1", + "block/copper/break2", + "block/copper/break3", + "block/copper/break4" + ], + "subtitle":"subtitles.block.generic.place" + }, + "block.anvil.place":{ + "sounds":[ + "internal/silence" + ], + "replace":true + }, + "replaced.block.anvil.place":{ + "sounds":[ + { + "name":"random/anvil_land", + "volume":0.5 + } + ], + "subtitle":"subtitles.block.generic.place" + }, + "block.metal.place":{ + "sounds":[ + "internal/silence" + ], + "replace":true + }, + "replaced.block.metal.place":{ + "sounds":[ + "dig/stone1", + "dig/stone2", + "dig/stone3", + "dig/stone4" + ], + "subtitle":"subtitles.block.generic.place" + }, + "block.stone.place":{ + "sounds":[ + "internal/silence" + ], + "replace":true + }, + "replaced.block.stone.place":{ + "sounds":[ + "dig/stone1", + "dig/stone2", + "dig/stone3", + "dig/stone4" + ], + "subtitle":"subtitles.block.generic.place" + }, + "block.wood.place":{ + "sounds":[ + "internal/silence" + ], + "replace":true + }, + "replaced.block.wood.place":{ + "sounds":[ + "dig/wood1", + "dig/wood2", + "dig/wood3", + "dig/wood4" + ], + "subtitle":"subtitles.block.generic.place" + }, + "block.grass.place":{ + "sounds":[ + "internal/silence" + ], + "replace":true + }, + "replaced.block.grass.place":{ + "sounds":[ + "dig/grass1", + "dig/grass2", + "dig/grass3", + "dig/grass4" + ], + "subtitle":"subtitles.block.generic.place" + }, + "item.crop.plant":{ + "sounds":[ + "internal/silence" + ], + "replace":true + }, + "replaced.item.crop.plant":{ + "sounds":[ + { + "name":"item/plant/crop1", + "volume":0.45 + }, + { + "name":"item/plant/crop1", + "pitch":1.2, + "volume":0.45 + }, + { + "name":"item/plant/crop2", + "volume":0.45 + }, + { + "name":"item/plant/crop2", + "pitch":1.2, + "volume":0.45 + }, + { + "name":"item/plant/crop3", + "volume":0.45 + }, + { + "name":"item/plant/crop3", + "pitch":1.2, + "volume":0.45 + }, + { + "name":"item/plant/crop4", + "volume":0.45 + }, + { + "name":"item/plant/crop4", + "pitch":1.2, + "volume":0.45 + }, + { + "name":"item/plant/crop5", + "volume":0.45 + }, + { + "name":"item/plant/crop5", + "pitch":1.2, + "volume":0.45 + }, + { + "name":"item/plant/crop6", + "volume":0.45 + }, + { + "name":"item/plant/crop6", + "pitch":1.2, + "volume":0.45 + } + ], + "subtitle":"subtitles.block.generic.place" + }, + "block.stone.break":{ + "sounds":[ + "internal/silence" + ], + "replace":true + }, + "replaced.block.stone.break":{ + "sounds":[ + "dig/stone1", + "dig/stone2", + "dig/stone3", + "dig/stone4" + ], + "subtitle":"subtitles.block.generic.break" + }, + "block.wood.break":{ + "sounds":[ + "internal/silence" + ], + "replace":true + }, + "replaced.block.wood.break":{ + "sounds":[ + "dig/wood1", + "dig/wood2", + "dig/wood3", + "dig/wood4" + ], + "subtitle":"subtitles.block.generic.break" + }, + "block.grass.break":{ + "sounds":[ + "internal/silence" + ], + "replace":true + }, + "replaced.block.grass.break":{ + "sounds":[ + "dig/grass1", + "dig/grass2", + "dig/grass3", + "dig/grass4" + ], + "subtitle":"subtitles.block.generic.break" + }, + "block.wool.break":{ + "sounds":[ + "internal/silence" + ], + "replace":true + }, + "replaced.block.wool.break":{ + "sounds":[ + "dig/cloth1", + "dig/cloth2", + "dig/cloth3", + "dig/cloth4" + ], + "subtitle":"subtitles.block.generic.break" + }, + "block.metal.break":{ + "sounds":[ + "internal/silence" + ], + "replace":true + }, + "replaced.block.metal.break":{ + "sounds":[ + "dig/stone1", + "dig/stone2", + "dig/stone3", + "dig/stone4" + ], + "subtitle":"subtitles.block.generic.break" + }, + "block.copper.break":{ + "sounds":[ + "internal/silence" + ], + "replace":true + }, + "replaced.block.copper.break":{ + "sounds":[ + "block/copper/break1", + "block/copper/break2", + "block/copper/break3", + "block/copper/break4" + ], + "subtitle":"subtitles.block.generic.break" + }, + "block.anvil.break":{ + "sounds":[ + "internal/silence" + ], + "replace":true + }, + "replaced.block.anvil.break":{ + "sounds":[ + "dig/stone1", + "dig/stone2", + "dig/stone3", + "dig/stone4" + ], + "subtitle":"subtitles.block.generic.break" + }, + "block.copper.step":{ + "sounds":[ + "internal/silence" + ], + "replace":true + }, + "replaced.block.copper.step":{ + "sounds":[ + "block/copper/step1", + "block/copper/step2", + "block/copper/step3", + "block/copper/step4", + "block/copper/step5", + "block/copper/step6" + ], + "subtitle":"subtitles.block.generic.footsteps" + }, + "block.anvil.step":{ + "sounds":[ + "internal/silence" + ], + "replace":true + }, + "replaced.block.anvil.step":{ + "sounds":[ + "step/stone1", + "step/stone2", + "step/stone3", + "step/stone4", + "step/stone5", + "step/stone6" + ], + "subtitle":"subtitles.block.generic.footsteps" + }, + "block.stone.step":{ + "sounds":[ + "internal/silence" + ], + "replace":true + }, + "replaced.block.stone.step":{ + "sounds":[ + "step/stone1", + "step/stone2", + "step/stone3", + "step/stone4", + "step/stone5", + "step/stone6" + ], + "subtitle":"subtitles.block.generic.footsteps" + }, + "block.wood.step":{ + "sounds":[ + "internal/silence" + ], + "replace":true + }, + "replaced.block.wood.step":{ + "sounds":[ + "step/wood1", + "step/wood2", + "step/wood3", + "step/wood4", + "step/wood5", + "step/wood6" + ], + "subtitle":"subtitles.block.generic.footsteps" + }, + "block.wool.step":{ + "sounds":[ + "internal/silence" + ], + "replace":true + }, + "replaced.block.wool.step":{ + "sounds":[ + "step/cloth1", + "step/cloth2", + "step/cloth3", + "step/cloth4" + ], + "subtitle":"subtitles.block.generic.footsteps" + }, + "block.metal.step":{ + "sounds":[ + "internal/silence" + ], + "replace":true + }, + "replaced.block.metal.step":{ + "sounds":[ + "step/stone1", + "step/stone2", + "step/stone3", + "step/stone4", + "step/stone5", + "step/stone6" + ], + "subtitle":"subtitles.block.generic.footsteps" + }, + "block.grass.step":{ + "sounds":[ + "internal/silence" + ], + "replace":true + }, + "replaced.block.grass.step":{ + "sounds":[ + "step/grass1", + "step/grass2", + "step/grass3", + "step/grass4", + "step/grass5", + "step/grass6" + ], + "subtitle":"subtitles.block.generic.footsteps" + }, + "block.wood.hit":{ + "sounds":[ + "internal/silence" + ], + "replace":true + }, + "replaced.block.wood.hit":{ + "sounds":[ + "step/wood1", + "step/wood2", + "step/wood3", + "step/wood4", + "step/wood5", + "step/wood6" + ], + "subtitle":"subtitles.block.generic.hit" + }, + "block.anvil.hit":{ + "sounds":[ + "internal/silence" + ], + "replace":true + }, + "replaced.block.anvil.hit":{ + "sounds":[ + "step/stone1", + "step/stone2", + "step/stone3", + "step/stone4", + "step/stone5", + "step/stone6" + ], + "subtitle":"subtitles.block.generic.hit" + }, + "block.metal.hit":{ + "sounds":[ + "internal/silence" + ], + "replace":true + }, + "replaced.block.metal.hit":{ + "sounds":[ + "step/stone1", + "step/stone2", + "step/stone3", + "step/stone4", + "step/stone5", + "step/stone6" + ], + "subtitle":"subtitles.block.generic.hit" + }, + "block.wool.hit":{ + "sounds":[ + "internal/silence" + ], + "replace":true + }, + "replaced.block.wool.hit":{ + "sounds":[ + "step/cloth1", + "step/cloth2", + "step/cloth3", + "step/cloth4" + ], + "subtitle":"subtitles.block.generic.hit" + }, + "block.copper.hit":{ + "sounds":[ + "internal/silence" + ], + "replace":true + }, + "replaced.block.copper.hit":{ + "sounds":[ + "block/copper/step1", + "block/copper/step2", + "block/copper/step3", + "block/copper/step4", + "block/copper/step5", + "block/copper/step6" + ], + "subtitle":"subtitles.block.generic.hit" + }, + "block.stone.hit":{ + "sounds":[ + "internal/silence" + ], + "replace":true + }, + "replaced.block.stone.hit":{ + "sounds":[ + "step/stone1", + "step/stone2", + "step/stone3", + "step/stone4", + "step/stone5", + "step/stone6" + ], + "subtitle":"subtitles.block.generic.hit" + }, + "block.grass.hit":{ + "sounds":[ + "internal/silence" + ], + "replace":true + }, + "replaced.block.grass.hit":{ + "sounds":[ + "step/grass1", + "step/grass2", + "step/grass3", + "step/grass4", + "step/grass5", + "step/grass6" + ], + "subtitle":"subtitles.block.generic.hit" + }, + "block.wooden_trapdoor.open":{ + "sounds":[ + "internal/silence" + ], + "replace":true + }, + "replaced.block.wooden_trapdoor.open":{ + "sounds":[ + { + "name":"block/wooden_trapdoor/open1", + "volume":0.9 + }, + { + "name":"block/wooden_trapdoor/open2", + "volume":0.9 + }, + { + "name":"block/wooden_trapdoor/open3", + "volume":0.9 + }, + { + "name":"block/wooden_trapdoor/open4", + "volume":0.9 + }, + { + "name":"block/wooden_trapdoor/open5", + "volume":0.9 + } + ], + "subtitle":"subtitles.block.trapdoor.open" + }, + "block.wooden_trapdoor.close":{ + "sounds":[ + "internal/silence" + ], + "replace":true + }, + "replaced.block.wooden_trapdoor.close":{ + "sounds":[ + { + "name":"block/wooden_trapdoor/close1", + "volume":0.9 + }, + { + "name":"block/wooden_trapdoor/close2", + "volume":0.9 + }, + { + "name":"block/wooden_trapdoor/close3", + "volume":0.9 + } + ], + "subtitle":"subtitles.block.trapdoor.close" + }, + "block.wooden_door.open":{ + "sounds":[ + "internal/silence" + ], + "replace":true + }, + "replaced.block.wooden_door.open":{ + "sounds":[ + { + "name":"block/wooden_door/open1", + "volume":0.9 + }, + { + "name":"block/wooden_door/open2", + "volume":0.9 + } + ], + "subtitle":"subtitles.block.door.toggle" + }, + "block.wooden_door.close":{ + "sounds":[ + "internal/silence" + ], + "replace":true + }, + "replaced.block.wooden_door.close":{ + "sounds":[ + { + "name":"block/wooden_door/close1", + "volume":0.9 + }, + { + "name":"block/wooden_door/close2", + "volume":0.9 + }, + { + "name":"block/wooden_door/close3", + "volume":0.9 + } + ], + "subtitle":"subtitles.block.door.toggle" + }, + "block.fence_gate.open":{ + "sounds":[ + "internal/silence" + ], + "replace":true + }, + "replaced.block.fence_gate.open":{ + "sounds":[ + { + "name":"block/fence_gate/open1", + "volume":0.9 + }, + { + "name":"block/fence_gate/open2", + "volume":0.9 + } + ], + "subtitle":"subtitles.block.fence_gate.toggle" + }, + "block.fence_gate.close":{ + "sounds":[ + "internal/silence" + ], + "replace":true + }, + "replaced.block.fence_gate.close":{ + "sounds":[ + { + "name":"block/fence_gate/close1", + "volume":0.9 + }, + { + "name":"block/fence_gate/close2", + "volume":0.9 + } + ], + "subtitle":"subtitles.block.fence_gate.toggle" + }, + "block.wooden_button.click_on":{ + "sounds":[ + "internal/silence" + ], + "replace":true + }, + "replaced.block.wooden_button.click_on":{ + "sounds":[ + { + "name":"random/wood_click", + "pitch":0.6, + "volume":0.3 + } + ], + "subtitle":"subtitles.block.button.click" + }, + "block.wooden_button.click_off":{ + "sounds":[ + "internal/silence" + ], + "replace":true + }, + "replaced.block.wooden_button.click_off":{ + "sounds":[ + { + "name":"random/wood_click", + "pitch":0.5, + "volume":0.3 + } + ], + "subtitle":"subtitles.block.button.click" + } +} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/sounds/internal/silence.ogg b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/sounds/internal/silence.ogg new file mode 100644 index 0000000000000000000000000000000000000000..263fd35e54ba99123fbc25089dbbad970089cb58 GIT binary patch literal 2380 zcmbtWe^3+I9e+VogdB~SGT{zd;x%{KBp{1t=U~Q83@4fmB5oo|a*mn>DS>dOh%+}m zJB%bZfSkkNZblI81+&pCWR=v!aqXcZL7O;?bwa!&+G}eCFRN%f)2l5v)4q+~&D>1? z>zm!T-}il=@2|Jt_kC|`W1|tIfme-7yCq4HiFBvvC!#|i9I!UE2@H|;rvUs1w(q_J zqOF4D_f3!#!BH-r|6!(9KnksI$x9Wl!I`SPhxYxvv>1g?2`WILM$phod{EzTU_G29 z;AH8$!en7fll7&XXz9!Ek8~BaP(%d8xKyslGh##rh2zN50;0yUsep);Rm$rn#x8vx z{j04iYA1GUCB75cSYWI&>M7g>DMD)8EH}o{26vm(@QHqfqGbzvFxT*SfN-Ie1;n%& zJ4M7%h{JKcyG>TUPf;%|uM9u7eq2&c4eONSH~)x#UF7Vs^n8Brbt7NokQth;XY6fz z8l1V0*}^iS7o7_K#i%@Tr*FI9C(x#gQa)z_Fi|7kxUEB&&@KZVK)P|i^ydEjP5nQM zrllZSAp8L3u|F&O-_-Zl*SQ+%T;7jd=PomA7TIE+eVXL59iNP*Ls=lJbhlTjIwcj6 z3Wt=qv-XUnLR>YKPgK9-5tnwY4fmCHSv1AxB!riJc=y<(2|C}g1isFiU*75gg_)qEWEtXw z0Ax(ykko*b0d*ssB z1FJ#TDp0by-&;5MR*%cuJ>1yCB)f+h^XbOH(@hN1ILO!-h96{-5!d{H7Y>sHUZ%&J zjH9WVEVWFy`laOYg%!X7^ZjAsAj4m>o#qk!NTbSjZA7z_) zM#GP*qT^^H^gPNH=O2HYVa_rvKfv$|)Xea+oOckaVvC>~2?!3Uqak*H(VS$}2`?WB zK-p)JKT%#@~&%im$YO z8}VmF1GAyA+nir>{`?y^il2OJc|i>_v!SoKlzJG)#r6j~D)0T{@J#6NZmQv{OU~U* zZ``=h%Z|YC`HALeWDU<nv7~*r_W)(dt#hQxfxE1q-Yp`b86NfmOv{w1UGW0D4OeiSPk2fo*cdAsb5; zdPq#=_r$DoL!Rt%b%7&>sZffvX89&-F`M5bCDiCl%zR8v%M92UMVjsCOx!%O?v?Q} zm4c2#1r5{sWZ}hFnbHSUsgQ7_Okdz2OK+VcNweBFnS*!xFG>l-7mit3B%E8JFLIG) zjc+n;?F|M^#<%HkKi;dLWR}s(p}0*9 zW?ANIbt}MoupCX5OvxOT$jzbSca@KZ+Hlo;p`#C<%Xdid$WUhuW*BIbV0r{DwaxFu zVHboYDKj5drj|S8&iv2r^ie>o0v*@)zq3WUeWv~J?lH|a)AoCm{oxJ`RfiqrS^h*q4o#gwC{S6 z_ggz3YURhDzbW4I)eHGwA1)r$WdN`hW|`{3-gd|F;jwG5V5WgQ06I`C&na8G8THDD zDs<`u;;#qVy>Ud{hj#`GWoU3b&^g(<|t^X1yYqBTyu6K%6FAuWAKL|R4X4Y;n~w~o|hC%y0$Pq^$rRlruROe_@%Ert9qD0upr literal 0 HcmV?d00001 diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/amethyst_torch.png b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/amethyst_torch.png new file mode 100644 index 0000000000000000000000000000000000000000..4e903b534d76a000a0e1264725cb81c92691161b GIT binary patch literal 140 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`!JaOTAr-fh6C_xhW#+_x_*tKS zZRYw>k7 pI;n9Ru1#KchV@z0qY7RIh7H=f)#pX!vVq1kc)I$ztaD0e0swGtHS7QY literal 0 HcmV?d00001 diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/chessboard_block.png b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/chessboard_block.png new file mode 100644 index 0000000000000000000000000000000000000000..9ae83007f862f4158ad2320d5fc4ef71f273ef60 GIT binary patch literal 256 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbL!Wq?nJtBMHEg)Iv%Y*=8UB6DQT z0vQ3G2PgKZNC>Ei2%K57KtlpZ&N;JVg91?5ngv&YD%Z?W5D~brWy!Af>}P?7G zhE&{g?Y}K{M1g~uIq2Z6+wcC@zj0fc{`r}Olgn8d)y<2$>|*t_I~XNnlyt@U3WKhBApz2Z)iMzI*FnGH9xvXrR>sQmow`0TL!^vJY?RJepx{QUT^ctrT zG-OG|{{R31JxN4CRCwC$lnbteAPhyX9}rLh-Tz|WX$_M+GfSAOf!oufZDQ2&l9muc z3ohFh6+|K>7W0CZkPM`)5U7zzlPgi$R4g}bXtKH@Pj4Y$X z4D!T*#u6_}b{rE7(BBdkZnr9|r4cO6t>~6)XpHJs>q}Z=j4irsTeTw+IkT7-bdT9U z)=r>CBG0Z&Y13}GS!lMpU7nW9iyTOUd;|W#&yhJlU>-3b4)Vm2#xgIT^E6F68&&>N^f13JFNA? z>MnWu8P1CwjPbt%f8giH(I0S(7*Gd!;!0zkmvuXisRroptS7fy+U2?l&f6{H(>#+h ls@vc9@%lb~|BrwFk3R-~A(MrqNXq~K002ovPDHLkV1kEy(;EN) literal 0 HcmV?d00001 diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/chinese_lantern.png.mcmeta b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/chinese_lantern.png.mcmeta new file mode 100644 index 00000000..3c559bed --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/chinese_lantern.png.mcmeta @@ -0,0 +1 @@ +{"animation":{"interpolate":true,"frametime":10}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/chinese_lantern_top.png b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/chinese_lantern_top.png new file mode 100644 index 0000000000000000000000000000000000000000..dd4403fc0ba452864fb59eaab48bbfdad7521112 GIT binary patch literal 492 zcmVYmV{P@hUctrgC?6ibbyo_AX$&m3CbU9z@ds{Ku)=x(IVBTUT z%;h0A-9Z4|EMn^^ePOw@_yrG=yDm4Ze;I;qYn<1>A#x0JTpu8u7TlpA*64^Y%z-a~ z9j{7sgCV3uWa!L9JZmkIa*Q(^W=8=(cbwJf#L3|C6?8dY8hTqMZ5uAceX!s#6XpsK z7jGbd&JHp6lpa_vu3^Q4FlIsfu&^;sep3)P`)m9oFB(LZD i`k(*DdHv7#;}qZiwI4n++b{b700006reQ>p00i_>zopr0P-F;%>V!Z literal 0 HcmV?d00001 diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/copper_coil_side.png b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/copper_coil_side.png new file mode 100644 index 0000000000000000000000000000000000000000..8cb16328fa3831400b8539534529f5b821bf60c6 GIT binary patch literal 137 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`0iG_7Ar-fhfBgS%e|VY7_y7H~ zi#!e~*edMhQAi4FI9gw1aEHNK`1JoL35#MGiuA0O^>S~xY4jnn;e6zm`Iuyl8T)4x*5OGTT=*L$J*8$CD@O1TaS?83{1OOhOGYJ3y literal 0 HcmV?d00001 diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/deepslate_topaz_ore.png b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/deepslate_topaz_ore.png new file mode 100644 index 0000000000000000000000000000000000000000..c054d4288daa47b1c3f944cb8816a011792ad9a0 GIT binary patch literal 346 zcmV-g0j2(lP)XDJLwf=nGuZb(Z6x@=l6aM>Bpb5=(X`aB5I4b6HN!^dK0>jC zXN6?uma_y_(pb{AAFS{_^I52*jc1k`?%l->2?%0I(8*VsvgN)hC3={bBwCJXOGUD+ zD;7qG%oH;ccCcMK{Ahv7;_e3uQo$gW@eo#Um}%H3m|`nwPK97o4fQM>i~=oUB{U}e z36It$kNW1(&uj8H+lxo-cOKW1dHmvk)H{!}f8jBz=(s+4w8!)K%m2~OH;?+_F~H+O sK^+{dEgm5Lokt(_&Z9kn$N&G253=hEsM<{{9RL6T07*qoM6N<$f-R?+D*ylh literal 0 HcmV?d00001 diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/deepslate_topaz_ore.png.mcmeta b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/deepslate_topaz_ore.png.mcmeta new file mode 100644 index 00000000..3c559bed --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/deepslate_topaz_ore.png.mcmeta @@ -0,0 +1 @@ +{"animation":{"interpolate":true,"frametime":10}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/drawer_block_back.png b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/drawer_block_back.png new file mode 100644 index 0000000000000000000000000000000000000000..ee3bf13d28e3397a99ccc98b5f6d4a00c2fc2243 GIT binary patch literal 387 zcmV-}0et?6P)Px$JxN4CR5*>5k-bU-K@^3*u(QHUva)OlDi|y*Vqqm>VK4X$K8Lk0;~UtjrD+VQ zERr%r(6A;9`I!NifW<76Nkr7CcF&x9@0ssbuCLDc&k?<$zBt|gqx-(|D(XqxI&3N# zdDYmZEes%IwV`+WBN6@s&g$G=1eA>2m1v~ZcDJ{iDL|$*U;m~*ykhknc%PU?S{19eYF}9~V;OdSMF#>ie2KA{i^!E7yz4?ad`HnSBmNbD+6X3uijf=~=P`h=Px$RY^oaR5*>5QL#$HP!v72FG5mNO43pgLj()4P^cDha8}S&HwPC-9i9CPe?X@W z&JGp&14VSQ1u2viv0y`KTv5L##-Hy)+|j;Qfafa`qykO!iQFmBEv1U#2XF#saqnyLf1 zx_z9fK0DgrBAj|C7mO%(a!`z^ukW4#XlhafC>IP?t+!7P%Upy$A7_oURLK6Uk@oqR zV71<6rmhfp^EjQ<7Auwj0H&@i5Fr9S$8j{K4XUD1!bg)REn$D?lZI8Ce2iPSGO?+A zG$D1x$+KFcdmj0?raPFq2??e@Evvt0|F}nlrmnDW$J*{rQCgRlh*cGhi;&pF&E-A- z&;N9LA69hqwR$002ovPDHLk FV1fW5ufG5Q literal 0 HcmV?d00001 diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/drawer_block_side_left.png b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/drawer_block_side_left.png new file mode 100644 index 0000000000000000000000000000000000000000..1b024e2877c376b281b4aaebe57ddf7a43eb5156 GIT binary patch literal 427 zcmV;c0aX5pP)Px$Wl2OqR5*>5Qqf8RK@>geY%rq>!^$E{X{Ny<1VKc95cCawN6-CCPklo|Z#_w` z<%3cgs4Q+nt~2N&^l+DPDWtsW1Os}(S;8RQ>hHO@< z0kBO$L7Vkh#gwsBt!9IQKP+x_V=#^^mBnIJsJc!u zQVZ^g{0=nCsDuQVR2!9$000@o>~o%9J&@i}=K#PY)-;YgV!2!bV7@F1UIK)rroAVz z&KpHI32PgdxU2|XYBd|g-fC{HHi`97rxdp9-G?VeOMmk_cRR~t!6LOVsRl$KJ(Ftg z2uLr}lj>j>B!K=)q!xvn>k9z!d^MUT^;%`C%T)5*9RRG`8v*FQ&bGGZ5$;z3d;yi& Vs1wxtC3*k=002ovPDHLkV1iGGy4C;y literal 0 HcmV?d00001 diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/drawer_block_side_right.png b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/drawer_block_side_right.png new file mode 100644 index 0000000000000000000000000000000000000000..b616e54c14d6d44f6f7d19c10744945802785897 GIT binary patch literal 431 zcmV;g0Z{&lP)Px$X-PyuR5*>5QB6w%Q4~FnZ-V!niD8Dpgf!E@A|a3ns%=64Am}%=Y~7z})o)N} z)lS+4xlk$vmBHze;|w|oEv`KW-PB#Z`|-}X=bqHv%?bV!?5!&=kGKCgU2pc7W9pT1 zUhuT4hS5BVLjYVCEA^MwkhxZd@^;@-y+{V?%`F2!Ip-1z0}#cb;3icG36@RM#L(`0 zVKfKeS{Zhtf)C0ICPOw7NRi=zF{{ zu2#t^M!HGk`4zyHEt1P9PguR#yS+XYJU#HkDsXXrxb7Xd4CNqmOkKgOV{^-ZTsplp z4iIOxeL_|G)IGQ^h|`mk)WiK10DnB|4ugEw0AQONR8fDZMRnF_b^)|LM(bB!iOP-x Z;0Ja7pTNvfHE#d_002ovPDHLkV1nQKy&C`k literal 0 HcmV?d00001 diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/drawer_block_top.png b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/drawer_block_top.png new file mode 100644 index 0000000000000000000000000000000000000000..b30875093d9fcb3678572fa8a33079b1e12729b8 GIT binary patch literal 378 zcmV-=0fqjFP)Px$G)Y83R5*=YQoByWKoA`KTJFN3$Wfpn5d}3B4Lt>4m7n1^=+jW;3s6jB5EjCY zkMj{kvCjJ9k&D^&&OUDU@4cYRCFxzF#KvmTT&i$mlli?}5snw=XC<@BxHGm(tLD>1^~GKux$ zd6L{@MG5B|r)OwoSRXohEk_l?mLxi?oSUo{5Rvt*^+R>*TVUWs1T+AKJ%o*lDKE>> zRoz8IB%9YN4!>Xt-~%C|VTRYY_t9O*X@uwn>&;edNJ#N zh;f6)VTY~+uEoBK9_CDnVY>W6;VHv1#~Ojz8D|xazA)+W-J+c^izAbT;pcv%o*%D` Rqk#r7c)I$ztaD0e0s!dyC++|M literal 0 HcmV?d00001 diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/ender_pearl_flower_stage_1.png b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/ender_pearl_flower_stage_1.png new file mode 100644 index 0000000000000000000000000000000000000000..73695f379b2a70871f959b644f32a4be0471b813 GIT binary patch literal 182 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPGa3-AeX1=7(b(GF4$HPJPBemVVx z{U$Rz7I)PP#0B!08<;4|cLP;0mIV0)GdMiEkp|?rdAc};RNP8VP>@z}$lS)mCeFqt z#xB<9^GrZN`HDl$rVR`MP8TC~L~yKexws*K@k~OHi3zJ#S^}qlP@9(|r{fX{5l1G5 Y%%$uRsxb`pKoc1}UHx3vIVCg!088{R%m4rY literal 0 HcmV?d00001 diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/ender_pearl_flower_stage_2.png b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/ender_pearl_flower_stage_2.png new file mode 100644 index 0000000000000000000000000000000000000000..dba763520584b2ce672118ba78ec0dbce72cc14e GIT binary patch literal 224 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPHF3h)VW1=2J7;-gKX9i$v;qHC7S ztz%YG;P!Q5votiB*`afGiW*Z=?jD>OL8_p4fDYbee2 zZC|RYxjRg4ea4wBt{Z>_XrmFQ+OZK54ZK*ZprEiO@ZWa7#l>YXV_kj_A#WbZ9MxgT;JYD@< J);T3K0RVlJWN`oh literal 0 HcmV?d00001 diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/fairy_flower_2.png b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/fairy_flower_2.png new file mode 100644 index 0000000000000000000000000000000000000000..3de58be0b19bdf818f432bd0a7bba7f8909e3d8e GIT binary patch literal 300 zcmV+{0n`48P){fpd?QxXqK%ZYmzXK!Z@4GM5Wh%vCGrTEa2Eh?&BP4f(zaN z0004WQchCE^sp>V->oG_f(C z&>}E#A%F@`IOe&+UQ@quBGw0Z2wJ#Z9h7d5DO^6FExgFP1x7%IAp8P^8$d+tnC;;J zB?>78B84+a>k+=oL+TFdDVU*bfEDVssGwkST^=l#@TQX`=qc0!| zka9u*O!)zy@jO76aSm9B<8;7?JiZCin5<$P;SI*b3c5-{oo%nES{q7QmhP`Uw%8VtHyj6=i=#Im^v+`p9rM2MJ)L<~^x4AlVb2F=XS tv#BP35J##}Y585h_zGR9jo`_fqFzC`-gO4G|M;MhgJTQ=_F z9KpwZH~;_u0d!JMQvg8b*k%9#0H#SqK~#9!#nIai!XOL=;GX2L!lu6e!%8>jjTB-u z@!yg)+Xt)wu!M{Nn8O0^xo=>valfG>w(A76gm x1yIE@)NYe3m;3s2=EZlF93Z3 znAzHF4+kVfijfdg|NCWMgI?w5;08$zXaem5wUJ0R-1&*52hcRw2ppf)1gwQQM&`0Q zpq?{`1LOqN1;x53?hIALHcF(9&YLD}PC=Z42!G52B%A`{=Vf3<00000NkvXXu0mjf DvxI

d z?U_aX)F1fpKSc6l4VyrEt2!s!f=G_=5C7*stgm4^V6rf}V_`!Cvm}S5;9ZAByazah znHqgAu*Ed;d{#Pnu}vsVAy~tUU7KQ literal 0 HcmV?d00001 diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/flame_cane_2.png b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/flame_cane_2.png new file mode 100644 index 0000000000000000000000000000000000000000..8988333d7863077e589c04c4ae0b96523327385f GIT binary patch literal 184 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`^`0({Ar-fh6BwHQ|KI*E{^7|F z^BKAR*(dy{U)57#$J}9jbp{Lb1)Ub{AOFvPu(xCWr{C7GFuG%5Ljxn%eiVfA0gUb2A(dqz9f6GF&V>ZAJAJ=b8<>w(j0}J}zL@#UD*pcIzsCt^Q=N&5CLDtxX!U4LGC9+*etwzntjarpqGs=S@cHDL#wi zFE|c6uDK@rGI`pQ`_-aqEp?2)`X9as{mj4oA7kyq1jRS+j%)-u($m$?Wt~$(69DSG BQ{n&s literal 0 HcmV?d00001 diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/hami_melon.png b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/hami_melon.png new file mode 100644 index 0000000000000000000000000000000000000000..862393833a796798dc10e4bd4a01f3a193c02bf3 GIT binary patch literal 204 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPE^3h)VWopB`K!JUkpH7+-f#5{OY z;4{JDdHb6sK-p4H7srr_TcT%9^Bz&)VLg!U#K>>P`k>|=%M; z3?4t^Co+WZ)|<#6xNd(d16%%U2ZrFfU5X4&5B4-NuxV9)VqfwDQCE{-7;w?umn@*XzeVeT(tUoe?frnK=!q=Lgm-cA2?LhV@?o66^i z#op7tkt%&sIq>+#rd3~5qGQ_1e9~nq?B}1X?|Pgky{y$vKfdYWy!>^Giptin2+#6q syCAVr=hLy>dxQ&K)|M`daoQ?B_atZUjS2Vf0_|n+boFyt=akR{0E~@I;{X5v literal 0 HcmV?d00001 diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/magma_plant.png b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/magma_plant.png new file mode 100644 index 0000000000000000000000000000000000000000..9a3dc134469ec80f9584a74de43a20905f0c7730 GIT binary patch literal 377 zcmeAS@N?(olHy`uVBq!ia0vp^3P7B|!VDz)cyd<*DfIxK5LY1W@9iHG6LY&>-OAeI z`5O0gA^h7yh1S?`A9vxLpvi7zY#Xe^Ehm=U22{#e666=m;PC858j#K4>EaktaVy!t z*UT^3f$e1G!4*vD5*HZS4lpzYa2!qJdMeG%z!}E2?MVQ08-qe~F|KHHNgxtej7Lzcm;h6zg93|$P{ zo256YEm-p)k3~AeovWGajCxnX)ZMHs3iFHt0~$_ftWs&#U}bX@Wi~jwVs9hoiG-kp zK!#5TOoTmj7c+G;OlFu6)_CCzPn7o_F+&LhV-3B+m_rO#auhCIe0ZW~f#j*FN4Te+ z5;SpNym&!Jw+r)iCjs594T&bT4}9c#UYu;SWUxKh(z~o*aE_gU1H(cV<2RSs8BVP# VY0+ZmJOKPx%yh%hsR9J=Wm%mFJVHn3h7Y>_pHEEJdPCX%3goLJ1I|LkD#I{&zi%?1_E$FNr zy0k<8fDV~D)Xt`KXtxf6LP{4Mgh~~I(V+xG(HObJrWmj#dL7K2i9brCCX*jHj`!a8 z_&(2b?{m-d3i0rOzM9_I*MLdZ#|Cv{O~X(`(8q`Mw3as`7!MEVS6_VkZzDvl zzMbUSFJg-cf&oYI-iqXqai=n@EGGbnEhfyD46*gGK|QVIc^BOz7-$6*R+Gz>1OQ80 zr_UUeintXS0LfuPa@h6+ie4uREfiEg*^L|xLlNQ1PL{2OS+*8tE8eK0A#4a3nwz?dmP2V+X-=O6 zvAMS&vC+k5D#NbJWlrS&WPnJu_0Kuy9E8$ZPO&5lcivV#{|&^?6Xk!pSgn+cSb`x1 z)oX=fD;5kX08G4kc5IC}OGHJMP-F?GXa5s~AK%j@hpiU+h*LjgW~S!}23mh1*K?)@9Uo_J}4T2%w|?_WrN(*XGGx`gVrQb|*JY6F}eJC|MM z=Yd)x0_M&y?FVXRz}(t?D;|p`4mF_F#$u$K(R$S?{R~96BAZ^f_-pGufDjK4=*dEh z`M@i#K*>3=+I^u2aJ^|0%uUz?#o|&== z$&g#G(a`h#+*MHt?c()}FQ4A;-mxropPc`WQ}4q}I#%9D5lJ@LE&ZzfD1XIvO-n}c wMbUpPSKF-qp!PJd^V$>#nMBpX7h)gTm$>qkA5iSy0<@dK)78&qol`;+0EatBLjV8( literal 0 HcmV?d00001 diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/netherite_anvil_top.png b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/netherite_anvil_top.png new file mode 100644 index 0000000000000000000000000000000000000000..185437b1c9391d6515a6739dc71da1c16388767d GIT binary patch literal 214 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPGa3-AeX{r~^Jucxn#k&%z1vxlok zRCtuNrM01^mcE9jvxD=LYd#i0m5e1pe!&b5&u*jvIcc6Qjv*Ddk`oflL`=lY5`dtL zmsgaK3tq5TVM^i~ zj$oZj9BCbvTuqW^5|rmQR2_JOQo@O1TaS?83{1OR%VEldCa literal 0 HcmV?d00001 diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/palm_door_bottom.png b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/palm_door_bottom.png new file mode 100644 index 0000000000000000000000000000000000000000..4734bea36146c9841f7b55003bae3cc2b29f82b6 GIT binary patch literal 195 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPGa2=EDU-7=$OK}*7ff{-I?TF&g5 zP!QpfkyFvoF(u`~bY7sEG*1`DkcwNjXAQXyDDbpC6h9if_O9#8ypK#y)l8Y?{TF`w z_wt(jaaO2dQ4Z>OrnKd$jYVtNLx-@1Uqq@;v8g&0n@m6OF;i<+_ll{Zg}W@iYtG+v rNZBi~!zg3Xzj(RbYmZdsY(K-D?k{j?PXzxnpp6Wku6{1-oD!MRs% literal 0 HcmV?d00001 diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/palm_door_top.png b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/palm_door_top.png new file mode 100644 index 0000000000000000000000000000000000000000..3fa6afd2b3888e6b7aefbf7457659cb43ed3234d GIT binary patch literal 209 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPGa3-AeX1=3q*mrpJVIkLX}{N726 z+7pW+JR7>FX6IMs=jTgo-0>Qyg0UpXFPOpM*^M+HC(+ZzF{I*Fa)DW4VOgPJVTyqW z3$r5IaTQfp1tudAi5ZO^JqrUG8(BMCB-NZ;S|oUyV|yAo)=G{ BLtp>^ literal 0 HcmV?d00001 diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/palm_leaves.png b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/palm_leaves.png new file mode 100644 index 0000000000000000000000000000000000000000..72b9532ff91b749559c7e079d9ba0bf938d0afc7 GIT binary patch literal 207 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPHV5AX?b1=8iE7TQsc z3RCP7+H7vj^L4MmH z>Wvnhx~8@yi08<3ro3I&2@|3tHSBbc&D_76|JL%&D^6X%Y}GG$X|Ltv`LpNAo#wY` W=Gp(^tMd$?EexKnelF{r5}E+dcS217 literal 0 HcmV?d00001 diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/palm_sapling.png b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/palm_sapling.png new file mode 100644 index 0000000000000000000000000000000000000000..277d1f08fa5501c56d9f7f0a91ff6b104e136191 GIT binary patch literal 190 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPGa4)6(a1=3|p?I!Q{h@WU%6=gf2 z#Mi6La%p>HoTH)hYyPu9X~vQuzhDN3XE)M-oIp<($B>F!$q5XMYHS(-Y=S)wYZ#t! z85nRjNILO2u_drAZc=hl-P|A*(!W7s%ESzYRD;8koB?doJ%Vvu3nODsGaumT6ANcI hXjWaaw6T$qLHPr_1*7o8J3zx3JYD@<);T3K0RX2~HS_=g literal 0 HcmV?d00001 diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/palm_trapdoor.png b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/palm_trapdoor.png new file mode 100644 index 0000000000000000000000000000000000000000..b2da75c948395c98efcb86f3637a7deb98e14e66 GIT binary patch literal 209 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPE^4e$wZ1=2^>w@)q#DT?siI=lS* z-bstv6Xyy&ngEnwED7=pW^j0RBMr#O@^ohlie?ix*|JLDuY{@pFN4Jz;khD~4 zTXwb6BhQF`+4Dm``<^pC32g0utsEGlc|2st@!!W-k0y&G=Li3{0ouyo>FVdQ&MBb@ E07CIoyZ`_I literal 0 HcmV?d00001 diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/pebble.png b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/pebble.png new file mode 100644 index 0000000000000000000000000000000000000000..2341c62cfe83aeea22e671661a52d3701d080e53 GIT binary patch literal 434 zcmV;j0ZsmiP)C+kT+32$80r6F9NU zdTi8)kcQYW`L%v*mw8Sa>rqLw^TR-u5&#Be%-1(fKRI{|qrJ>?qvA=a;H-`EyskpH znj{nuIG6bnlP|s;{5@slYra%8-$tUmFj2NqLAu{8@z=5;rK&uEeQ8O4Z?(7KLCMF0 z_a;=K>mWcc2Om(N_B+GH%!r^+EBBmAT&Vu_;#1=B6)S0gMk_@Zo`Ne<4!0#hnf@Jk1J`r0>%e@k c(BXCe0de6>6DwQ7EC2ui07*qoM6N<$f>)HlY5)KL literal 0 HcmV?d00001 diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/reed.png b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/reed.png new file mode 100644 index 0000000000000000000000000000000000000000..9152768a856e8322f1fc59eac2ae8ca7b2db6da6 GIT binary patch literal 360 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnF3?v&v(vJfv^#Gp`S0KHnGxf@jzP(!~UAeGq z`|_53YdWr6+;V(l--gBYTV@pByt-=J@+PJT`%Iux#*!evUJV$o0w%ryMmc3RHg>hdw!>T==Sm(3CR)@mxH@z+O1=wXT);5FK{&u5!G&W31M8ID zi7azu8ko8TnYjA+xOh$-(mBE8AR3gx#Kq*nV!gN>c74@Ef# zJ1=CqthBssXFVdQ&MBb@00{Ib3;+NC literal 0 HcmV?d00001 diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/safe_block_front.png b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/safe_block_front.png new file mode 100644 index 0000000000000000000000000000000000000000..a8bb018a84606585617a5cf19f4a3c25f8dd16da GIT binary patch literal 231 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPFv5AX?bEvacp$tm#g2?&WvFfg&O zuyN4PG3c2xXT^psH4QB(83hFuEinlheRr=G0<~0ox;TbZ+)7SJNNHfW79g&`!JCi} zD#pT;sNfvHprI#m;6MaV&;f}93O1Z)I8p=*dAJhZGZ?w>&XqYD&cS9hLyDU#YPvL= zv4ohUw6vzAwebrdQ#M9*Hd9ptkEDQN#*12>Jc*eKyDtSvvhX&B8E|nMwd`8T=;)=v YQ20ySAkN134bT}3p00i_>zopr0ACnE%>V!Z literal 0 HcmV?d00001 diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/safe_block_front_open.png b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/safe_block_front_open.png new file mode 100644 index 0000000000000000000000000000000000000000..7904dc8bdccda091e443889706220f7fc2b71e62 GIT binary patch literal 221 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPFv5AX?bRZvkWscA^bDX_3{2#HBB zFtO0kG4SvS=$SI7prU2PhAlA(88r5_D)gcN$2+!INWmZB&&|lp@6qc zVw~w3+JWqbmn2V}nabUuw%mBe(#AJl-f00vK_Vg|L4ipIeBR7WA;}Cv$)e3gQ=Q)c PEobm_^>bP0l+XkK=FUQx literal 0 HcmV?d00001 diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/safe_block_side.png b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/safe_block_side.png new file mode 100644 index 0000000000000000000000000000000000000000..c345df934fe434c66cac36cd105b3a52a488604c GIT binary patch literal 287 zcmV+)0pR|LP)Px#*-1n}R5*=|lD`guFc8K+8e)(T+B(TAI2d=08ehuE#V6Cm=g>I81T7&*m>do( z;ZOCZ-u3sT-}TNpp3VROq?wvYfnId#E`Zzh(&q+av)j9L;z9(Ww4g;foX)lZGVm{$6KOIm5xPAuHlQjur$%|R$F z8iO$abyb>@g(j>STpTA+G`DEtIB6`={OYQFKJM0rsTt)imMdzjvl?beKYO78aKWAR l_CSA37RO@Z`To=c@CHX6cL@gP87%A;uunKD>)%SAc28dOgud~Sy-H%O-xx;A)qWpAW(>fNp(Sol1JkNW@h7- zM1~{{E+@%DT>)(ZJ&GDEsSP61MjZ#XY(Bu-67jHMgUAyew*}q|rViYF5{8d&1I=gf MboFyt=akR{0JQTilmGw# literal 0 HcmV?d00001 diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/solid_gunpowder_block.png b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/solid_gunpowder_block.png new file mode 100644 index 0000000000000000000000000000000000000000..8c013826210cb4143905b92179a54d3aa0404a22 GIT binary patch literal 72 zcmeAS@N?(olHy`uVBq!ia0vp^0wBx*Bp9q_EZ7UA_&r@5Ln>}1cQ`QfC`U6e96l7m Ts1+dp6r{w{)z4*}Q$iB}-*yka literal 0 HcmV?d00001 diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/stripped_palm_log.png b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/stripped_palm_log.png new file mode 100644 index 0000000000000000000000000000000000000000..67d008f467b96bb1991d926835868d2b674ceebb GIT binary patch literal 184 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPHV5AX?bUD6XXry*oQiBCgsr9w)MCGU<<<7SzP0SXT?%~4%odqM zu3B>R=-Rf#i6B1&%|)sb=|4k(ygA_9aeN7^9Q}E583{X g?RZ$a^vZL2<=@;QODxto0PSP&boFyt=akR{0CK}e>;M1& literal 0 HcmV?d00001 diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/stripped_palm_log_top.png b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/stripped_palm_log_top.png new file mode 100644 index 0000000000000000000000000000000000000000..f06fb497d25c074b6428e970f45411f02463736a GIT binary patch literal 203 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPE^4e$wZ-7=$OLP5xamV_f~T9&j# zOepcGh_JCuW0nOfDD-r345_%Kd(N7##ejz;!1}TQsc z3RCP7+H7vj^L4MmHd=n_@or@kP!TY0Pti0{LoDNv^f0mu>7DXZp}450002k zNkla&0c=)_U=@qaM-a?{W|I$K zFbrcX+$fWjPPS`oC8 zsLCUN6T?%U0b*@d00ON0E3s&lhKbf0e|uu*Xe(q{(I|*xxJ()}IRd#%bVPg_E9TXdV0C&#9Uaf8TF}agNsxAIC4cRXWRW SkjC)<0000HYaZfQW60^A+A9BK^ep4NQVDMRX$D> z{{Oo6|IfYu|NlSu{i!ifjslI;Ml38G zpJuj9D?YEm)bMe?;%1H;e5?{rcsqHHGr8IY7PaQRP;1uYZ0uWg>i2>za@yHX&(C~( z{a@nsyZ`p`%{g72o5Jt@FmYS%41;ZNt^8LB2HVzVd|`f-D<1pdl6DBtkqn-$elF{r G5}E+nW@!)r literal 0 HcmV?d00001 diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/entity/equipment/wings/flame.png b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/entity/equipment/wings/flame.png new file mode 100644 index 0000000000000000000000000000000000000000..0275ae73f8df401cf0570377a57fe9ba4852ca9f GIT binary patch literal 280 zcmeAS@N?(olHy`uVBq!ia0vp^4nVBH!VDw>HYaZfQi=gSA+G=b|3Biv@c(t~*S$*5 zItBh8Rrxqk_(dYaW^0BAWeitB8Q4r^41tOnOM?7@862M7NCR?~db&7PM?pfP z_`y}5K1~(=ppg*2Z_g!F#?>JVEvx3dd^D-W|Decp%{;dVQH=v470VdBZ|< zKIh5IW5+7iCK&s9haF01jo!2|Q^QU;BD7FdYXuYA(hCZ2xDpPEFIghh70#F~&{$&4 cb%K%M&|kTOFFVdQ&MBb@0J7m|VE_OC literal 0 HcmV?d00001 diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/entity/shulker/shulker_white.png b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/entity/shulker/shulker_white.png new file mode 100644 index 0000000000000000000000000000000000000000..21e5e1a018133857fe3f1a4918ca75ab6944fe4d GIT binary patch literal 1122 zcmV-o1fBbdP)Dzudv0;&FJgwrmL*a)z+)AvhMNm(%9LkuCBMe zzOJ;jvbed}-QM8k<d6W%+lA`i_@$ zT+ENe0000fbW%=J|NsC0|NsC0|NsC0|NsC0|NsC0|NsC0|NsC0|NsC0|NsC0|NsC0 z08;cIhX4QrNJ&INRCwC#R@;)JI1CjAj6<4`Cim{$oplWI{Qnp3kVnfC8f)Lb zEyoHO(Sj8-{3U}J&+c>2E-jSEHfq>yQ^`nDlsJ%)VGhU`60+<$et!0n5hs~Zl1vEU zjY_f;_csGRu}1w}4Ii9DGDx>+8aV7(4e~a~h!_Qs4K*3$ZEADWpfP?sG({Ho{6%h@ zO$Ygi)<(@{viP$Z6&atlIGvg7(yy|CY{me`Py@pg;t4fyyq!gmK1pX85o$7JctRh1 zFij5IM#E=v_z=070({U7yO{hxNdNYeb?-^m-2*+njgQo|fevkZm3a+7cbMX@1Hd@M zJiY_)_yt0Id9RPZ2B3{2#(x2z3&nUPgYLx)UIpk&xEi2+v54J*WBjF&u6-LFzS&5> z>BR2ER{lcY16X{W6G{RN$^;6kYntRFsWC>mp8O*KD`us}14tmwWnyvQ$drF92dD0}eC>_)$rM(N5(Bn+bO2Mwjgl|0*ORM)lXF z{JYfHao7>_zq-7ZVrN0D81^gabIa{p;0k=ZOtSF(BJ+Ez0-s@r-{I{r+Np%)4Fk{X zxjmOLJZ6`A|x=t4&I) z3t9Ip`z3&dpC)7FoI9g^Zt*K^!?KRDZfpEclugI-#Y~f3N|Y&h;w5;5K&e2?S-uJm zvayuD#waUAo|v;NGoPNFZz6}FxVaF>5>f7~PkrCt^?PSEQ056fjoMo{v?dTu}XQs*nm+ppcX52cFM~;8FFS!iuwx4oLH+pZ^ mZd>g$mtV?@Tz-RdUiSl7@s*1w%YR@10000Fv(eJ)J$}jGg8nU$WIbaDRz2{M&({#I4Kd0M`WM4Mi?_+O%hUK@Ly-47%NDpXBVO(&2mjNWe zRc!Xo!e&3SJMaDDiN#KsN)J1D9Q3f6CpKFJ`vN&Ano)jxjcs_s!pT@txk$q$jz{UfzDH(t*p+o4# zln&=N?c_!`HUV~5d>9*3LTP7T0@#>2!W_r&>ySJ-eaqTY1h_;lCA&z^U@^|v4=aam zN?%2EWUt;C`}A#`IozJh1>U|JdwFvU?1!a;jmVF4?#I~|+{y3d_#N19$fbLdNwc$} z8ynrMq2zS4&n5e8-^~-mir^C`dwwvRRkSDQqCE%Eq3lZ^82lm3pMy4lcl1+NE6O#>=NH(Uu+2;kqMh?#7>7Em0<_Tj5_Iw{3n{9az zJ8N&t1#R>sgq?ZV$sEnqSQVL#_Xw*omR4*Ufz1*^%?*gN2{;}wb$Z#n3M%I`fKJW| zNbM+Wa9fNiJODT0x}$gkZp&_np%Wp&HvH=0iMX2(wz3ksUsV+DjvvsL8CPBDuJ(0` ze!3Hs(4y4M-k4AozD!r_aobqM*}C7#5-)q{X3q(R%rpGnOWE_jY|N9*@Vg{VLfMNJ zwtQFfy9+yUv6%xmfD1Dxe;0z8m4G-J#DPQ{d8;fj$~J( zF6yNl8mpQc2wxU!yJML4X-l^2Xw6_)-_^sYADePB)IT3)X0adX+(!-an{8||Yt-fg z`#XCP=k~H-yZ70UW@$AXP~lZt(ml+3o|=_5#26b)y~RYmeP|8 z`@m4gOC|f8I=;D5pIX@`J3C(bZl8OceN~^jdNfb19dOAyQ>lH*J`&gc(vf{+|JT@h zpS1v;FIntwdY?6;`=$CB?Rary|Lg3#p<+GytLeWLG#=x1#77h4@6l?w_y`wpy002ovPDHLkV1mBI4oUz3 literal 0 HcmV?d00001 diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/font/gui/custom/campfire.png b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/font/gui/custom/campfire.png new file mode 100644 index 0000000000000000000000000000000000000000..2d00b20c014ce8a8583176562320ea0be45c7406 GIT binary patch literal 352 zcmV-m0iXVfP)YuRZ*93KdRjXpG&Ha zyO6c_1%3VkW{$+n>)Z2?b9{HJ}Z$wZ9>Oz$i-LLzwaCKY< yf9PwB>tA8jVdkE$U0i_@%0d!JMQvg8b*k%9#193@2 zK~#9!?VHbQ+b|TzbIBjjvcawqD&%g6@Nq(h9k*gPtk<%X^%^p>(s zPqO7aD@qp!z0x20Vr<3o`{?P1QK#Uwg)s#x|*!(LT9(hVM=GU!R3{cvCF>6l~&e+-B{fHk3Cr{%r57moSSvoEQv^L z0@jGFT*r6VjoS@dR4cnw>8gUYn2RQD5}55eZrHff8@DYxNk#eHc&vZGTC9Z78pH6DMZP>#4ZGKdVNK28fbQ%&>&2DYL-lG0A>@U8P&9GB&8t{6l z{f1^2{dY8HSbDYP_fV5do>O?#hv>@iz8>OTgNI&3bv zgng1R4jX<18=C_Rv7sn#isPmNk^%d0<;EK9rD*`EaUC|(`?xL}3hvLAN;@reDXhx| zny!#EnL5ogJDC1%_R1cT!|~b-T;m$UI&H#Caomu#|A^g=e60IUW^OD@bv0Ypz3VsB z!;np1N|p7v?&QY8^dc~nVoqNM)|SnKvn68x3MnGZwIwN48KX0}qVe`m-VQfaiW|kd( zu0rhKb1Y&9zcxG)o3c#^`;u}DK2J8u_40YMISE@v_RC`v+#}a)MRISiT6XwnlE-0F zwh6)Wj%Cw5lSFo8NA_!DQ_fZKy7MBgJCyI)rey5JV7ee;Pk}9R5_UG%?~xZI?5TN2 zEeZm5F^}IeBKt{v-_h*gb8O2VEdyT~#;4nF|L+3FEc`%m1@BM7>WxIPEyo9J_(Mcc z{E75OiLeLl>$T5PavXnBAHw}?oyqsGrKcK_p%@YHoAJK&-hVj5es2d44()Q(FY96_ zR_@$-FVEb7p`KZmecgs{7VS}m8`;@2>zf<*DB7qZc`@%stsRljfA+>p5bS&<#t zPmPVwSqIQN%VA&RbGEDgS-UaX;S|}A&Yn?eG5GBJTfqatyk6b=AioC%o&Es}wLHC$ S7o6V!0000v0{{R3^=7T%0000XP)t-s|NsAz zQaqP^hg?28xN|@WCN$v9pv0t`&Yx6yVSG(UX1>y;Hvj+t0d!JMQvg8b*k%9#1cymP zK~#9!?V8PM8!-^aedz-Tt-qNE(wEAe;bXTU?)s01R*$+#S zX5;65?CFlAnl0R6C(Cw)Bl}*nblF0<4pQtNugYFtUcNxOeG<>tsNafxTjsaRn$7du z+py<__%F$0f+TP)TmELAiCsvQZ^V{9$;dW*A}u4^iIexrCL~`FTI_i?c46fX$!lir zWVR#w$Ud?MVZ(523QX|XU~CF7m`?>cs5>0xYgwH8}WFB^T$4)6()o8S*#HegPs zkL8kl9!d5&_dDc(x#YS(BE;dvV5*|wYaBS?<&0RJ|2}jhde-Yl@b`7JpQqD7N^!Q0EDcYOugF zlrz<58>Jh_;~9S0(}n%irVed@rjP6J4u7)=SDxe>vuUzul+T(zTgrN|vHp?CnR@PY zYsT=T`Yd%@7{#7UTK#IAVIV9(U@B8g3i%_eOO*0N21Lw~mB%Z;{F zLD48%c!?&mNid%$O18JF|X;b2)_O@VaeM0_r*0EI9I8{IS#@c39IVc^a)mR!_ z#~N%}aI>Y$m7fLwLC{&kNsyHIzOJh!ZYfVGH^E2 zoX;fG!ScHEoj@%(deZ6fP9XV(!2j`HYRGrdL%u^F_}%~Uu7&5m&ro+;-t&DQ@tec( zg?k5zXB*8Td@syQ0K?*%E}gq_7q#@_+`jx4*;KRdn(Lco)2p;^c1AXRx9>fk+%~-~ zugy!02~F0WO0Ac5u`{9R$Ud_FHMX9!79hIGV&CaGYg&Ahdq+E;9ocWrz8}igqpzr9d9xA)hkf!C1cluy{L++691OsD2sAYl?EHQ!acT> zt=Nl7u%GKv9lQFO9aX{3O|~nXv&}-6vMGCir2hU<34fQxuBvuSamoIm$8%Yhwr=of zf+YJlRpO`9=@%^QCtG(}DBU~BE?>&B7HoYFy$m(bn~Y)Vi6d@-+(&=V?06}I&p&dM-(X&7 z8SmrP9qnuA!_gq!SUAMhEt3ou^|c=xx=6zye?osYQ--^&Uz}XM67KD8c3xN#+8Jl; zr!^5Vzz~16S)OpReq-#b*BRll!9H`+W```dkk#X7%6?kSWImy?zklKm_&|tza+~EA zvYNe7_A8j_{5>bqyTm`q5>8g&aZ87sCi{~leeh2XIl?KM4T3Mu#AYMf3vi?TJs$hc zW>e`=c4|to*enJ?gw68;%3@C?8^v_9e8$`B6!x{nj+doKTsY%5MK$*riBCc8~HOQ6xZ1Ay+Z z5H8$dd;Xs3F<=7wdlNago=*-sPFC4$V6mmg9o;CvhH34*$>zd=%@+Aqv9FWaOw_@s z;d4Glf!p-!vtbJxM%x{;$9Ac_P1*W4O+JxqV6wZ~9c(4S15y!SH7*C@#D^huzl$2_Yx!$>hwc?l=5kr*!Ku=x!zDaXQuL8h%6p`@}*oXg9OLB!Jq zItyDQYkEM?huxX0)Hp3a26-WM&MB#cf_tz*(}D!&!psDn&juZHcq&1|lp%c}pG4*# zjp^BZe2Z`8gR_#&BX1kFv5W?wJ%_K?SuLA}{dIU%v&2oXRaZ_OdVZZWZ} znKic_T8r+mjHRP#a1DKwMefMj|ByAn*q()fvi}Ece{ahmc4WWLAa-QG&vhFOfqm|~geP5Ve0W8bAbnoqzyHnDqH|~a^%u9;>Rd3&1>tC(iot>GNes}jhF23kr z-Iw;RwH}w8J(b3<+%0kWm)_a$?Ef0utg{Xv`;x={YSvlX@-O*&w8yh|_P@^FoXfV8 pUqk<`Ah?aU!;T@yACvX@>>sk8JD41EG9>^2002ovPDHLkV1js_Z9f12 literal 0 HcmV?d00001 diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/font/gui/custom/item_browser.png b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/font/gui/custom/item_browser.png new file mode 100644 index 0000000000000000000000000000000000000000..27c53ba5ca83b5767e5205b5c0af3815b88ced96 GIT binary patch literal 1000 zcmV>P)i_@%0d!JMQvg8b*k%9#19eG6 zK~#9!?VHbQ+b|TzbIBjjvcawuD&%g6@Nq(h9k*gPtk<%X^%^p>(s zPqO7a+e&8_z0jumVr<3s`{?P1Wy^jUjocb%{q=D)OyhjsSNUFc*NrE#9iUm>(z0aF zi@utdYzJr-H8tIona=N`ev0R%!PRx^K$m@+Dy?JyyRx|dAA7n{n4K>~zA)>&S|SnI z1gsHTwH@!UE4M4QDAsl<;&lOQu@F_-Brv<}xMAZ)uiUomC>Hs5-BF;s;)@eu-CA+o(dyD#0vA?)3Hp7m=X~65H z^c$*q9hW7E*0#P~=9iYux;ii0vbc+**en2vVyJ1@z)q8htNOlh*kiV8X?Pz*YOuNF z681^PIBfV6*w`Fkhz(hBlN~n&kPO)Ul^ScXm!<-w#x>YX@8dde$apwgD($q?xv(Z1 zXu3es9Mox^*v|BKyI1y<6wcRX;2PH$)~FL^vg3xV{YUJ&=VLuI4yMM!6j!r#*_(bt zISkpfrBum)`%Y>sOe+FIDb{LB&)TuMceX_AUw(zzADCbLMC{d>8OTl<^OKnD*b`Qb zlFV0PwPT-E`%Zl&0z0q+`_;0^#;WON!aR?$Yy}VFnthv1m~XAJd(ED15(0L5bq(y> zG$E*yG`R=%MkNGonX0QLOgVw=zYnHLPlCrpY(1kLt8)VO#mi<(5;hO)BV#iXHnVL1 zV-;e1A7c^Q`@P{nY|1(zY)i^M_%hif_sf^f<|J$x*vH2vct$SSisac|)olNBlEbhm z>x5vwW7%|blE4n^z$iVJ8dy9(hT^o|$*l zA|qgDi|{QYu%E^E9nJPW#@6h!mFHW-{0u2?Xr{{$Dfp^a5uZQXWfIXd}S5pB(dM@k@yy=TQy+*KBX?vFgTX`%_>aoIR(~a`f5tw}MB4d7XN2L4J=iI{gEw Wx-yhNFz09h0000)UL literal 0 HcmV?d00001 diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/font/gui/custom/no_recipe.png b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/font/gui/custom/no_recipe.png new file mode 100644 index 0000000000000000000000000000000000000000..4284695e44bd7edab2494ce38ea70191d3fd1c24 GIT binary patch literal 994 zcmV<810DQ{P)WVSLV?RP8j{;s5{u0d!JMQvg8b*k%9#18+%0 zK~#9!?b}Ol+CUHhU=I9&6=;8eCA7X;L^r={D`cj$)C0(HW~dFc%vk)QxUr z)tW%!Rmj>OiZ#C5?cPZfAFVBly!D+t5^*NtjcP+9H+H!UEMHLHtbNtBv1vPoq=8qH z$s5YNiOna8HbuR=7C$fSX**8Ly3Ft5DAp4oQ4E!a8+cGRVq5RCj^z zY=`5HtNr}wvKdvh?S#x8HMSi_8})66ID#GQU|P=C;x-ZrJmE?wOv8%)6+YQj|7w%XH2o>JzmN^)xL+aHY5mNlC;?}qJC@3C7=9x?r7hPCy&tmU23 z*__pFE|GSE$UEh(d5_SxtmTd9Cx3@6>-Cm|Hf${1mo4iyC$*v1?e|rv{fV{vzsGWQ zoZRnYIcB?LXj>;<92+F1t%}0-$290QbhgxcRbC#9`@f~2ZEiOfjz7>l+k2d_-m-iX zuD)WC+IBx{cCDQ8l-gE(Jgt2U+PvM*0ezld20Pfn4mOGH^E%tYo4p<^)}HJI*uv8_ z)0Mi8y!K)*^fhYXVh}PUc&UI!3J3_G v%MGuv>s+`W$8KoGC9mI<6WVSLV?RNJ_&Xk&wI=oa4q0004WQchCuw%4<(Ka+ajYgzqxA>@-i zD^uN@_ZKPGqD--qZJNQ^-+wUOS7lp3^H|f8vy+f%EFZun-XIpxJXE!}&ThI$7MIkj zvABs#W8NTV=URrzzCH=4hKuC$c3X|jYuuHw_tt@6|J`mkzc(3s6cZAXIHpIIfHPdo zu>;+3gU!vR?6=!3t4i6cG>JzfT_tb;70z);;9{Pw8_wAIM(1Wz_7&@Y8T&R4S1W*q zaDdTpUJ*i6yMwblh_kOmi$jQ+j5)|l5qAar3rFNNSd)_9jGr*-#Gii_OdOK zn?K-g?(aBGGB=0pkNSH|ZsR1^PgH#r?5U|EK#oG`?=%gQFiF9|2~WUzoMr`1E%i&- zmHT%wdoqB326;hSW^Gcre+vN#a62}=GSS(ao6Tl(GcFxZH1>d6S;DS74wkT~Pjt2v zy#XH-Rf)SBY{e&3g>2dX`M|3Tga+H_CmMTKwRGNTz*ei4%Enep3|(fG%VbZ2wlvV* zouFN*?@r6=*d4oLckGUxvG>*<*bt0U_VvsIdv-_Jd+VVG_Q}~fu&+;UKcGr&czi z#W6DtxCqF|-X7xVEN*kL+0#bC=h*%ZVMS48HuJ-;OvuTGgO{nw=ARMJ8=iQ;JYi|d z16igLdvM5}aewm26UY1Fir%#`mSs$b+t^d?z+;h^KJvuG=!6Hd%!A=J8~czKKM;xi z2a(YF63UhN8MMj93cFpqHMZN|!=^rYF#E~L)7h*o6}zMM*f10*Y;BSf?8%etj!?1P zg9dE1jL}bCD;ul+#x1hpWkJ5!SY@LsZ1-3-)rW7i8>=ki31{cy*y>{}%t*U27CGbC zp*c4MrE>!_T$I6;*s`VMe1)wM3ca|S)36@j6|z}jF_~M?Y*a;ZGS;IMH=Ba9xQDye z68Yp}B+EqaVn^8!N{8sk5zfl{Nq99j!n^Q8+{+n0Bj_TS#YmOy79kTIOOZQ{<%S?L zgemZMW_ZNoK9^`8kL;^}LbfwD*6c1@1NvNFcI=Mbu{(AvY@grR=HA%L-hAnaJqPy4 z(>GH>zauZbu;=U>^~lRNYSR7Q@G@+lzeW4}4c%NAH1S8-o`r^H{|9VyZ%ZR~$$ps5vvEN5&(1E!dt6tW#u;uofQ(5Xr-!N1&ORz8H_RX0rHPd%?*39~% z?|U3w$WkAPx@+wTS=ye;Tq%7^T>Y$$-LYRAJO9pVfZACa`!fH|s;Zx5?$K^f9sAkY t3tw9HKH2_Tfpr^if$nXPuf3T+{R4j2FUWI??@<5%002ovPDHLkV1j*Rhl2nB literal 0 HcmV?d00001 diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/font/gui/custom/smoking.png b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/font/gui/custom/smoking.png new file mode 100644 index 0000000000000000000000000000000000000000..924d28d14cb9de954ac70e3e0e3579168002262d GIT binary patch literal 348 zcmV-i0i*tjP)D_FRQ2)bcJ-&=xu)iJ zrA@x8=>1b+XDl9sAzUD!&rkd%-z$7slY+m(|Jq;~=Gng;h4rJi47b7z+zP0b-RA;+ zq=YgY38m#o%q>zxy`(1vY=6!0BoJc?C=oQex?Dzf<4Ws-JM1(jCOA$B=82g~7=p9X z*^vk)M6I)&UGj@GXc=kAr6U3abY`_xn_s}zl%sV%)f8)HsLn>$pP0G?KYhEk{-R|M uH~fT6Y0000`PkhDNMXmi4e9;!Fo8N18W=BDTI_WR_mW0i}Z2rt0K zf7)6rxHz8lPJa7O+CK3uNk!Kx$VO@aadlqXntj~ljkO;fLuU>LkvrizLHZtjjZ`<3 ze&5RaCHQ;H$3GfIWIIm#|K#)v>zO`m#!n4v z4gfk|tTx$)ODrvJAg$u!de9Z2%glljEi8cUcBJtXgS2YS^n&qF*wkn)b0{wb*P^O} zHr2p$eCHFsP;A&UmW=eqU}$t9Df#J-V=Yv#9*dFvOO)@}6T^~0@Z4j}dFvwm!{^eN z8BRU7D#lWXL}o981y#3%@}K*v17)WYFB8|3iwuk^Igv#rEE5x(TwXsz@+|D#?Zta79|;Gw zadAt_0^%9s05boW zi?YP(H?*dj{BD_m2kMKb8Z54zJ8!_|7l#Y_&Ww(0fu*`u1ZLhU^U@#%JFqXmZEmXR z0Ehi0aXH*g_CFgj-~d<%Q9Zn4Y6PMbqS6$;;34tghqj~X9sD&b+?+Npz9U#)Hamrb zpsh3lP+|j8I*MSMX{DUHmW|8L%;F#$<^v>kSKvTQYuRWM|FcHj&_ohhgs>Kp(^39l ztx=-K`@}NCBuqeAI~;>OR2}`qH5w<~{hB#?y|qzSbr>sqewc8`{uYNTco;X(zF6y3 z6hFj#PlLSi^krl-IHg(m+edYJ8@g9b5blA!rL%Z5cM*IzMa~87uem{(uqKMa(nC>-j3iX5bp5PrJXCa|PNU`qh+dU5%!s;) z^2USspkiVnHNr~`>P?>V$yJCVfRSn7@ZXIoqeuILx(pFD(pdLqJ%93WeLQyZLv5b$ ztILrMhUY>}#f6sk&R^=r(^?_LczS#l=^$7=vpHozQ%5f%fjyB?3P&*s_~GrQQ_k~U z5+S-Dizi$P)NHTZ_F(y@Eq~U*T!aACwDA4vUt9=&2?CR|z`VsPkGl$h^{RWuflv1^ z5|UtncO-353cMWK9yNRT47UaR=oQa<0%V<78!0E1cpYQ2dmmcfSPe6rR44u+h%@JW zq?;2EJB1-8pCTRPHgW-oI~QWsX}E19-x>4XjiFiY`uL@xVyUj6ZGK@U*MC&cwSS*z z@5PR>Uri#PP5Q(_V>8cw96nkP#Zy)3-Q|(ePL;H5bXlc@SM@I$WwtYvD4=fP!Pp?j zd-X#LE^qvPCf@z4Ak?P6j`d2|O6p{(>vogZ&DLmi;8(3FkIazu2$A%Ahh$${0js tWz_pl&b=++$!P*yvlzFsp-CsGHczbRJ9OG(a=7bT-w)v8gmC=k{|1LSx(NUP literal 0 HcmV?d00001 diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/font/image/emojis.png b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/font/image/emojis.png new file mode 100644 index 0000000000000000000000000000000000000000..c3bf1fc55a535659bdb0fe62d1ddc9bdc27860b8 GIT binary patch literal 626 zcmV-&0*(ENP)eN9|ol?TlOg^T1~c zf8YQB00DGTPE!Ct=GbNc00HVrL_t(|+U-~Ea)clZG%;1<*R}8evJD9!aCr5!GwlyE zCo^lp3J$yGn&v+Q#5jo&TMa}wgXKo+BNRMga)@^F4Ych*c3D9S;LNdr2iG4U7bqPY5KZLnN^J zjbM<7c^+K>;>ez$3llo<*b_#a=Y_y+F(K$sqYD#$z|4j@5cK_rM&H93eElfj@vDBo z7yW?kWSsE>D_}dDpjKd4-4AmA*a}9Im-vW10CxPK@C#W|DDdxK3i_YJ**DBw^@~#f zFwK)~X`UQ|^AGa_?;xdLl!gH^&*UpiMiBg9BS`&1^=}1Ut~2_W;D}$S-nHPU9~AiZ zgXZoJ4)zBrh9QaA52*f=en7=!^0mckUKd>>uo*;q{Xy8W$HQ0Y2gUbarLLm)SmvS* zp5V0~yp5~wD}_coLB;J*EG zoIQp>2-W`+75$44S{;HvM23LLnv&Qb6#AE`f`=h#aS)Rhhs+P?4L^|T$K#bBVD1N{ zKe+gO?Bq?~>ze7^>ovtf@S;D!WyMSV!LlyP6+e*q>$+U9Q7kcwN$73>TQ9~j=pJ`B+T O$$Gl_xvX;M1%?My7^OC(4GMVLy0 z{DK+2hkC7Q2lAvnT^vIyZY3uyF#o~NF7H;kcu(Lxjr@QQFSr@r+?~AajeWZwP#J@# LtDnm{r-UW|L4P5{ literal 0 HcmV?d00001 diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/gui/sprites/tooltip/topaz_background.png.mcmeta b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/gui/sprites/tooltip/topaz_background.png.mcmeta new file mode 100644 index 00000000..33045fe3 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/gui/sprites/tooltip/topaz_background.png.mcmeta @@ -0,0 +1 @@ +{"gui":{"scaling":{"type":"nine_slice","width":100,"height":100,"border":8}}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/gui/sprites/tooltip/topaz_frame.png b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/gui/sprites/tooltip/topaz_frame.png new file mode 100644 index 0000000000000000000000000000000000000000..944d34ffbabd447a4fb09d50698696082603b698 GIT binary patch literal 338 zcmV-Y0j>UtP)JtUfyaL>g#qQ5t-p_brXLx{aE zt{;A!;{&DC3?GY?={p|Z&bh$m^fCATZ32XTXf5_TU(Q9Co&iA_x@VPUe{fn0u! zBq+VU2y&QI65LI;r;~9Wc0>!GoWRtcgncDLdP{%**o+AiCQO(xVZww76D9*E!575* zWMxRi{QX-jdXOryFw-k42#T`}!E^;d+*nh@ kq?`J6k^9`+`Oa)V9RL6T literal 0 HcmV?d00001 diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/gui/sprites/tooltip/topaz_frame.png.mcmeta b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/gui/sprites/tooltip/topaz_frame.png.mcmeta new file mode 100644 index 00000000..d8d66152 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/gui/sprites/tooltip/topaz_frame.png.mcmeta @@ -0,0 +1 @@ +{"gui":{"scaling":{"type":"nine_slice","width":100,"height":100,"border":8,"stretch_inner":true}}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/bench.png b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/bench.png new file mode 100644 index 0000000000000000000000000000000000000000..038cb3a8055f172a0c125c6de848e8364f6491f9 GIT binary patch literal 582 zcmV-M0=fN(P)IS<0_pOFjBgL49%!2m@OcPfhCcyKm|lj64?l7f_<^`N!uA<|ka!1QDRb)&#m zvn}Qx+iKQ@MTEe5sHJr?HUO9nRNzDb&_v-^o;MDT^N;}KCY2)((My>qXxcwPdP7rB0mC0I&ZWL!cw0$bq-EMImUV@m{qwUG5+Z!gl7?GwZ zTxV;z~=HJ9ZJB_ue!IP;QT+50^WQxAi49{P{hPo0Okv|77iUfs4HO3^9Xu!(Ax zmz0P#mncwmUz$6%+^v+>5d%y*;6v-jLqNO0LPgudpJD>$KLY@^i%>=OhL1jv0D2d$ zXq#r9TmS$7 literal 0 HcmV?d00001 diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/candelabrum.png b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/candelabrum.png new file mode 100644 index 0000000000000000000000000000000000000000..b91cb6b1ffd96a6658e4d6d87d121373ca35a49f GIT binary patch literal 922 zcmV;L17-Y)P)Px&R7pfZR9J=WzGduI%?21ipg#rM_ z=OEa-*8qUU(;4C*1OP-bfeEg#008x-WX1(+U;{wEI|G*^&3uym3kM4vw`wD zaS-DEYLq2JEir*wvaqxhpJ0GC?GhthdjB#!YDCN3X?|UB$uT=?qx* zyohus>#INk8#f{AwYZ|havt@aM>2uqr*?by8m>4sawL*TB?XAfA(I_X$sc5 zRp`8^JnkHy&BL0^wk>b?{9~9@zms2DE0f7qHlmziIi4g9yb)}dmcB`j?=5uhO}(}mnSRd3vr+{0lE(^-ByVW zXl+ZYSHq+&l;d;QyVto-Jpg!k_?ad^UnwYD8i;)Q`?9s9n*G*A<{SX__Fe)LU>ckv zl1X;KaSnm$_%Y=`y(yXg^&&f-DjvHOAd(6C-C5}*+wsoXj(5(c<3~)#k6G`@A3w6O ze{ql{m~%owOczQ0;#ozO-A^CXtHWKq{dk?zeSG%?j?eM^>kEwUp2`Q&wwT-s70CpH w_zeKSfA=FjKPK-10QWanaD|27+iL*8A7V-9?iVXfr2qf`07*qoM6N<$f{6;NNB{r; literal 0 HcmV?d00001 diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/candelabrum_2d.png b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/candelabrum_2d.png new file mode 100644 index 0000000000000000000000000000000000000000..fdd99a1bc53b43e0e0d8090a38dd5801a960fa60 GIT binary patch literal 315 zcmV-B0mS}^P)_jXnO|9ySx z{{(mA|LAIQx`2U!fk9SQhGFMa83qOh28OeTuV7WfgiG_|$4{`bi8g>3%{UFXe*Z1Q zs|O$8{8tY?Fg&>SkvIbqbcO!UUM|b<;Mzxqvxl#s7!<(wi6KE(2qhqK2BM?wMTY%{ z_2GPur>7ZIby*k~ZlJ2eYQU{2HyPA&)EOKZE;2AMFfhEi`j3G@h=t+y=R02!kMzHrT8!s4Z7yR0RYtDW*JZdDzpFq N002ovPDHLkV1nn$jIRIy literal 0 HcmV?d00001 diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/candelabrum_flame.png b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/candelabrum_flame.png new file mode 100644 index 0000000000000000000000000000000000000000..82b9e3c819d467f6b5f490e5d273dc1d4c0b8fe9 GIT binary patch literal 165 zcmeAS@N?(olHy`uVBq!ia0vp^0zmA*!3HFSYrjteQjEnx?oJHr&dIz4a^gK*977^n zlM@!ORoq(ft3PJ1&lIUcM-BkN+vD!*m=zA3Jo(bz?3;!J>*9uc4Ud>wZ};~rIlG;1 z4m99m<6W@A2Ba;2ORWKy+rb1z=2>%Rb_6&}^h{%4oFHPrz%cuaisVA(I~qW%7(8A5 KT-G@yGywo-a5}31 literal 0 HcmV?d00001 diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/candelabrum_flame.png.mcmeta b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/candelabrum_flame.png.mcmeta new file mode 100644 index 00000000..ceecb036 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/candelabrum_flame.png.mcmeta @@ -0,0 +1,5 @@ +{ + "animation": { + "frametime": 2 + } +} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/cap.png b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/cap.png new file mode 100644 index 0000000000000000000000000000000000000000..d7e3923ea6006d8da3200e67cdb7175dc8c32229 GIT binary patch literal 443 zcmV;s0Yv_ZP)Px$bxA})R9J=Wm%VO-Fc8Pj5f2bCAc7bWOHf!?c!2OIo%=YQyL9P8MCnrH4XE6W z0TIN2(xpQecW7PladwOWMXLBs;q3VScibI74kyYeEg%RS=)&zAXAS4#0vl)D+r#al zXOrHd0tWwq9ZqQh006FK!nwEz4{Y&v`k%p?k()z;E^0U&oOTc~ygJnJocnRx+JBF}RZ7uO*>fuDBBj*x1F_UMQ!8u7ysE`Da1E^e zy6lr3;N}99 zi!cbcvj`w6Q%<+SRal9f%j{EP@Cnu(B%nBg$3oJqWI7L#g@u2^tkr!uQQ_-840vZ) lm=&}Jrkal3?*r_fe*RFb<-6EA%SaHPSH|hwYLQkQA;&MAPogUl0#dIV}A$^ z6r!ZMQqZy~90kE&OC8pkQZ9Yr4ZrXE@pXU;6Es)IDFG^dn7E4Y8zW(e*~&wiM1v zc@|IF=%0E9Ae%`_RRI8gPrKNdZAKgI1RywlLqYZekWOXDW|ESt8UVmF3z+6TkwlT0 zm6M{S7O|;x*?Gqp%N4V7QY2Ai`KrmT9DKTyWW{aYso6oy%1KH`tB@5p!z1HDR@}T~ oU+sMDk$gz$=yNR8=SSA1cL`g5oZ5|%Hvj+t07*qoM6N<$f~WYc6aWAK literal 0 HcmV?d00001 diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/drill_selected.png b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/drill_selected.png new file mode 100644 index 0000000000000000000000000000000000000000..cf908b392d764df55b8f756d0e11bb350a166b5d GIT binary patch literal 540 zcmV+%0^|LOP)1u;D+r>9Qw&$V!&DH=5WVRX1t~%|DbY;Qp$1%9H-~OQ5z)nFD23plP-w77 zw=SW{U|NK`rXaSojV6%OC`hf~P$=YgsQF29$wk|x6koXEzW;dcyZgTPg?*!Nq)&z; zeR9_TL$_pZd0p-aWayUcj}HA4=umUv(v2$s^qdPZF`1wfq^tg>Seh3vo+4pb)nf4h zNFv|oXGJT3r)cPwjF^{IC#mF1Ud2B0c)AL}YrD`AA2qTG}REsEFz63He+*tIj=RtXH~F5viqZ9=$uJ-W>h3DuP-- zJ=3v+bfF@&?vpa81-N?crVMHUzPMl2dFPS*k=A{|vrx4kc~G=l8>=b&`tg&&hr^IW z0<<%auWF$(IzIK+dEnWDOx9s>F2}@Vf=t%&wKC0{xRVD7W#z@W9I^O-Z>Y50#7x$K z`aC$iW8>yLXxUmVRPwgNoBQ9D8v)`&r3Oe#GZjnoB5ym4m@WWLf0eOY8vrbPJJPV$ e|MOr!cKI5dwMsV^S}wUnUIHHwUU=ED7=pW^j0RBMr!j_jGX#skr5PW}{$(0#ED1Cymz%bS5M- z-B6gT%WM1Y!9R7!^OKcoTt5ld_WL_Z2{*HB@fT?}W?__`v~bC4U=Yd&)}M17UoxEB*bFW!W$~$Xu`aCgV7NQw?yX^tY?@4 c*pyctWk?fbfBbDx9>_@yp00i_>zopr052yz4FCWD literal 0 HcmV?d00001 diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/flame_elytra.png b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/flame_elytra.png new file mode 100644 index 0000000000000000000000000000000000000000..28f3984222da5f9be95d5f73b5550e483fee97a1 GIT binary patch literal 208 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPGa4)6(a{r~@emnDOjGW-A6wGYY| z{vTDj63Xy#qVWIUkM~wTi~uTQED7=pW^j0RBMrz&_H=O!skoJ#aDa)WRfP56mdy(m za85Y-;?BYYHxiW&9LR_RGUC=8I1rJy=0HXaUy8+SEd#dM43cW=xOx=NIkiLIj#QJyvKoNN@@CFfwpC@P3u!Stbv(j=|H_&t;ucLK6W0 CW=f0z literal 0 HcmV?d00001 diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/flame_elytra_broken.png b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/flame_elytra_broken.png new file mode 100644 index 0000000000000000000000000000000000000000..bcfdd36d715927e4aadb8e92f0396059b7f54e0b GIT binary patch literal 198 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPGa2=EDU{r~^Jmoj^oCBv0ah6iN~ zA14a`KdSQob*GPFWb_ozSjGLL z`?;HS!^K^Vzt=xloo>nSkok{-;!^+XM^4I4xBjFlxJI>zo9VcgoZ15Yq;I;EO;?2EiJ}@MOH2yOiWGTVcnKv zHhWPlMIsr?POVXlH{Ghm*^a3eOzB)t3G_GM2gRZuHk0p%~-;78X(I60004W zQchCFnmmsHMmG^Fq;JUH0Ij7CfTjR^ z4MWme07`FhH}OQ!B=q93R}fE>q%9GjL}Yd=&R*K(|DS-O=- zKb2u3hA;e z%~FnPf==tszdGPhaYqT zb0eA=*YwCCfEqtDDyXjAx$1K|1hy%m@=0YbpJ}k0vGy|3MS$B|=KKtxrLDG|e3b%- z;yxW}34kc>+cv!K0MPd9>r0VNCF(*H_dER-%{WSF z>q3#6wm7U(%clU#%duDaOxFe7qFdM1OxOVf=&mSANM}!57YZjvvF-+$2f&5i^{hdt z_!c>&v;Jx8f+DZ_2L{%W1Y1kB<5F8cOUnX`Iw9)1kQb&60LW}MTEqse0u;hMlK=oJ zf~^Z4fZ1CrH^P~TO#hi}0Hv(^!PW(D2sRZEBLid3o47>bi3r}dF8Ctay{#2NjhfhJ z;+oww0)1N-;%Pjwbs>!pTNgfDNb6F@iMnvja=cppBLIw6!#@O2MFXK~7vQj@1_0GA zz&xXQ{?!m>`)R>{2Jo8Ba*7AAGlbWl3Blz=2aK$WZvZoTsdD&2LY#?cry&5CIiE$v zIfA1)TFUD*0)Q7x0*M(m00=NDkw7T5`69w(H!2CV)4rK}MkG#YGX z4)z0Fynm$WN&v5F*W5g;Hpa7U|bV z$0fKbNk%@N2Q-R-u_VYZn8D%MjWi&q($mE;q~ca-|7o$q3LGx1j7NX?UHbQb{v>u;9msq82|c57;KiP+ns-j?PMA3{^OY&Mu2+5SmHc4I}n zvhPBLRkFnwx@DJytDOprSk9r@Qmfu}pCe)7kxTC)4=g_9@G;+I-(S}ro7!AE>;EjQ T3*C!vf}G^(>gTe~DWM4fE`Mg| literal 0 HcmV?d00001 diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/globe.png b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/globe.png new file mode 100644 index 0000000000000000000000000000000000000000..d0124ae73cd133d85339ff6b2e0914773f73d5bf GIT binary patch literal 1119 zcmV-l1fctgP)Px(8A(JzR9J8kNVq}|bC~lIO&F-YlwrNM>A^Uy#X7-!O z1|Jyq`}5BCKJWX^Jo9eH<&UrKrfrL(mQ5TUxej&5Wohhk#k38IBWD1ZUA)s`+i-jU zOxuV(v*Gv{Y1`uda*34V#u|GykHO)*JT&aMQl66IfuYZ|XM}A`+rT(#*`yqopL;%t zB~akzfm!;nJ_f+IZIBU2sFUYjwY67N6b;9h*G@ITSO46WLwe{QuLQm%eMUv4t6-j|zXV|5y*x+&LEFI=YdlH7~-k8Rzy zguh-JO(4SljlP+fesgN`=~@9kPvRvNnQCStCR#XNEC^NNmO zSY}W49_Q}XgTNc0BWbA4R7c^lWo5CfEK5yCs>BNCKb|N7@b1bK#rMBw;Z|ANypbQ0 zX|wtSn`XW0g#{ zYocX;p;T^(Tp<2MJpfTEr$X(Xez>(Lf8|@CD?!}Ds7kPkutFOBe!w{zeP}qoz64RQ ztSnE?9n%U;@9E&d-rO1<@bzq~P^pk_K^zHn&$Nwz=;$B_cGMd3ih@BiGV!iQK`o0; zgra)C(T7i&@9C5zMjt)};Md&VXF3s9y123HZpt2zW}6izQYlXbGBn@Q86cEDl9AZ~ zFe>KTvlTT%Cdj!uZq74s7UkozQ%%tI{J%{ZzCxjT5`ZpXH)GOKYjDv|QhHotzNeEJ zV;dAw9RMdLW`Byvd;lvqisNTze*0Tp)3suKxk<>T3`Nb$0=DS_ zb{T*tCMaV6nF`pDMp2L~u82P;z5v$~Jb-ZqLMSkT05XiA?3wgGZ)C~yDY7EY4_YM- zA*q?r*6I|TnhpUYr_462(K?n=9x=kk$WIu77KY?mdT>P?Pm)d^HH?-_km};m2Oh@7 zQ^sY}(WgU%EzpF(F$?}a+4u7?p7*QbDDN05K1v0DF@kI!UOYs%{e-=zg@Nngz2xB- zXXesDyo$tfiNt=RW5mTHzMpD5-8kpzPTu{xAKcRn17Vis5GUB^?HS}&;^yIn!6(Mm gLFf)TPrC4Y0a`a9$fAD2bpQYW07*qoM6N<$f)weKZvX%Q literal 0 HcmV?d00001 diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/gui/cooking_info.png.mcmeta b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/gui/cooking_info.png.mcmeta new file mode 100644 index 00000000..b995b819 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/gui/cooking_info.png.mcmeta @@ -0,0 +1 @@ +{"animation":{"interpolate":false,"frametime":5}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/gui/exit.png b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/gui/exit.png new file mode 100644 index 0000000000000000000000000000000000000000..951eb4ca9e069f8304ac67e2b1d44dd283248cbf GIT binary patch literal 165 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPHV5AX?bJ+fp5hl+`hN6M6%mIr4R zlvr2;Wf%fIT^vIyZuy?ODCpq8)AG<(%EFCNh0EZiX~Wz7YAR=b%-^>>$6!yQ)0V|v zApuw4zhS&P(;_-awZCDa)QtwahCDYXUB!1v|C@J)8a%t!^uCu{=p66oD?gqkgG~2y L^>bP0l+XkKyHh;c literal 0 HcmV?d00001 diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/gui/get_item.png b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/gui/get_item.png new file mode 100644 index 0000000000000000000000000000000000000000..0843cf32b9135dffce635c47b4eaed229afd62bf GIT binary patch literal 134 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`zMd|QAr-fh6C}1gICzuwzvGV+ zlWr#1OyX(CbTMzpXs)rnR3ODLN%@rMiM9!AB<~7rGEtUx+LAV7GUv*}k~2b#8v;x& ionwe-5bRF;#bEmL?^ES@o5g?zGkCiCxvX>l)=(YPLoA2K(eb%(^R)YAd%OBeZm^XNd7Wj0oRO<6kY+_8>R`oz8xZE zycvxhZ_E$Pa}!os!|2=cs6$!E(Ntja1O<*&jVde*qOpM&7QM*G23pAA>FVdQ&MBb@ E0G$dd+5i9m literal 0 HcmV?d00001 diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/gui/next_page_1.png b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/gui/next_page_1.png new file mode 100644 index 0000000000000000000000000000000000000000..817f8d569025d4f52e184b0a607fae67affca782 GIT binary patch literal 154 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPHV5AX?b_3=oVQq#hrVsd23j0a~H z{I%Iq4wQ29ba4!+xMkXRP_V&(=dj2whMWU|Vi}tmfAhQQulsuGaNpt056?bY9PCpS z(;X}%rlKt>l)=(YPLoA2K(eb%(^R)YfRWeXw&w+g5Z@-Yjx3XwVCJx^KTI543FVdQ&MBb@ E0PGzs0ssI2 literal 0 HcmV?d00001 diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/gui/previous_page_1.png b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/gui/previous_page_1.png new file mode 100644 index 0000000000000000000000000000000000000000..e02d945e26d69fd8e6245582c4adafb7dc843eee GIT binary patch literal 155 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPHV5AX?b_3=oVQq#hrVsd23j0a~H z{I%Iq4wQ2Dba4!+xMkXRkoSNA2eba%1`X~IU-pheY^XT BHckKl literal 0 HcmV?d00001 diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/gui/return.png b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/gui/return.png new file mode 100644 index 0000000000000000000000000000000000000000..b29810b5c68481524cbe50bc5206e994086f9682 GIT binary patch literal 162 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPHV5AX?bol?_sWXTK;6%!wilm}-P zbb8g-1Eu^tT^vIyZuy=&$$LP7$K~S0Hns)KlSBmC*%qDnd%eY!P4oX3y|{uk1)*OT z@?X7>?;>)lO<&}D_y>;-GsGg?nb^Dqp42Da%d+@^j`JJtXI literal 0 HcmV?d00001 diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/hami_melon_seeds.png b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/hami_melon_seeds.png new file mode 100644 index 0000000000000000000000000000000000000000..0d081cd8f9f6917eb868a179472b226fa52e0086 GIT binary patch literal 207 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`(>z@qLn>}1CoEtsm@53UpIdlo zWmcE2%=8_v7jO6|#dKL_m1?(e^OKEIO}?KGi>^wjSrfyy`@~@vqe5@_@6vz!@4n

U?brE#-K)z> z;astz&m@QHO|CCjd${G91}Gmn2~@;b666=m;PC858jus=>EaktaVt5&fpwulR0N~b zZU>2lO`XRS*j6XbS}Zw3aoU>gTe~DWM4fW7tCs literal 0 HcmV?d00001 diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/magma_fruit.png b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/magma_fruit.png new file mode 100644 index 0000000000000000000000000000000000000000..63690030ff898f5b0ed3cbba5a3df810b05740a5 GIT binary patch literal 227 zcmeAS@N?(olHy`uVBq!ia0vp^0zhoQ!VDx|6+TY^QqloFA+A6=ScyAbhx2y5`tvpJ z{@(uQLinw$Jz`>FUi`YW9VpFM666=m;PC858jw@w>EaktaVt5&ftAysjd4auP(m5= zMIXI3opT9on-$q3x-RN0Hf2y*pdi5&w(8M|xC2~C9O~P&SR1B#h|IKTeCi}Q`5@0X zrej-N44NAq0~mBd4>a&DuxxH@Jj?h@E`3GyjMx`1#qP^z~JfX=d#Wzp$Pyl<4#@x literal 0 HcmV?d00001 diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/magma_fruit.png.mcmeta b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/magma_fruit.png.mcmeta new file mode 100644 index 00000000..cc0cf146 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/magma_fruit.png.mcmeta @@ -0,0 +1 @@ +{"animation":{"frametime":2}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/pebble.png b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/pebble.png new file mode 100644 index 0000000000000000000000000000000000000000..3bb38c03bf31429b72fa7bdaf4befc15017b4269 GIT binary patch literal 173 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`C7v#hAr-fh6D0O6Sh3-Qy_K5h z=S``n0}9-$*$dkeF4uf`;JAa)(b4gLrxC*v&bGu^oKg%y3_(3>7}eU|@VdJn|F7~> zTCzE&;W|S}`r#uECLYFq;teVvE#+1C4_ojyWIBCg;!wWb6KcFk@x--@yYCWKn08?L4Lsu4$p3+0Xe~*E{-7;w~`YYnB61}yD)gLI7qHp#xhm?h8f_%Y=uCAdvuoGsDv@PGnCnt`E% gqz(@c7Y7@|gS%{NcCLAr2sEC-)78&qol`;+0L*nhkN^Mx literal 0 HcmV?d00001 diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/showcase.png b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/showcase.png new file mode 100644 index 0000000000000000000000000000000000000000..861ec955ca3e3bb7412ed54c37240fd927fb7afd GIT binary patch literal 776 zcmV+j1NZ!iP)Px%!bwCyR9J=Wmd#2VQ5462F_TrSL?_N9!P0_(C=w96NLTGjXu)NlAg^GwLf3+y zuiy*VT~k^pUDTb6N+6WBG?i#dKE|Y`qtO-#(}kH~CK)p`VkwmVU|{CnlY9R6+;dK@ zFQ?Qr9Qagj0x%H^F)hiyezxg!S}Ru+rzHW1MI{8laZw#NV#^hUYOUr<0Dz$HE~nHq zCn3768)l}Hh9EPss06@XE)T#!>BlK_qOkt%z2gqOphv^}bPE#99}5rf^^Jfo){FCQ zy2l1wulR@f`vRH`cO?Vh#n!cekSMt}_F@~0N8v88=6i zDHJHy10;if@~t-VU>gLCoi>pNLq;TYn;rp@sU*YV$aOXJ zP`vnQJ8qi;ON$HIO*!8^u96y#Sl;z0*a}!#TlZa+gl;IQs*(BmR@>q*H5{RK+C&Qa zJ2onU-h|9t$Fa^vJWk?ZAHc|V9Z5Su>QqNE=w~Ayzxh5el^EwJEb<_`2c~4x(Mxn^ zZUzYuW+%rSZ@YF;>c^-U;`#kMWC{i7DoyCLV)3#Z1-Dmnx3tdAIXnMle4Cw@RJF(c z#*d&_DjPT77Y73*gXgB%0Qpv%a!{dMQ9S)~{^vjcF24bCS|?kPx(h)G02RCt`_o3U=&Fc5}+2i#%bdB@}N?npOIhm%JD z==9nEfPT<~iP3Bh0GLi90Koe}uVK7l1Nigz{*n57GoB&39V5EC#>2xu2)cMPo&f-+ zVPJe1wF7`|PTNgkF{o`hXdKb$wWUzqFp!pDg4)}(-2@tqhSo|2z3GO5v;^JAaz$}V z*k(jOXkr?VJPF_FwKKke=KjriX6-Mw0l`0z@Qb;!RKjRB$8-{Hjmf(p(if5rV<9jJ z-w&FYPS(-Q^2jIv3a_b}5_MtE^krQfoe8A{(3~Hf904-usizfW6u=$cQsAUds1peV z@BoL8Hunj98LR_hG@B>px(taG-hTPrLJ^}HC_-8Q4}x@1j8G@%D0qTkBN%U^N-nky zfm9Ndn-2Gu!BHI$G@|r6Tyux2#uy0g0z0n&0RUGQKb>xR{pLei{iz($4Fg2CFRgEg z?ygJiP}RsdpnVt`8%DR|D*97700_U&uA=-ywEtQb#1aHPOygeRN)0;IQtHS9J zm;#+`DSi902aS+*%J@tqra(VvCPLv|P=eA2)UooTBcTAQ{qGV|0p#>Xv-wUbLT-+B z!yuF5)~WEJL-6Wv8tw$AlPKO3G)IivhWPRQ8vvmF%swALjdB9vDmdYL-=?A57^#xe z;pDNCDzo{{dhHBr(X)X1_>knfVMtOw|{US)>pV$S@WlPj5A zAa7@=YD`h-Dk4^a*qmt^*c_4~A5exRs5V?|1@+mii3=j3mBU#sS3&8!#N^!a92>15 zzQ|ResySx^IapPGl7@u$b;@#YkfZaw+!V`pgr=#eYU_*Ul$e@+&@4SwR-IMwx!0CV zJ-~)4c7|Pots;S$AZN3jZ~2iIn6`_aHb=_b=_I!cMKaUG`2d?*U_W@V(zQ8z8qGb^ zERvbZdVnv!8>M7HUq8QF>;DZBPVnL3pVdwK`v>y9@BG`8ZMK90xL~%pCQ$?(xnFxd z0P)E0?;prl6X~`TM#D3m9-JIy1b3|k@MpP_u>g}2RNwhn0JS%*+pfvy!2f4EElvzQLcnMzrg)~E9t1R zNR;W74txJv3^~44%vqHHWry8b1#q)BO#wP#c6H&`fo}Lkd3|l!AQS?dR)>$D76Pc| zYToGa3X^IHtzvI7qX32et!=DIR8CqU=_)bZ!Q4#Pi~^9z^40~trng> sY01x|kiyAOkr<##!sk!pcdf+r|C>LfSzi{=8UO$Q07*qoM6N<$f)~X}!~g&Q literal 0 HcmV?d00001 diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/table_lamp.png b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/table_lamp.png new file mode 100644 index 0000000000000000000000000000000000000000..c5c0bb397e5aaabfc5057ac330b1aaca763cc2c0 GIT binary patch literal 279 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnF3?v&v(vJfv^#Gp`S0KIb)w{JWGE?m4=d9I?4sfkYM^;b-6-y}IDb2A+n#l@#zVU1B}Y})kY(@dU) zdaJj$II&t;-MZAsl&8?h$uq~HvBc4F#(^_4jhFkr$Pf-{%dk9fn1LyQal=A`#**aZ zj;+~#jjX4%8(D57@(2WQ3KcLi&SSp8dg>ul47bFCh8V_oyctY9JWDtftZO@%8EUq8 V_BQw2dX%iF~>*XJ0>*yLB z9cN@_?cf;@l8|m@U0L#U&-Wp_xTyj&IB*i771FQd1W& zEnIj|&4Dp-f&&w?bijd>?|CyEqN1XToH9Pl3l`87wvcpS&|xqWQA^mAC3@u6sh0_i z;^qpBWfIIRI~rM792<(6${59WFjO-#%S_NdaIrz{zyXIYhE12-EkIthcnQX N44$rjF6*2UngCH@QtSW# literal 0 HcmV?d00001 diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz.png b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz.png new file mode 100644 index 0000000000000000000000000000000000000000..d1184338ff15cb7f33ec9188dd86f96c7e86a680 GIT binary patch literal 289 zcmeAS@N?(olHy`uVBq!ia0vp^0ze$V!VDxIwZ57{Ku znnRge6?oV-iny=1*~G+igYk~-F@x_C(uX7h6cdvlcLubn9zopr0D=8&;{X5v literal 0 HcmV?d00001 diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz.png.mcmeta b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz.png.mcmeta new file mode 100644 index 00000000..3c559bed --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz.png.mcmeta @@ -0,0 +1 @@ +{"animation":{"interpolate":true,"frametime":10}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_axe.png b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_axe.png new file mode 100644 index 0000000000000000000000000000000000000000..b72b5047dc9d1ae26a304fefcbdc585d3c98a684 GIT binary patch literal 240 zcmeAS@N?(olHy`uVBq!ia0vp^0ze$V!VDxIwZ5 zU6u_0U)N^%$#tfy|6i>6F_qy#8N>ghD*r!k`hUUqe>=nVCo3ib^)QwM`2{mLJiCzw zRrFs@?_ICd*KpmFy41x&{3jdu^1et+t}Au=Ys`I&#~F83m> k-aE!O4y9kQeesTwLCek5pjC9oBB0F-p00i_>zopr015q8p8x;= literal 0 HcmV?d00001 diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_axe.png.mcmeta b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_axe.png.mcmeta new file mode 100644 index 00000000..3c559bed --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_axe.png.mcmeta @@ -0,0 +1 @@ +{"animation":{"interpolate":true,"frametime":10}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_boots.png b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_boots.png new file mode 100644 index 0000000000000000000000000000000000000000..c3a4cc348abc4c4fa858640168066c3751bf4310 GIT binary patch literal 252 zcmeAS@N?(olHy`uVBq!ia0vp^0ze$V!VDxIwZ5Xl{4F4Bv{s)53oBp>mJer=_2~^5h666=m;PC858j#cM>EaktaVt6D z0Q(e?8B-igE(b9xFc~_r&S*N=lfbB!Y;aiOm_eh_lt!L(_X$1i48h%<49t_g7c(sG zV4tAKF(sWvFr{e=%Qh2%v)iH=IvjfLGUePp*z=Yt=V^kQWltby>Jnzj%j!)j&p0;B vT_ci^FuO9KA+U&Vg5%0+w&)){yVx0yI_ht{XcGJo=o|)5S3j3^P6-ctb6$X^{xN^`&T&_Ot_ocd0b$I+62ZEQWFg0&NA-XnQ-=oNyf}0Lf2v@ z+~!_(@oDB_Ny`++bH|oR&X#b?IQ++FQd)|$!@}M?hQL`5*%lntb)EIG%}nw6P|0G-0%>FVdQ&MBb@0IuFmNdN!< literal 0 HcmV?d00001 diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_bow_pulling_0.png b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_bow_pulling_0.png new file mode 100644 index 0000000000000000000000000000000000000000..1b2440e7dcab3aedb81315bb59d5db3668d6fa4a GIT binary patch literal 231 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPHF3h)VW1=5!z8M-VP0(^5d|GM`7QI-Gy|8Ly5@y3lC1-ZSG*0;Fk!1Rupr-!MhiHV129ZyfIknwB@i3lbZ?b%aA8YZoK=AgxRLVzN{Ny%{{(HpVm_oGO_zVF?qnw?T&@y;i;C8kY=@=DS0Rg>TcW^7$9)snVrIomyceuh;XeA2nq^fFmk!v*uof)nJY2lpvH}Jvkn~K z5qS}iz`<-Np&}{~A$+5eM{q%#fdumku0sr*3|9@L#Tz7)PO%B>o~alra7>k44ofy`glX(ebpYn8Z42fuc zJ8h#Ev!g)U{*I+{T5h-o-Q>6xnIU*zVUm}}FOwwcwOclHe`|We$YP!Rkh$YV1cy3{ zi{rr%DW@xSI(oD3yvxl?Rz3Ca>c-FK&5I|W-tgh}DTWr&BRo3u-3*t8_(wRpxID@A ze^TX`^Q>^*%7u?><>mYsHP$@a(v`@nx#pQk|D`V>88vA(FF?I zij9BH*I>S|UiE(Eww3$yS1pg1{&U?vTB%%h9Y)uFG}elao>;draJcKL;#=n~Ydexov7%u5aVB*vbBG;l7J)Mao%M zeL|{oi?0}2UHEoz+tMr_ciroD5|b@*?oX(dU*b52!F%eK&qwS!{3|BSD3!lr-cc8% z40YS*|9klV{8gB=U*3nWkm=9g2l}VpGwbGAaB*?Tb&`-5 zV$;+zpAaGMt0xF#KPY1W3Vxg@yv&2)|4|h!li2+U3<18m1-ZRu3f%u+*G`+Ve5M)0 znOugHoqUx*vp7nE{6J=d!S?4t3xSM&PZ!6Kid(+tPKz}w@UUFiIBQDFhYc(K{cUY1k;o)cY2%)5 pw4Xi4Xisx>%^|hOe~q0kFW5Qt*j;~IdASwjMo(8imvv4FO#m%*Z(INX literal 0 HcmV?d00001 diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_crossbow_arrow.png b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_crossbow_arrow.png new file mode 100644 index 0000000000000000000000000000000000000000..4b720c5ec6dc7d82349fc6478e2eb8558e59bee2 GIT binary patch literal 341 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbK}LV!<*E0At%Y>bGAaB*=lHa5<6 zl8_f-^VJj7)H0tCArE9fC}Rk*6$LGc2K3?Orsr;B4q z#Vz0SZ}|=@aIgkMsV66_4*R`#?fd`J7Vpw)wtu4HpvU0ge80{M z{}c1BaLJ7g*G*R&?LN22>4f_IkT_*+7k$mrsKwvbIVoOAx%Nr!>(8lEdc4lpJG7kW Yk#Dc%DvFfTx&?Bur>mdKI;Vst066S>8UO$Q literal 0 HcmV?d00001 diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_crossbow_firework.png b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_crossbow_firework.png new file mode 100644 index 0000000000000000000000000000000000000000..a2ba2e8e7378dc33207e156817c598fecc280974 GIT binary patch literal 351 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbK}T7XZ8E0A_^afyhCFg7;Mb&`-5 zV)NA#)YLMc5Frm_KPY1e@Xb|HH2_L|oG84^gW;N%*8ig_Ks7rxHTBJWXKHGSOQ~p? z#1`cC#x!=eNK0=zb8&wH!d2X6uAGtu04~>@Q39uBhV(!k{~~j%@9zWGJ7GA zHQ&?4F{I*_@A=z&hYUE_5>~C{h(7;rk7e!u=~K$iahN~hZuukN^zK76r=UW6B~$B( zGxs(+e4jI|;Gx9a;+O}P<(4_?OJi+$p1PDx%jHZ-S=Zp@Yq_P9A*7h$_|Dob)BG5| zFAF&;bKv6rlVLv@?{$4CGZCG$L+$qV+Qq#M{jKX=-Gn^)+80igTKZk-p8Uxz%WO}6 kHrCV<^saBn;FbGAaB*?Tb&`-5 zV)NA#)YLMc5Frm?KPY1WihrCayv&2)|523y-`xEP3|c0!1-ZRu3f%u+*G`+VT+vo* z6VM>ek{~~j!4OcKGJ7GAHPzF_F{I*_?>SGQ!v-8I2R=F(IPFgP|9>T;W&4W-t6nBC zH}ux~&t$x1{$Rs`S(Eh+1efcoE?vUc!~UW?TetYT*aD~bYAK0~@-LRQDzu!^U-4Yx z$Y$o{YSWS>zBEm%+1azy-yIFK2zwi!bn+QlFqC_=_oL5eMf(mzRPdr+T{jxvXbGAaB*?Tb&`-5 zV)NA#)YLMc5Frm_0J#s!7=Yp*Ckij~VEBJjCBQdV%OtiSw|9R6gP8*N|JSwCrYxUn z#&9N=VOrsm2%vGCB|&~5;~}6pW%fcKYnrEvV@Sm<-*eGohZJ~NF09mb6S{Zd+TZn8 zSiZ=7HlJ?8(9pZ@X(z+?8x3=T&Yi-!FtW0 z)#v@@i*-DGFw;ajpyvLp&|6F=Umgvf^_$Vwchy yqSmCd*oSDSuCc1f;P1FrFUrUFhyRJp=HCqEYdBOquE=YG-0JD-=d#Wzp$P!_k8v0P literal 0 HcmV?d00001 diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_crossbow_pulling_2.png b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_crossbow_pulling_2.png new file mode 100644 index 0000000000000000000000000000000000000000..ccde7e67299da71d0424f7173b2909b1eb08c112 GIT binary patch literal 308 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbL!cYsfbE0At%Y>bGAaB*?Tb&`-5 zV)NA#)YLMc5Frm_0J#s!7y^8Afl?nQ3NQ0u_ol>qvV20Cb6{8v!2!udNxm+6cogMjPuIkt;^OFPqrPw`ajL zv8D;RwhQKMSFmZg{Crc6k%M>LX=VEd*OjeHJ?>pqUH8rC`K8mbW$U>-vwO{Uuf5$; r{7$_g^xX!|Khv4RZa$Hp;nA`$_XdYf-QtF4AV+$-`njxgN@xNAdedzM literal 0 HcmV?d00001 diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_helmet.png b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_helmet.png new file mode 100644 index 0000000000000000000000000000000000000000..1ae323bc1471271f7549f08f9e27549058687df1 GIT binary patch literal 234 zcmeAS@N?(olHy`uVBq!ia0vp^0ze$V!VDxIwZ58G0j`Y160ab666=m;PC858jw@y>EaktaVt6D z0Q-z7Q$!B%h$cUF*wFC1C^?)_;P9RsM_A7ogaz?18uzfUx+d@h8XOipl@O4UAds?v zDZ$&@o59$~+RChn_1T)2Gk7;Ot$ptD+{a+CvTmXJjEia-8l1@<&62_kdD>jGcBXG= cJ-?!w!7@<2EaOh=R-ok!p00i_>zopr0P8DMnE(I) literal 0 HcmV?d00001 diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_helmet.png.mcmeta b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_helmet.png.mcmeta new file mode 100644 index 00000000..3c559bed --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_helmet.png.mcmeta @@ -0,0 +1 @@ +{"animation":{"interpolate":true,"frametime":10}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_hoe.png b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_hoe.png new file mode 100644 index 0000000000000000000000000000000000000000..c4030ea90376a4b79f9d4e4449a0513e3350742b GIT binary patch literal 216 zcmeAS@N?(olHy`uVBq!ia0vp^0ze$V!VDxIwZ5)QVpeE)ymv{1Vy8>pJGB*-tA!Qt7BG$1F&)5S5Q z;#P8k15-|BfLob6Q_I1ed&{^|r&>FynszCg1aH{MIAfvG0iHAiR;SPv91fuZA_)R1 z2be9=og|CT`!wu2^h)K7?dpVg7bAI!`$c>28s9jSe#KVe9V3HhoN`RS4kI3*Jq(_% KelF{r5}E)()JZJ> literal 0 HcmV?d00001 diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_hoe.png.mcmeta b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_hoe.png.mcmeta new file mode 100644 index 00000000..3c559bed --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_hoe.png.mcmeta @@ -0,0 +1 @@ +{"animation":{"interpolate":true,"frametime":10}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_leggings.png b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_leggings.png new file mode 100644 index 0000000000000000000000000000000000000000..c3fbd4246bacf9441df78f3de17cd2d5150aff62 GIT binary patch literal 258 zcmeAS@N?(olHy`uVBq!ia0vp^0ze$V!VDxIwZ5cXU4F4Bv{s)3~hX0>8sWrd<0aVIZ666=m;PC858j#cJ>EaktaVt6D z08>wIFR!CX@wH7Vp^O5`zMh_}XFP%mn~Y>!6?s${-8h_G8zg%lDjj&il(vJ*U{{kw z&q5{#mLv`?20`YD3l=Y4Ea*}^C#ral)ROMUK9!ZKGYa<FODNa{rI2{C{2hF_q!}V$J^-eE)ymRIh1Y4phxp666=m;PC858jw@(>Eakt zaVt6D09#Cq%mI_rJr~4^1rA>hG%(@RIeZ{NkR$L&jEEvb+6>JOE(aC~1s-EoHcrM4 zhUO&2KoZsfG=Oy@sid&%It v$KgB5%*FjWXKcka3(hBS&ky{5fPtaC)1+w1f{DL?PGRtL^>bP0l+XkKsK{2m literal 0 HcmV?d00001 diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_pickaxe.png.mcmeta b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_pickaxe.png.mcmeta new file mode 100644 index 00000000..3c559bed --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_pickaxe.png.mcmeta @@ -0,0 +1 @@ +{"animation":{"interpolate":true,"frametime":10}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_rod.png b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_rod.png new file mode 100644 index 0000000000000000000000000000000000000000..f9d2ab82f19d71441e8c4804941c6ce0baeba67c GIT binary patch literal 199 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`eV#6kAr-fh6C^kSCfxpQf57~^ z{mohW?nZy!Z%R?P%P?WB!rA}*t0v?z#C(1owIOZNo`!XjYHr)oA|fWNovFdh!Fpqh z=4nG-hD?UUBq!;^tOjQlo=;jMc~@b=v)$!#4I8It84|lpn&)_zg&gEz%G_7| zoKYfs=8=Euo}Z6*9!i*9{?^847UPLojx`h9Cgreas+>MQg^A$;Plxf{v|JgWoeZ9? KelF{r5}E**V?9a$ literal 0 HcmV?d00001 diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_shovel.png b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_shovel.png new file mode 100644 index 0000000000000000000000000000000000000000..2b157b65145c87a2820de3ad4ad4f57e34d14c62 GIT binary patch literal 220 zcmeAS@N?(olHy`uVBq!ia0vp^0ze$V!VDxIwZ5Hb10%6 PXcvR0tDnm{r-UW|)D=ra literal 0 HcmV?d00001 diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_shovel.png.mcmeta b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_shovel.png.mcmeta new file mode 100644 index 00000000..3c559bed --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_shovel.png.mcmeta @@ -0,0 +1 @@ +{"animation":{"interpolate":true,"frametime":10}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_spear.png b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_spear.png new file mode 100644 index 0000000000000000000000000000000000000000..3b2fc0862ed5e409fabf1f30afc5ca3b8af75115 GIT binary patch literal 1081 zcmaJ=&rj1(9B)7q!UQ>B6pW-P2Y%@KYpmNECXRK31-2~P5_T|=(!OmCw6C@gH!x8# z@xaBufW!mw;(?0?6-*$SC|)!q9{j~YPu}pt!SG|g4mLbEU(&w!ef@ks-=AGfCPrGC zJDUlDXo-zVDZIBiPg5g)_qxxf@z#MNS(Ju3RFo}1gj6^M$e1qYK?=y~+|74jkRTd+ zv`iLd-4vhA4@+|LVSRcdkZjKi@zsPyW<3(YQmYNe&QuNp#wt`dvAyZ_S zVzEdUJv6lP3>OFlumHpJZj5l-a|V)2Zo}@bDoDUqEX_n3G)PBLo`SO|Na1LY($LMC ztYIIQ3Kxwj$tJ_mtdmw17?1xSs_QkhjZ)ww-hT?)nK=_MDPY4{OTo>{bvv$1F>C=D zK`R5{Otq590z}X*K$GNsG*9+UXod=lc3*`MkBc$GMzW!Rm=vV21g&YR==DmHmlFiR z6P7qG%7uhT*dOIRQNho8hgpA>D?w#e2L`Hg)f29-F4vg{-Nc?HU}?928nvKKR&o}# z`mqeu)jQ^@^<(kYl8!~R$A;ggot8w1N@RJmNx%Tc-mj#PnPRIHZt82`Ti~3Uk?B!Ylp0*+7m{3+ootz+WN)WnQ(*-(AUCxn zQK2F?C$HG5!d3}vt`(3C64qBz04piUwpD^SD#ABF!8yMuRl(3e&pIxIyg$@@$ndN=gc> z^!3Zj%k|2Q_413-^$jg8ErAB;8yV>WRp=I1=9MH?=;jqG!%T2VElw`VEGWs$&r<-I zn3$AbT4JjNbS=aixdm`z^NOKC1q?L(io^naLp=kKw_pl=eeo;J&4sHjE(uCSxEHIz z#UYgisro^w#rdU0$-u}hRnJHF|E{2vy76xu+#?DTLhHi!yj+Q2l zE>6ZqPKKri&L-wCy)OC5rManjB{01yaJ_~GIQ4?kLv8`kW|!2W%(B!Jx1#)91+bs3 zGI6`b1*dsXy(u`|V&IBXuRhQ*`kKtqVs=% z`NA^5C&X1lj@#2r^m!dqhM!z#y87mD#(%4L(>1vrC0PI5HvRX|`~Uwxo5C5I9TgXQ zE8WUr{MyL0E8gV)|NjAcnU8>m2$ux;1p~QgfMHYZ9S)%MEKe85kcwL^mml&qEAX&9 z2!8I6dim~e`!}o9{ABljYM)eN>EUU(UH9rC8=pxF>iI5faO~imFA-7pkg3}sP~$+7 z6Jxi=(rl3zx!+m(9$n0Mz&YpCD_x80TX_rw5)=xo%RHH%`Cn@IIoD)Icm07sUQ#ix zyfH4K2LE^QJ)hj)*VxFw%vi7Rt=!?vm1&HorP*u}90meX0zbG67+ySf{J8w_>jywr OGI+ZBxvX)PVu9vRo3g@iTz{53)ukqq917F=6t_wdKKTVdeKie+pVttG??Q| zJ~kR|^6t2FCzbOe&mu>OC7f-Y+a#Avd{WW=vwBIUn)QK%i>}+!6c`wiST{-L+ioZX PTFl_->gTe~DWM4f7@$1@ literal 0 HcmV?d00001 diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_trident_3d.png b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_trident_3d.png new file mode 100644 index 0000000000000000000000000000000000000000..1575e4110ef724686f7b82f61787d0bb6369611d GIT binary patch literal 266 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnF3?v&v(vJfv^#Gp`S0EiRx9>$0-`5GUU6u^H zb{?KKW%=buhX4Qn7v%Qt3KzV4=fVH^iYj;BP6aAuDhcunW?(3reAWWUo8al<7*cU7 z`9au&S4D*h4h>hXxK0-HW!e~_$RsJLr=_Q*V8^Z<((sjG#=(OJ8Lv*7#g(>UlT%1a znwv|5U80%1odk?hpq{I@ literal 0 HcmV?d00001 diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/wooden_chair.png b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/wooden_chair.png new file mode 100644 index 0000000000000000000000000000000000000000..16a328048b7dde3f27bf245b3204548c11882ed1 GIT binary patch literal 284 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnF3?v&v(vJfv(Ey(iS0J4ppi`G*erRsejw$i; zTYRULI8Ixq~g}v3D$hg20RXTSG<`a+z{&bpk%#B zy1PIz^N#<5SqtPRE%m-H^z`M;iAeynq2#?PG3=^yiH8TTj*^kGS;tA^<8o@& z@7x`)n3{7m-i*#`-FlHFI^**CLuD$RtKYs5F#EOlL;S@9DsLX|6XDzDbZ$}JUDca$ z6_@#@z79R!FCllmtH&or`EWpJ!Lr=Br(LG~?+v&!Q&aq}M`~j$#~0_0DN3SFTLm=5 e*3YTWf6O^;k?I|e=mj9}GI+ZBxvXHYaZfQbGYfA+A7r@7}#zwrp9lbjgy1 zOQuYmQl}K&3KV553GxeOaCmkj4ak}2>Eaktack=ZYrew@0xTCgufIFXtK!H&Xx$yat3&z&p6A$iG7XS8NsYSqb4?oN4)jU2E6FOJv zn~J~kuGfv(%{_UQ{=rj{Q?zT+B`$2&Vb?iQ!Isw_bMnsPN2!TI+uSCWimD}QtFBe? zoq8fBL|e-B^QxVUM;#_-nc3cacG)9e+~;-Z>aUj%$zF2SzM11^7Y}qPgQu&X%Q~lo FCIFttWZeJ& literal 0 HcmV?d00001 diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/trims/entity/humanoid_leggings/chainmail.png b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/trims/entity/humanoid_leggings/chainmail.png new file mode 100644 index 0000000000000000000000000000000000000000..0d47920d99831bf7e1c9cb65832447fd4052982e GIT binary patch literal 167 zcmeAS@N?(olHy`uVBq!ia0vp^4nVBH!VDw>HYaZfQv3lvA+A7r@7}#zwrp9lbjg&7 zQ(VmFPX-DxmIV0)GdMiEkp|?rdAc};RNP9IU|q~0s=;OWfW4`SMKmC-b+e(w4uc0w zXM7Y6oH^6LE#bh(tapHil{u4%TSUV^fZ>b>!}8FIwZ(2sDynP@p%ZxCGoK1n0-DI+ M>FVdQ&MBb@0I>TnE&u=k literal 0 HcmV?d00001 diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/ce_overlay_84/assets/default/items/gui_head_size_1.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/ce_overlay_84/assets/default/items/gui_head_size_1.json new file mode 100644 index 00000000..367eff1d --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/ce_overlay_84/assets/default/items/gui_head_size_1.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"special","model":{"type":"player_head"},"base":"item/custom/gui_head_size_1","transformation":[1.0,0.0,0.0,0.5,0.0,-1.0,0.0,0.0,0.0,0.0,-1.0,0.5,0.0,0.0,0.0,1.0]}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/ce_overlay_84/assets/default/items/gui_head_size_4.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/ce_overlay_84/assets/default/items/gui_head_size_4.json new file mode 100644 index 00000000..9c5210ef --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/ce_overlay_84/assets/default/items/gui_head_size_4.json @@ -0,0 +1 @@ +{"oversized_in_gui":true,"model":{"type":"special","model":{"type":"player_head"},"base":"item/custom/gui_head_size_4","transformation":[1.0,0.0,0.0,0.5,0.0,-1.0,0.0,0.0,0.0,0.0,-1.0,0.5,0.0,0.0,0.0,1.0]}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/pack.mcmeta b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/pack.mcmeta new file mode 100644 index 00000000..83a00a62 --- /dev/null +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/pack.mcmeta @@ -0,0 +1 @@ +{"pack":{"description":{"color":"gray","text":"CraftEngine ResourcePack"},"min_format":[75,0],"max_format":[88,0]},"overlays":{"entries":[{"directory":"ce_overlay_84","min_format":[84,0],"max_format":[1000,0]}]}} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/pack.png b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/pack.png new file mode 100644 index 0000000000000000000000000000000000000000..d72a566d19c8176aadc5e940bcc80bf8baf73b2a GIT binary patch literal 27402 zcmaI7c|26n|39vz4O!F7BtqG;&0IssI*c%~ZwZ+h7h_+_5=zTt8Cyy-gX|27PGjpAD&+DG^d~MIyxvBQ2EQR+X_VV%Z z30s{scjV*S4*YAo`JpRMDFI)h4|ueNd$dy+7#-sq>BnbE48!{!whHm}_jB~~CB{Yc z`JLe7<5voFc8_+q#px5mLNt8;_0fn835Q1W@trV^4fiDk`9&Yb`}qfk8pj)awfzF5%h@i#zu!v#Ogyg2=R;dJscYn92%t`YbgJp z`|3mA|6SIUKm4CA(Lsjt|0R^Wt^Hw4Sft-!Jq@HfK}!pDSXWQOSI1We(9=2Yt9BTr zh0@m40yMRB)R9PiG)i9!efYos>8iJ-otIrhJ&gMJyx2Si7Q>uYMp#KdUC02*PD z{+dWVJv~h=lqL$L4)suviVKbQja3hgQuv=cnEOQ$A_K#t1H(cO|GT3vKI~kyp*$q) ze?3J=xUKE~zHw;Of3Fp^YMQaW;hIPdEzOXSe~ zkrr4zQ&TfNv@Xi*I9l5RrDgg*W357?qJ2XNe*ZHz@c)d}`+ttr$3*)1Mu$Z@hlK_I z&j#8Dghhu%1%!nkMxiy3$ivERfuY2(m?)Khi~HZQ`b7qw_akB>!$J=KXLa-g|1T1t zQQBI^O?83)k-*Gc4{eUc9yiz3Lt9|bko5mGmiT{p^8X&I{r@{w6B0)A-`4(rw)%fA zLHPOi^?zd*`tiTf?-vR|J`%#Vr9y53q%wT=IA;qvgjln`{>6)AGu1Xr5!!6FFGT)G=jURv`k!q`Sz?uvg9%~QK3BYr5^`l+oo zQbvLfV)A_rN)w4M;w?P%QleBiuUVK6Q;{RZ{iDJk*2A*M&-Fo$O;_Qw^ZxCxe1WL(|_Ute<#OLf^B1oK2I z6?)u-{7{ELy!SnlQIWm6qq=x$w0l0axZTyI7&N_k*02VzbHi1$WuHrrXP z>@2!5)bw$VM_M$#I_-R<(IFMMXr|}!v@{CMM=uVmTuF}5loqo+CVn%}_S&W7*O#rs zPO2BsOOvq*PRHd~vDi#Y#qtQdV0%4{gQ7H76g|}N?NytSIByFznZiKJwos$KVsJ3& z?G2SLx*Ogn5R)xc z(}Kbxjvp^8srEHdtV)S0^3aSnQ^qQb7Zp|>lNR?fQcQ?XuDBB7pnW*YQPWWK&@GZ- z?xm|Y9gm%}Qp$`t6CWLQ%}qPS8-3AAvGiiV_0;RBSY2%7e zk|?*TK;yE@q}$GFw7febmrhPzI{7xq^7<*2;TQ}ZcdR1P@tUooo2Iy*-r@a{qD6kj zM#_h*HRa?ag(7XV)Dfat88^RV*w??^cae{e7-D5^>Kyy_GDKep(Q!{sQr!?{NKC<>$)%J2<%6z6TR*?SA-6Z zPq{o`Tzk9JxVXNG4Sx6`R6@q)^=*^wAP9>risCJHp3&Tzrp?oZ7S|qh{1wXWBfgAD z+S<~aZLiCXIo-%T;TKw)r1jWt*%kR$?Sbu^G4r^w%8+L-nJw^&ikq(sz4O<{)cx-- zJ_@b?zUdso1v=-%Fh^bxvph4 zlnSt4QH@lCF0*3DU8Ot}iv(Zw<;Hw;W=oTqFwe!8foDyr`|>KTyfIimJ2WQk)Rd-% z4F!2eu5kKtF-z=2NL$%=kIS3)I6I}Kz>NYIvOS;t$|aCa?bA;@okMGdWsu%sdExgS z`&_M2Q5RrRi~8>+#*YM8tn~FYHst`+O#`nYW*uWv_(-CbNs9yuGJU7eba zY-u=x7Fprq5EouGskk(?!8p{nZ*dp>7I)>}!g4zsUW)8-aoTutHA&OH=*<@2cKY>S zpA2ya%AAE&SxJrRSMCKjwQv9N^iBNouB%wvMPD_N&fH%3>ERQdVLsm8Q;)9C;W@U# zi162i>UH;AR^)DtxH44i9}`oNk6n!UMx>3#!$=c&A_<4Agp=u3N*4K-88p|+X(~>? zOiM^_9GW`sY;F6?mtb5>zhS%1OxZi!1+tiZt%E6M*i?i&&V%;WM5C7dz(l>i{y?J1 z+2NbFlKrK1RKkeTo`2nS;5In%3|nsbdhXT5+=WymTX}ioXDO**Kgp(R0b?d8nO0eD z=EgoUJPa^fIk54rXe7;CIJWgdb9r!mCO@akFaJ+zPWrbJFzozDN^k7QME*{KE}@hb zE&j%+&y0O@VMLxaA+;mYh>O7 zNjXBMw{e{j>5E-tR{opU%Fjk?<)adox$rb(i^tyndG(j}lyfq_iCxwxKffiteHE8r z62kFP^Aev|DK^5(k&>Rm`lrJpXnP?^Tu5h;{%D^td`eFB*izy;(mvzkiLZf!ac4LE zme(o03+e_XSc*RS!YyI)JFiHyUEU47)Bx)_{0EYAq2Nz%y>Ra^amuZ5VdcvQX%>0PEyh8~&R^JMaaNH6C(nF4z*JlB`=+?j+rHO{F)ynt%ILOy@j0oIR|;_p9Gy z%;foP;Gnq^Idga3zNLcMx_4hczkK`YsgJ$&ff+kt?F2==B&?2X=v`x^-+kDtltpzo zLnZ&b>t9cVcTo;CuJLsYHp89LX1i@9mNmz{nYl1=TdBxm&W2+hy(KB`PY(X3w^EGj ze{copadNoQZvZ>BCZK~JSLrXhVVW#2B(GaW*2;=hd&|E01kWaNctg($S{p@HQyRFg zrUz+n-w*qQH{XPz_Go`@QS~Thosze8jiYM$To~9HzNMW^OiTASmGHVC!!!?5CnA<6@m7UxW_*dym1kmKv?WPZJ<%C8GMK4YpaG_$1aims{1 zc>4&Z&0Y3>e7_ZzZ=88R*=0pJF=ebtX3}{4uB`N_DXVMOM$L;(uW!y-^xmwfJMcf$twVrJt8PnoeGWFUk=l2-PL&4Z{mLwUBIHZ~Ui{ zNlW8;K1DFXI3~e34;E!mqC)x}iKV3SKABl5%+MRRZT@m!}^JkieeDK2+WGIGoXL=|3(VQHJdo&o}u5{+4QoARVTH zmBqW)J2wlQN&V)Ydzff~^31#7O&HJfh(;z2?=Ay*cP~Ev`c!a5z{p!Ik^L6@*+Y%Tu9Bss05PMW8l6QqvsqHtx-fbC_w2DF#|5STCNY+#g zR6K+}*qyHT@U@7`L6j9b8kt9*&wsVNdq3b?^=CKS8SrcIvK?C5=#GkgarDa4dCiM7 z4XkN$W2zO+iZOQIH|bQ0m8Gy1rOTv*p!M?9v{k&ZZNPB(@WPW`QTmlhonA+zB7NQz zeQ<#kj1LBd&`mnpfl@$;cx;@Lt=!*UU7yF#5^N6BdL)`1?4~t-Re-Zg1O$^henY(x z%WAuKedN9w%a_+~6XUitGR|J;o?7{)er;er?2(L=QKP(F%@_*XK+6C z+bw4vC}v+7Hsq*+)hKlRxFi03C9&P)~IJAsERRTqW!Hx}kY52f4M)zs~KI?k^jAXJ-{ zVQawaJw0#(#FTr=_eeBe^<5+Lj+p-W%P8c2crMbede89v%p?nkD`{5Rs8iY!H*3Zm zmL3KF?Z0i!Eif|dtF62%9YTD*ffAt|q3>x^U^xPIMxRs5!Qah~IA+*5Pbcq}2$@_* z1;n_AQD2+!u@{5cDsD%yIrN_WHtRP-I?~-qh~G*$P!jbAeVb0aoK+8u%XI)8vVU2qyWcTwv80iOCByY9x1RHJ6n@8mG!-a_sHk&;~bjt z)d$S+@-L9^ib;c(MxXmiD&^F9?<|X{Yu`n7y8zMGZEe@WDw@I$YIJ35`E*E&(72!C znZMnl+_PX3+$V9&>nfJ4(y2W9FG-)T|smy}<5}HwHBU2(;7SzgZpm@1AsU zYBxORehCy-C%vQS#)vAPq+xa9} zha^8e2!Fj6|4E>xIw86LO?qwI7yjN1N>;X2+MEKGODp2wCZw!k?_bx*I^%VYtfp880$!B*?LQiBV96KY z9uCRtCf8skh|Zkk-c^)Qy2J7wjG|HVN=;Z%M5>tG{jnyGQFd#kW)BIqkG5F)UUgp5 zoVyF-rkZLPl>{sqYTaU_E4nr}mt!J4tMI8N5@MTSc z4TUl2okxY|I~(Shj8Mb^g21RP)Qu%r-X+ zDHz>ZHpWkCdc&SjGkl`=CFDH&IB&}P$0DIDd(F|{m=KCxqsD(E#ivqEEXtwyC z=h)2*id^rVvU`1I3YfPN)!RQw&QNEzx}T2?;4KWo9tnE|?;AIktshciRUv*G?PGh= zyBaw{G`aR(d!;W6hkC^cz)H6t)~0En=ld^ZDsLQ5Jad&Nxz?Qk_}je`e)Ck`)KIS} z(O2^-zRZc@Fl$^nEE$8jgO;#k= zm#6ko3rr6XgfD$5O-sG_Rw)H=crjY$SN#?-d#z^7IQuU6synQ5Yu_P!X3K+uJ8|$K z4*$zRowLbrGiqp!85(2;@9X8&vyP6#(4I|5*$;QO9H=qMkw&;@Vuhh3BsolJGjB1T zxw;tAuuglSu|kb|hx)~L@0|J@b?2C4nee+!32M zxau+Um(nYs3LrO!*=*^Xe=KB>f_1-CShZwbDZEz^Z~Mbs1WFt|nygTy29TucE&JJbKfY8}4jU^i zHfiWh+0==3xpHp)IKf}$Fz5Bok%iE{yC(N;7VUofLf08*})Aiz-v>1tpFFEPB6h=GLa{B?q8m zx62Tp;o}mbVI%pH82Z|PA5B0|s{Tx|93er9VRnqfdStt`Z9Z%AK~l?3WI1HNe-%kb z)`p@7bb@|5y&0!%4MVWzi$*Q_2Ct(L=xb$<&|gA6t^v(G_|utOXS9#O)YbQ-v`8#& z`j5e>I|(%w)A793#+#`T&3=|Rr$PsEh^lFQGSM|uU z5~ZxexiOj^kcmZ`+@kM%oWZezHq$QuE~0@-YHZdb;W&cwJUtP6ek^?DQZ z-HX=Auv?^?Dab(~`%3WlrRPGuCn0(u1Iu1`0c;+OE)&Zl$b3h-7mvpHt@}zE38blP zxZkfSgAhNG;=llZ$2)VLE$Hpz-}N0}NjCNWF@DL&5wW}`=nO)lCi>ktX99!0u+U@cX#L!RSx)8_#}yT=&S}_VTy&v0i$5IQ`>CBxCH*P( zsB6rL2%Y~xS`yYbW90#lH-B_h$tFgt8T#{XKasUQngR|ZS7*9ioncd#xM$S=Uc(|c zOTjq5qRi}u{fyzk8{?dMpH$r^L~YFTKMBgWFsA5VzNF{8i?}V5pIephalR@hl_mGT zK00@LaH2EOKoL~7u3VP*?1}ywtx$W!LoQeUP15RMJd|zPI~j=-M2}Tjag*i^yiU40 zk%Zks2N*nF;L(8(3P#LJpE@=NhwA^($DSX-kZV|vVaB8-%t!)Gn8wV3TiFI;BHeWE z4k@!vHYTGm?br>eot86j}dR(D^j(OvVX9aDUiw z28PQ$+I%iknW&n$rCLgFg+)bKa*t8cZ>H}ck#G8Kt~pcY<~`S|k|$szaFxMU5om^-)nLvzJDG+kO;H z2n!6POF6<&x%)3O0LX~)o(6ghm95}%N1TcRZVlL_S^MlfXzHIEV@+R6;M1Hq((*r zl-l_os3U7AIu!3sepvi>KSLnjn(?|#ON(i{PUJJQ5>MRrXHoc;jds#z9^LX5_jS_BH>avo_Ye#Z?hWg9 zMAXO?@g3X&+un+Cu^k4gS#D;`=G(!iv;1&K?VV-BK5_2!+r~VLnx*=`zw@g;jMpUd zuRfZaG)G?>zbB`8bi^5rslE3X<3>n9+UdEz>ZL9-TIqG*Hbq`=-w%54sxYkeON0d| zW9&B`U0Wi_xC(2hm&}DltL(9j^NaK&mePm6d-R%X3)Vcz9!u;>Lb5g!3u>^#{pDtg zZF8CQqm9^e9R&A7rd<1tr4n=7wnX(s>on?Wpo!z~$2-(V+xq_6I6FN>ul$~=Ix*h8 z=`sUPQ3(tpxBtq**{Exg*<0S~{}TAccCr z!&7MXAU6Y%M~#ijJoD;==ZWN6@YDM}c=kSea^H5k(Ulqj&V$H+g9p z7k|8ZH>ZT5GJEF>C>zscrdY!Jy1s(JODV!cvd2v;f|{mL+MNRPL?qKXN=X zVzE|zzAf~U4}WJ|oE~|GpZnOVOZtsJEJImgMGZV%cLiHw-o{b}l z5MAP3>}@0v@^&O4dME9ZJ1WuCN3ZcBXS>Uzj1!z5M<;jdi#ENOzbSLCvE=>eU#=lB zDOUN&kqNyuf!$oy$!C+}-Sen-n<@ejf#WQn!eu-;NGp8XI}mffgg52Zyp@|y;ZiCp zzsm2<2t{8oLBDAxXs#zoX>Pln!`FA_@oejq$ZAWitDM2_(&d+Lzevq!6PnQq%?0a# zgVQ5_&CT;t%hkjFu`Qv<2Ux|fuDI}(2TP$1@Y;K+1=9j)s+E2IWz}}v&`ErEcHEz9 zpN2+H$m!0M-5Zoa+m1(CQYx^5^hw(`*F3Ua{%A*KK3;KZ^rLGssofh%>w1sWa z)a^Al-~q0u;xT8hvlN2nWONWd4XUAmNNZc4vCty?>O#?s-=h)dJoT3<$ODPL1a8AF zf}9t70+L_dV~Nm9)*lU~AGp2I{>CNG6CU+ta5|RxTYF}<)icJk>3}QXysV3`Y$AmD zgytX-v?*^tFrff8TDP<7QNnrU?_YSRJ?xclUmhqtWB%dhzn~HSK$|ZeFV`}>8t9bk zo@t=~U&JdG>R-E)Gq>mx!g}^&sQ?qzEG>s|joM6)ThTp%q|qAo4%g1c4d2w<$sB;J z1neefX4e}24Y(wq-`Cq*DRStReUh}Of}0a9DuWZ@%!#=jwseg%F*3wYMQSQ_E0MEi zr4YWOTA{((=Fz`htE=?E!=T#l!lYFJ2euXmh8F_F%rmlPmaH!PXdH7W{apL9ZNHQy z_d{2JpW2{0h*afqq2*q*;GFQyL2^t2{zx*c{OBXy{zIJ}QD-1X$x&K-nvcw)DueGn z$C7;&MXoUK-;wEnKZhB(4kct=p4z`7*xrF6xUoB2_B$7R@c`i!1Z zWxa@G)0c141I%)c^ut^$TC(79iu!?1&dFbnS(dS!F_O8Ypv>2$uiGD_KY1Zuk<*YL zk=Bs^q>2Lpn5U~qTHNZjG;b!wlQM)meqv`( zkPLqr7#wn{T4mC~M`Tj3H7O=DRnOZqO9$1n4Ju$|!CGkdmzuF12z|O^lvm0&!W@aU zsq>7vdT3Yg-S(6T_7ScYyOrBbdOO$*278<`w+)P}uHBZqnxf~~=-onH3-E})fKUdx z5{8n1d-D452_&T&Zs1c-FB#fHT1YPwE;bid1KUAVx&yMxJGNxInz^jXrEivz}_*!0&c zrHZo%+KescouI(}O=dUvZe|I7Aer>@reBB2t+b^Wt#>W6rXH7}M`pVz%nVT=NIibC zc_*G5aAy9ybr@^Ll|NnYZikvWwzuH>82h&lzZ3(xF)*{V?)jspp`M3pcbd3_L(o3l zYVT)Hq~%p?gpL;^L;851v9@~8KyZ-JM@PKv5*Ts-_Uw;x2WY(vs>{Wdry-y9Izt7( zr-#laKfeeM3DTC0sn;}0pU6a&@LF;sak%M-)|@qN$XSo?8m*uEh3a-1F4b+hFQXYh zB&>_arw{^r)opquq&`bE2`e;__D`|3MnA6xv7E2$XKaaR*vHR0^?OfUqU!PMqTco< zP;^k!HB$v`R2-++0RWjVis?t`vz`4r2PCB~TiT4!`_wjJp+xc(zv|m6iVDE{a6UEr zD=m=Sq#Jf7t5!DeS^$$i3y6lsT>KI9QVJPdf{H)meq zUUFEOgZ*y3z&=E8s;qsVAQok*gMfGAUaMo-zqPKkptrS}1bV-W^ty5x%i~E)%yi_) z<zI95bC91C}9AZ-tryVNB^Uw z$oiaZy#=R#+#9cfRwN=df?h31ApQI2yld2bxnE{G4*+M9VL3F7+psFy<-_HQ#uukO z-IMjp9-7?ZTF%t0^!HHEKFVaXEfz zeH=>3P6(87f`&_qX~;fU0K)+|yCpxrtNr{?FSS36W}C3tJT|Re^fqYy8hjg03uRZEur-OpF#GZ-N!h0pStJZ09wN`1!!GTh+oAXg*U^row%N(k97;3y| z|6x}^z|N$3^3sx0G#$x|j+sZ!I4I~4%!MmKoJr(F$bl%jbMa2KM&ri}iyH9!3*5NK z12(4eQ~q34*ze_SJCFxo^;em5yZv6YKZH2k!=OxpC~`*C9tDJtcHVkyG0HwZm{P`) zLZvPmHXy2C61IX~lnRr}m7hEh7WCh)4y<;UlEqhZITOsj6OFW8^^f%H;mDa3L>s&n z@>EVs85)o0A%1Bstd72It1IOj|MFsGdJbc3PD&wzo+msdD_TwK0zD$#>lA^gTp|OM z(Pp11d<_fO$uXB-TuXtsnnYxF(C|B;3Mx)}-slDzl^LQa!hP97>z}O+Tw50A$hM}8 zv;R27E4N5NwGMM257vWI8+}8eTGh(Yo{VVK#YFXfeM{e#{=475hSn9TI6DWthRWGz ze(5a#7=yUf-wqOCL~VLQx*W|arGdi~cfg=?gM(5)O7qUnsmVtcuh=I`$^R;^vT@7; zu@jTE*u&(>QK5Hf?-_w(ogAc}c^9qirGslEV1 z7NQbvP3jh)==-(i=E}K{rz^UD68K8g8p>Ex?9a#$C>C~14`^}E|ocy(5! zePQFa*EP}DPp>mX6#8YgKi{_0b6Sj3kTC&T)Mhv@c+|Oe<}pPl=sx%W`8Q9CumJAQ zu36tIUuz_2n=bhcByM^Ed;YY-lvI1_-IhmSrCcO4sP`jgp!%t)QMx874*V z4dhl{yi#zF1}RUU!nW9Eh{dcp!FX&18M9oDuiiWc{!GaByt&=!q!Z z94<_5NSKB+E^#N+p+hiP=h6xEZihbB!Xw~A3?@I=3!SPtBd z&E}M6<)wfcW1r+^UgI8!A^FSZAT{$=KoWvUN!b0l6#6ci!^YFk5%1J{%Ro^Kg)L-5 z8Q?VDfV)iDo+Te;J*G9Yu-!OqSn6lP%g@JKG)2aAHVsTzjw^htf98{1uOHTdz=)o| zZFq^cz( zIZ^#vA8s#{?CKoq-d|wI1%O{`HL7gRCutO%n%Yo`ErD$D+Nydf9T_wI*MKm@;Juoq zynei~gmgwOPc#PiCPLFH>9`y)1$p}}YzLy&46biR7DNKPH~rW`@GC>EI`uT36LMch z`?mMynLj_4H*aFW@9Ht<6%N#p7d?F_O=uR!C!q!^!2rlxz<``u^1hCgJiwN3*()@^OhcLxg+prlXTv!Y2 zSWw+xf2cGaBykSiukP6_-%ynTO?BZgF!$tPWzP`Tn5ZGx=KDO9c$29P*Fpr(F|A@c#v&5(v;GA=XV zJz`~QkoQnS6Lw?>O;T(js70A=>*ah3L>>X^pY>8f&RB?CH|{R_4Fk%%wjT{5I@gM& z_|`(CM90F$>Cnoz-&!XqL8CV&D27C3@CFpV5NZM|@~vtH{aE%_z>F>vE2ca5YsK?} za0kyB4lIpEQi4~*`|lp5L7`JMJfB()1(?Uqvh0T#Lqc_miTGHGGi0muwn%jsmh{#% z?^|*|dN#LbU1x$dhFfYnO)P_c+hAVb>>2zKNb6pK6ov{P2j(C#5D0}`nBBDBMn7uF zM_6?{q#gSt$Jy>{-J+Uy6B(J}9>BB8f~CT*LuYkPmWL>uWl`w*g`m8zyRZl4BKozh z;@0+B6T_Gnjr%Ey>RL`*ci}Tckn1qo8kG#kvQxMTJr=A`Mal6LYN|l~ycTe7m%beO z+_|&K@#&{nZk|z-QMoy<9~(S<4l9AXvQs$sdw2h*Ev&O-v1uHpPN+G@oNh2L3Y2`t z?zTNHRJs<;sS>4Q?4c8HNxwQ?e()<09FYb(sB%5JQEmcZ>*#S#&c@^CQau3h!zzXq z%e_Am&NZi!c7UY^a~OLL2H2yEE<0dcXE2=i4}03T0Ub%`TTS}>&p2Kd676!pug4oB zgV{8tEXon8Z?)LJMnjH#UJ{N;%r+Hn}-eow* zrQ+j7fnPpN@gK~Y6uHW@P}U)|IFQ5pqtC=WI7=|XD^8T?k?znE3LTM;1tr~Z^A;Rt z?*NwxWfA{eLLQ7sDN)=>ji}C{BZryaw*lDU9Y31U{b!WKSA>4z5A{lnD!%N01^Iw% zu8@sU7Kyjn3Tvk+Nf@V4BP5mE;Fihq)Dpjpzr4Nlak~G`mEi0V={#M8M8FiFq6DIc)zALFOF$w}@w6XY?=AvpU8|`-FD_ystd(scV=@ zS~PorBXq3MFcr_+{HB7`hDL4%f4Oc7%-w}Tu39;Ij%CJtlEYiUn{M0^j5}Lfs=g3B zIQTT3_JHP9Z@}8H;YzDVp0EgI$&n#u4!OxWG9b!5GGfn#+}skbYNK_7w(PGA4xN71 zs#gvFrL9e)`PM0&ZZ$z9Tcv@jCg?7?1hz}`|!BYS!!iBp9?!aV__|@I^ zoK@R=4++E?c)p>kJ(4T!w4Zd zM^S{Dx#0lTb;Rk>@@L<~`?Ld3AGK z+u?S};`zw<*;9}q$+@)d{YKB{(qXXOL}&1rQyY0y;wNj`2;I z1)F~^1GRGfp5`NxA@x9zZA}RcI)B+mF(heIk^V|hd3rE@9}YS6310xJF7))MfHDuJ z-_pYKp#AYHSTAQNbN~bJ|r8iiKqbGN#>w-bz9V8ygN=8#-eFh6i z<=`2TbN)9*4mEj%9qMB5l<+hQ*3H4BR_v<=b&kp?L5YJYhj~zzNjW6^gu=Clkqj!{gTkc_L>e3|K$@;Sy4gFx=_L9b@(!)6 zeY<)52`4KAe-ga&(0G?lZVIA?R*tX*Uy%a9r|%QtSgz4@hR_(t=H&(ZlU!#5+1vRM zDRR`fQB&4+S}Wu>k0V0B8vzUu<#Vp%}2wZMXvFD$Sm-ZKq|)v13J->~9q z3^BU@xVR=P*gycw zk)N7erZ_mdaG~J{0Vxh>B16ZOw4Ah)zqPW3Fc5BQDT0DYTyrg8aQoE#y+=XL-fPrv zPQ^bb^$eS^*iiCOED_wk67h&83-s;gbgsONW%VR+wV$2N&o8-fG^V*(4%BJZRe&NA zB%npNYtj7dVoDCGoOcUGB>=&wGeG}D)B1!SlcQjl>2I_&O&Qz;^_CAtp8*=&lK?!~ zsW2A&Li(-+^pe=&9LfEYY`K5&PDw-x&Hql@Y)(`Pgdli-+f-pH+;uo*x%Sl{8A=MI zzJJU|&aNqdBrUW)7lvnLT;brl)=6v*@M|Jz1F}ArtRjOdh)9u&tj(E7uj-LNn*kJt z7|qurgDq5!Eu)nleD-e;T6PzQviaUHipSX&$rH;JI?H1lL<2JDR~xzlr#-g;4b+Z% zVsu}ISpK$w0KmzaY4Ds!YhVv>VSa%xrJ1-hLX(`F7>z9 z_4%1C2Mtt$q791IKek-x2`8tV+DbDYw&yaGRSI{5$?m;a;d@j z5ve&)`3q|QK2vk(4XIYt)LOZGD@o;dk6OMdC^!D+4oB=p?YYAgc&;rVgG2#NRYuWh zB9C_A&K-VQM0yTQ4=<66B1kEBQ(TIRFC5MH!01Z2L5ANRqod$dHjEq8Sbii$|CR!U z8CNMBj)FJJ46v*_mu;1wx&vZJvB_V$m+B7%U^rBPy;@M!y_@2mVFp-?2%+QwCpgg@ z6hhkdn{w_mQ#i+;-*|y5F9u|_BxWW(Xcrz|>Bh2gcM}!xtP}*B!no%Ek{$AxAQis@ zbcZWw_ek~V&b)+*aRCpUs%R$(rrRLn>^t2~Be2el8eO8kFLNOBKEL%UNaO%NHcZh!OMgEIP?kNj5diQeXo@$9YAhr;Nt$i z*fkrja|gb}(rJqS;r|gbtIqU)$?sX{^@;?*0b`p<)r)tt$Z`dow!UvUCvFB7g0A&O zE!jj?Ew=ifZgB2H&0J(yAQG~rm6lbsUBXD0tVD0Z%ey+)LmarRQn{=M1JX*Ps`U z?`9+I3IblxMp7F}{woPBa8N+cq(O0s+c5Dp4n=%Gqpi1W(K~mSR~LB{B5Z|d4cwgr zzN`|+wpIUYiuqtLewB)3mM`%!s){^94qn_xPd$G=GW2N~lXB0*0b)+)oDw8~^XM^P zMzpM#Gko!0$^;oB0j5j@tg^ zkYS#`WL414Kp&&;2HcI!(47%4D=G3=ymNB)86|Gw-XL^5Du;Vy7;+TD z#9oRU1rK;5Yc^;jQ`NUOIpzje^tn_Aerm&8h}U!}ZuI2^2oN-Kt)V@*g&aERVN7_L z>d9@D`ZR5G9118`o=g@hK2p&|m=DF$Coy~o}3P@}zS(7{b z&XTLK|B~!63N=-G=QtnG;OaX3m3wvUht)M2x~IKE4hUyY9FIKmOsJ!X#=zmoASX?9 z2UL@KyA4o7Z-;C(yB0#?J;f*h%Z|o?30FBM>)@`&z&EA6eOlZJb6o-`j926Z1~I`- z0qX$hfL8#y0-`e`pc5Jw@xS$E=KP1#d}(cSl~E}WP)>4N%dnv0tIy652gTTP82l_z zm?noL0!h8$+|~{F2p$H8qGUKWzYawLr_hnW%VtGmWq?ovIeoLt`PYuX5~GjJp|2jY z4g~*bqwqjo5?D$?$^g1F;>%CH+qswE7m`b<4F{CHImg|u-1p0vpfs8E{mWyAsaDs8 z1}R(FazBAD7*>d)21{E)Fj^jb<$wWlHSDz^iiC`3c^4~#(gM$0Xy~Xz81N$qy$iWX z`gpP$?)mSjYx@g_NQx>fRIW2dJJ<0)4gDWXMh_2g-juScAcCWfMnREZ^#_O(bfcWs zpD^hb+nAJw*OyahR}qagqUV2)be-v^#HgH2g?Hwx^_;x%zk0g%K&JZtucV7cq~u6x z)Vi1Lm|OJ_TDR#Tii%=eXUr(+f^<>Lr72ovXH#J%mm-qT&68Q=OvxprdV17UbdheN z{NBg&e1Cs@sz1&+JLi4g@7L{f!g-FUheTR}%Z0p?7?CrAaBWY9KYc><{Av1PA>`d^ zu#8K8`evl#xg&r0{hc*K^Y@_O;kHKJ0Sn?0G%W$6h-3t9fG6)HIXHfI59 z8#$d&vW46coNV+l;!L<^!PoJ3ny}-8V<4utW0B)SB1t?I+2pA378gBxHA{jc+HTM- zAJ>Xa3-CEh1YYuEyC&gmFjC&p!Mrs?af_9znHU7Ew ziwR+SRA^x}NSf!{;F3m3mWf=h2WjZzb@&D;rx%)_$lqvinE~lNL|E@{m~X38R{Vn=ycgF*}c& z;!u#*wwf|Lq9)MVXaZ76@Evy~*3KF(JQ7wm9H}_G6x*d_uK|&JF5tyPaV-;t%qBUUVqb%)Y_51#x1ZB&X+rspXXxgO3x2K_f{X;(s589HCv{mz1LMbIb z`SQ4fe?yFFRqPd393IfTY+00g={DauS)}7^!YYdusB$-QCQJmf5x{juqCzGvM>Yne zGz4iTy0Dv5`%u1#05GtJCA~A*G!qbx0d$uzMQ&{q+gH2}%{J+?8yF;zLb&BOV7a)# z&^Ll1cP{7UGxe!J+FaIo+;P(EheMi;^(7-QPEm^%$RTixeFZ$MV|X!8^s>XA)2k); zKV9a1L9Fol-Fx9sqWXvd`Yk6DS~xs>!mHXkJ`cv zS6y&G5AF26*inygpA>!Mt5GB22caurW@qqVC84xJM?V;;WY0VzdwWGg)NRBx{U`bP zUeZX%{TPQ0>_D~e^hHrH&2)Rd$M)$EQT2 z`Bw33;`E#7_d{Rrj>UYEFH};(kH{)PN!-S*mukj;k#0hTKHsgB;tBLaCjA!vqQxQ! z>V5Dnnj^jYWBf^EN7Gm}SzM5%)Kx2ey5+o3)g-XCaNVTxsI+qNSbxpiV>v&?`$4b-nD;8!x>Fd;prb@-hg~h3HU8#$V(EdR=u1m>X;yC|Gmb&b znWzn{y-Ww9RYB86tIRB6l10ag4=BYQMEZnrydL}T*J+`jr!mU@ok#QBT>-!BO~!SsD#9#F>Q&Es z3^^>=bS!aiONJ~i!(iy&z@UeZQ zMYt-aPAKU{jl4VW6ILx=v=~GOk`pcyaM$`D%PbZ5*bCg_rHLhDK#vy5Y?3izq>g;< z@R>@&EG<#(M0&WU*8G=ZB>kYeB(5rX&tX!K%+aSC>Ai}dfo9I&&`QCED({Q@c1uX= zA<=V=b_O58_Z5_zXz%>%#3FYKxKbihC3}Gif)o<-+J`$X$`e)Xt%7$ME7+&-wl6=u zb`w$+1%Y(B8%*j^@i73bs1zmkfB#{^oH>Dw&rMa(vvYj5AZ>fh#uott*P%s+*TwHuqLe{oKZIsdh{QtStsiHlw}`@*ujdYg7v8Zz6gxkidw;>WSZ zDYS3`NV8xiabf(VTJifbIS;s|_3DS&wEY{vm>c7yog6FhQ>VCR^a zJ)@5NB+M4JEAa;p>EWHWU|b5%_d4!)BG7bii_}K@R8vQxwJyea_#0KmMwD$$|9#Jv z*h0;*3NOjY;g95KR6C-%GkMqmSnW~j=wILO-Y0HR{mjeS!ZOxc8!enO_MNr%LI?kX z-wzT@b+F^ccs%-b3Ilh194!7e z_T`LAb!=zw0G%lJ#kr&DonDIPlsyeGUw*z?z8!SooZ(fv*v)VIW1gn_?w_Hq=#GRZ zMc}FW2{F{rBJ2xtkDdvYw|{v zHq876rE}lCiyd+vvIWuxk5hGBOTOZZN8oAI6h-oGt+p#@LvZh zrGO-lAkkbFPqaY90~5R&jvoPH!xpWHalfko$Bh#L*Od>dm~B&e-1MrCZ{pIJ$K*Qh*27&$X@c zvSd`Px3n?}=H|YX2jl~&Ht^S|3JRvzh|50^dn*aE$@kYX(5~H5QqfAZ9-{@D8!#m$ zI5+8F4dTh3z)@|^ebZxDfiUm4{^F?`TUHSfSSS#o>_xb*vV8d>YG&D@;C&e3z%l!WKKE zY(Vd>F+b5rv@T*a5IJQjSE|`|qwu2l^pl9(^dvIybcQr6r#2gRbjThsf?{$^A##wx zjQec6+-y8TurL;1oe8eO-3cd=sj?otU(shi7K7n72djTwipR>Z&u?1|cyP|36;^|L z-Y?mNc3N24c1};5%~S|ePXB=hgiqX#?$mW0g(vd$oil{7(h<@Kmhz*wa!O3@s{pL}YLyu1xKHRDC zj1F3e4lU=2n5S0U0E-$9DmV5rfdUk(bH}~t(OI?_h-dP zFUt~3ZM&_j^4BdzQ&&yp(9D)*G_$AdcpFuKJXg{C>X&Rg`t8}hxF?6PJ0oSAeoWW} zNcbJG^QZqEeC&L|4=ihpLka%&o#`HPEIW(8kf%Aj^6L23@k5{MhP2V6*@R88L~B8`gPQKqQNnsaPAms`>sdy+r|)pm>D zOzHqoI2HKCwTsW8W30H_DICrGKfw1**I82zU_6lo8Oq+;1s5pfx-;`?Mf?l(Bg9mIf!wdcGGTNH!si+?I1)!C2 zbKZUmp+$iH;tEp>un>I`I=(Qnvu+!Uh<-hP+xNwznUeL2`(igBVi)Y2lB7i|l6Rnf z^rPYtU9nA;mUbwms2ATqzBU~%b$$od*6s3 zIYP;{mQIl2I{4dvwtmt`+kU?KVV{D>nSt&vaE3uZ5;QtV1b0evMSNA@QJf@r>?&Ur zB)fuw@2mqx^lN*%!-wp~pyBGY<>)7sr6h6q>2Yrao$ACY8uYK1@^NVM94l@T5(k2z z*rd1XU&i(vnpc2pat%4HsvM%$`)ihUn?JXNh}a;4hvlc@q<7StXDIJwCAW%g1q>z- z`-4OTA@svi`@d>;(2*w zm8GHe;#7HWLcb@S{DwXPNLQFvvVEb`Efu`M{_*IX&riB_V!T@THKD(eUUmEIo)P>f zuU#;T>2f7pR466#Q_-))wmcY+)INR)#vK7OOt;hmX!<%pV&0LE))=kEJ^WS>@#UC4 zT0Lklr?>wNw2nWs5}>ou`yN-~(-`@#t>y$i*VFEl9afQaZW`S=AKx*wa8+k=VGMRB zqk}RK{{ypNlOlIEXeF)o=*1gT7~E4uQ|PGCY-jAwFGnZF6yHzY=i`Xzm*dIFMc(*K zQlrYLO-{!-Da(o7laaF%FwBBC+PF`}AA0v-z9DKx$K~XZ`>zCkQu)LC#V8m?=2IN$ z2}ps-WT0}O7!0rCbI@$ahI1IdG<#hv@pm#{D62l52H6T-qU_t5CUHJ&rF9+eFo5z; za&oZ8_dC6Y&k)qm0dF|bPjPYWYP+oAyT1!mBd6Jav15*><0ok@42dpM3_sQxV;Hzt zTN*0}xbM~QC5ldmsv;VWufvhwvGa%Qxl;fcO>sd%N}@|rO->@XNgVcgK#bAO0+B1d z+z?7TJ=~MlK`$e(&L@^?k%+^Z$I8WdVAafgYMO<6ZIN70Cvi}(uTP3BGRlHSs{%;V zKQczV{{Pdxt6kmB?81`b#jWBc5a@vS=3xwDOVni|VD5`>|F45-9>&~Mi-;i5Bm#51 z5dI##T<8t1;gma{CX{%ektgo8z{Gwx49PC51>VcN@%B}dEUjSKpkWpmt%|e|=ZSdP z$p>;%_)t9XG^INEjq#^#eq{3a9D4h93ZfZ1E_3+8G{uT*h$(L%NXDUO%c6f@X_$%& zA~5G7hf>q6MLlCV$Ml4{)jMOyr*)>h#F1Yo$V*_HHx8m2n=Qe7Yn}n>(?;V@ zY9)ub{Qx!6A9JK8OM7Z?>zqi;VT~4gKU;XtMwgC8eerLi-1_xq%_B;Qp<20l83fj= zl1x(p$&s|ufRmk_y~xQHtvDrA88ki}k0S>HKShRO)Ml}Fax29p`4MF;*oc;bSj@*m z5?OEdRQLx)iiDiBFH|pxe!qYBf4<3TBBFV$I-)s2ZPmn+!LMg`$3f&N{UI1q-o7!? zVWKu4Oh3{w+!u2a&kg&24}UG*aK-?JUsoZrRvbWUW!ZMRyI6I4!4iYd!iP=GWmz;u zx_znrS1TAqL}W0Q3HxFtWka(Y$U!z-TQ0x>U4ZC$x{bD%=p$KpgAJqW61@M(2fMci z`U}4LI+!DGNk4BRXx&1=Dy&Bk-9;3s)H3f*3$ejOS-s1bXLJH%^={y@$C7dQXWy+opGB>XXFw!bQ(zhYx0dp(T5k+a&^ z48h=Q`0*d&XF<8uJEG&?!zMi9sf-L7olQVGU%Mm>BXiOlk2T$9f33}hCB#b7h)4{3 z`8}QY7*2dDxP48rWT5GlB}SA&p&HLof;ICg-Ckt?H*sS4LA*DiNIvd{F-TeB0-DJv z!sNEqO1+0$r}0!yo`(V1V-y+6rjJD9;(a*v^U?9kAjV>6`8^U$57>`oa3vt`C7u|7 zi8Eeh@a4I=$WaZ2--+W4?kE2%*z+F?0yV#E8T!ZxM05GT9l$pRkajB71Y1{a*{#K_ zQX@6QDRpCMFcYTe^P%}Q#DHVPjH8NK1yEhO5PX)AQtD#HyML!=rMw&t)B#9uVwW@&-9fb+ zdGRl?JvTeUahGZlnU8=*FxaxW*V0hWZ2RBKZ{vk+)$Y(z ziLQbgvLZmFBv&#GeVbFevEI&wbrj(Pwwbed?XF?%oAiDq?j+W7+q(<0I@gC&I?Fg0 z{xvng3{eS!zrg$9YFYJGpiNd8SlTEuQ>kzY-yD=;L*@wbj}TL}Pl%iGF6@DIi{l*Y zJ|@}Cra>x$y``)`--^p}o90h54e1er$w&py#6DvQAK3F_;@)?h_XFE~dR8&=?Ze-) z++%SdIQ1Lqn?8?_ZnSyeuyt#5Tz83v{n5I<(+rLOyT4sXk4AT7aPIUC`DV6L=7W{N z$@I4*?GGLi54PK@!^qhTy%wH)moBl z2-qog@5ZJ%br1uihA&Jt?>dPr;2EIj4p`W52lrcYL>F1NKq7)3?K-+Np5b zKA-Q)*+u0KGGVK|NT%fvo5&xjXX;LB6Q?r!hXo`raDF#Ez+IkS-#TE=A55Ed6DS-+ zyS5yaCdN5KdB7&8VZmvl&b;~do#XI>4{=KM1=1q~DGRzxMt5DN{|F9zfq%*0#wH$> z@5A|N%a2a5Utf(H>5YN|UsfD3*nPlWgwuEYt+&wOktxL)h<#UA&_lc-eNWB6Vm?E_ zGr{hS*w_T|-SIY}-Lk|_8^^r7va-Q2HnhZ`wlN(IU)*)Y?_n)|{xDV$ZTWP2Z7|JD z-@3Fx?b;@2!dL5YFX7|%S&!Zz^^l<9@yq^VRvGt6_EFJ8UpMVkRs|orwLsXr^Z|pS9=4Jz2xa zsXbWl!>PC#lTL^BQgAE7+!QH*l(=Ou59|~LiJ)h82S>J>HnC@VqTvhaPW6K`*NKFh z2jic=IbWo?;JZnmL&1tiR&H_GG|;d$!yR>8xWPhnW|+I}wCpqO zs4>g^97MYab<;vBNykhdM`f1g)NZXOt{=;MMf_<7VCLtI)KoHpl81Y>1TrlBc2_Pt zgkGd=vG1fH&h=%Go8l=JOv`;h06&9hU@1!unAxImZMwVUY&xV&UXy_;wz2Y7pK!y5 zZ0vGpDCvQis+Ee-K6UMa;Np{LIHaxYJ11M(NVJndpwGl0QSR<})kA?aWN8!Eb%>l= z=X&D6k>#vYsAE8?p_F{H*?8n6e*6s!s8iI81Uv{rnM%%;2oZC$*xIstbtGu(_inuWH=(eO4-nLXNnWZ#Q8V!^2Dj@bIm zKVODF+_)i^S>*+Rm1RcrZMgcK!7L(HJ2?g4dGK0&I$lSus>N$hWMY-?vp@ctwhH^g z-SAHBdRu1=PZZX$lB}B&pNTHX;GJaqaqD+$+oNr*%QmY!zTEzJK%dc9#b=3~hy}Cc zV63(dgCB}6oYvK0FIM-|UNjA@4ursIzZpk03ABNVJ@cPIi%|k*QbGmsj%jS2VY1EZ zwny!Yf=lqkV!?_Uv*$W3IhPC_`Vk?lr$)?|JC=;yUSIW|8s#@!Zf zSdMZ%CAZU&o{rh?035j!iZFsDr z)OHOJLV+NPt0MC^1f>-V`4b_jSKwA)zm|zE?j7R!8z7<;W9DG1-~;8E_eM*wgpBU83ID^r%5=Mkcs#X3+=O5VQR z6-Y`Gv9!zlZ;0P}uNq@n&KLU!S+S3pHuy94iZP=;mX1G?o0IdU*e3Lem_;&kAe42}g+)Y=7ps zfu~6mJ67I6d_lK29($dNl})`*F;8ZoLb`6a2y|`D=5Kzoe(YfFpfTR{reSGly_2lRBE-clJ%3f6M$cVZ}w3sa54w1CNW{GjbM(f(6c=8=>i{}|2Gj}fXS9+j5oUm8O{nw99V zFQ0%|TcSFmnAVMzb$#}FP23xWt^Cm+0s2~S?w-s(@)R*z6 z3z-s+`U^_1<(2Nk>vCCLl=Y5n$s3uOS|HbkhG-LZ&AjISovexmZa+WEonpeB(Q~3=-JzVF`R0-t0oZX5p4S`*(SecjE}@>b#&?vehiNQsQ#h ziPv6d(NM@-hSJxgiU|wNnXt=kiiGs+8XyutE1fv6*+e8j?il=|22gHMdxrOqA`1>z5plb?!5gK*kX0qRX2oxdDLzeukBV?gU zc0;V=ATto&gG4sF^sSk$(0n?TRH(PSlgMT=O_@FcOQM**De)F2(+zvM%yB2^>BT*3OAi{9LtG#BkGzbQB_ zU!Bx&W?0LXm>V7Im99=$PQ3BpKHZ}a^`)~Xrtd!6W4*W_J@Wmz3p!bNErTA4`sLm? zL>+Wbai6pSta^2Gq`H-N{%TxpxymT z%>*=)`s27on#ouD@DtsEt1!(aSNdGk?|brtR*EU}Ua9E%M*G2h`~Pn&qiap-K)Ytp74ORAH$Ljx2_hml80ap?1S6+KsXMBT6;}KY0oyKU pWQaHsVZOUPz-mwrZW}RLt4kU}jVB^2$p4*c^@??_1Nu literal 0 HcmV?d00001 diff --git a/Plugin/src/test/resources/minimal-test/bedrock/items/simple_assets/configuration/items/topaz_sword.yml b/Plugin/src/test/resources/minimal-test/bedrock/items/simple_assets/configuration/items/topaz_sword.yml new file mode 100644 index 00000000..a972bd4e --- /dev/null +++ b/Plugin/src/test/resources/minimal-test/bedrock/items/simple_assets/configuration/items/topaz_sword.yml @@ -0,0 +1,7 @@ +items: + default:topaz_sword: + material: golden_sword + data: + item_name: Topaz Sword + max_damage: 64 + texture: minecraft:item/custom/topaz_sword diff --git a/Plugin/src/test/resources/minimal-test/bedrock/items/simple_assets/configuration/pack.yml b/Plugin/src/test/resources/minimal-test/bedrock/items/simple_assets/configuration/pack.yml new file mode 100644 index 00000000..1f627441 --- /dev/null +++ b/Plugin/src/test/resources/minimal-test/bedrock/items/simple_assets/configuration/pack.yml @@ -0,0 +1 @@ +pack-format: bedrock diff --git a/Plugin/src/test/resources/minimal-test/bedrock/items/simple_assets/resourcepack/assets/minecraft/textures/item/custom/topaz_sword.png b/Plugin/src/test/resources/minimal-test/bedrock/items/simple_assets/resourcepack/assets/minecraft/textures/item/custom/topaz_sword.png new file mode 100644 index 0000000000000000000000000000000000000000..72dff60ab6f43c70c9680d704501858156b459a4 GIT binary patch literal 291 zcmeAS@N?(olHy`uVBq!ia0vp^0ze$V!3-qTOIhuKlyQJhh%1opvShd%$?zWtUe|t1 zW%z$o)PVu9vRo3g@iTz{53)ukqq917F=6t_wdKKTVdeKie+GjpAD&+DG^d~MIyxvBQ2EQR+X_VV%Z z30s{scjV*S4*YAo`JpRMDFI)h4|ueNd$dy+7#-sq>BnbE48!{!whHm}_jB~~CB{Yc z`JLe7<5voFc8_+q#px5mLNt8;_0fn835Q1W@trV^4fiDk`9&Yb`}qfk8pj)awfzF5%h@i#zu!v#Ogyg2=R;dJscYn92%t`YbgJp z`|3mA|6SIUKm4CA(Lsjt|0R^Wt^Hw4Sft-!Jq@HfK}!pDSXWQOSI1We(9=2Yt9BTr zh0@m40yMRB)R9PiG)i9!efYos>8iJ-otIrhJ&gMJyx2Si7Q>uYMp#KdUC02*PD z{+dWVJv~h=lqL$L4)suviVKbQja3hgQuv=cnEOQ$A_K#t1H(cO|GT3vKI~kyp*$q) ze?3J=xUKE~zHw;Of3Fp^YMQaW;hIPdEzOXSe~ zkrr4zQ&TfNv@Xi*I9l5RrDgg*W357?qJ2XNe*ZHz@c)d}`+ttr$3*)1Mu$Z@hlK_I z&j#8Dghhu%1%!nkMxiy3$ivERfuY2(m?)Khi~HZQ`b7qw_akB>!$J=KXLa-g|1T1t zQQBI^O?83)k-*Gc4{eUc9yiz3Lt9|bko5mGmiT{p^8X&I{r@{w6B0)A-`4(rw)%fA zLHPOi^?zd*`tiTf?-vR|J`%#Vr9y53q%wT=IA;qvgjln`{>6)AGu1Xr5!!6FFGT)G=jURv`k!q`Sz?uvg9%~QK3BYr5^`l+oo zQbvLfV)A_rN)w4M;w?P%QleBiuUVK6Q;{RZ{iDJk*2A*M&-Fo$O;_Qw^ZxCxe1WL(|_Ute<#OLf^B1oK2I z6?)u-{7{ELy!SnlQIWm6qq=x$w0l0axZTyI7&N_k*02VzbHi1$WuHrrXP z>@2!5)bw$VM_M$#I_-R<(IFMMXr|}!v@{CMM=uVmTuF}5loqo+CVn%}_S&W7*O#rs zPO2BsOOvq*PRHd~vDi#Y#qtQdV0%4{gQ7H76g|}N?NytSIByFznZiKJwos$KVsJ3& z?G2SLx*Ogn5R)xc z(}Kbxjvp^8srEHdtV)S0^3aSnQ^qQb7Zp|>lNR?fQcQ?XuDBB7pnW*YQPWWK&@GZ- z?xm|Y9gm%}Qp$`t6CWLQ%}qPS8-3AAvGiiV_0;RBSY2%7e zk|?*TK;yE@q}$GFw7febmrhPzI{7xq^7<*2;TQ}ZcdR1P@tUooo2Iy*-r@a{qD6kj zM#_h*HRa?ag(7XV)Dfat88^RV*w??^cae{e7-D5^>Kyy_GDKep(Q!{sQr!?{NKC<>$)%J2<%6z6TR*?SA-6Z zPq{o`Tzk9JxVXNG4Sx6`R6@q)^=*^wAP9>risCJHp3&Tzrp?oZ7S|qh{1wXWBfgAD z+S<~aZLiCXIo-%T;TKw)r1jWt*%kR$?Sbu^G4r^w%8+L-nJw^&ikq(sz4O<{)cx-- zJ_@b?zUdso1v=-%Fh^bxvph4 zlnSt4QH@lCF0*3DU8Ot}iv(Zw<;Hw;W=oTqFwe!8foDyr`|>KTyfIimJ2WQk)Rd-% z4F!2eu5kKtF-z=2NL$%=kIS3)I6I}Kz>NYIvOS;t$|aCa?bA;@okMGdWsu%sdExgS z`&_M2Q5RrRi~8>+#*YM8tn~FYHst`+O#`nYW*uWv_(-CbNs9yuGJU7eba zY-u=x7Fprq5EouGskk(?!8p{nZ*dp>7I)>}!g4zsUW)8-aoTutHA&OH=*<@2cKY>S zpA2ya%AAE&SxJrRSMCKjwQv9N^iBNouB%wvMPD_N&fH%3>ERQdVLsm8Q;)9C;W@U# zi162i>UH;AR^)DtxH44i9}`oNk6n!UMx>3#!$=c&A_<4Agp=u3N*4K-88p|+X(~>? zOiM^_9GW`sY;F6?mtb5>zhS%1OxZi!1+tiZt%E6M*i?i&&V%;WM5C7dz(l>i{y?J1 z+2NbFlKrK1RKkeTo`2nS;5In%3|nsbdhXT5+=WymTX}ioXDO**Kgp(R0b?d8nO0eD z=EgoUJPa^fIk54rXe7;CIJWgdb9r!mCO@akFaJ+zPWrbJFzozDN^k7QME*{KE}@hb zE&j%+&y0O@VMLxaA+;mYh>O7 zNjXBMw{e{j>5E-tR{opU%Fjk?<)adox$rb(i^tyndG(j}lyfq_iCxwxKffiteHE8r z62kFP^Aev|DK^5(k&>Rm`lrJpXnP?^Tu5h;{%D^td`eFB*izy;(mvzkiLZf!ac4LE zme(o03+e_XSc*RS!YyI)JFiHyUEU47)Bx)_{0EYAq2Nz%y>Ra^amuZ5VdcvQX%>0PEyh8~&R^JMaaNH6C(nF4z*JlB`=+?j+rHO{F)ynt%ILOy@j0oIR|;_p9Gy z%;foP;Gnq^Idga3zNLcMx_4hczkK`YsgJ$&ff+kt?F2==B&?2X=v`x^-+kDtltpzo zLnZ&b>t9cVcTo;CuJLsYHp89LX1i@9mNmz{nYl1=TdBxm&W2+hy(KB`PY(X3w^EGj ze{copadNoQZvZ>BCZK~JSLrXhVVW#2B(GaW*2;=hd&|E01kWaNctg($S{p@HQyRFg zrUz+n-w*qQH{XPz_Go`@QS~Thosze8jiYM$To~9HzNMW^OiTASmGHVC!!!?5CnA<6@m7UxW_*dym1kmKv?WPZJ<%C8GMK4YpaG_$1aims{1 zc>4&Z&0Y3>e7_ZzZ=88R*=0pJF=ebtX3}{4uB`N_DXVMOM$L;(uW!y-^xmwfJMcf$twVrJt8PnoeGWFUk=l2-PL&4Z{mLwUBIHZ~Ui{ zNlW8;K1DFXI3~e34;E!mqC)x}iKV3SKABl5%+MRRZT@m!}^JkieeDK2+WGIGoXL=|3(VQHJdo&o}u5{+4QoARVTH zmBqW)J2wlQN&V)Ydzff~^31#7O&HJfh(;z2?=Ay*cP~Ev`c!a5z{p!Ik^L6@*+Y%Tu9Bss05PMW8l6QqvsqHtx-fbC_w2DF#|5STCNY+#g zR6K+}*qyHT@U@7`L6j9b8kt9*&wsVNdq3b?^=CKS8SrcIvK?C5=#GkgarDa4dCiM7 z4XkN$W2zO+iZOQIH|bQ0m8Gy1rOTv*p!M?9v{k&ZZNPB(@WPW`QTmlhonA+zB7NQz zeQ<#kj1LBd&`mnpfl@$;cx;@Lt=!*UU7yF#5^N6BdL)`1?4~t-Re-Zg1O$^henY(x z%WAuKedN9w%a_+~6XUitGR|J;o?7{)er;er?2(L=QKP(F%@_*XK+6C z+bw4vC}v+7Hsq*+)hKlRxFi03C9&P)~IJAsERRTqW!Hx}kY52f4M)zs~KI?k^jAXJ-{ zVQawaJw0#(#FTr=_eeBe^<5+Lj+p-W%P8c2crMbede89v%p?nkD`{5Rs8iY!H*3Zm zmL3KF?Z0i!Eif|dtF62%9YTD*ffAt|q3>x^U^xPIMxRs5!Qah~IA+*5Pbcq}2$@_* z1;n_AQD2+!u@{5cDsD%yIrN_WHtRP-I?~-qh~G*$P!jbAeVb0aoK+8u%XI)8vVU2qyWcTwv80iOCByY9x1RHJ6n@8mG!-a_sHk&;~bjt z)d$S+@-L9^ib;c(MxXmiD&^F9?<|X{Yu`n7y8zMGZEe@WDw@I$YIJ35`E*E&(72!C znZMnl+_PX3+$V9&>nfJ4(y2W9FG-)T|smy}<5}HwHBU2(;7SzgZpm@1AsU zYBxORehCy-C%vQS#)vAPq+xa9} zha^8e2!Fj6|4E>xIw86LO?qwI7yjN1N>;X2+MEKGODp2wCZw!k?_bx*I^%VYtfp880$!B*?LQiBV96KY z9uCRtCf8skh|Zkk-c^)Qy2J7wjG|HVN=;Z%M5>tG{jnyGQFd#kW)BIqkG5F)UUgp5 zoVyF-rkZLPl>{sqYTaU_E4nr}mt!J4tMI8N5@MTSc z4TUl2okxY|I~(Shj8Mb^g21RP)Qu%r-X+ zDHz>ZHpWkCdc&SjGkl`=CFDH&IB&}P$0DIDd(F|{m=KCxqsD(E#ivqEEXtwyC z=h)2*id^rVvU`1I3YfPN)!RQw&QNEzx}T2?;4KWo9tnE|?;AIktshciRUv*G?PGh= zyBaw{G`aR(d!;W6hkC^cz)H6t)~0En=ld^ZDsLQ5Jad&Nxz?Qk_}je`e)Ck`)KIS} z(O2^-zRZc@Fl$^nEE$8jgO;#k= zm#6ko3rr6XgfD$5O-sG_Rw)H=crjY$SN#?-d#z^7IQuU6synQ5Yu_P!X3K+uJ8|$K z4*$zRowLbrGiqp!85(2;@9X8&vyP6#(4I|5*$;QO9H=qMkw&;@Vuhh3BsolJGjB1T zxw;tAuuglSu|kb|hx)~L@0|J@b?2C4nee+!32M zxau+Um(nYs3LrO!*=*^Xe=KB>f_1-CShZwbDZEz^Z~Mbs1WFt|nygTy29TucE&JJbKfY8}4jU^i zHfiWh+0==3xpHp)IKf}$Fz5Bok%iE{yC(N;7VUofLf08*})Aiz-v>1tpFFEPB6h=GLa{B?q8m zx62Tp;o}mbVI%pH82Z|PA5B0|s{Tx|93er9VRnqfdStt`Z9Z%AK~l?3WI1HNe-%kb z)`p@7bb@|5y&0!%4MVWzi$*Q_2Ct(L=xb$<&|gA6t^v(G_|utOXS9#O)YbQ-v`8#& z`j5e>I|(%w)A793#+#`T&3=|Rr$PsEh^lFQGSM|uU z5~ZxexiOj^kcmZ`+@kM%oWZezHq$QuE~0@-YHZdb;W&cwJUtP6ek^?DQZ z-HX=Auv?^?Dab(~`%3WlrRPGuCn0(u1Iu1`0c;+OE)&Zl$b3h-7mvpHt@}zE38blP zxZkfSgAhNG;=llZ$2)VLE$Hpz-}N0}NjCNWF@DL&5wW}`=nO)lCi>ktX99!0u+U@cX#L!RSx)8_#}yT=&S}_VTy&v0i$5IQ`>CBxCH*P( zsB6rL2%Y~xS`yYbW90#lH-B_h$tFgt8T#{XKasUQngR|ZS7*9ioncd#xM$S=Uc(|c zOTjq5qRi}u{fyzk8{?dMpH$r^L~YFTKMBgWFsA5VzNF{8i?}V5pIephalR@hl_mGT zK00@LaH2EOKoL~7u3VP*?1}ywtx$W!LoQeUP15RMJd|zPI~j=-M2}Tjag*i^yiU40 zk%Zks2N*nF;L(8(3P#LJpE@=NhwA^($DSX-kZV|vVaB8-%t!)Gn8wV3TiFI;BHeWE z4k@!vHYTGm?br>eot86j}dR(D^j(OvVX9aDUiw z28PQ$+I%iknW&n$rCLgFg+)bKa*t8cZ>H}ck#G8Kt~pcY<~`S|k|$szaFxMU5om^-)nLvzJDG+kO;H z2n!6POF6<&x%)3O0LX~)o(6ghm95}%N1TcRZVlL_S^MlfXzHIEV@+R6;M1Hq((*r zl-l_os3U7AIu!3sepvi>KSLnjn(?|#ON(i{PUJJQ5>MRrXHoc;jds#z9^LX5_jS_BH>avo_Ye#Z?hWg9 zMAXO?@g3X&+un+Cu^k4gS#D;`=G(!iv;1&K?VV-BK5_2!+r~VLnx*=`zw@g;jMpUd zuRfZaG)G?>zbB`8bi^5rslE3X<3>n9+UdEz>ZL9-TIqG*Hbq`=-w%54sxYkeON0d| zW9&B`U0Wi_xC(2hm&}DltL(9j^NaK&mePm6d-R%X3)Vcz9!u;>Lb5g!3u>^#{pDtg zZF8CQqm9^e9R&A7rd<1tr4n=7wnX(s>on?Wpo!z~$2-(V+xq_6I6FN>ul$~=Ix*h8 z=`sUPQ3(tpxBtq**{Exg*<0S~{}TAccCr z!&7MXAU6Y%M~#ijJoD;==ZWN6@YDM}c=kSea^H5k(Ulqj&V$H+g9p z7k|8ZH>ZT5GJEF>C>zscrdY!Jy1s(JODV!cvd2v;f|{mL+MNRPL?qKXN=X zVzE|zzAf~U4}WJ|oE~|GpZnOVOZtsJEJImgMGZV%cLiHw-o{b}l z5MAP3>}@0v@^&O4dME9ZJ1WuCN3ZcBXS>Uzj1!z5M<;jdi#ENOzbSLCvE=>eU#=lB zDOUN&kqNyuf!$oy$!C+}-Sen-n<@ejf#WQn!eu-;NGp8XI}mffgg52Zyp@|y;ZiCp zzsm2<2t{8oLBDAxXs#zoX>Pln!`FA_@oejq$ZAWitDM2_(&d+Lzevq!6PnQq%?0a# zgVQ5_&CT;t%hkjFu`Qv<2Ux|fuDI}(2TP$1@Y;K+1=9j)s+E2IWz}}v&`ErEcHEz9 zpN2+H$m!0M-5Zoa+m1(CQYx^5^hw(`*F3Ua{%A*KK3;KZ^rLGssofh%>w1sWa z)a^Al-~q0u;xT8hvlN2nWONWd4XUAmNNZc4vCty?>O#?s-=h)dJoT3<$ODPL1a8AF zf}9t70+L_dV~Nm9)*lU~AGp2I{>CNG6CU+ta5|RxTYF}<)icJk>3}QXysV3`Y$AmD zgytX-v?*^tFrff8TDP<7QNnrU?_YSRJ?xclUmhqtWB%dhzn~HSK$|ZeFV`}>8t9bk zo@t=~U&JdG>R-E)Gq>mx!g}^&sQ?qzEG>s|joM6)ThTp%q|qAo4%g1c4d2w<$sB;J z1neefX4e}24Y(wq-`Cq*DRStReUh}Of}0a9DuWZ@%!#=jwseg%F*3wYMQSQ_E0MEi zr4YWOTA{((=Fz`htE=?E!=T#l!lYFJ2euXmh8F_F%rmlPmaH!PXdH7W{apL9ZNHQy z_d{2JpW2{0h*afqq2*q*;GFQyL2^t2{zx*c{OBXy{zIJ}QD-1X$x&K-nvcw)DueGn z$C7;&MXoUK-;wEnKZhB(4kct=p4z`7*xrF6xUoB2_B$7R@c`i!1Z zWxa@G)0c141I%)c^ut^$TC(79iu!?1&dFbnS(dS!F_O8Ypv>2$uiGD_KY1Zuk<*YL zk=Bs^q>2Lpn5U~qTHNZjG;b!wlQM)meqv`( zkPLqr7#wn{T4mC~M`Tj3H7O=DRnOZqO9$1n4Ju$|!CGkdmzuF12z|O^lvm0&!W@aU zsq>7vdT3Yg-S(6T_7ScYyOrBbdOO$*278<`w+)P}uHBZqnxf~~=-onH3-E})fKUdx z5{8n1d-D452_&T&Zs1c-FB#fHT1YPwE;bid1KUAVx&yMxJGNxInz^jXrEivz}_*!0&c zrHZo%+KescouI(}O=dUvZe|I7Aer>@reBB2t+b^Wt#>W6rXH7}M`pVz%nVT=NIibC zc_*G5aAy9ybr@^Ll|NnYZikvWwzuH>82h&lzZ3(xF)*{V?)jspp`M3pcbd3_L(o3l zYVT)Hq~%p?gpL;^L;851v9@~8KyZ-JM@PKv5*Ts-_Uw;x2WY(vs>{Wdry-y9Izt7( zr-#laKfeeM3DTC0sn;}0pU6a&@LF;sak%M-)|@qN$XSo?8m*uEh3a-1F4b+hFQXYh zB&>_arw{^r)opquq&`bE2`e;__D`|3MnA6xv7E2$XKaaR*vHR0^?OfUqU!PMqTco< zP;^k!HB$v`R2-++0RWjVis?t`vz`4r2PCB~TiT4!`_wjJp+xc(zv|m6iVDE{a6UEr zD=m=Sq#Jf7t5!DeS^$$i3y6lsT>KI9QVJPdf{H)meq zUUFEOgZ*y3z&=E8s;qsVAQok*gMfGAUaMo-zqPKkptrS}1bV-W^ty5x%i~E)%yi_) z<zI95bC91C}9AZ-tryVNB^Uw z$oiaZy#=R#+#9cfRwN=df?h31ApQI2yld2bxnE{G4*+M9VL3F7+psFy<-_HQ#uukO z-IMjp9-7?ZTF%t0^!HHEKFVaXEfz zeH=>3P6(87f`&_qX~;fU0K)+|yCpxrtNr{?FSS36W}C3tJT|Re^fqYy8hjg03uRZEur-OpF#GZ-N!h0pStJZ09wN`1!!GTh+oAXg*U^row%N(k97;3y| z|6x}^z|N$3^3sx0G#$x|j+sZ!I4I~4%!MmKoJr(F$bl%jbMa2KM&ri}iyH9!3*5NK z12(4eQ~q34*ze_SJCFxo^;em5yZv6YKZH2k!=OxpC~`*C9tDJtcHVkyG0HwZm{P`) zLZvPmHXy2C61IX~lnRr}m7hEh7WCh)4y<;UlEqhZITOsj6OFW8^^f%H;mDa3L>s&n z@>EVs85)o0A%1Bstd72It1IOj|MFsGdJbc3PD&wzo+msdD_TwK0zD$#>lA^gTp|OM z(Pp11d<_fO$uXB-TuXtsnnYxF(C|B;3Mx)}-slDzl^LQa!hP97>z}O+Tw50A$hM}8 zv;R27E4N5NwGMM257vWI8+}8eTGh(Yo{VVK#YFXfeM{e#{=475hSn9TI6DWthRWGz ze(5a#7=yUf-wqOCL~VLQx*W|arGdi~cfg=?gM(5)O7qUnsmVtcuh=I`$^R;^vT@7; zu@jTE*u&(>QK5Hf?-_w(ogAc}c^9qirGslEV1 z7NQbvP3jh)==-(i=E}K{rz^UD68K8g8p>Ex?9a#$C>C~14`^}E|ocy(5! zePQFa*EP}DPp>mX6#8YgKi{_0b6Sj3kTC&T)Mhv@c+|Oe<}pPl=sx%W`8Q9CumJAQ zu36tIUuz_2n=bhcByM^Ed;YY-lvI1_-IhmSrCcO4sP`jgp!%t)QMx874*V z4dhl{yi#zF1}RUU!nW9Eh{dcp!FX&18M9oDuiiWc{!GaByt&=!q!Z z94<_5NSKB+E^#N+p+hiP=h6xEZihbB!Xw~A3?@I=3!SPtBd z&E}M6<)wfcW1r+^UgI8!A^FSZAT{$=KoWvUN!b0l6#6ci!^YFk5%1J{%Ro^Kg)L-5 z8Q?VDfV)iDo+Te;J*G9Yu-!OqSn6lP%g@JKG)2aAHVsTzjw^htf98{1uOHTdz=)o| zZFq^cz( zIZ^#vA8s#{?CKoq-d|wI1%O{`HL7gRCutO%n%Yo`ErD$D+Nydf9T_wI*MKm@;Juoq zynei~gmgwOPc#PiCPLFH>9`y)1$p}}YzLy&46biR7DNKPH~rW`@GC>EI`uT36LMch z`?mMynLj_4H*aFW@9Ht<6%N#p7d?F_O=uR!C!q!^!2rlxz<``u^1hCgJiwN3*()@^OhcLxg+prlXTv!Y2 zSWw+xf2cGaBykSiukP6_-%ynTO?BZgF!$tPWzP`Tn5ZGx=KDO9c$29P*Fpr(F|A@c#v&5(v;GA=XV zJz`~QkoQnS6Lw?>O;T(js70A=>*ah3L>>X^pY>8f&RB?CH|{R_4Fk%%wjT{5I@gM& z_|`(CM90F$>Cnoz-&!XqL8CV&D27C3@CFpV5NZM|@~vtH{aE%_z>F>vE2ca5YsK?} za0kyB4lIpEQi4~*`|lp5L7`JMJfB()1(?Uqvh0T#Lqc_miTGHGGi0muwn%jsmh{#% z?^|*|dN#LbU1x$dhFfYnO)P_c+hAVb>>2zKNb6pK6ov{P2j(C#5D0}`nBBDBMn7uF zM_6?{q#gSt$Jy>{-J+Uy6B(J}9>BB8f~CT*LuYkPmWL>uWl`w*g`m8zyRZl4BKozh z;@0+B6T_Gnjr%Ey>RL`*ci}Tckn1qo8kG#kvQxMTJr=A`Mal6LYN|l~ycTe7m%beO z+_|&K@#&{nZk|z-QMoy<9~(S<4l9AXvQs$sdw2h*Ev&O-v1uHpPN+G@oNh2L3Y2`t z?zTNHRJs<;sS>4Q?4c8HNxwQ?e()<09FYb(sB%5JQEmcZ>*#S#&c@^CQau3h!zzXq z%e_Am&NZi!c7UY^a~OLL2H2yEE<0dcXE2=i4}03T0Ub%`TTS}>&p2Kd676!pug4oB zgV{8tEXon8Z?)LJMnjH#UJ{N;%r+Hn}-eow* zrQ+j7fnPpN@gK~Y6uHW@P}U)|IFQ5pqtC=WI7=|XD^8T?k?znE3LTM;1tr~Z^A;Rt z?*NwxWfA{eLLQ7sDN)=>ji}C{BZryaw*lDU9Y31U{b!WKSA>4z5A{lnD!%N01^Iw% zu8@sU7Kyjn3Tvk+Nf@V4BP5mE;Fihq)Dpjpzr4Nlak~G`mEi0V={#M8M8FiFq6DIc)zALFOF$w}@w6XY?=AvpU8|`-FD_ystd(scV=@ zS~PorBXq3MFcr_+{HB7`hDL4%f4Oc7%-w}Tu39;Ij%CJtlEYiUn{M0^j5}Lfs=g3B zIQTT3_JHP9Z@}8H;YzDVp0EgI$&n#u4!OxWG9b!5GGfn#+}skbYNK_7w(PGA4xN71 zs#gvFrL9e)`PM0&ZZ$z9Tcv@jCg?7?1hz}`|!BYS!!iBp9?!aV__|@I^ zoK@R=4++E?c)p>kJ(4T!w4Zd zM^S{Dx#0lTb;Rk>@@L<~`?Ld3AGK z+u?S};`zw<*;9}q$+@)d{YKB{(qXXOL}&1rQyY0y;wNj`2;I z1)F~^1GRGfp5`NxA@x9zZA}RcI)B+mF(heIk^V|hd3rE@9}YS6310xJF7))MfHDuJ z-_pYKp#AYHSTAQNbN~bJ|r8iiKqbGN#>w-bz9V8ygN=8#-eFh6i z<=`2TbN)9*4mEj%9qMB5l<+hQ*3H4BR_v<=b&kp?L5YJYhj~zzNjW6^gu=Clkqj!{gTkc_L>e3|K$@;Sy4gFx=_L9b@(!)6 zeY<)52`4KAe-ga&(0G?lZVIA?R*tX*Uy%a9r|%QtSgz4@hR_(t=H&(ZlU!#5+1vRM zDRR`fQB&4+S}Wu>k0V0B8vzUu<#Vp%}2wZMXvFD$Sm-ZKq|)v13J->~9q z3^BU@xVR=P*gycw zk)N7erZ_mdaG~J{0Vxh>B16ZOw4Ah)zqPW3Fc5BQDT0DYTyrg8aQoE#y+=XL-fPrv zPQ^bb^$eS^*iiCOED_wk67h&83-s;gbgsONW%VR+wV$2N&o8-fG^V*(4%BJZRe&NA zB%npNYtj7dVoDCGoOcUGB>=&wGeG}D)B1!SlcQjl>2I_&O&Qz;^_CAtp8*=&lK?!~ zsW2A&Li(-+^pe=&9LfEYY`K5&PDw-x&Hql@Y)(`Pgdli-+f-pH+;uo*x%Sl{8A=MI zzJJU|&aNqdBrUW)7lvnLT;brl)=6v*@M|Jz1F}ArtRjOdh)9u&tj(E7uj-LNn*kJt z7|qurgDq5!Eu)nleD-e;T6PzQviaUHipSX&$rH;JI?H1lL<2JDR~xzlr#-g;4b+Z% zVsu}ISpK$w0KmzaY4Ds!YhVv>VSa%xrJ1-hLX(`F7>z9 z_4%1C2Mtt$q791IKek-x2`8tV+DbDYw&yaGRSI{5$?m;a;d@j z5ve&)`3q|QK2vk(4XIYt)LOZGD@o;dk6OMdC^!D+4oB=p?YYAgc&;rVgG2#NRYuWh zB9C_A&K-VQM0yTQ4=<66B1kEBQ(TIRFC5MH!01Z2L5ANRqod$dHjEq8Sbii$|CR!U z8CNMBj)FJJ46v*_mu;1wx&vZJvB_V$m+B7%U^rBPy;@M!y_@2mVFp-?2%+QwCpgg@ z6hhkdn{w_mQ#i+;-*|y5F9u|_BxWW(Xcrz|>Bh2gcM}!xtP}*B!no%Ek{$AxAQis@ zbcZWw_ek~V&b)+*aRCpUs%R$(rrRLn>^t2~Be2el8eO8kFLNOBKEL%UNaO%NHcZh!OMgEIP?kNj5diQeXo@$9YAhr;Nt$i z*fkrja|gb}(rJqS;r|gbtIqU)$?sX{^@;?*0b`p<)r)tt$Z`dow!UvUCvFB7g0A&O zE!jj?Ew=ifZgB2H&0J(yAQG~rm6lbsUBXD0tVD0Z%ey+)LmarRQn{=M1JX*Ps`U z?`9+I3IblxMp7F}{woPBa8N+cq(O0s+c5Dp4n=%Gqpi1W(K~mSR~LB{B5Z|d4cwgr zzN`|+wpIUYiuqtLewB)3mM`%!s){^94qn_xPd$G=GW2N~lXB0*0b)+)oDw8~^XM^P zMzpM#Gko!0$^;oB0j5j@tg^ zkYS#`WL414Kp&&;2HcI!(47%4D=G3=ymNB)86|Gw-XL^5Du;Vy7;+TD z#9oRU1rK;5Yc^;jQ`NUOIpzje^tn_Aerm&8h}U!}ZuI2^2oN-Kt)V@*g&aERVN7_L z>d9@D`ZR5G9118`o=g@hK2p&|m=DF$Coy~o}3P@}zS(7{b z&XTLK|B~!63N=-G=QtnG;OaX3m3wvUht)M2x~IKE4hUyY9FIKmOsJ!X#=zmoASX?9 z2UL@KyA4o7Z-;C(yB0#?J;f*h%Z|o?30FBM>)@`&z&EA6eOlZJb6o-`j926Z1~I`- z0qX$hfL8#y0-`e`pc5Jw@xS$E=KP1#d}(cSl~E}WP)>4N%dnv0tIy652gTTP82l_z zm?noL0!h8$+|~{F2p$H8qGUKWzYawLr_hnW%VtGmWq?ovIeoLt`PYuX5~GjJp|2jY z4g~*bqwqjo5?D$?$^g1F;>%CH+qswE7m`b<4F{CHImg|u-1p0vpfs8E{mWyAsaDs8 z1}R(FazBAD7*>d)21{E)Fj^jb<$wWlHSDz^iiC`3c^4~#(gM$0Xy~Xz81N$qy$iWX z`gpP$?)mSjYx@g_NQx>fRIW2dJJ<0)4gDWXMh_2g-juScAcCWfMnREZ^#_O(bfcWs zpD^hb+nAJw*OyahR}qagqUV2)be-v^#HgH2g?Hwx^_;x%zk0g%K&JZtucV7cq~u6x z)Vi1Lm|OJ_TDR#Tii%=eXUr(+f^<>Lr72ovXH#J%mm-qT&68Q=OvxprdV17UbdheN z{NBg&e1Cs@sz1&+JLi4g@7L{f!g-FUheTR}%Z0p?7?CrAaBWY9KYc><{Av1PA>`d^ zu#8K8`evl#xg&r0{hc*K^Y@_O;kHKJ0Sn?0G%W$6h-3t9fG6)HIXHfI59 z8#$d&vW46coNV+l;!L<^!PoJ3ny}-8V<4utW0B)SB1t?I+2pA378gBxHA{jc+HTM- zAJ>Xa3-CEh1YYuEyC&gmFjC&p!Mrs?af_9znHU7Ew ziwR+SRA^x}NSf!{;F3m3mWf=h2WjZzb@&D;rx%)_$lqvinE~lNL|E@{m~X38R{Vn=ycgF*}c& z;!u#*wwf|Lq9)MVXaZ76@Evy~*3KF(JQ7wm9H}_G6x*d_uK|&JF5tyPaV-;t%qBUUVqb%)Y_51#x1ZB&X+rspXXxgO3x2K_f{X;(s589HCv{mz1LMbIb z`SQ4fe?yFFRqPd393IfTY+00g={DauS)}7^!YYdusB$-QCQJmf5x{juqCzGvM>Yne zGz4iTy0Dv5`%u1#05GtJCA~A*G!qbx0d$uzMQ&{q+gH2}%{J+?8yF;zLb&BOV7a)# z&^Ll1cP{7UGxe!J+FaIo+;P(EheMi;^(7-QPEm^%$RTixeFZ$MV|X!8^s>XA)2k); zKV9a1L9Fol-Fx9sqWXvd`Yk6DS~xs>!mHXkJ`cv zS6y&G5AF26*inygpA>!Mt5GB22caurW@qqVC84xJM?V;;WY0VzdwWGg)NRBx{U`bP zUeZX%{TPQ0>_D~e^hHrH&2)Rd$M)$EQT2 z`Bw33;`E#7_d{Rrj>UYEFH};(kH{)PN!-S*mukj;k#0hTKHsgB;tBLaCjA!vqQxQ! z>V5Dnnj^jYWBf^EN7Gm}SzM5%)Kx2ey5+o3)g-XCaNVTxsI+qNSbxpiV>v&?`$4b-nD;8!x>Fd;prb@-hg~h3HU8#$V(EdR=u1m>X;yC|Gmb&b znWzn{y-Ww9RYB86tIRB6l10ag4=BYQMEZnrydL}T*J+`jr!mU@ok#QBT>-!BO~!SsD#9#F>Q&Es z3^^>=bS!aiONJ~i!(iy&z@UeZQ zMYt-aPAKU{jl4VW6ILx=v=~GOk`pcyaM$`D%PbZ5*bCg_rHLhDK#vy5Y?3izq>g;< z@R>@&EG<#(M0&WU*8G=ZB>kYeB(5rX&tX!K%+aSC>Ai}dfo9I&&`QCED({Q@c1uX= zA<=V=b_O58_Z5_zXz%>%#3FYKxKbihC3}Gif)o<-+J`$X$`e)Xt%7$ME7+&-wl6=u zb`w$+1%Y(B8%*j^@i73bs1zmkfB#{^oH>Dw&rMa(vvYj5AZ>fh#uott*P%s+*TwHuqLe{oKZIsdh{QtStsiHlw}`@*ujdYg7v8Zz6gxkidw;>WSZ zDYS3`NV8xiabf(VTJifbIS;s|_3DS&wEY{vm>c7yog6FhQ>VCR^a zJ)@5NB+M4JEAa;p>EWHWU|b5%_d4!)BG7bii_}K@R8vQxwJyea_#0KmMwD$$|9#Jv z*h0;*3NOjY;g95KR6C-%GkMqmSnW~j=wILO-Y0HR{mjeS!ZOxc8!enO_MNr%LI?kX z-wzT@b+F^ccs%-b3Ilh194!7e z_T`LAb!=zw0G%lJ#kr&DonDIPlsyeGUw*z?z8!SooZ(fv*v)VIW1gn_?w_Hq=#GRZ zMc}FW2{F{rBJ2xtkDdvYw|{v zHq876rE}lCiyd+vvIWuxk5hGBOTOZZN8oAI6h-oGt+p#@LvZh zrGO-lAkkbFPqaY90~5R&jvoPH!xpWHalfko$Bh#L*Od>dm~B&e-1MrCZ{pIJ$K*Qh*27&$X@c zvSd`Px3n?}=H|YX2jl~&Ht^S|3JRvzh|50^dn*aE$@kYX(5~H5QqfAZ9-{@D8!#m$ zI5+8F4dTh3z)@|^ebZxDfiUm4{^F?`TUHSfSSS#o>_xb*vV8d>YG&D@;C&e3z%l!WKKE zY(Vd>F+b5rv@T*a5IJQjSE|`|qwu2l^pl9(^dvIybcQr6r#2gRbjThsf?{$^A##wx zjQec6+-y8TurL;1oe8eO-3cd=sj?otU(shi7K7n72djTwipR>Z&u?1|cyP|36;^|L z-Y?mNc3N24c1};5%~S|ePXB=hgiqX#?$mW0g(vd$oil{7(h<@Kmhz*wa!O3@s{pL}YLyu1xKHRDC zj1F3e4lU=2n5S0U0E-$9DmV5rfdUk(bH}~t(OI?_h-dP zFUt~3ZM&_j^4BdzQ&&yp(9D)*G_$AdcpFuKJXg{C>X&Rg`t8}hxF?6PJ0oSAeoWW} zNcbJG^QZqEeC&L|4=ihpLka%&o#`HPEIW(8kf%Aj^6L23@k5{MhP2V6*@R88L~B8`gPQKqQNnsaPAms`>sdy+r|)pm>D zOzHqoI2HKCwTsW8W30H_DICrGKfw1**I82zU_6lo8Oq+;1s5pfx-;`?Mf?l(Bg9mIf!wdcGGTNH!si+?I1)!C2 zbKZUmp+$iH;tEp>un>I`I=(Qnvu+!Uh<-hP+xNwznUeL2`(igBVi)Y2lB7i|l6Rnf z^rPYtU9nA;mUbwms2ATqzBU~%b$$od*6s3 zIYP;{mQIl2I{4dvwtmt`+kU?KVV{D>nSt&vaE3uZ5;QtV1b0evMSNA@QJf@r>?&Ur zB)fuw@2mqx^lN*%!-wp~pyBGY<>)7sr6h6q>2Yrao$ACY8uYK1@^NVM94l@T5(k2z z*rd1XU&i(vnpc2pat%4HsvM%$`)ihUn?JXNh}a;4hvlc@q<7StXDIJwCAW%g1q>z- z`-4OTA@svi`@d>;(2*w zm8GHe;#7HWLcb@S{DwXPNLQFvvVEb`Efu`M{_*IX&riB_V!T@THKD(eUUmEIo)P>f zuU#;T>2f7pR466#Q_-))wmcY+)INR)#vK7OOt;hmX!<%pV&0LE))=kEJ^WS>@#UC4 zT0Lklr?>wNw2nWs5}>ou`yN-~(-`@#t>y$i*VFEl9afQaZW`S=AKx*wa8+k=VGMRB zqk}RK{{ypNlOlIEXeF)o=*1gT7~E4uQ|PGCY-jAwFGnZF6yHzY=i`Xzm*dIFMc(*K zQlrYLO-{!-Da(o7laaF%FwBBC+PF`}AA0v-z9DKx$K~XZ`>zCkQu)LC#V8m?=2IN$ z2}ps-WT0}O7!0rCbI@$ahI1IdG<#hv@pm#{D62l52H6T-qU_t5CUHJ&rF9+eFo5z; za&oZ8_dC6Y&k)qm0dF|bPjPYWYP+oAyT1!mBd6Jav15*><0ok@42dpM3_sQxV;Hzt zTN*0}xbM~QC5ldmsv;VWufvhwvGa%Qxl;fcO>sd%N}@|rO->@XNgVcgK#bAO0+B1d z+z?7TJ=~MlK`$e(&L@^?k%+^Z$I8WdVAafgYMO<6ZIN70Cvi}(uTP3BGRlHSs{%;V zKQczV{{Pdxt6kmB?81`b#jWBc5a@vS=3xwDOVni|VD5`>|F45-9>&~Mi-;i5Bm#51 z5dI##T<8t1;gma{CX{%ektgo8z{Gwx49PC51>VcN@%B}dEUjSKpkWpmt%|e|=ZSdP z$p>;%_)t9XG^INEjq#^#eq{3a9D4h93ZfZ1E_3+8G{uT*h$(L%NXDUO%c6f@X_$%& zA~5G7hf>q6MLlCV$Ml4{)jMOyr*)>h#F1Yo$V*_HHx8m2n=Qe7Yn}n>(?;V@ zY9)ub{Qx!6A9JK8OM7Z?>zqi;VT~4gKU;XtMwgC8eerLi-1_xq%_B;Qp<20l83fj= zl1x(p$&s|ufRmk_y~xQHtvDrA88ki}k0S>HKShRO)Ml}Fax29p`4MF;*oc;bSj@*m z5?OEdRQLx)iiDiBFH|pxe!qYBf4<3TBBFV$I-)s2ZPmn+!LMg`$3f&N{UI1q-o7!? zVWKu4Oh3{w+!u2a&kg&24}UG*aK-?JUsoZrRvbWUW!ZMRyI6I4!4iYd!iP=GWmz;u zx_znrS1TAqL}W0Q3HxFtWka(Y$U!z-TQ0x>U4ZC$x{bD%=p$KpgAJqW61@M(2fMci z`U}4LI+!DGNk4BRXx&1=Dy&Bk-9;3s)H3f*3$ejOS-s1bXLJH%^={y@$C7dQXWy+opGB>XXFw!bQ(zhYx0dp(T5k+a&^ z48h=Q`0*d&XF<8uJEG&?!zMi9sf-L7olQVGU%Mm>BXiOlk2T$9f33}hCB#b7h)4{3 z`8}QY7*2dDxP48rWT5GlB}SA&p&HLof;ICg-Ckt?H*sS4LA*DiNIvd{F-TeB0-DJv z!sNEqO1+0$r}0!yo`(V1V-y+6rjJD9;(a*v^U?9kAjV>6`8^U$57>`oa3vt`C7u|7 zi8Eeh@a4I=$WaZ2--+W4?kE2%*z+F?0yV#E8T!ZxM05GT9l$pRkajB71Y1{a*{#K_ zQX@6QDRpCMFcYTe^P%}Q#DHVPjH8NK1yEhO5PX)AQtD#HyML!=rMw&t)B#9uVwW@&-9fb+ zdGRl?JvTeUahGZlnU8=*FxaxW*V0hWZ2RBKZ{vk+)$Y(z ziLQbgvLZmFBv&#GeVbFevEI&wbrj(Pwwbed?XF?%oAiDq?j+W7+q(<0I@gC&I?Fg0 z{xvng3{eS!zrg$9YFYJGpiNd8SlTEuQ>kzY-yD=;L*@wbj}TL}Pl%iGF6@DIi{l*Y zJ|@}Cra>x$y``)`--^p}o90h54e1er$w&py#6DvQAK3F_;@)?h_XFE~dR8&=?Ze-) z++%SdIQ1Lqn?8?_ZnSyeuyt#5Tz83v{n5I<(+rLOyT4sXk4AT7aPIUC`DV6L=7W{N z$@I4*?GGLi54PK@!^qhTy%wH)moBl z2-qog@5ZJ%br1uihA&Jt?>dPr;2EIj4p`W52lrcYL>F1NKq7)3?K-+Np5b zKA-Q)*+u0KGGVK|NT%fvo5&xjXX;LB6Q?r!hXo`raDF#Ez+IkS-#TE=A55Ed6DS-+ zyS5yaCdN5KdB7&8VZmvl&b;~do#XI>4{=KM1=1q~DGRzxMt5DN{|F9zfq%*0#wH$> z@5A|N%a2a5Utf(H>5YN|UsfD3*nPlWgwuEYt+&wOktxL)h<#UA&_lc-eNWB6Vm?E_ zGr{hS*w_T|-SIY}-Lk|_8^^r7va-Q2HnhZ`wlN(IU)*)Y?_n)|{xDV$ZTWP2Z7|JD z-@3Fx?b;@2!dL5YFX7|%S&!Zz^^l<9@yq^VRvGt6_EFJ8UpMVkRs|orwLsXr^Z|pS9=4Jz2xa zsXbWl!>PC#lTL^BQgAE7+!QH*l(=Ou59|~LiJ)h82S>J>HnC@VqTvhaPW6K`*NKFh z2jic=IbWo?;JZnmL&1tiR&H_GG|;d$!yR>8xWPhnW|+I}wCpqO zs4>g^97MYab<;vBNykhdM`f1g)NZXOt{=;MMf_<7VCLtI)KoHpl81Y>1TrlBc2_Pt zgkGd=vG1fH&h=%Go8l=JOv`;h06&9hU@1!unAxImZMwVUY&xV&UXy_;wz2Y7pK!y5 zZ0vGpDCvQis+Ee-K6UMa;Np{LIHaxYJ11M(NVJndpwGl0QSR<})kA?aWN8!Eb%>l= z=X&D6k>#vYsAE8?p_F{H*?8n6e*6s!s8iI81Uv{rnM%%;2oZC$*xIstbtGu(_inuWH=(eO4-nLXNnWZ#Q8V!^2Dj@bIm zKVODF+_)i^S>*+Rm1RcrZMgcK!7L(HJ2?g4dGK0&I$lSus>N$hWMY-?vp@ctwhH^g z-SAHBdRu1=PZZX$lB}B&pNTHX;GJaqaqD+$+oNr*%QmY!zTEzJK%dc9#b=3~hy}Cc zV63(dgCB}6oYvK0FIM-|UNjA@4ursIzZpk03ABNVJ@cPIi%|k*QbGmsj%jS2VY1EZ zwny!Yf=lqkV!?_Uv*$W3IhPC_`Vk?lr$)?|JC=;yUSIW|8s#@!Zf zSdMZ%CAZU&o{rh?035j!iZFsDr z)OHOJLV+NPt0MC^1f>-V`4b_jSKwA)zm|zE?j7R!8z7<;W9DG1-~;8E_eM*wgpBU83ID^r%5=Mkcs#X3+=O5VQR z6-Y`Gv9!zlZ;0P}uNq@n&KLU!S+S3pHuy94iZP=;mX1G?o0IdU*e3Lem_;&kAe42}g+)Y=7ps zfu~6mJ67I6d_lK29($dNl})`*F;8ZoLb`6a2y|`D=5Kzoe(YfFpfTR{reSGly_2lRBE-clJ%3f6M$cVZ}w3sa54w1CNW{GjbM(f(6c=8=>i{}|2Gj}fXS9+j5oUm8O{nw99V zFQ0%|TcSFmnAVMzb$#}FP23xWt^Cm+0s2~S?w-s(@)R*z6 z3z-s+`U^_1<(2Nk>vCCLl=Y5n$s3uOS|HbkhG-LZ&AjISovexmZa+WEonpeB(Q~3=-JzVF`R0-t0oZX5p4S`*(SecjE}@>b#&?vehiNQsQ#h ziPv6d(NM@-hSJxgiU|wNnXt=kiiGs+8XyutE1fv6*+e8j?il=|22gHMdxrOqA`1>z5plb?!5gK*kX0qRX2oxdDLzeukBV?gU zc0;V=ATto&gG4sF^sSk$(0n?TRH(PSlgMT=O_@FcOQM**De)F2(+zvM%yB2^>BT*3OAi{9LtG#BkGzbQB_ zU!Bx&W?0LXm>V7Im99=$PQ3BpKHZ}a^`)~Xrtd!6W4*W_J@Wmz3p!bNErTA4`sLm? zL>+Wbai6pSta^2Gq`H-N{%TxpxymT z%>*=)`s27on#ouD@DtsEt1!(aSNdGk?|brtR*EU}Ua9E%M*G2h`~Pn&qiap-K)Ytp74ORAH$Ljx2_hml80ap?1S6+KsXMBT6;}KY0oyKU pWQaHsVZOUPz-mwrZW}RLt4kU}jVB^2$p4*c^@??_1Nu literal 0 HcmV?d00001 From d98bf424c803b18cfd851499b39b506c7bad6a59 Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Fri, 24 Jul 2026 14:41:33 +0200 Subject: [PATCH 033/116] feat: update JSON files for improved formatting and additional entries --- .../assets/minecraft/blockstates/anvil.json | 12 +- .../assets/minecraft/font/default.json | 395 +++++++++++++++++- .../assets/minecraft/lang/en_us.json | 108 ++++- 3 files changed, 512 insertions(+), 3 deletions(-) diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/blockstates/anvil.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/blockstates/anvil.json index 3339030a..dbc3b731 100644 --- a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/blockstates/anvil.json +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/blockstates/anvil.json @@ -1 +1,11 @@ -{"variants":{"facing=east":{"model":"block/custom/netherite_anvil","y":90},"facing=north":{"model":"block/custom/netherite_anvil"}}} \ No newline at end of file +{ + "variants":{ + "facing=east":{ + "model":"block/custom/netherite_anvil", + "y":90 + }, + "facing=north":{ + "model":"block/custom/netherite_anvil" + } + } +} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/font/default.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/font/default.json index 98932fde..fa55ad4b 100644 --- a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/font/default.json +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/font/default.json @@ -1 +1,394 @@ -{"providers":[{"type":"bitmap","height":-3,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf800"]},{"type":"bitmap","height":-4,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf801"]},{"type":"bitmap","height":-5,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf802"]},{"type":"bitmap","height":-6,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf803"]},{"type":"bitmap","height":-7,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf804"]},{"type":"bitmap","height":-8,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf805"]},{"type":"bitmap","height":-9,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf806"]},{"type":"bitmap","height":-10,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf807"]},{"type":"bitmap","height":-11,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf808"]},{"type":"bitmap","height":-12,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf809"]},{"type":"bitmap","height":-13,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf80a"]},{"type":"bitmap","height":-14,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf80b"]},{"type":"bitmap","height":-16,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf80d"]},{"type":"bitmap","height":-15,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf80c"]},{"type":"bitmap","height":-17,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf80e"]},{"type":"bitmap","height":-18,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf80f"]},{"type":"bitmap","height":-34,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf810"]},{"type":"bitmap","height":-50,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf811"]},{"type":"bitmap","height":-66,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf812"]},{"type":"bitmap","height":-130,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf813"]},{"type":"bitmap","height":-258,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf814"]},{"type":"bitmap","height":-1,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf830"]},{"type":"bitmap","height":1,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf831"]},{"type":"bitmap","height":2,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf832"]},{"type":"bitmap","height":3,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf833"]},{"type":"bitmap","height":4,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf834"]},{"type":"bitmap","height":5,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf835"]},{"type":"bitmap","height":6,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf836"]},{"type":"bitmap","height":7,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf837"]},{"type":"bitmap","height":8,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf838"]},{"type":"bitmap","height":9,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf839"]},{"type":"bitmap","height":10,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf83a"]},{"type":"bitmap","height":11,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf83b"]},{"type":"bitmap","height":12,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf83c"]},{"type":"bitmap","height":13,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf83d"]},{"type":"bitmap","height":14,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf83e"]},{"type":"bitmap","height":15,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf83f"]},{"type":"bitmap","height":31,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf840"]},{"type":"bitmap","height":47,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf841"]},{"type":"bitmap","height":63,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf842"]},{"type":"bitmap","height":127,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf843"]},{"type":"bitmap","height":255,"ascent":-5000,"file":"minecraft:font/offset/space_split.png","chars":["\uf844"]},{"type":"bitmap","height":11,"ascent":9,"file":"minecraft:font/image/emojis.png","chars":["\ue000\ue001\ue002\ue003","\ue004\ue005\ue006\ue007","\ue008\ue009\ue00a\ue00b","\ue00c\ue00d\ue00e\ue00f"]}]} \ No newline at end of file +{ + "providers":[ + { + "type":"bitmap", + "height":-3, + "ascent":-5000, + "file":"minecraft:font/offset/space_split.png", + "chars":[ + "\uf800" + ] + }, + { + "type":"bitmap", + "height":-4, + "ascent":-5000, + "file":"minecraft:font/offset/space_split.png", + "chars":[ + "\uf801" + ] + }, + { + "type":"bitmap", + "height":-5, + "ascent":-5000, + "file":"minecraft:font/offset/space_split.png", + "chars":[ + "\uf802" + ] + }, + { + "type":"bitmap", + "height":-6, + "ascent":-5000, + "file":"minecraft:font/offset/space_split.png", + "chars":[ + "\uf803" + ] + }, + { + "type":"bitmap", + "height":-7, + "ascent":-5000, + "file":"minecraft:font/offset/space_split.png", + "chars":[ + "\uf804" + ] + }, + { + "type":"bitmap", + "height":-8, + "ascent":-5000, + "file":"minecraft:font/offset/space_split.png", + "chars":[ + "\uf805" + ] + }, + { + "type":"bitmap", + "height":-9, + "ascent":-5000, + "file":"minecraft:font/offset/space_split.png", + "chars":[ + "\uf806" + ] + }, + { + "type":"bitmap", + "height":-10, + "ascent":-5000, + "file":"minecraft:font/offset/space_split.png", + "chars":[ + "\uf807" + ] + }, + { + "type":"bitmap", + "height":-11, + "ascent":-5000, + "file":"minecraft:font/offset/space_split.png", + "chars":[ + "\uf808" + ] + }, + { + "type":"bitmap", + "height":-12, + "ascent":-5000, + "file":"minecraft:font/offset/space_split.png", + "chars":[ + "\uf809" + ] + }, + { + "type":"bitmap", + "height":-13, + "ascent":-5000, + "file":"minecraft:font/offset/space_split.png", + "chars":[ + "\uf80a" + ] + }, + { + "type":"bitmap", + "height":-14, + "ascent":-5000, + "file":"minecraft:font/offset/space_split.png", + "chars":[ + "\uf80b" + ] + }, + { + "type":"bitmap", + "height":-16, + "ascent":-5000, + "file":"minecraft:font/offset/space_split.png", + "chars":[ + "\uf80d" + ] + }, + { + "type":"bitmap", + "height":-15, + "ascent":-5000, + "file":"minecraft:font/offset/space_split.png", + "chars":[ + "\uf80c" + ] + }, + { + "type":"bitmap", + "height":-17, + "ascent":-5000, + "file":"minecraft:font/offset/space_split.png", + "chars":[ + "\uf80e" + ] + }, + { + "type":"bitmap", + "height":-18, + "ascent":-5000, + "file":"minecraft:font/offset/space_split.png", + "chars":[ + "\uf80f" + ] + }, + { + "type":"bitmap", + "height":-34, + "ascent":-5000, + "file":"minecraft:font/offset/space_split.png", + "chars":[ + "\uf810" + ] + }, + { + "type":"bitmap", + "height":-50, + "ascent":-5000, + "file":"minecraft:font/offset/space_split.png", + "chars":[ + "\uf811" + ] + }, + { + "type":"bitmap", + "height":-66, + "ascent":-5000, + "file":"minecraft:font/offset/space_split.png", + "chars":[ + "\uf812" + ] + }, + { + "type":"bitmap", + "height":-130, + "ascent":-5000, + "file":"minecraft:font/offset/space_split.png", + "chars":[ + "\uf813" + ] + }, + { + "type":"bitmap", + "height":-258, + "ascent":-5000, + "file":"minecraft:font/offset/space_split.png", + "chars":[ + "\uf814" + ] + }, + { + "type":"bitmap", + "height":-1, + "ascent":-5000, + "file":"minecraft:font/offset/space_split.png", + "chars":[ + "\uf830" + ] + }, + { + "type":"bitmap", + "height":1, + "ascent":-5000, + "file":"minecraft:font/offset/space_split.png", + "chars":[ + "\uf831" + ] + }, + { + "type":"bitmap", + "height":2, + "ascent":-5000, + "file":"minecraft:font/offset/space_split.png", + "chars":[ + "\uf832" + ] + }, + { + "type":"bitmap", + "height":3, + "ascent":-5000, + "file":"minecraft:font/offset/space_split.png", + "chars":[ + "\uf833" + ] + }, + { + "type":"bitmap", + "height":4, + "ascent":-5000, + "file":"minecraft:font/offset/space_split.png", + "chars":[ + "\uf834" + ] + }, + { + "type":"bitmap", + "height":5, + "ascent":-5000, + "file":"minecraft:font/offset/space_split.png", + "chars":[ + "\uf835" + ] + }, + { + "type":"bitmap", + "height":6, + "ascent":-5000, + "file":"minecraft:font/offset/space_split.png", + "chars":[ + "\uf836" + ] + }, + { + "type":"bitmap", + "height":7, + "ascent":-5000, + "file":"minecraft:font/offset/space_split.png", + "chars":[ + "\uf837" + ] + }, + { + "type":"bitmap", + "height":8, + "ascent":-5000, + "file":"minecraft:font/offset/space_split.png", + "chars":[ + "\uf838" + ] + }, + { + "type":"bitmap", + "height":9, + "ascent":-5000, + "file":"minecraft:font/offset/space_split.png", + "chars":[ + "\uf839" + ] + }, + { + "type":"bitmap", + "height":10, + "ascent":-5000, + "file":"minecraft:font/offset/space_split.png", + "chars":[ + "\uf83a" + ] + }, + { + "type":"bitmap", + "height":11, + "ascent":-5000, + "file":"minecraft:font/offset/space_split.png", + "chars":[ + "\uf83b" + ] + }, + { + "type":"bitmap", + "height":12, + "ascent":-5000, + "file":"minecraft:font/offset/space_split.png", + "chars":[ + "\uf83c" + ] + }, + { + "type":"bitmap", + "height":13, + "ascent":-5000, + "file":"minecraft:font/offset/space_split.png", + "chars":[ + "\uf83d" + ] + }, + { + "type":"bitmap", + "height":14, + "ascent":-5000, + "file":"minecraft:font/offset/space_split.png", + "chars":[ + "\uf83e" + ] + }, + { + "type":"bitmap", + "height":15, + "ascent":-5000, + "file":"minecraft:font/offset/space_split.png", + "chars":[ + "\uf83f" + ] + }, + { + "type":"bitmap", + "height":31, + "ascent":-5000, + "file":"minecraft:font/offset/space_split.png", + "chars":[ + "\uf840" + ] + }, + { + "type":"bitmap", + "height":47, + "ascent":-5000, + "file":"minecraft:font/offset/space_split.png", + "chars":[ + "\uf841" + ] + }, + { + "type":"bitmap", + "height":63, + "ascent":-5000, + "file":"minecraft:font/offset/space_split.png", + "chars":[ + "\uf842" + ] + }, + { + "type":"bitmap", + "height":127, + "ascent":-5000, + "file":"minecraft:font/offset/space_split.png", + "chars":[ + "\uf843" + ] + }, + { + "type":"bitmap", + "height":255, + "ascent":-5000, + "file":"minecraft:font/offset/space_split.png", + "chars":[ + "\uf844" + ] + }, + { + "type":"bitmap", + "height":11, + "ascent":9, + "file":"minecraft:font/image/emojis.png", + "chars":[ + "\ue000\ue001\ue002\ue003", + "\ue004\ue005\ue006\ue007", + "\ue008\ue009\ue00a\ue00b", + "\ue00c\ue00d\ue00e\ue00f" + ] + } + ] +} \ No newline at end of file diff --git a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/lang/en_us.json b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/lang/en_us.json index 5d5c63cb..677ad3d7 100644 --- a/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/lang/en_us.json +++ b/Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/lang/en_us.json @@ -1 +1,107 @@ -{"item.default.palm_slab":"Palm Slab","item.default.topaz_axe":"Topaz Axe","item.default.palm_door":"Palm Door","item.default.topaz_chestplate":"Topaz Chestplate","item.default.palm_wood":"Palm Wood","item.default.palm_fence_gate":"Palm Fence Gate","item.default.cap":"Cap","item.default.topaz_crossbow":"Topaz Crossbow","item.default.safe_block":"Safe Block","item.default.topaz_leggings":"Topaz Leggings","item.default.topaz_sword":"Topaz Sword","item.default.palm_leaves":"Palm Leaves","item.default.copper_coil":"Copper Coil","item.default.flame_cane":"Flame Cane","item.default.showcase":"Showcase","item.default.palm_fence":"Palm Fence","item.default.topaz_pickaxe":"Topaz Pickaxe","item.default.globe":"Globe","item.default.bench":"Bench","item.default.table_lamp":"Table Lamp","item.default.pebble":"Pebble","item.default.reed":"Reed","item.default.topaz_bow":"Topaz Bow","item.default.topaz_spear":"Topaz Spear","item.default.topaz":"Topaz","item.default.sofa":"Sofa","item.default.palm_sapling":"Palm Sapling","item.default.palm_stairs":"Palm Stairs","item.default.palm_log":"Palm Log","item.default.stripped_palm_wood":"Stripped Palm Wood","item.default.hami_melon_seeds":"Hami Melon Seeds","item.default.stripped_palm_log":"Stripped Palm Log","item.default.flower_basket":"Flower Basket","item.default.ender_pearl_flower_seeds":"Ender Pearl Flower Seeds","item.default.topaz_hoe":"Topaz Hoe","item.default.fairy_flower":"Fairy Flower","item.default.topaz_rod":"Topaz Rod","item.default.hami_melon_slice":"Hami Melon Slice","item.default.topaz_helmet":"Topaz Helmet","item.default.palm_planks":"Palm Planks","item.default.drawer_block":"Drawer Block","item.default.netherite_anvil":"Netherite Anvil","item.default.topaz_shovel":"Topaz Shovel","item.default.magma_fruit":"Magma Fruit","item.default.togglable_light_block":"Togglable Light Block","item.default.chinese_lantern":"Chinese Lantern","item.default.palm_button":"Palm Button","item.default.wooden_chair":"Wooden Chair","item.default.gunpowder_block":"GunPowder Block","item.default.amethyst_torch":"Amethyst Torch","item.default.drill":"Drill","item.default.palm_trapdoor":"Palm Trapdoor","item.default.solid_gunpowder_block":"Solid GunPowder Block","item.default.candelabrum":"Candelabrum","item.default.topaz_ore":"Topaz Ore","item.default.topaz_boots":"Topaz Boots","item.default.hami_melon":"Hami Melon","item.default.deepslate_topaz_ore":"Deepslate Topaz Ore","item.default.topaz_trident":"Topaz Trident","item.default.palm_pressure_plate":"Palm Pressure Plate","item.default.chessboard_block":"Chessboard Block","item.default.flame_elytra":"Flame Elytra","block.default.amethyst_wall_torch":"Amethyst Torch","block.default.palm_planks":"Palm Planks","block.default.palm_leaves":"Palm Leaves","block.default.chinese_lantern":"Chinese Lantern","block.default.netherite_anvil":"Netherite Anvil","block.default.palm_sapling":"Palm Sapling","block.default.gunpowder_block":"GunPowder Block","block.default.palm_log":"Palm Log","block.default.magma_plant":"Magma Plant","block.default.chessboard_block":"Chessboard Block","block.default.drawer_block":"Drawer Block","block.default.palm_button":"Palm Button","block.default.stripped_palm_wood":"Stripped Palm Wood","block.default.palm_stairs":"Palm Stairs","block.default.togglable_light_block":"Togglable Light Block","block.default.stripped_palm_log":"Stripped Palm Log","block.default.ender_pearl_flower":"Ender Pearl Flower","block.default.amethyst_torch":"Amethyst Torch","block.default.hami_melon":"Hami Melon","block.default.palm_slab":"Palm Slab","block.default.palm_fence":"Palm Fence","block.default.hami_melon_stem":"Hami Melon Stem","block.default.flame_cane":"Flame Cane","block.default.sleeper_sofa":"Sofa","block.default.palm_door":"Palm Door","block.default.palm_wood":"Palm Wood","block.default.palm_fence_gate":"Palm Fence Gate","block.default.fairy_flower":"Fairy Flower","block.default.sofa":"Sofa","block.default.reed":"Reed","block.default.deepslate_topaz_ore":"Deepslate Topaz Ore","block.default.solid_gunpowder_block":"Solid GunPowder Block","block.default.palm_trapdoor":"Palm Trapdoor","block.default.safe_block":"Safe Block","block.default.attached_hami_melon_stem":"Hami Melon Stem","block.default.topaz_ore":"Topaz Ore","block.default.copper_coil":"Copper Coil","furniture.default.globe":"Globe","furniture.default.wooden_chair":"Wooden Chair","furniture.default.showcase":"Showcase","furniture.default.candelabrum":"Candelabrum","furniture.default.bench":"Bench","furniture.default.flower_basket":"Flower Basket"} \ No newline at end of file +{ + "item.default.palm_slab":"Palm Slab", + "item.default.topaz_axe":"Topaz Axe", + "item.default.palm_door":"Palm Door", + "item.default.topaz_chestplate":"Topaz Chestplate", + "item.default.palm_wood":"Palm Wood", + "item.default.palm_fence_gate":"Palm Fence Gate", + "item.default.cap":"Cap", + "item.default.topaz_crossbow":"Topaz Crossbow", + "item.default.safe_block":"Safe Block", + "item.default.topaz_leggings":"Topaz Leggings", + "item.default.topaz_sword":"Topaz Sword", + "item.default.palm_leaves":"Palm Leaves", + "item.default.copper_coil":"Copper Coil", + "item.default.flame_cane":"Flame Cane", + "item.default.showcase":"Showcase", + "item.default.palm_fence":"Palm Fence", + "item.default.topaz_pickaxe":"Topaz Pickaxe", + "item.default.globe":"Globe", + "item.default.bench":"Bench", + "item.default.table_lamp":"Table Lamp", + "item.default.pebble":"Pebble", + "item.default.reed":"Reed", + "item.default.topaz_bow":"Topaz Bow", + "item.default.topaz_spear":"Topaz Spear", + "item.default.topaz":"Topaz", + "item.default.sofa":"Sofa", + "item.default.palm_sapling":"Palm Sapling", + "item.default.palm_stairs":"Palm Stairs", + "item.default.palm_log":"Palm Log", + "item.default.stripped_palm_wood":"Stripped Palm Wood", + "item.default.hami_melon_seeds":"Hami Melon Seeds", + "item.default.stripped_palm_log":"Stripped Palm Log", + "item.default.flower_basket":"Flower Basket", + "item.default.ender_pearl_flower_seeds":"Ender Pearl Flower Seeds", + "item.default.topaz_hoe":"Topaz Hoe", + "item.default.fairy_flower":"Fairy Flower", + "item.default.topaz_rod":"Topaz Rod", + "item.default.hami_melon_slice":"Hami Melon Slice", + "item.default.topaz_helmet":"Topaz Helmet", + "item.default.palm_planks":"Palm Planks", + "item.default.drawer_block":"Drawer Block", + "item.default.netherite_anvil":"Netherite Anvil", + "item.default.topaz_shovel":"Topaz Shovel", + "item.default.magma_fruit":"Magma Fruit", + "item.default.togglable_light_block":"Togglable Light Block", + "item.default.chinese_lantern":"Chinese Lantern", + "item.default.palm_button":"Palm Button", + "item.default.wooden_chair":"Wooden Chair", + "item.default.gunpowder_block":"GunPowder Block", + "item.default.amethyst_torch":"Amethyst Torch", + "item.default.drill":"Drill", + "item.default.palm_trapdoor":"Palm Trapdoor", + "item.default.solid_gunpowder_block":"Solid GunPowder Block", + "item.default.candelabrum":"Candelabrum", + "item.default.topaz_ore":"Topaz Ore", + "item.default.topaz_boots":"Topaz Boots", + "item.default.hami_melon":"Hami Melon", + "item.default.deepslate_topaz_ore":"Deepslate Topaz Ore", + "item.default.topaz_trident":"Topaz Trident", + "item.default.palm_pressure_plate":"Palm Pressure Plate", + "item.default.chessboard_block":"Chessboard Block", + "item.default.flame_elytra":"Flame Elytra", + "block.default.amethyst_wall_torch":"Amethyst Torch", + "block.default.palm_planks":"Palm Planks", + "block.default.palm_leaves":"Palm Leaves", + "block.default.chinese_lantern":"Chinese Lantern", + "block.default.netherite_anvil":"Netherite Anvil", + "block.default.palm_sapling":"Palm Sapling", + "block.default.gunpowder_block":"GunPowder Block", + "block.default.palm_log":"Palm Log", + "block.default.magma_plant":"Magma Plant", + "block.default.chessboard_block":"Chessboard Block", + "block.default.drawer_block":"Drawer Block", + "block.default.palm_button":"Palm Button", + "block.default.stripped_palm_wood":"Stripped Palm Wood", + "block.default.palm_stairs":"Palm Stairs", + "block.default.togglable_light_block":"Togglable Light Block", + "block.default.stripped_palm_log":"Stripped Palm Log", + "block.default.ender_pearl_flower":"Ender Pearl Flower", + "block.default.amethyst_torch":"Amethyst Torch", + "block.default.hami_melon":"Hami Melon", + "block.default.palm_slab":"Palm Slab", + "block.default.palm_fence":"Palm Fence", + "block.default.hami_melon_stem":"Hami Melon Stem", + "block.default.flame_cane":"Flame Cane", + "block.default.sleeper_sofa":"Sofa", + "block.default.palm_door":"Palm Door", + "block.default.palm_wood":"Palm Wood", + "block.default.palm_fence_gate":"Palm Fence Gate", + "block.default.fairy_flower":"Fairy Flower", + "block.default.sofa":"Sofa", + "block.default.reed":"Reed", + "block.default.deepslate_topaz_ore":"Deepslate Topaz Ore", + "block.default.solid_gunpowder_block":"Solid GunPowder Block", + "block.default.palm_trapdoor":"Palm Trapdoor", + "block.default.safe_block":"Safe Block", + "block.default.attached_hami_melon_stem":"Hami Melon Stem", + "block.default.topaz_ore":"Topaz Ore", + "block.default.copper_coil":"Copper Coil", + "furniture.default.globe":"Globe", + "furniture.default.wooden_chair":"Wooden Chair", + "furniture.default.showcase":"Showcase", + "furniture.default.candelabrum":"Candelabrum", + "furniture.default.bench":"Bench", + "furniture.default.flower_basket":"Flower Basket" +} \ No newline at end of file From 1feea68ad73b609dd8cb5093bccd89086d2bb9e5 Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Fri, 24 Jul 2026 14:42:51 +0200 Subject: [PATCH 034/116] feat: implement language conversion functionality and add support for lang directory --- BEDROCK-ROADMAP.md | 9 ++ .../converter/bedrock/BedrockConverter.java | 9 +- .../converter/bedrock/ConversionContext.java | 8 ++ .../converter/bedrock/LanguageConverter.java | 96 --------------- .../bedrock/lang/LanguageMapper.java | 112 ++++++++++++++++++ 5 files changed, 137 insertions(+), 97 deletions(-) create mode 100644 BEDROCK-ROADMAP.md delete mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/LanguageConverter.java create mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/lang/LanguageMapper.java diff --git a/BEDROCK-ROADMAP.md b/BEDROCK-ROADMAP.md new file mode 100644 index 00000000..cef9f069 --- /dev/null +++ b/BEDROCK-ROADMAP.md @@ -0,0 +1,9 @@ + + + + +Conversion: + +- [X] Sound conversion +- [X] Language conversion + diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockConverter.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockConverter.java index 3c5340c2..21046b7e 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockConverter.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockConverter.java @@ -11,6 +11,7 @@ import java.io.File; import java.nio.file.Files; import java.nio.file.Path; +import java.util.Locale; public class BedrockConverter { @@ -270,7 +271,13 @@ private void convertNamespaceAssets(File namespaceDir, String namespace, Convers for (var file : listed) { if (file.isDirectory()) { - + String name = file.getName().toLowerCase(Locale.ROOT); + switch (name) { + case "lang" -> ctx.addLangDirectory(file, namespace); + default -> { + // Other directories can be handled here if needed + } + } } else if (file.isFile()) { if (FileUtils.isJsonFile(file)) { String fileNameWithoutExtension = FileUtils.getFileNameWithoutExtension(file); diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/ConversionContext.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/ConversionContext.java index 2af828b6..5dca5cac 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/ConversionContext.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/ConversionContext.java @@ -18,6 +18,7 @@ import fr.robie.craftengineconverter.converter.bedrock.attachable.BedrockAttachableContext; import fr.robie.craftengineconverter.converter.bedrock.block.BedrockBlockMapper; import fr.robie.craftengineconverter.converter.bedrock.geometry.BedrockGeometry; +import fr.robie.craftengineconverter.converter.bedrock.lang.LanguageMapper; import fr.robie.craftengineconverter.converter.bedrock.geometry.GeometryMapper; import fr.robie.craftengineconverter.converter.bedrock.geometry.JavaBlockModel; import fr.robie.craftengineconverter.converter.bedrock.sound.SoundMapper; @@ -45,6 +46,7 @@ public class ConversionContext { private final Map animations = new HashMap<>(); private final Map animationControllers = new HashMap<>(); private final SoundMapper soundMapper = new SoundMapper(); + private final LanguageMapper languageMapper = new LanguageMapper(); private ManifestConfiguration manifest; private final Path customMappingsDir; private final Path texturesDir; @@ -232,6 +234,10 @@ public BlockMappingConfiguration blockMappings() { return this.blockMappings; } + public void addLangDirectory(File langDir, String namespace) { + this.languageMapper.addFromLangDirectory(langDir, namespace); + } + public void convertSoundDefinitions(File javaSoundsJson, String namespace) { if (this.javaAssetsDir == null) return; fr.robie.craftengineconverter.api.manager.FileCacheManager.getJsonCache() @@ -362,6 +368,8 @@ public void saveAll() { } this.blockMappings.save(this.customMappingsDir); + this.languageMapper.save(this.packDir.resolve("texts")); + if (!this.soundMapper.isEmpty()) { try { Path soundDefPath = this.packDir.resolve("sounds/sound_definitions.json"); diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/LanguageConverter.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/LanguageConverter.java deleted file mode 100644 index 9bc86602..00000000 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/LanguageConverter.java +++ /dev/null @@ -1,96 +0,0 @@ -package fr.robie.craftengineconverter.converter.bedrock; - -import com.google.gson.Gson; -import fr.robie.messageflow.logger.Logger; - -import java.io.IOException; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.HashMap; -import java.util.Map; -import java.util.stream.Stream; - -public final class LanguageConverter { - - private static final Gson GSON = new Gson(); - - private LanguageConverter() {} - - public static void convertLanguages(Path javaAssetsDir, Path packDir) { - if (javaAssetsDir == null || !Files.isDirectory(javaAssetsDir)) return; - - Path langDir = packDir.resolve("texts"); - Map> combined = new HashMap<>(); - - try (Stream namespaceDirs = Files.list(javaAssetsDir)) { - namespaceDirs.filter(Files::isDirectory).forEach(ns -> { - Path langFolder = ns.resolve("lang"); - if (!Files.isDirectory(langFolder)) return; - try (Stream langFiles = Files.list(langFolder)) { - langFiles.filter(f -> f.toString().endsWith(".json")).forEach(jsonFile -> { - String locale = toLocale(jsonFile); - Map entries = readLanguageFile(jsonFile); - combined.merge(locale, entries, (a, b) -> { a.putAll(b); return a; }); - }); - } catch (IOException e) { - Logger.error("Failed to list lang files in " + langFolder, e); - } - }); - } catch (IOException e) { - Logger.error("Failed to list namespace directories in " + javaAssetsDir, e); - } - - if (combined.isEmpty()) return; - - try { - Files.createDirectories(langDir); - } catch (IOException e) { - Logger.error("Failed to create texts directory", e); - return; - } - - for (Map.Entry> entry : combined.entrySet()) { - String locale = entry.getKey(); - Map entries = entry.getValue(); - Path outFile = langDir.resolve(locale + ".lang"); - try { - StringBuilder sb = new StringBuilder(); - for (Map.Entry langEntry : entries.entrySet()) { - String value = langEntry.getValue().replace("\n", "\\n").replace("\r", "\\r"); - sb.append(langEntry.getKey()).append('=').append(value).append('\n'); - } - Files.writeString(outFile, sb.toString(), StandardCharsets.UTF_8); - Logger.info("Exported language " + locale + " with " + entries.size() + " keys"); - } catch (IOException e) { - Logger.error("Failed to write language file " + outFile, e); - } - } - } - - private static String toLocale(Path jsonFile) { - String name = jsonFile.getFileName().toString(); - if (name.endsWith(".json")) name = name.substring(0, name.length() - 5); - return name; - } - - @SuppressWarnings("unchecked") - private static Map readLanguageFile(Path path) { - try { - String content = Files.readString(path, StandardCharsets.UTF_8); - Object parsed = GSON.fromJson(content, Object.class); - if (parsed instanceof Map raw) { - Map result = new HashMap<>(); - for (Map.Entry e : raw.entrySet()) { - String key = e.getKey() != null ? e.getKey().toString() : null; - String value = e.getValue() != null ? e.getValue().toString() : null; - if (key != null && value != null) result.put(key, value); - } - return result; - } - } catch (Exception e) { - Logger.error("Failed to read language file " + path, e); - } - return new HashMap<>(); - } -} diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/lang/LanguageMapper.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/lang/LanguageMapper.java new file mode 100644 index 00000000..d3c49e4d --- /dev/null +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/lang/LanguageMapper.java @@ -0,0 +1,112 @@ +package fr.robie.craftengineconverter.converter.bedrock.lang; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import fr.robie.craftengineconverter.api.manager.FileCacheManager; +import fr.robie.messageflow.logger.Logger; + +import java.io.File; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.LinkedHashMap; +import java.util.Locale; +import java.util.Map; + +public final class LanguageMapper { + + private static final Gson GSON = new GsonBuilder().setPrettyPrinting().disableHtmlEscaping().create(); + + private final Map> entries = new LinkedHashMap<>(); + + /** + * Reads all *.json language files from a Java resource pack's lang directory and accumulates + * them. Merges across namespaces and pack layers — later keys overwrite earlier ones for the + * same locale. + */ + public void addFromLangDirectory(File langDir, String namespace) { + File[] files = langDir.listFiles(); + if (files == null) return; + + for (File file : files) { + if (!file.isFile() || !file.getName().endsWith(".json")) continue; + + String locale = normalizeLocale(file.getName()); + FileCacheManager.getJsonCache().getData(file.toPath()).ifPresent(root -> { + LinkedHashMap localeMap = this.entries.computeIfAbsent(locale, k -> new LinkedHashMap<>()); + for (Map.Entry entry : root.entrySet()) { + JsonElement value = entry.getValue(); + if (value != null && value.isJsonPrimitive()) { + localeMap.put(entry.getKey(), value.getAsString()); + } + } + }); + } + } + + public boolean isEmpty() { + return this.entries.isEmpty(); + } + + public int size() { + return this.entries.size(); + } + + public void save(Path textsDir) { + if (this.isEmpty()) return; + + try { + Files.createDirectories(textsDir); + } catch (IOException e) { + Logger.error("Failed to create texts directory", e); + return; + } + + int totalKeys = 0; + JsonArray languagesJson = new JsonArray(); + + for (Map.Entry> localeEntry : this.entries.entrySet()) { + String locale = localeEntry.getKey(); + Map keyValues = localeEntry.getValue(); + + StringBuilder sb = new StringBuilder(); + for (Map.Entry kv : keyValues.entrySet()) { + String value = kv.getValue() + .replace("\n", "\\n") + .replace("\r", "\\r"); + sb.append(kv.getKey()).append('=').append(value).append('\n'); + } + + Path outFile = textsDir.resolve(locale + ".lang"); + try { + Files.writeString(outFile, sb.toString(), StandardCharsets.UTF_8); + totalKeys += keyValues.size(); + } catch (IOException e) { + Logger.error("Failed to write language file " + outFile, e); + } + + languagesJson.add(locale); + } + + Path languagesFile = textsDir.resolve("languages.json"); + try (var writer = Files.newBufferedWriter(languagesFile, StandardCharsets.UTF_8)) { + GSON.toJson(languagesJson, writer); + } catch (IOException e) { + Logger.error("Failed to write languages.json", e); + } + + Logger.info("Exported " + this.entries.size() + " language(s) with " + totalKeys + " total keys"); + } + + private static String normalizeLocale(String filename) { + String name = filename.endsWith(".json") ? filename.substring(0, filename.length() - 5) : filename; + int sep = name.indexOf('_'); + if (sep < 0) return name.toLowerCase(Locale.ROOT); + return name.substring(0, sep).toLowerCase(Locale.ROOT) + + "_" + + name.substring(sep + 1).toUpperCase(Locale.ROOT); + } +} From ca73f5b5e9d77c01cbc963d0650f0f7ed176c97c Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Mon, 27 Jul 2026 10:36:19 +0200 Subject: [PATCH 035/116] chore: update .gitignore to include MCBE-Vanilla-RP directory --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index f48d9070..033d192c 100644 --- a/.gitignore +++ b/.gitignore @@ -122,4 +122,5 @@ gha-creds-*.json /GEMINI.md agent.yaml reflection/ -concepts/ \ No newline at end of file +concepts/ +MCBE-Vanilla-RP/ \ No newline at end of file From 84ce318bfa5339c6b4986f82231ff236280fbb59 Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Mon, 27 Jul 2026 10:36:35 +0200 Subject: [PATCH 036/116] feat: add support for block states, font mapping, and waypoint styles in BedrockConverter --- .../mapping/block/BlockDefinition.java | 5 +- .../block/BlockMappingConfiguration.java | 9 +- BEDROCK-ROADMAP.md | 25 ++ .../converter/bedrock/BedrockConverter.java | 6 +- .../converter/bedrock/ConversionContext.java | 94 +++-- .../bedrock/block/BedrockBlockMapper.java | 279 -------------- .../bedrock/block/BlockStateMapper.java | 291 +++++++++++++++ .../converter/bedrock/font/FontMapper.java | 342 ++++++++++++++++++ .../bedrock/font/JsonUiImageWriter.java | 327 +++++++++++++++++ .../bedrock/waypoint/WaypointStyleMapper.java | 156 ++++++++ 10 files changed, 1230 insertions(+), 304 deletions(-) delete mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/block/BedrockBlockMapper.java create mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/block/BlockStateMapper.java create mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/font/FontMapper.java create mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/font/JsonUiImageWriter.java create mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/waypoint/WaypointStyleMapper.java diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/block/BlockDefinition.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/block/BlockDefinition.java index f1b3c2d9..0b204434 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/block/BlockDefinition.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/block/BlockDefinition.java @@ -33,7 +33,10 @@ public BlockDefinition( public JsonObject serialize() { JsonObject obj = new JsonObject(); - this.geometry().ifPresent(g -> obj.add("geometry", g.serialize())); + this.geometry().ifPresent(g -> { + obj.add("geometry", g.geometry().serialize()); + obj.add("material_instances", g.materialInstances().serialize()); + }); this.friction.ifPresent(f -> obj.addProperty("friction", f)); if (this.lightEmission > 0) obj.addProperty("light_emission", this.lightEmission); if (this.lightDampening > 0) obj.addProperty("light_dampening", this.lightDampening); diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/block/BlockMappingConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/block/BlockMappingConfiguration.java index 5cadb46f..53937dee 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/block/BlockMappingConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/block/BlockMappingConfiguration.java @@ -1,5 +1,6 @@ package fr.robie.craftengineconverter.api.configuration.bedrock.mapping.block; +import com.google.gson.JsonElement; import com.google.gson.JsonObject; import fr.robie.craftengineconverter.api.manager.FileCacheManager; import org.jetbrains.annotations.NotNull; @@ -79,7 +80,13 @@ public BlockEntry mergeStateOverrides(BlockEntry other) { public JsonObject serialize() { JsonObject obj = new JsonObject(); obj.addProperty("name", this.name); - if (this.base != null) obj.add("base", this.base.serialize()); + if (this.base != null) { + // Inline base properties (geometry, material_instances, etc.) at the top level — + // Geyser has no "base" key; these fields live directly on the block entry. + for (Map.Entry e : this.base.serialize().entrySet()) { + obj.add(e.getKey(), e.getValue()); + } + } if (this.includeInCreativeInventory) obj.addProperty("included_in_creative_inventory", true); if (this.onlyOverrideStates) obj.addProperty("only_override_states", true); JsonObject overrides = new JsonObject(); diff --git a/BEDROCK-ROADMAP.md b/BEDROCK-ROADMAP.md index cef9f069..fde0afe5 100644 --- a/BEDROCK-ROADMAP.md +++ b/BEDROCK-ROADMAP.md @@ -7,3 +7,28 @@ Conversion: - [X] Sound conversion - [X] Language conversion +Java resource pack structure: + +**name** or **name.zip**: +|- pack.mcmeta +|- pack.png +|- /assets +|- assets + |- + | |- atlases [Folder]: `.json` + | |- blockstates [Folder]: `.json` + | |- equipment [Folder]: `.json` + | |- font [Folder]: `.json` + | |- items [Folder]: `.json` + | |- lang [Folder]: `.json` [X] + | |- models [Folder]: `.json` + | |- particles [Folder]: `.json` + | |- post_effect [Folder]: `.json` + | |- sounds [Folder]: `.ogg` + | |- texts [Folder]: `.json` [X] + | |- textures [Folder]: `.png` + | |- waypoint_style [Folder]: `.json` [X] + | |- gpu_warnlist.json + | |- regional_compliancies.json + | |- sounds.json [X] Finish + |- .mcassetsroot \ No newline at end of file diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockConverter.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockConverter.java index 21046b7e..fc57002a 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockConverter.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockConverter.java @@ -84,7 +84,6 @@ public void convert() { this.convertItems(extra, ctx); } - ctx.convertBlocks(); ctx.saveAll(); this.createMcPack(packOut, outputFolder); } @@ -273,7 +272,10 @@ private void convertNamespaceAssets(File namespaceDir, String namespace, Convers if (file.isDirectory()) { String name = file.getName().toLowerCase(Locale.ROOT); switch (name) { - case "lang" -> ctx.addLangDirectory(file, namespace); + case "lang" -> ctx.addLangDirectory(file, namespace); + case "font" -> ctx.addFontDirectory(file, namespace); + case "blockstates" -> ctx.addBlockstatesDirectory(file, namespace); + case "waypoint_style" -> ctx.addWaypointStyleDirectory(file, namespace); default -> { // Other directories can be handled here if needed } diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/ConversionContext.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/ConversionContext.java index 5dca5cac..29767524 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/ConversionContext.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/ConversionContext.java @@ -4,20 +4,22 @@ import fr.robie.craftengineconverter.api.configuration.bedrock.ItemTextureConfiguration; import fr.robie.craftengineconverter.api.configuration.bedrock.ManifestConfiguration; import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.MappingsConfiguration; -import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.block.BlockMappingConfiguration; import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.GroupDefinitionMapping; import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.ItemMapping; import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.ItemModelItemMapping; import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.option.BedrockOptions; import fr.robie.craftengineconverter.api.configuration.bedrock.texture.FlipbookTextureConfiguration; +import fr.robie.craftengineconverter.api.configuration.bedrock.texture.FlipbookTextureData; import fr.robie.craftengineconverter.api.configuration.bedrock.texture.TextureData; import fr.robie.craftengineconverter.api.manager.FileCacheManager; import fr.robie.craftengineconverter.converter.bedrock.animation.BedrockAnimation; import fr.robie.craftengineconverter.converter.bedrock.animation.BedrockAnimationController; import fr.robie.craftengineconverter.converter.bedrock.animation.BedrockRenderControllers; import fr.robie.craftengineconverter.converter.bedrock.attachable.BedrockAttachableContext; -import fr.robie.craftengineconverter.converter.bedrock.block.BedrockBlockMapper; +import fr.robie.craftengineconverter.converter.bedrock.block.BlockStateMapper; import fr.robie.craftengineconverter.converter.bedrock.geometry.BedrockGeometry; +import fr.robie.craftengineconverter.converter.bedrock.font.FontMapper; +import fr.robie.craftengineconverter.converter.bedrock.waypoint.WaypointStyleMapper; import fr.robie.craftengineconverter.converter.bedrock.lang.LanguageMapper; import fr.robie.craftengineconverter.converter.bedrock.geometry.GeometryMapper; import fr.robie.craftengineconverter.converter.bedrock.geometry.JavaBlockModel; @@ -38,7 +40,7 @@ public class ConversionContext { private final ItemTextureConfiguration texturesConfig = new ItemTextureConfiguration(); private final ItemTextureConfiguration terrainTexturesConfig = new ItemTextureConfiguration(); private final FlipbookTextureConfiguration flipbookConfig = new FlipbookTextureConfiguration(); - private final BlockMappingConfiguration blockMappings = new BlockMappingConfiguration(); + private final BlockStateMapper blockStateMapper = new BlockStateMapper(); private final TexturePipeline texturePipeline = new TexturePipeline(); private final Map collectedGeometry = new HashMap<>(); private final Map collectedAttachables = new HashMap<>(); @@ -47,6 +49,8 @@ public class ConversionContext { private final Map animationControllers = new HashMap<>(); private final SoundMapper soundMapper = new SoundMapper(); private final LanguageMapper languageMapper = new LanguageMapper(); + private final FontMapper fontMapper = new FontMapper(); + private final WaypointStyleMapper waypointStyleMapper = new WaypointStyleMapper(); private ManifestConfiguration manifest; private final Path customMappingsDir; private final Path texturesDir; @@ -230,14 +234,15 @@ public void registerAttachable(String bedrockKey, BedrockAttachableContext ctx) } } - public BlockMappingConfiguration blockMappings() { - return this.blockMappings; - } - public void addLangDirectory(File langDir, String namespace) { this.languageMapper.addFromLangDirectory(langDir, namespace); } + public void addFontDirectory(File fontDir, String namespace) { + if (this.javaAssetsDir == null) return; + this.fontMapper.addFromFontDirectory(fontDir, namespace, this.javaAssetsDir); + } + public void convertSoundDefinitions(File javaSoundsJson, String namespace) { if (this.javaAssetsDir == null) return; fr.robie.craftengineconverter.api.manager.FileCacheManager.getJsonCache() @@ -246,17 +251,13 @@ public void convertSoundDefinitions(File javaSoundsJson, String namespace) { root, namespace, this.javaAssetsDir, this.packDir.resolve("sounds"))); } - public void convertBlocks() { + public void addWaypointStyleDirectory(File dir, String namespace) { + this.waypointStyleMapper.addFromWaypointStyleDirectory(dir, namespace); + } + + public void addBlockstatesDirectory(File blockstatesDir, String namespace) { if (this.javaAssetsDir == null) return; - BedrockBlockMapper mapper = new BedrockBlockMapper(this.javaAssetsDir); - mapper.mapAllBlocks(); - BlockMappingConfiguration result = mapper.result(); - if (!result.isEmpty()) { - for (var entry : result.entries().entrySet()) { - this.blockMappings.mapBlock(entry.getKey(), entry.getValue()); - } - fr.robie.messageflow.logger.Logger.info("Mapped " + result.size() + " block states"); - } + this.blockStateMapper.addFromBlockstatesDirectory(blockstatesDir, namespace, this.javaAssetsDir); } public void registerTextureData(String modelPath, String bedrockKey) { @@ -273,12 +274,24 @@ public void copyTexture(String modelPath, String bedrockKey) { } public void registerTextureDataAsTerrain(String modelPath, String bedrockKey) { - this.registerTextureDataInternal(modelPath, bedrockKey, this.terrainTexturesConfig); + this.registerTextureDataAsTerrain(modelPath, bedrockKey, this.javaAssetsDir); + } + + // Explicit assets dir overload: javaAssetsDir is reassigned per pack layer, so deferred + // callers (e.g. block textures resolved during the walk but registered in saveAll) must + // supply the dir that was active when the texture was discovered. + public void registerTextureDataAsTerrain(String modelPath, String bedrockKey, Path assetsDir) { + this.registerTextureDataInternal(modelPath, bedrockKey, this.terrainTexturesConfig, assetsDir); } private void registerTextureDataInternal(String modelPath, String bedrockKey, ItemTextureConfiguration targetConfig) { - if (this.javaAssetsDir == null) return; - Optional resolved = this.texturePipeline.resolveTexture(modelPath, bedrockKey, this.javaAssetsDir); + this.registerTextureDataInternal(modelPath, bedrockKey, targetConfig, this.javaAssetsDir); + } + + private void registerTextureDataInternal(String modelPath, String bedrockKey, + ItemTextureConfiguration targetConfig, Path assetsDir) { + if (assetsDir == null) return; + Optional resolved = this.texturePipeline.resolveTexture(modelPath, bedrockKey, assetsDir); if (resolved.isEmpty()) { resolved = this.tryResolveTextureFromModel(modelPath, bedrockKey); } @@ -357,18 +370,57 @@ public void registerGeometry(String modelPath, String bedrockKey, int texW, int } } + // Registers a block texture in terrain_texture.json and, when animated (.mcmeta present), + // also adds a flipbook entry so Bedrock animates the full spritesheet directly. + private void registerBlockTerrainTexture(String textureRef, String shortname, Path assetsDir) { + if (assetsDir == null) return; + Optional resolved = this.texturePipeline.resolveTexture(textureRef, shortname, assetsDir); + if (resolved.isEmpty()) { + resolved = this.tryResolveTextureFromModel(textureRef, shortname); + } + resolved.ifPresent(info -> { + this.texturePipeline.copyTexture(info, this.texturesDir); + this.terrainTexturesConfig.addTextureData(this.texturePipeline.toTextureData(info)); + info.animation().ifPresent(anim -> { + java.util.List frameIndices = anim.frames().stream() + .map(CachedTextureInfo.FrameInfo::index) + .toList(); + this.flipbookConfig.addFlipbookTexture(new FlipbookTextureData( + shortname, + info.bedrockTexturePath(), + anim.defaultTickTime(), + frameIndices, + 1, + true + )); + }); + }); + } + public void saveAll() { this.mappings.saveMappings(this.customMappingsDir); this.texturesConfig.save(this.texturesDir); + // Copy block textures, register in terrain_texture.json, and add flipbook if animated + for (Map.Entry tex : this.blockStateMapper.getDiscoveredTextures().entrySet()) { + String textureRef = tex.getKey(); + String shortname = textureRef.replace("minecraft:", "minecraft/").replace(":", "/"); + this.registerBlockTerrainTexture(textureRef, shortname, tex.getValue()); + } if (!this.terrainTexturesConfig.isEmpty()) { this.terrainTexturesConfig.save(this.texturesDir); } if (!this.flipbookConfig.isEmpty()) { this.flipbookConfig.save(this.texturesDir); } - this.blockMappings.save(this.customMappingsDir); + this.blockStateMapper.save(this.customMappingsDir); this.languageMapper.save(this.packDir.resolve("texts")); + this.fontMapper.save(this.packDir, this.texturesDir); + + if (!this.waypointStyleMapper.isEmpty() && this.javaAssetsDir != null) { + this.waypointStyleMapper.save(this.customMappingsDir, this.texturesDir, this.javaAssetsDir); + fr.robie.messageflow.logger.Logger.info("Saved " + this.waypointStyleMapper.size() + " waypoint style(s)"); + } if (!this.soundMapper.isEmpty()) { try { diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/block/BedrockBlockMapper.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/block/BedrockBlockMapper.java deleted file mode 100644 index 903db630..00000000 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/block/BedrockBlockMapper.java +++ /dev/null @@ -1,279 +0,0 @@ -package fr.robie.craftengineconverter.converter.bedrock.block; - -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.block.BlockDefinition; -import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.block.BlockMappingConfiguration; -import fr.robie.craftengineconverter.converter.bedrock.geometry.JavaBlockModel; -import fr.robie.messageflow.logger.Logger; - -import java.io.IOException; -import java.io.Reader; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.HashMap; -import java.util.Map; -import java.util.stream.Stream; - -public class BedrockBlockMapper { - private final Path javaAssetsDir; - private final Map modelCache = new HashMap<>(); - private final Map textureResolutionCache = new HashMap<>(); - private final Map pendingBlocks = new HashMap<>(); - private final BlockMappingConfiguration output = new BlockMappingConfiguration(); - - public BedrockBlockMapper(Path javaAssetsDir) { - this.javaAssetsDir = javaAssetsDir; - } - - public void mapAllBlocks() { - Path blockstatesDir = this.javaAssetsDir.resolve("minecraft/blockstates"); - if (!Files.isDirectory(blockstatesDir)) { - blockstatesDir = this.findBlockstatesDir(); - if (blockstatesDir == null) return; - } - - try (Stream files = Files.list(blockstatesDir)) { - files.filter(f -> f.toString().endsWith(".json")).forEach(this::mapBlockstate); - } catch (IOException e) { - Logger.error("Failed to list blockstates", e); - } - - for (Map.Entry entry : this.pendingBlocks.entrySet()) { - this.output.mapBlock(entry.getKey(), entry.getValue().build()); - } - } - - private Path findBlockstatesDir() { - if (!Files.isDirectory(this.javaAssetsDir)) return null; - try (Stream nsDirs = Files.list(this.javaAssetsDir)) { - return nsDirs.filter(Files::isDirectory) - .map(ns -> ns.resolve("blockstates")) - .filter(Files::isDirectory) - .findFirst() - .orElse(null); - } catch (IOException e) { - return null; - } - } - - private void mapBlockstate(Path blockstateFile) { - String fileName = blockstateFile.getFileName().toString(); - String blockName = fileName.substring(0, fileName.length() - 5); - String bedrockName = "minecraft:" + blockName; - - try (Reader reader = Files.newBufferedReader(blockstateFile)) { - JsonObject root = com.google.gson.JsonParser.parseReader(reader).getAsJsonObject(); - - if (root.has("variants")) { - this.mapVariants(blockstateFile, blockName, bedrockName, root.getAsJsonObject("variants")); - } else if (root.has("multipart")) { - this.mapMultipart(blockstateFile, blockName, bedrockName, root.getAsJsonArray("multipart")); - } - } catch (Exception e) { - Logger.error("Failed to parse blockstate: " + blockstateFile, e); - } - } - - private void mapVariants(Path blockstateFile, String blockName, String bedrockName, JsonObject variants) { - BlockMappingConfiguration.BlockEntry.Builder entryBuilder = new BlockMappingConfiguration.BlockEntry.Builder(bedrockName); - boolean hasMultipleStates = variants.keySet().size() > 1; - - for (String stateKey : variants.keySet()) { - JsonElement varEntry = variants.get(stateKey); - BlockDefinition def = this.resolveVariantToDefinition(varEntry, blockName); - if (def == null) continue; - - if (hasMultipleStates) { - entryBuilder.onlyOverrideStates().withStateOverride(stateKey, def); - } else { - entryBuilder.withBase(def); - } - } - - this.pendingBlocks.put(bedrockName, entryBuilder); - } - - private void mapMultipart(Path blockstateFile, String blockName, String bedrockName, JsonArray multipart) { - BlockMappingConfiguration.BlockEntry.Builder entryBuilder = new BlockMappingConfiguration.BlockEntry.Builder(bedrockName); - // For multipart, use the first case's model as a base definition - for (JsonElement partElem : multipart) { - JsonObject part = partElem.getAsJsonObject(); - if (part.has("apply")) { - JsonElement apply = part.get("apply"); - BlockDefinition def = this.resolveVariantToDefinition(apply, blockName); - if (def != null) { - entryBuilder.withBase(def); - break; - } - } - } - this.pendingBlocks.put(bedrockName, entryBuilder); - } - - private BlockDefinition resolveVariantToDefinition(JsonElement varEntry, String blockName) { - String modelPath; - int rotX = 0, rotY = 0; - boolean uvLock = false; - - if (varEntry.isJsonArray()) { - JsonArray arr = varEntry.getAsJsonArray(); - if (arr.isEmpty()) return null; - JsonObject first = arr.get(0).getAsJsonObject(); - modelPath = first.get("model").getAsString(); - if (first.has("x")) rotX = first.get("x").getAsInt(); - if (first.has("y")) rotY = first.get("y").getAsInt(); - if (first.has("uvlock")) uvLock = first.get("uvlock").getAsBoolean(); - } else { - JsonObject obj = varEntry.getAsJsonObject(); - modelPath = obj.get("model").getAsString(); - if (obj.has("x")) rotX = obj.get("x").getAsInt(); - if (obj.has("y")) rotY = obj.get("y").getAsInt(); - if (obj.has("uvlock")) uvLock = obj.get("uvlock").getAsBoolean(); - } - - return this.resolveModelToDefinition(modelPath, blockName, rotX, rotY); - } - - private BlockDefinition resolveModelToDefinition(String modelPath, String blockName, int rotX, int rotY) { - try { - JavaBlockModel model = this.loadModel(modelPath); - if (model == null) return null; - - BlockDefinition.Builder builder = new BlockDefinition.Builder() - .withTransformation(new BlockDefinition.Transformation(1, 1, 1, 0, 0, 0, rotX, rotY, 0)); - - String resolvedTexture = this.resolveTexture(model, "all"); - if (resolvedTexture == null) resolvedTexture = this.resolveTexture(model, "particle"); - if (resolvedTexture == null) resolvedTexture = this.resolveTexture(model, "top"); - if (resolvedTexture == null) resolvedTexture = blockName; - - if (this.isFullBlock(model)) { - builder.withFullBlockGeometry(resolvedTexture, "opaque"); - } else if (this.isCrossModel(model)) { - builder.withCrossGeometry(resolvedTexture, "blend"); - } else if (model.elements().isEmpty()) { - builder.withFullBlockGeometry(resolvedTexture, "opaque"); - } else { - builder.withCrossGeometry(resolvedTexture, "blend"); - } - - return builder.build(); - } catch (Exception e) { - Logger.warn("Failed to resolve model " + modelPath + " for block " + blockName); - return null; - } - } - - private JavaBlockModel loadModel(String modelPath) { - if (this.modelCache.containsKey(modelPath)) { - return this.modelCache.get(modelPath); - } - - String[] parts = modelPath.split(":", 2); - String ns = parts[0]; - String path = parts.length > 1 ? parts[1] : parts[0]; - Path modelFile = this.javaAssetsDir.resolve(ns + "/models/" + path + ".json"); - if (!Files.exists(modelFile)) { - this.modelCache.put(modelPath, null); - return null; - } - - try { - JavaBlockModel model = JavaBlockModel.load(modelFile); - this.resolveParent(model); - this.modelCache.put(modelPath, model); - return model; - } catch (IOException e) { - this.modelCache.put(modelPath, null); - return null; - } - } - - private void resolveParent(JavaBlockModel model) { - if (model.parent().isEmpty()) return; - String parentPath = model.parent().get(); - if (this.modelCache.containsKey(parentPath)) { - JavaBlockModel parent = this.modelCache.get(parentPath); - if (parent == null) return; - this.inheritModel(model, parent); - return; - } - - String[] parts = parentPath.split(":", 2); - String ns = parts[0]; - String path = parts.length > 1 ? parts[1] : parts[0]; - Path parentFile = this.javaAssetsDir.resolve(ns + "/models/" + path + ".json"); - if (!Files.exists(parentFile)) { - this.modelCache.put(parentPath, null); - return; - } - - try { - JavaBlockModel parent = JavaBlockModel.load(parentFile); - this.resolveParent(parent); - this.inheritModel(model, parent); - this.modelCache.put(parentPath, parent); - } catch (IOException e) { - this.modelCache.put(parentPath, null); - } - } - - private void inheritModel(JavaBlockModel child, JavaBlockModel parent) { - for (Map.Entry tex : parent.textures().entrySet()) { - String childTex = child.textures().get(tex.getKey()); - if (childTex == null || childTex.startsWith("#")) { - if (childTex == null) { - child.textures().put(tex.getKey(), tex.getValue()); - } else { - String resolved = this.resolveVariableReference(child, tex.getValue()); - if (resolved != null) { - child.textures().put(tex.getKey(), resolved); - } else { - child.textures().put(tex.getKey(), tex.getValue()); - } - } - } - } - if (child.elements().isEmpty() && !parent.elements().isEmpty()) { - for (var el : parent.elements()) child.addElement(el); - } - } - - private String resolveTexture(JavaBlockModel model, String key) { - if (key == null) return null; - if (key.startsWith("#")) { - String varName = key.substring(1); - String tex = model.textures().get(varName); - if (tex == null) return null; - return this.resolveTexture(model, tex); - } - if (key.contains(":")) { - return key.replace("minecraft:", "minecraft/").replace(":", "/"); - } - return "minecraft/" + key; - } - - private String resolveVariableReference(JavaBlockModel model, String value) { - if (value == null) return null; - if (value.startsWith("#")) { - String resolved = model.textures().get(value.substring(1)); - if (resolved != null && !resolved.startsWith("#")) return resolved; - } - return value.startsWith("#") ? null : value; - } - - private boolean isFullBlock(JavaBlockModel model) { - if (model.elements().size() != 1) return false; - var el = model.elements().getFirst(); - return el.fromX() == 0 && el.fromY() == 0 && el.fromZ() == 0 - && el.toX() == 16 && el.toY() == 16 && el.toZ() == 16; - } - - private boolean isCrossModel(JavaBlockModel model) { - return model.elements().size() == 2; - } - - public BlockMappingConfiguration result() { return this.output; } -} diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/block/BlockStateMapper.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/block/BlockStateMapper.java new file mode 100644 index 00000000..a89b1e2e --- /dev/null +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/block/BlockStateMapper.java @@ -0,0 +1,291 @@ +package fr.robie.craftengineconverter.converter.bedrock.block; + +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.block.BlockDefinition; +import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.block.BlockMappingConfiguration; +import fr.robie.craftengineconverter.api.manager.FileCacheManager; +import fr.robie.craftengineconverter.converter.bedrock.geometry.JavaBlockModel; +import fr.robie.messageflow.logger.Logger; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Path; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.Map; + +public final class BlockStateMapper { + private static final String[] TEXTURE_KEYS = { + "all", "particle", "top", "side", "bottom", "end", "front", "back", "cross", "face" + }; + + private final Map modelCache = new HashMap<>(); + private final Map pendingBlocks = new LinkedHashMap<>(); + // texture ref ("namespace:path") -> the java assets dir it was discovered under. + // The dir must be captured here because ConversionContext#javaAssetsDir is reassigned + // for every pack layer and no longer points at this pack by the time save() runs. + private final Map discoveredTextures = new LinkedHashMap<>(); + private Path currentAssetsDir; + + public void addFromBlockstatesDirectory(File blockstatesDir, String namespace, Path javaAssetsDir) { + File[] files = blockstatesDir.listFiles(); + if (files == null) return; + + this.currentAssetsDir = javaAssetsDir; + + for (File file : files) { + if (!file.isFile() || !file.getName().endsWith(".json")) continue; + String blockName = file.getName().substring(0, file.getName().length() - 5); + String bedrockName = namespace + ":" + blockName; + + FileCacheManager.getJsonCache().getData(file.toPath()).ifPresent(root -> { + if (root.has("variants")) { + this.mapVariants(blockName, bedrockName, root.getAsJsonObject("variants"), javaAssetsDir); + } else if (root.has("multipart")) { + this.mapMultipart(blockName, bedrockName, root.getAsJsonArray("multipart"), javaAssetsDir); + } + }); + } + } + + private void mapVariants(String blockName, String bedrockName, JsonObject variants, Path javaAssetsDir) { + BlockMappingConfiguration.BlockEntry.Builder builder = + this.pendingBlocks.computeIfAbsent(bedrockName, + k -> new BlockMappingConfiguration.BlockEntry.Builder(k)); + boolean hasMultipleStates = variants.keySet().size() > 1; + + for (String stateKey : variants.keySet()) { + BlockDefinition def = this.resolveVariantToDefinition(variants.get(stateKey), blockName, javaAssetsDir); + if (def == null) continue; + if (hasMultipleStates) { + builder.onlyOverrideStates().withStateOverride(stateKey, def); + } else { + builder.withBase(def); + } + } + } + + private void mapMultipart(String blockName, String bedrockName, JsonArray multipart, Path javaAssetsDir) { + BlockMappingConfiguration.BlockEntry.Builder builder = + this.pendingBlocks.computeIfAbsent(bedrockName, + k -> new BlockMappingConfiguration.BlockEntry.Builder(k)); + for (JsonElement partElem : multipart) { + if (!partElem.isJsonObject()) continue; + JsonObject part = partElem.getAsJsonObject(); + if (!part.has("apply")) continue; + BlockDefinition def = this.resolveVariantToDefinition(part.get("apply"), blockName, javaAssetsDir); + if (def != null) { + builder.withBase(def); + break; + } + } + } + + private BlockDefinition resolveVariantToDefinition(JsonElement varEntry, String blockName, Path javaAssetsDir) { + String modelPath; + int rotX = 0, rotY = 0; + + if (varEntry.isJsonArray()) { + JsonArray arr = varEntry.getAsJsonArray(); + if (arr.isEmpty()) return null; + JsonObject first = arr.get(0).getAsJsonObject(); + if (!first.has("model")) return null; + modelPath = first.get("model").getAsString(); + if (first.has("x")) rotX = first.get("x").getAsInt(); + if (first.has("y")) rotY = first.get("y").getAsInt(); + } else if (varEntry.isJsonObject()) { + JsonObject obj = varEntry.getAsJsonObject(); + if (!obj.has("model")) return null; + modelPath = obj.get("model").getAsString(); + if (obj.has("x")) rotX = obj.get("x").getAsInt(); + if (obj.has("y")) rotY = obj.get("y").getAsInt(); + } else { + return null; + } + + return this.resolveModelToDefinition(modelPath, blockName, rotX, rotY, javaAssetsDir); + } + + private BlockDefinition resolveModelToDefinition(String modelPath, String blockName, int rotX, int rotY, + Path javaAssetsDir) { + try { + JavaBlockModel model = this.loadModel(modelPath, javaAssetsDir); + if (model == null) return null; + + BlockDefinition.Builder builder = new BlockDefinition.Builder() + .withTransformation(new BlockDefinition.Transformation(1, 1, 1, 0, 0, 0, rotX, rotY, 0)); + + String resolvedTexture = null; + for (String key : TEXTURE_KEYS) { + resolvedTexture = this.resolveTexture(model, key); + if (resolvedTexture != null) break; + } + // Model uses a non-standard texture variable (e.g. "pattern") — try any value + if (resolvedTexture == null) { + for (String tex : model.textures().values()) { + resolvedTexture = this.resolveTextureRef(model, tex); + if (resolvedTexture != null) break; + } + } + if (resolvedTexture == null) resolvedTexture = blockName; + + if (this.isFullBlock(model)) { + builder.withFullBlockGeometry(resolvedTexture, "opaque"); + } else if (this.isCrossModel(model)) { + builder.withCrossGeometry(resolvedTexture, "blend"); + } else if (model.elements().isEmpty()) { + builder.withFullBlockGeometry(resolvedTexture, "opaque"); + } else { + builder.withCrossGeometry(resolvedTexture, "blend"); + } + + return builder.build(); + } catch (Exception e) { + Logger.warn("Failed to resolve model " + modelPath + " for block " + blockName); + return null; + } + } + + private JavaBlockModel loadModel(String modelPath, Path javaAssetsDir) { + if (this.modelCache.containsKey(modelPath)) { + return this.modelCache.get(modelPath); + } + + int colon = modelPath.indexOf(':'); + String ns = colon >= 0 ? modelPath.substring(0, colon) : "minecraft"; + String path = colon >= 0 ? modelPath.substring(colon + 1) : modelPath; + Path modelFile = javaAssetsDir.resolve(ns + "/models/" + path + ".json"); + + if (!modelFile.toFile().exists()) { + this.modelCache.put(modelPath, null); + return null; + } + + try { + JavaBlockModel model = JavaBlockModel.load(modelFile); + this.resolveParent(model, javaAssetsDir); + this.modelCache.put(modelPath, model); + return model; + } catch (IOException e) { + this.modelCache.put(modelPath, null); + return null; + } + } + + private void resolveParent(JavaBlockModel model, Path javaAssetsDir) { + if (model.parent().isEmpty()) return; + String parentPath = model.parent().get(); + if (this.modelCache.containsKey(parentPath)) { + JavaBlockModel parent = this.modelCache.get(parentPath); + if (parent != null) this.inheritModel(model, parent); + return; + } + + int colon = parentPath.indexOf(':'); + String ns = colon >= 0 ? parentPath.substring(0, colon) : "minecraft"; + String path = colon >= 0 ? parentPath.substring(colon + 1) : parentPath; + Path parentFile = javaAssetsDir.resolve(ns + "/models/" + path + ".json"); + + if (!parentFile.toFile().exists()) { + this.modelCache.put(parentPath, null); + return; + } + + try { + JavaBlockModel parent = JavaBlockModel.load(parentFile); + this.resolveParent(parent, javaAssetsDir); + this.inheritModel(model, parent); + this.modelCache.put(parentPath, parent); + } catch (IOException e) { + this.modelCache.put(parentPath, null); + } + } + + private void inheritModel(JavaBlockModel child, JavaBlockModel parent) { + for (Map.Entry tex : parent.textures().entrySet()) { + String childTex = child.textures().get(tex.getKey()); + if (childTex == null) { + child.textures().put(tex.getKey(), tex.getValue()); + } else if (childTex.startsWith("#")) { + String resolved = this.resolveVariableReference(child, tex.getValue()); + child.textures().put(tex.getKey(), resolved != null ? resolved : tex.getValue()); + } + } + if (child.elements().isEmpty() && !parent.elements().isEmpty()) { + for (var el : parent.elements()) child.addElement(el); + } + } + + // Looks up a texture variable key in the model's textures map, then resolves the value. + private String resolveTexture(JavaBlockModel model, String variableKey) { + String tex = model.textures().get(variableKey); + if (tex == null) return null; + return this.resolveTextureRef(model, tex); + } + + // Follows #variable references and converts the final path to a shortname-style string. + private String resolveTextureRef(JavaBlockModel model, String ref) { + if (ref == null) return null; + if (ref.startsWith("#")) { + String tex = model.textures().get(ref.substring(1)); + if (tex == null) return null; + return this.resolveTextureRef(model, tex); + } + // Record in namespace:path format for terrain_texture.json registration + String modelPath = ref.contains(":") ? ref : "minecraft:" + ref; + if (this.currentAssetsDir != null) { + this.discoveredTextures.putIfAbsent(modelPath, this.currentAssetsDir); + } + // Return shortname for geyser_block_mappings.json + if (ref.contains(":")) { + return ref.replace("minecraft:", "minecraft/").replace(":", "/"); + } + return "minecraft/" + ref; + } + + // Maps each discovered texture ref ("namespace:path") to the java assets dir it lives under. + public Map getDiscoveredTextures() { + return java.util.Collections.unmodifiableMap(this.discoveredTextures); + } + + private String resolveVariableReference(JavaBlockModel model, String value) { + if (value == null) return null; + if (value.startsWith("#")) { + String resolved = model.textures().get(value.substring(1)); + if (resolved != null && !resolved.startsWith("#")) return resolved; + return null; + } + return value; + } + + private boolean isFullBlock(JavaBlockModel model) { + if (model.elements().size() != 1) return false; + var el = model.elements().getFirst(); + return el.fromX() == 0 && el.fromY() == 0 && el.fromZ() == 0 + && el.toX() == 16 && el.toY() == 16 && el.toZ() == 16; + } + + private boolean isCrossModel(JavaBlockModel model) { + return model.elements().size() == 2; + } + + public boolean isEmpty() { + return pendingBlocks.isEmpty(); + } + + public int size() { + return pendingBlocks.size(); + } + + public void save(Path customMappingsDir) { + if (isEmpty()) return; + BlockMappingConfiguration config = new BlockMappingConfiguration(); + for (Map.Entry entry : pendingBlocks.entrySet()) { + config.mapBlock(entry.getKey(), entry.getValue().build()); + } + config.save(customMappingsDir); + Logger.info("Saved " + config.size() + " block state mapping(s)"); + } +} diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/font/FontMapper.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/font/FontMapper.java new file mode 100644 index 00000000..0a4d5af0 --- /dev/null +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/font/FontMapper.java @@ -0,0 +1,342 @@ +package fr.robie.craftengineconverter.converter.bedrock.font; + +import com.google.gson.JsonArray; +import com.google.gson.JsonObject; +import fr.robie.craftengineconverter.api.manager.FileCacheManager; +import fr.robie.messageflow.logger.Logger; + +import javax.imageio.ImageIO; +import java.awt.*; +import java.awt.image.BufferedImage; +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Comparator; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +/** + * Converts Java bitmap font providers into Bedrock glyph pages ({@code font/glyph_XX.png}). + *

+ * A Java provider declares {@code height} (the glyph's rendered height in logical font pixels) + * and {@code ascent} (the distance from the text baseline up to the top of the glyph), so a glyph + * spans from {@code ascent} above the baseline down to {@code height - ascent} below it. Bedrock + * has no per-glyph metrics of any kind — a page is always a 16x16 grid of equal square cells and + * each cell is rendered as exactly one character box — so those metrics have to be baked into + * where and how large each glyph is drawn inside its cell. + *

+ * Alignment is page-relative, not absolute. A Bedrock glyph can never render larger than + * one character box, so a 142-logical-pixel GUI overlay cannot occupy the ~18 character boxes it + * does in Java. What survives the conversion is the size and baseline alignment of each glyph + * relative to the other glyphs on the same page, which is what matters for overlays that + * are composited together. Absolute size relative to surrounding text is not preserved and + * cannot be. + *

+ * Source artwork is never upscaled: the page's cell size is chosen large enough to hold the + * biggest glyph at its natural pixel size, then snapped up to a power of two. The slack that + * leaves in each cell is deliberate headroom for the ascent shift. + *

+ * Because of that one-character-box ceiling, glyphs at or above {@link #JSON_UI_MIN_HEIGHT} logical + * pixels are not glyphs in any useful sense — they are GUI overlays. Those are diverted to + * {@link JsonUiImageWriter}, which renders them at true pixel size through JSON-UI, and are + * deliberately not also baked into a glyph page: drawing both would put a tiny unreadable + * copy on top of the correctly sized image. + */ +public final class FontMapper { + // Bedrock glyph pages are always a 16x16 grid of cells. + private static final int GRID_SIZE = 16; + // Vanilla "default8" pages are 128x128, i.e. 8px cells — that is the smallest sensible page. + private static final int MIN_CELL_PX = 8; + // Caps a page at 4096x4096. Beyond this the page is downscaled to fit. + private static final int MAX_CELL_PX = 256; + // At or above this logical height a bitmap is a GUI overlay rather than text, and goes to + // JSON-UI instead of a glyph page. Normal text fonts are height 8; CraftEngine's emoji sheets + // are around 11; its GUI overlays start at 23. + private static final int JSON_UI_MIN_HEIGHT = 20; + + // Keyed by resolved absolute path — avoids re-reading the same PNG when multiple + // bitmap providers reference the same file. + private final Map srcImageCache = new HashMap<>(); + + // Pending draw operations grouped by glyph page key (e.g. "glyph_E0", "glyph_4E"). + // Deferred because a page's cell size and scale can only be computed once every provider + // contributing to that page has been seen. + private final Map> pendingDraws = new LinkedHashMap<>(); + + // Tall glyphs bound for JSON-UI, keyed by code point so that a later font file claiming the + // same character replaces the earlier one — the same last-write-wins rule the pages use. + private final Map uiImages = new LinkedHashMap<>(); + + private record PendingDraw(BufferedImage src, + int srcX, int srcY, int srcW, int srcH, + int height, int ascent, + int cellCol, int cellRow) {} + + public void addFromFontDirectory(File fontDir, String namespace, Path javaAssetsDir) { + File[] files = fontDir.listFiles(); + if (files == null) return; + + // listFiles() order is unspecified; sort so that two providers claiming the same code + // point always resolve the same way (last write wins) and the output is reproducible. + Arrays.sort(files, Comparator.comparing(File::getName)); + + for (File file : files) { + if (!file.isFile() || !file.getName().endsWith(".json")) continue; + FileCacheManager.getJsonCache().getData(file.toPath()).ifPresent(root -> { + if (!root.has("providers")) return; + JsonArray providers = root.getAsJsonArray("providers"); + for (var elem : providers) { + if (!elem.isJsonObject()) continue; + JsonObject provider = elem.getAsJsonObject(); + if (!provider.has("type")) continue; + if ("bitmap".equals(provider.get("type").getAsString())) { + processBitmapProvider(provider, javaAssetsDir); + } + } + }); + } + } + + private void processBitmapProvider(JsonObject provider, Path javaAssetsDir) { + if (!provider.has("file") || !provider.has("chars")) return; + String fileRef = provider.get("file").getAsString(); + JsonArray charsArray = provider.getAsJsonArray("chars"); + if (charsArray.isEmpty()) return; + + int height = provider.has("height") ? provider.get("height").getAsInt() : 8; + // Vanilla's default font is height 8 / ascent 7, so height - 1 is the natural default. + int ascent = provider.has("ascent") ? provider.get("ascent").getAsInt() : height - 1; + + // Offset characters exist only to shift text horizontally, which Bedrock fonts cannot + // express, so they are dropped. CraftEngine declares them two ways, both on a 1x1 PNG: + // - negative height (-3 .. -N), which renders nothing at all; + // - positive height with ascent -5000, which parks the glyph thousands of pixels below + // the baseline so it is off-screen and only its advance width counts. + // An ascent below -height puts the whole glyph box further down than its own height, which + // no visible glyph ever does — that is the signature of the off-screen trick. + if (height <= 0 || ascent < -height) return; + + Path texturePath = resolveTexturePath(fileRef, javaAssetsDir); + if (texturePath == null) return; + + BufferedImage srcImage = srcImageCache.computeIfAbsent( + texturePath.toAbsolutePath().toString(), k -> { + try { + return ImageIO.read(texturePath.toFile()); + } catch (IOException e) { + Logger.warn("Could not load font texture: " + texturePath); + return null; + } + }); + if (srcImage == null) return; + + int numRows = charsArray.size(); + String[] rows = new String[numRows]; + int numCols = 0; + for (int i = 0; i < numRows; i++) { + rows[i] = charsArray.get(i).getAsString(); + int cols = rows[i].codePointCount(0, rows[i].length()); + if (cols > numCols) numCols = cols; + } + if (numCols == 0) return; + + int cellW = srcImage.getWidth() / numCols; + int cellH = srcImage.getHeight() / numRows; + if (cellW <= 0 || cellH <= 0) return; + + for (int textRow = 0; textRow < numRows; textRow++) { + String rowStr = rows[textRow]; + int textCol = 0; + for (int i = 0; i < rowStr.length(); i += Character.charCount(rowStr.codePointAt(i))) { + int cp = rowStr.codePointAt(i); + int col = textCol++; + + if (cp == 0) continue; // NUL = Java's empty-slot sentinel + + int srcX = col * cellW; + int srcY = textRow * cellH; + if (srcX + cellW > srcImage.getWidth() || srcY + cellH > srcImage.getHeight()) continue; + if (isFullyTransparent(srcImage, srcX, srcY, cellW, cellH)) continue; + + // Too tall to ever fit a character box — hand it to JSON-UI and do not also draw + // it into a page, or a tiny copy would render on top of the full-size image. + if (height >= JSON_UI_MIN_HEIGHT) { + uiImages.put(cp, new JsonUiImageWriter.UiImage(cp, texturePath, + bedrockTexturePath(fileRef), srcX, srcY, cellW, cellH, + srcImage.getWidth(), srcImage.getHeight(), height, ascent)); + continue; + } + + if (cp > 0xFFFF) continue; // Bedrock only has 256 pages, all inside the BMP + + String pageKey = "glyph_" + String.format("%02X", (cp >> 8) & 0xFF); + int offset = cp & 0xFF; + + pendingDraws.computeIfAbsent(pageKey, k -> new ArrayList<>()) + .add(new PendingDraw(srcImage, srcX, srcY, cellW, cellH, + height, ascent, offset & 0xF, (offset >> 4) & 0xF)); + } + } + } + + private static boolean isFullyTransparent(BufferedImage img, int x, int y, int w, int h) { + for (int py = y; py < y + h; py++) { + for (int px = x; px < x + w; px++) { + if ((img.getRGB(px, py) >>> 24) != 0) return false; + } + } + return true; + } + + /** + * The scale and cell size shared by every glyph on one page. + * + * @param scale destination pixels per logical font pixel + * @param cellPx side length in pixels of one cell in the 16x16 grid + * @param pageAscent the largest ascent on the page; acts as the page's baseline anchor + * @param downscaled whether the page had to be shrunk to fit {@link #MAX_CELL_PX} + */ + private record PageMetrics(double scale, int cellPx, int pageAscent, boolean downscaled) { + static PageMetrics of(List draws) { + // The natural scale is the largest source-pixels-per-logical-unit ratio on the page. + // Taking the max means no glyph is ever drawn smaller than its source artwork. + double scale = 0; + int pageAscent = Integer.MIN_VALUE; + int pageDescent = Integer.MIN_VALUE; + double logicalSpanX = 0; + for (PendingDraw d : draws) { + scale = Math.max(scale, (double) d.srcH / d.height); + pageAscent = Math.max(pageAscent, d.ascent); + pageDescent = Math.max(pageDescent, d.height - d.ascent); + logicalSpanX = Math.max(logicalSpanX, (double) d.srcW * d.height / d.srcH); + } + + // Cells are square, so the page must accommodate the larger of the two spans. + double logicalExtent = Math.max(logicalSpanX, pageAscent + pageDescent); + int needed = (int) Math.ceil(logicalExtent * scale); + int cellPx = Math.min(MAX_CELL_PX, Math.max(MIN_CELL_PX, nextPowerOfTwo(needed))); + + // Only when the page is too large to fit the cap does anything get downscaled. + boolean downscaled = needed > cellPx; + if (downscaled) { + scale = cellPx / logicalExtent; + } + return new PageMetrics(scale, cellPx, pageAscent, downscaled); + } + } + + private static int nextPowerOfTwo(int value) { + if (value <= 1) return 1; + return Integer.highestOneBit(value - 1) << 1; + } + + // Composites one page. Each glyph is drawn at its natural pixel size (unless the page had to + // be downscaled to fit MAX_CELL_PX) and shifted down by however much lower than the page's + // topmost glyph its own ascent puts it. + private BufferedImage buildGlyphPage(List draws) { + PageMetrics m = PageMetrics.of(draws); + int pagePx = m.cellPx() * GRID_SIZE; + + BufferedImage page = new BufferedImage(pagePx, pagePx, BufferedImage.TYPE_INT_ARGB); + Graphics2D g = page.createGraphics(); + // Src, not the default SrcOver: blending a partially transparent pixel onto transparent + // black perturbs its colour channels, so an unscaled glyph would not come out byte-exact. + // Cells never overlap, so replacing the destination outright is safe. + g.setComposite(AlphaComposite.Src); + g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, m.downscaled() + ? RenderingHints.VALUE_INTERPOLATION_BILINEAR + : RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR); + + for (PendingDraw d : draws) { + // Destination pixels per source pixel — exactly 1.0 whenever the glyph's own + // resolution is what set the page scale. + double k = m.scale() * d.height / d.srcH; + int destW = Math.max(1, (int) Math.round(d.srcW * k)); + int destH = Math.max(1, (int) Math.round(d.srcH * k)); + int cellX = d.cellCol * m.cellPx(); + int cellY = d.cellRow * m.cellPx(); + int destY = cellY + (int) Math.round((m.pageAscent() - d.ascent) * m.scale()); + + // Two independent roundings can push a glyph a pixel past its cell; clip so it can + // never bleed into a neighbouring character. + g.setClip(cellX, cellY, m.cellPx(), m.cellPx()); + g.drawImage(d.src.getSubimage(d.srcX, d.srcY, d.srcW, d.srcH), + cellX, destY, destW, destH, null); + } + + g.dispose(); + return page; + } + + private Path resolveTexturePath(String fileRef, Path javaAssetsDir) { + Path resolved = javaAssetsDir.resolve(namespaceOf(fileRef) + "/textures/" + pathOf(fileRef)); + return resolved.toFile().exists() ? resolved : null; + } + + // Where the same texture lands inside the Bedrock pack, as an extension-less pack-root + // relative reference. The Java namespace is kept as a directory so that two namespaces + // shipping the same path cannot collide: + // minecraft:font/gui/custom/item_browser.png + // -> textures/minecraft/font/gui/custom/item_browser + private static String bedrockTexturePath(String fileRef) { + String path = pathOf(fileRef); + if (path.endsWith(".png")) { + path = path.substring(0, path.length() - 4); + } + return "textures/" + namespaceOf(fileRef) + "/" + path; + } + + private static String namespaceOf(String fileRef) { + int colon = fileRef.indexOf(':'); + return colon >= 0 ? fileRef.substring(0, colon) : "minecraft"; + } + + private static String pathOf(String fileRef) { + int colon = fileRef.indexOf(':'); + return colon >= 0 ? fileRef.substring(colon + 1) : fileRef; + } + + public boolean isEmpty() { + return pendingDraws.isEmpty() && uiImages.isEmpty(); + } + + public int size() { + return pendingDraws.size() + uiImages.size(); + } + + public void save(Path packDir, Path texturesDir) { + if (isEmpty()) return; + saveGlyphPages(packDir.resolve("font")); + new JsonUiImageWriter().write(this.uiImages.values(), packDir, texturesDir); + this.srcImageCache.clear(); + } + + private void saveGlyphPages(Path fontDir) { + if (pendingDraws.isEmpty()) return; + try { + Files.createDirectories(fontDir); + } catch (IOException e) { + Logger.error("Failed to create font output directory", e); + return; + } + + // Build, write and release one page at a time — a 256px-cell page is a 67 MiB + // BufferedImage, so holding every page at once would be an OOM risk on a server heap. + int saved = 0; + for (Map.Entry> entry : pendingDraws.entrySet()) { + Path out = fontDir.resolve(entry.getKey() + ".png"); + try { + ImageIO.write(buildGlyphPage(entry.getValue()), "PNG", out.toFile()); + saved++; + } catch (IOException e) { + Logger.error("Failed to write " + entry.getKey() + ".png", e); + } + } + Logger.info("Saved " + saved + " glyph page(s) to font/"); + } +} diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/font/JsonUiImageWriter.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/font/JsonUiImageWriter.java new file mode 100644 index 00000000..758eff9d --- /dev/null +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/font/JsonUiImageWriter.java @@ -0,0 +1,327 @@ +package fr.robie.craftengineconverter.converter.bedrock.font; + +import com.google.gson.JsonArray; +import com.google.gson.JsonObject; +import fr.robie.craftengineconverter.api.manager.FileCacheManager; +import fr.robie.messageflow.logger.Logger; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.StandardCopyOption; +import java.util.Collection; +import java.util.LinkedHashSet; +import java.util.Set; + +/** + * Emits the JSON-UI needed to display a Java font image at its true pixel size on Bedrock chest + * containers. + *

+ * Bedrock cannot render a font glyph larger than one character box, so tall glyphs (GUI overlays) + * cannot go through {@code font/glyph_XX.png} at all. JSON-UI is the only mechanism that can draw an + * arbitrary image at an arbitrary size — but it has no font or glyph hook whatsoever. The only + * string tooling available is the arithmetic operator set, so "does this text contain my marker?" has + * to be spelled as delete-the-substring-and-see-if-it-changed: + *

(not ($atext - '一' = $atext))
+ * The marker character itself is never replaced inline — it still occupies its place in the container + * title and simply renders as nothing. + *

+ * The title text comes from {@code $container_title}, which is a {@code $} variable, not a + * {@code #} binding. The engine injects it at screen level and it propagates down the tree by + * template substitution, which makes it invisible to the {@code #}-binding data model. Visibility is + * therefore a plain {@code visible} property holding the expression directly — there is no + * {@code bindings} array and no {@code "visible": false} default, because a property expression always + * evaluates. Routing {@code $container_title} through a {@code binding_type: "view"} entry instead is + * the one thing that silently never resolves, and is what makes container screens look impossible. + * {@code $container_title} is also aliased through {@code $atext} first, and the marker is + * single-quoted inside the expression; both are required. + *

+ * Structure follows {@code concepts/chest_screen_clean.json}, a known-working pack. Rather than + * patching vanilla with {@code modifications}, the four controls that need to change are redefined + * outright in the {@code chest} namespace. Bedrock merges pack UI files with vanilla per top-level key, + * so redefining {@code small_chest_panel} / {@code large_chest_panel} replaces just those two controls + * and every other vanilla control in the file survives untouched. Image controls are written inline + * into {@code root_panel.controls} — no wrapper panel, no template, no separate namespace file, and + * hence no {@code _ui_defs.json} entry. + *

+ * The two screen controls are redefined as well, to gate the layout on a marker: pocket devices + * normally render {@code pocket_containers.*}, which carries none of these images. With the gate, a + * pocket player opening a marked container gets the desktop layout (and the image); an unmarked + * container is left on the stock pocket layout. + *

+ * Only {@code ui/chest_screen.json} is produced. Server forms and the HUD title were previously also + * targeted; both were removed, as the HUD factory insert failed to resolve at runtime + * ({@code Type not specified (or @-base not found)}) and neither surface is where CraftEngine renders + * its GUIs. + *

+ * Placement is approximate. Java positions these overlays with {@code ascent} plus a run of + * negative-space offset characters for horizontal nudging. Those offset characters have no Bedrock + * equivalent and are dropped, so horizontal placement information is simply gone; the vertical + * {@code offset} of {@code -ascent} with the default centre anchoring is a deterministic default, not a + * faithful reproduction. Note also that JSON-UI is unversioned and deprecated in favour of Ore UI, so + * generated UI can break on any Bedrock update. + */ +final class JsonUiImageWriter { + // Above chest_panel (layer 5) so the overlay covers the slot grid; CraftEngine artwork is + // transparent where the slots are. Matches the reference pack. + private static final int IMAGE_LAYER = 11; + + // Where the container title sits, measured from the top of the chest window. Bedrock does not put + // it where Java does — Java's AbstractContainerScreen uses titleLabelY = 6, whereas vanilla + // chest_screen.json stacks chest_label's offset (-1) onto its parent panel's (12 small / 11 large). + // Anchoring to Java's value renders every overlay 4-5px too high, so these follow Bedrock. + // Raise both to push every image further down. + private static final int TITLE_TOP_Y_SMALL = 12 - 1; + private static final int TITLE_TOP_Y_LARGE = 11 - 1; + // Bedrock's default UI font is 8px tall with a 7px ascent, so its baseline is 7 below the label top. + private static final int FONT_ASCENT = 7; + + /** + * One tall glyph destined for JSON-UI rather than a glyph page. + * + * @param codePoint the character that triggers the image + * @param sourcePng the Java source PNG to copy into the pack + * @param texturePath the Bedrock texture reference, without the {@code .png} extension + * @param srcX cell rect within {@code sourcePng} — only emitted as {@code uv} when the + * @param srcY cell is a sub-rect of a larger multi-character sheet + * @param height the provider's Java {@code height}, in logical font pixels + * @param ascent the provider's Java {@code ascent}, in logical font pixels + */ + record UiImage(int codePoint, Path sourcePng, String texturePath, + int srcX, int srcY, int srcW, int srcH, + int fullW, int fullH, int height, int ascent) { + + boolean isWholeImage() { + return this.srcX == 0 && this.srcY == 0 + && this.srcW == this.fullW && this.srcH == this.fullH; + } + + String controlName() { + return String.format("craftengine_image_%04X", this.codePoint); + } + + /** The marker character this glyph reacts to. */ + String marker() { + return new String(Character.toChars(this.codePoint)); + } + } + + void write(Collection images, Path packDir, Path texturesDir) { + if (images.isEmpty()) return; + + Path uiDir = packDir.resolve("ui"); + try { + Files.createDirectories(uiDir); + } catch (IOException e) { + Logger.error("Failed to create ui output directory", e); + return; + } + + int copied = copyTextures(images, texturesDir); + FileCacheManager.saveJsonToFile(uiDir.resolve("chest_screen.json"), buildChestScreen(images)); + + Logger.info("Saved " + images.size() + " JSON-UI image(s) to ui/chest_screen.json (" + + copied + " texture(s) copied)"); + } + + // Several glyphs can share one sheet, so copy each distinct source only once. + private int copyTextures(Collection images, Path texturesDir) { + Set done = new LinkedHashSet<>(); + int copied = 0; + for (UiImage image : images) { + if (!done.add(image.sourcePng().toAbsolutePath())) continue; + // texturePath is pack-root relative and extension-less, e.g. + // "textures/minecraft/font/gui/custom/item_browser" + String relative = image.texturePath().substring("textures/".length()) + ".png"; + Path dest = texturesDir.resolve(relative); + try { + Files.createDirectories(dest.getParent()); + Files.copy(image.sourcePng(), dest, StandardCopyOption.REPLACE_EXISTING); + copied++; + } catch (IOException e) { + Logger.error("Failed to copy font image " + image.sourcePng(), e); + } + } + return copied; + } + + private JsonObject buildChestScreen(Collection images) { + JsonObject root = new JsonObject(); + root.addProperty("namespace", "chest"); + + root.add("small_chest_panel", buildChestPanel(images, false)); + root.add("large_chest_panel", buildChestPanel(images, true)); + + // A $ variable holding the whole boolean, referenced from each variables entry's "requires" — + // the same shape the reference pack uses for its own marker test. + String markerTest = buildMarkerTest(images); + root.add("small_chest_screen@common.inventory_screen_common", + buildScreen(markerTest, "chest.small_chest_panel", "pocket_containers.small_chest_panel")); + root.add("large_chest_screen@common.inventory_screen_common", + buildScreen(markerTest, "chest.large_chest_panel", "pocket_containers.large_chest_panel")); + return root; + } + + /** + * Vanilla's chest panel, rebuilt verbatim, with the image controls appended to + * {@code root_panel.controls}. Only the two entries that differ between the small and large + * variants are branched on; everything else is identical in both. + */ + private JsonObject buildChestPanel(Collection images, boolean large) { + String prefix = large ? "large" : "small"; + + JsonArray chestControls = new JsonArray(); + chestControls.add(ref(prefix + "_chest_panel_top_half@chest." + prefix + "_chest_panel_top_half")); + chestControls.add(ref("inventory_panel_bottom_half_with_label@common.inventory_panel_bottom_half_with_label")); + chestControls.add(ref("hotbar_grid@common.hotbar_grid_template")); + chestControls.add(ref("inventory_take_progress_icon_button@common.inventory_take_progress_icon_button")); + JsonObject flying = new JsonObject(); + flying.addProperty("layer", 15); + chestControls.add(named("flying_item_renderer@common.flying_item_renderer", flying)); + + JsonObject chestPanel = new JsonObject(); + chestPanel.addProperty("type", "panel"); + chestPanel.addProperty("layer", 5); + chestPanel.add("controls", chestControls); + + JsonArray rootControls = new JsonArray(); + rootControls.add(ref("common_panel@common.common_panel")); + rootControls.add(named("chest_panel", chestPanel)); + rootControls.add(ref("inventory_selected_icon_button@common.inventory_selected_icon_button")); + rootControls.add(ref("gamepad_cursor@common.gamepad_cursor_button")); + // The overlays go last so they render above their siblings at equal layer. + int titleTopY = large ? TITLE_TOP_Y_LARGE : TITLE_TOP_Y_SMALL; + for (UiImage image : images) { + rootControls.add(named(image.controlName(), buildImageControl(image, titleTopY))); + } + + JsonObject rootPanel = new JsonObject(); + if (large) rootPanel.add("size", vector(176, 220)); + rootPanel.addProperty("layer", 1); + rootPanel.add("controls", rootControls); + + JsonArray outer = new JsonArray(); + outer.add(ref("container_gamepad_helpers@common.container_gamepad_helpers")); + if (large) { + JsonObject details = new JsonObject(); + details.addProperty("control_name", "@chest.selected_item_details"); + outer.add(named("selected_item_details_factory@common.selected_item_details_factory", details)); + JsonObject lock = new JsonObject(); + lock.addProperty("control_name", "@common.item_lock_notification"); + outer.add(named("item_lock_notification_factory@common.item_lock_notification_factory", lock)); + } else { + outer.add(ref("selected_item_details_factory@common.selected_item_details_factory")); + outer.add(ref("item_lock_notification_factory@common.item_lock_notification_factory")); + } + outer.add(named("root_panel@common.root_panel", rootPanel)); + + JsonObject panel = new JsonObject(); + panel.addProperty("type", "panel"); + panel.add("controls", outer); + return panel; + } + + /** + * One overlay, positioned to match where Java draws it. + *

+ * Java scales the source bitmap to {@code height} logical pixels tall and places its top edge + * {@code ascent} pixels above the container title's baseline. Measured from the top of the chest + * window, where {@code titleTopY} is Bedrock's own label position for this panel size: + *

image_top = titleTopY + FONT_ASCENT - ascent
+ * Anchoring {@code top_middle} to {@code top_middle} makes that the offset directly, and keeps the + * result independent of the parent's height — which matters because the small and large chest + * panels differ in both title position and window height. (The reference pack encodes an equivalent + * position centre-anchored: for its {@code ascent} 73 / 256px overlay, + * {@code -60 + 128 - 110 = -42}, its actual offset.) + *

+ * Horizontal placement is not recoverable — Java nudges these with negative-space offset + * characters that have no Bedrock equivalent and are dropped upstream — so the overlay is simply + * centred. + */ + private JsonObject buildImageControl(UiImage image, int titleTopY) { + // Java renders the bitmap at `height` logical pixels tall, whatever the source resolution. + int displayH = image.height(); + int displayW = Math.max(1, Math.round((float) image.srcW() * displayH / image.srcH())); + + JsonObject control = new JsonObject(); + control.addProperty("type", "image"); + control.addProperty("texture", image.texturePath()); + control.addProperty("layer", IMAGE_LAYER); + control.add("size", vector(displayW, displayH)); + control.addProperty("anchor_from", "top_middle"); + control.addProperty("anchor_to", "top_middle"); + control.add("offset", vector(0, titleTopY + FONT_ASCENT - image.ascent())); + control.addProperty("$atext", "$container_title"); + control.addProperty("visible", "(not ($atext - '" + image.marker() + "' = $atext))"); + + // Only a glyph taken from a multi-character sheet needs the texture cropped. + if (!image.isWholeImage()) { + control.add("uv", vector(image.srcX(), image.srcY())); + control.add("uv_size", vector(image.srcW(), image.srcH())); + control.addProperty("keep_ratio", false); + } + return control; + } + + /** + * Vanilla's screen control with its {@code variables} gate widened: the desktop layout is selected + * whenever the container title carries one of our markers, and the pocket layout only when it does + * not. Without this a pocket player would get {@code pocket_containers.*}, which has no overlay. + */ + private JsonObject buildScreen(String markerTest, String screenContent, String pocketContent) { + JsonObject desktop = new JsonObject(); + desktop.addProperty("requires", "($desktop_screen or $craftengine_marker)"); + desktop.addProperty("$screen_content", screenContent); + desktop.addProperty("$screen_bg_content", "common.screen_background"); + desktop.addProperty("$screen_background_alpha", 0.4); + + JsonObject pocket = new JsonObject(); + pocket.addProperty("requires", "($pocket_screen and (not $craftengine_marker))"); + pocket.addProperty("$use_custom_pocket_toast", true); + pocket.addProperty("$screen_content", pocketContent); + + JsonArray variables = new JsonArray(); + variables.add(desktop); + variables.add(pocket); + + JsonObject screen = new JsonObject(); + screen.addProperty("$craftengine_marker", markerTest); + screen.addProperty("$close_on_player_hurt|default", true); + screen.addProperty("$use_custom_pocket_toast|default", false); + screen.addProperty("close_on_player_hurt", "$close_on_player_hurt"); + screen.addProperty("use_custom_pocket_toast", "$use_custom_pocket_toast"); + screen.add("variables", variables); + return screen; + } + + // "contains" is a real JSON-UI operator; the reference pack gates its own layout the same way. + private static String buildMarkerTest(Collection images) { + StringBuilder test = new StringBuilder("("); + boolean first = true; + for (UiImage image : images) { + if (!first) test.append(" or "); + test.append("($container_title contains '").append(image.marker()).append("')"); + first = false; + } + return test.append(")").toString(); + } + + /** A controls-array entry that only references a template, with no overrides. */ + private static JsonObject ref(String controlName) { + return named(controlName, new JsonObject()); + } + + /** A controls-array entry wrapping one named control. */ + private static JsonObject named(String controlName, JsonObject body) { + JsonObject entry = new JsonObject(); + entry.add(controlName, body); + return entry; + } + + private static JsonArray vector(int x, int y) { + JsonArray vec = new JsonArray(); + vec.add(x); + vec.add(y); + return vec; + } +} diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/waypoint/WaypointStyleMapper.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/waypoint/WaypointStyleMapper.java new file mode 100644 index 00000000..1532cc45 --- /dev/null +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/waypoint/WaypointStyleMapper.java @@ -0,0 +1,156 @@ +package fr.robie.craftengineconverter.converter.bedrock.waypoint; + +import com.google.gson.JsonArray; +import com.google.gson.JsonObject; +import fr.robie.craftengineconverter.api.manager.FileCacheManager; +import fr.robie.craftengineconverter.api.utils.FileUtils; +import fr.robie.messageflow.logger.Logger; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.StandardCopyOption; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Comparator; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * Converts Java Edition {@code assets//waypoint_style/*.json} files into a Geyser + * {@code custom_mappings/waypoint_mappings.json} file, and copies the referenced sprite textures + * into the Bedrock resource pack. + * + *

Java waypoint style identifiers become {@code namespace:filename} keys in the Geyser output. + * Sprite identifiers are passed through unchanged — Geyser itself flattens them to + * {@code textures/ui//locator_bar_dot/} inside the pack. + * This mapper copies those PNG files from the Java asset tree to that Bedrock location. + * + *

Fields {@code near_distance} and {@code far_distance} are only written when non-default + * (128 and 332 respectively). + */ +public final class WaypointStyleMapper { + + private static final int DEFAULT_NEAR = 128; + private static final int DEFAULT_FAR = 332; + + private record WaypointEntry(String id, int nearDistance, int farDistance, List sprites) {} + + private final Map entries = new LinkedHashMap<>(); + + /** + * Scans all {@code *.json} files in {@code dir} and accumulates waypoint style entries for + * {@code namespace}. Later calls with the same {@code namespace:name} key overwrite earlier + * ones (last-write-wins, consistent with other mappers). + */ + public void addFromWaypointStyleDirectory(File dir, String namespace) { + File[] files = dir.listFiles(); + if (files == null) return; + + Arrays.sort(files, Comparator.comparing(File::getName)); + + for (File file : files) { + if (!file.isFile() || !FileUtils.isJsonFile(file)) continue; + FileCacheManager.getJsonCache().getData(file.toPath()).ifPresent(root -> { + if (!root.has("sprites")) return; + JsonArray spritesArr = root.getAsJsonArray("sprites"); + if (spritesArr.isEmpty()) return; + + List sprites = new ArrayList<>(); + for (var elem : spritesArr) { + if (elem.isJsonPrimitive()) sprites.add(elem.getAsString()); + } + if (sprites.isEmpty()) return; + + int near = root.has("near_distance") ? root.get("near_distance").getAsInt() : DEFAULT_NEAR; + int far = root.has("far_distance") ? root.get("far_distance").getAsInt() : DEFAULT_FAR; + + String name = FileUtils.getFileNameWithoutExtension(file); + String id = namespace + ":" + name; + entries.put(id, new WaypointEntry(id, near, far, sprites)); + }); + } + } + + public boolean isEmpty() { return entries.isEmpty(); } + public int size() { return entries.size(); } + + /** + * Writes {@code waypoint_mappings.json} to {@code customMappingsDir} and copies each + * referenced sprite texture from the Java asset tree into the Bedrock pack. + * + * @param customMappingsDir Geyser custom_mappings output directory + * @param texturesDir Bedrock pack textures root ({@code /textures/}) + * @param javaAssetsDir Java asset root ({@code assets/}) from which sprite PNGs are read + */ + public void save(Path customMappingsDir, Path texturesDir, Path javaAssetsDir) { + try { + Files.createDirectories(customMappingsDir); + FileCacheManager.saveJsonToFile( + customMappingsDir.resolve("waypoint_mappings.json"), serialize()); + } catch (IOException e) { + Logger.error("Failed to create custom_mappings directory for waypoint styles", e); + return; + } + + // Deduplicate: many styles may share the same sprite. + Set seen = new LinkedHashSet<>(); + for (WaypointEntry entry : entries.values()) { + seen.addAll(entry.sprites()); + } + for (String sprite : seen) { + copySprite(sprite, texturesDir, javaAssetsDir); + } + } + + private JsonObject serialize() { + JsonObject stylesObj = new JsonObject(); + for (WaypointEntry entry : entries.values()) { + JsonObject style = new JsonObject(); + if (entry.nearDistance() != DEFAULT_NEAR) style.addProperty("near_distance", entry.nearDistance()); + if (entry.farDistance() != DEFAULT_FAR) style.addProperty("far_distance", entry.farDistance()); + JsonArray spritesArr = new JsonArray(); + entry.sprites().forEach(spritesArr::add); + style.add("sprites", spritesArr); + stylesObj.add(entry.id(), style); + } + JsonObject root = new JsonObject(); + root.addProperty("format_version", 1); + root.add("waypoint_styles", stylesObj); + return root; + } + + // Java: assets//textures/gui/sprites/hud/locator_bar_dot/.png + // Bedrock: /ui//locator_bar_dot/.png + private static void copySprite(String sprite, Path texturesDir, Path javaAssetsDir) { + int colon = sprite.indexOf(':'); + if (colon < 0) { + Logger.warn("Waypoint sprite '" + sprite + "' has no namespace — skipping"); + return; + } + String spriteNs = sprite.substring(0, colon); + String spritePath = sprite.substring(colon + 1); + + Path src = javaAssetsDir.resolve(spriteNs) + .resolve("textures/gui/sprites/hud/locator_bar_dot") + .resolve(spritePath + ".png"); + if (!Files.exists(src)) { + Logger.warn("Waypoint sprite texture not found: " + src); + return; + } + + Path dst = texturesDir.resolve("ui").resolve(spriteNs) + .resolve("locator_bar_dot") + .resolve(spritePath + ".png"); + try { + Files.createDirectories(dst.getParent()); + Files.copy(src, dst, StandardCopyOption.REPLACE_EXISTING); + } catch (IOException e) { + Logger.error("Failed to copy waypoint sprite texture " + src, e); + } + } +} From 33a0f499135fe197311fd74c223608faf33ef925 Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Wed, 5 Aug 2026 10:46:48 +0200 Subject: [PATCH 037/116] chore: update .gitignore and documentation to reflect Gradle migration and remove BOM references --- .gitignore | 9 + API/build.gradle.kts | 19 + API/pom.xml | 61 ---- CONTRIBUTING.md | 11 +- Common/build.gradle.kts | 18 + Common/pom.xml | 69 ---- Hooks/BOM/pom.xml | 44 --- Hooks/ItemsAdder/build.gradle.kts | 7 + Hooks/ItemsAdder/pom.xml | 24 -- Hooks/Nexo/build.gradle.kts | 9 + Hooks/Nexo/pom.xml | 20 -- Hooks/PacketEvent/build.gradle.kts | 7 + Hooks/PacketEvent/pom.xml | 20 -- Hooks/PlaceholderAPI/build.gradle.kts | 7 + Hooks/PlaceholderAPI/pom.xml | 20 -- Hooks/build.gradle.kts | 0 Hooks/pom.xml | 39 -- Plugin/build.gradle.kts | 142 ++++++++ Plugin/pom.xml | 141 -------- README.md | 1 - build-logic/build.gradle.kts | 7 + build-logic/settings.gradle.kts | 10 + build-logic/src/main/kotlin/catalog.kt | 24 ++ ...ngineconverter.hook-conventions.gradle.kts | 11 + ...ngineconverter.java-conventions.gradle.kts | 128 +++++++ build.gradle.kts | 17 + gradle.properties | 44 +++ gradle/gradle-daemon-jvm.properties | 12 + gradle/libs.versions.toml | 73 ++++ gradle/wrapper/gradle-wrapper.jar | Bin 0 -> 48462 bytes gradle/wrapper/gradle-wrapper.properties | 8 + gradlew | 248 +++++++++++++ gradlew.bat | 82 +++++ pom.xml | 339 ------------------ settings.gradle.kts | 49 +++ 35 files changed, 937 insertions(+), 783 deletions(-) create mode 100644 API/build.gradle.kts delete mode 100644 API/pom.xml create mode 100644 Common/build.gradle.kts delete mode 100644 Common/pom.xml delete mode 100644 Hooks/BOM/pom.xml create mode 100644 Hooks/ItemsAdder/build.gradle.kts delete mode 100644 Hooks/ItemsAdder/pom.xml create mode 100644 Hooks/Nexo/build.gradle.kts delete mode 100644 Hooks/Nexo/pom.xml create mode 100644 Hooks/PacketEvent/build.gradle.kts delete mode 100644 Hooks/PacketEvent/pom.xml create mode 100644 Hooks/PlaceholderAPI/build.gradle.kts delete mode 100644 Hooks/PlaceholderAPI/pom.xml create mode 100644 Hooks/build.gradle.kts delete mode 100644 Hooks/pom.xml create mode 100644 Plugin/build.gradle.kts delete mode 100644 Plugin/pom.xml create mode 100644 build-logic/build.gradle.kts create mode 100644 build-logic/settings.gradle.kts create mode 100644 build-logic/src/main/kotlin/catalog.kt create mode 100644 build-logic/src/main/kotlin/craftengineconverter.hook-conventions.gradle.kts create mode 100644 build-logic/src/main/kotlin/craftengineconverter.java-conventions.gradle.kts create mode 100644 build.gradle.kts create mode 100644 gradle.properties create mode 100644 gradle/gradle-daemon-jvm.properties create mode 100644 gradle/libs.versions.toml create mode 100644 gradle/wrapper/gradle-wrapper.jar create mode 100644 gradle/wrapper/gradle-wrapper.properties create mode 100644 gradlew create mode 100644 gradlew.bat delete mode 100644 pom.xml create mode 100644 settings.gradle.kts diff --git a/.gitignore b/.gitignore index 033d192c..86716932 100644 --- a/.gitignore +++ b/.gitignore @@ -97,6 +97,15 @@ $RECYCLE.BIN/ target/ +# Gradle +.gradle/ +build/ +!gradle/wrapper/gradle-wrapper.properties +# `*.jar` above would otherwise swallow the wrapper jar, which MUST be committed so that +# `./gradlew` works on a fresh clone. +!gradle/wrapper/gradle-wrapper.jar + +# Maven leftovers (the build migrated to Gradle; the pom.xml files are gone) pom.xml.tag pom.xml.releaseBackup pom.xml.versionsBackup diff --git a/API/build.gradle.kts b/API/build.gradle.kts new file mode 100644 index 00000000..985d7e48 --- /dev/null +++ b/API/build.gradle.kts @@ -0,0 +1,19 @@ +plugins { + id("craftengineconverter.java-conventions") +} + +base { + archivesName = "CraftEngineConverter-API" +} + +dependencies { + api(libs.folialib) + + compileOnly(libs.paper.api) + compileOnly(libs.craftengine.core) + compileOnly(libs.craftengine.bukkit) + compileOnly(libs.sarah) + compileOnly(libs.reflections) + compileOnly(libs.message.flow) + compileOnly(libs.yamllibrary) +} diff --git a/API/pom.xml b/API/pom.xml deleted file mode 100644 index b06e79d5..00000000 --- a/API/pom.xml +++ /dev/null @@ -1,61 +0,0 @@ - - - 4.0.0 - - fr.robie.craftengineconverter - CraftEngineConverter - 0.0.2 - - - API - - - CraftEngineConverter-API-${project.version} - - - - - io.papermc.paper - paper-api - - - - net.momirealms - craft-engine-core - - - net.momirealms - craft-engine-bukkit - - - - fr.maxlego08.sarah - sarah - provided - - - - com.tcoded - FoliaLib - - - - org.reflections - reflections - 0.10.2 - - - - com.github.1robie.MessageFlow - message-flow - provided - - - - fr.robie - yamllibrary - - - \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0b9a9806..eb898e2d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -107,7 +107,6 @@ CraftEngineConverter/ │ ├── packet/ # Packet handling │ └── tag/ # Tag processing system ├── Hooks/ # Plugin hook implementations -│ ├── BOM/ # Bill of Materials │ ├── PacketEvent/ # Packet event integration │ └── PlaceholderAPI/ # PlaceholderAPI integration └── Plugin/ # Main plugin implementation @@ -325,10 +324,12 @@ void testConvertItemWithValidInput() { ### Adding a New Hook 1. Create module in `Hooks/` directory -2. Add dependency in `pom.xml` -3. Implement hook interface -4. Add to BOM required to load the hook into `Plugin` module -5. Test integration +2. Add an `include(":Hooks:")` entry in `settings.gradle.kts` +3. Apply `craftengineconverter.hook-conventions` in the module's `build.gradle.kts` +4. Implement hook interface + +The hook is picked up by `:Plugin` automatically - it no longer needs to be listed anywhere, the +old `Hooks/BOM` aggregator is gone. ## Reporting Bugs diff --git a/Common/build.gradle.kts b/Common/build.gradle.kts new file mode 100644 index 00000000..77f6bdad --- /dev/null +++ b/Common/build.gradle.kts @@ -0,0 +1,18 @@ +plugins { + id("craftengineconverter.java-conventions") +} + +dependencies { + api(project(":API")) + api(libs.sarah) + + compileOnly(libs.paper.api) + compileOnly(libs.craftengine.core) + compileOnly(libs.craftengine.bukkit) + compileOnly(libs.message.flow) + compileOnly(libs.yamllibrary) + + testImplementation(platform(libs.junit.bom)) + testImplementation(libs.junit.jupiter) + testRuntimeOnly(libs.junit.platform.launcher) +} diff --git a/Common/pom.xml b/Common/pom.xml deleted file mode 100644 index 223939da..00000000 --- a/Common/pom.xml +++ /dev/null @@ -1,69 +0,0 @@ - - - 4.0.0 - - fr.robie.craftengineconverter - CraftEngineConverter - 0.0.2 - - - Common - - - - org.junit.jupiter - junit-jupiter - - - io.papermc.paper - paper-api - - - fr.robie.craftengineconverter - API - - - - net.momirealms - craft-engine-core - - - net.momirealms - craft-engine-bukkit - - - - fr.maxlego08.sarah - sarah - compile - - - - com.github.1robie.MessageFlow - message-flow - provided - - - - fr.robie - yamllibrary - - - - - - - org.apache.maven.plugins - maven-surefire-plugin - - - **/*Test.java - - - - - - - \ No newline at end of file diff --git a/Hooks/BOM/pom.xml b/Hooks/BOM/pom.xml deleted file mode 100644 index 66262c3a..00000000 --- a/Hooks/BOM/pom.xml +++ /dev/null @@ -1,44 +0,0 @@ - - - 4.0.0 - - fr.robie.craftengineconverter - Hooks - 0.0.2 - - - BOM - - - - fr.robie.craftengineconverter - PacketEvent - ${project.version} - compile - - - - fr.robie.craftengineconverter - PlaceholderAPI - ${project.version} - compile - - - - fr.robie.craftengineconverter - Nexo - ${project.version} - compile - - - - fr.robie.craftengineconverter - ItemsAdder - ${project.version} - compile - - - - \ No newline at end of file diff --git a/Hooks/ItemsAdder/build.gradle.kts b/Hooks/ItemsAdder/build.gradle.kts new file mode 100644 index 00000000..69fdd053 --- /dev/null +++ b/Hooks/ItemsAdder/build.gradle.kts @@ -0,0 +1,7 @@ +plugins { + id("craftengineconverter.hook-conventions") +} + +dependencies { + compileOnly(libs.itemsadder) +} diff --git a/Hooks/ItemsAdder/pom.xml b/Hooks/ItemsAdder/pom.xml deleted file mode 100644 index 79730773..00000000 --- a/Hooks/ItemsAdder/pom.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - 4.0.0 - - fr.robie.craftengineconverter - Hooks - 0.0.2 - - - ItemsAdder - - - - dev.lone - api-itemsadder - - - net.kyori - adventure-api - - - \ No newline at end of file diff --git a/Hooks/Nexo/build.gradle.kts b/Hooks/Nexo/build.gradle.kts new file mode 100644 index 00000000..da7ccecc --- /dev/null +++ b/Hooks/Nexo/build.gradle.kts @@ -0,0 +1,9 @@ +plugins { + id("craftengineconverter.hook-conventions") +} + +dependencies { + compileOnly(libs.nexo) { + exclude(group = "dev.triumphteam", module = "triumph-gui") + } +} diff --git a/Hooks/Nexo/pom.xml b/Hooks/Nexo/pom.xml deleted file mode 100644 index 714cafbc..00000000 --- a/Hooks/Nexo/pom.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - 4.0.0 - - fr.robie.craftengineconverter - Hooks - 0.0.2 - - - Nexo - - - - com.nexomc - nexo - - - \ No newline at end of file diff --git a/Hooks/PacketEvent/build.gradle.kts b/Hooks/PacketEvent/build.gradle.kts new file mode 100644 index 00000000..92eeb8ed --- /dev/null +++ b/Hooks/PacketEvent/build.gradle.kts @@ -0,0 +1,7 @@ +plugins { + id("craftengineconverter.hook-conventions") +} + +dependencies { + compileOnly(libs.packetevents.spigot) +} diff --git a/Hooks/PacketEvent/pom.xml b/Hooks/PacketEvent/pom.xml deleted file mode 100644 index 4a3f433f..00000000 --- a/Hooks/PacketEvent/pom.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - 4.0.0 - - fr.robie.craftengineconverter - Hooks - 0.0.2 - - - PacketEvent - - - - com.github.retrooper - packetevents-spigot - - - \ No newline at end of file diff --git a/Hooks/PlaceholderAPI/build.gradle.kts b/Hooks/PlaceholderAPI/build.gradle.kts new file mode 100644 index 00000000..e8609853 --- /dev/null +++ b/Hooks/PlaceholderAPI/build.gradle.kts @@ -0,0 +1,7 @@ +plugins { + id("craftengineconverter.hook-conventions") +} + +dependencies { + compileOnly(libs.placeholderapi) +} diff --git a/Hooks/PlaceholderAPI/pom.xml b/Hooks/PlaceholderAPI/pom.xml deleted file mode 100644 index b68be7de..00000000 --- a/Hooks/PlaceholderAPI/pom.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - 4.0.0 - - fr.robie.craftengineconverter - Hooks - 0.0.2 - - - PlaceholderAPI - - - - me.clip - placeholderapi - - - \ No newline at end of file diff --git a/Hooks/build.gradle.kts b/Hooks/build.gradle.kts new file mode 100644 index 00000000..e69de29b diff --git a/Hooks/pom.xml b/Hooks/pom.xml deleted file mode 100644 index aad70f03..00000000 --- a/Hooks/pom.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - 4.0.0 - - fr.robie.craftengineconverter - CraftEngineConverter - 0.0.2 - - - Hooks - pom - - - BOM - PacketEvent - PlaceholderAPI - Nexo - ItemsAdder - - - - - io.papermc.paper - paper-api - - - fr.robie.craftengineconverter - Common - - - - com.github.1robie.MessageFlow - message-flow - provided - - - \ No newline at end of file diff --git a/Plugin/build.gradle.kts b/Plugin/build.gradle.kts new file mode 100644 index 00000000..8d4c7526 --- /dev/null +++ b/Plugin/build.gradle.kts @@ -0,0 +1,142 @@ +import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar +import io.papermc.paperweight.userdev.ReobfArtifactConfiguration +import org.gradle.jvm.toolchain.JavaLanguageVersion +import org.gradle.jvm.toolchain.JvmVendorSpec +import xyz.jpenilla.runpaper.task.RunServer + +plugins { + id("craftengineconverter.java-conventions") + alias(libs.plugins.shadow) + alias(libs.plugins.paperweight.userdev) + alias(libs.plugins.run.paper) +} + +val pluginVersion: String = project.version.toString() + +paperweight { + injectPaperRepository = false + reobfArtifactConfiguration = ReobfArtifactConfiguration.MOJANG_PRODUCTION +} + +dependencies { + paperweight.paperDevBundle(libs.versions.paper.get()) + + rootProject.subprojects + .filter { it.path.startsWith(":Hooks:") } + .sortedBy { it.path } + .forEach { implementation(project(it.path)) } + + implementation(libs.message.flow) { isTransitive = false } + + implementation(libs.bstats.bukkit) + implementation(libs.bstats.base) + implementation(libs.yamllibrary) + implementation(libs.paper.dispatch) + + compileOnly(libs.craftengine.core) + compileOnly(libs.craftengine.bukkit) + compileOnly(libs.reflections) + compileOnly(libs.snakeyaml) + + testImplementation(platform(libs.junit.bom)) + testImplementation(libs.junit.jupiter) + testRuntimeOnly(libs.junit.platform.launcher) +} + +val resourceTokens: Map = mapOf( + "version" to project.version.toString(), + "project" to mapOf( + "version" to project.version.toString(), + "artifactId" to project.name, + "parent" to mapOf("artifactId" to rootProject.name), + ), + "plugin" to mapOf( + "finalVersion" to pluginVersion, + "author" to providers.gradleProperty("plugin.author").get(), + "description" to providers.gradleProperty("plugin.description").get(), + "apiVersion" to providers.gradleProperty("plugin.apiVersion").get(), + "mainClass" to providers.gradleProperty("plugin.mainClass").get(), + "bootstrapper" to providers.gradleProperty("plugin.bootstrapper").get(), + "loader" to providers.gradleProperty("plugin.loader").get(), + ), +) + +tasks.processResources { + val tokens = resourceTokens + + inputs.property("resourceTokens", tokens.toString()) + + filesMatching(listOf("paper-plugin.yml", "translations/**/messages.yml")) { + expand(tokens) + } +} + +tasks.named("shadowJar") { + archiveBaseName = "CraftEngineConverter" + archiveVersion = pluginVersion + archiveClassifier = "" + + dependencies { + include(dependency("fr.robie.craftengineconverter:.*")) + include(dependency("com.tcoded:FoliaLib")) + include(dependency("org.bstats:bstats-bukkit")) + include(dependency("org.bstats:bstats-base")) + include(dependency("fr.maxlego08.sarah:sarah")) + include(dependency("com.github.1robie.MessageFlow:message-flow")) + include(dependency("fr.robie:yamllibrary")) + include(dependency("com.github.1robie.paper-dispatch:paper-dispatch")) + } + + relocate("com.tcoded.folialib", "fr.robie.craftengineconverter.lib.folialib") + relocate("org.bstats", "fr.robie.craftengineconverter.lib.bstats") + relocate("fr.maxlego08.sarah", "fr.robie.craftengineconverter.lib.sarah") + relocate("fr.robie.messageflow", "fr.robie.craftengineconverter.lib.messageflow") + + duplicatesStrategy = DuplicatesStrategy.INCLUDE + mergeServiceFiles() + + exclude("META-INF/*.SF", "META-INF/*.DSA", "META-INF/*.RSA") + + exclude("org/slf4j/**") +} + +tasks.assemble { + dependsOn(tasks.named("shadowJar")) +} + + +val runServerJvmArgs: Provider> = providers.gradleProperty("runServer.jvmArgs") + .map { args -> args.split(' ').filter(String::isNotBlank) } + .orElse(emptyList()) + +val runServerJavaAgent: Provider = providers.gradleProperty("runServer.javaAgent") + +val runServerJavaAgentArgs: Provider = providers.gradleProperty("runServer.javaAgentArgs") + +val runServerJavaVersion: Provider = providers.gradleProperty("runServer.javaVersion") + .map(String::toInt) + .orElse(libs.versions.java.map(String::toInt)) + +val runServerJavaVendor: Provider = providers.gradleProperty("runServer.javaVendor") + +tasks.withType().configureEach { + // Lets the dev server run on a different JDK than the compilation toolchain - useful for + // pointing it at a JetBrains Runtime / DCEVM install for HotSwap. + javaLauncher = javaToolchains.launcherFor { + languageVersion = runServerJavaVersion.map(JavaLanguageVersion::of) + if (runServerJavaVendor.isPresent) { + vendor = JvmVendorSpec.matching(runServerJavaVendor.get()) + } + } + + jvmArgs(runServerJvmArgs.get()) + runServerJavaAgent.orNull?.let { agent -> + val agentArgs = runServerJavaAgentArgs.orNull?.takeIf(String::isNotBlank) + jvmArgs(if (agentArgs == null) "-javaagent:$agent" else "-javaagent:$agent=$agentArgs") + } + + // downloadPlugins { + // hangar("PlaceholderAPI", "2.11.6") + // modrinth("packetevents", "2.9.1") + // } +} diff --git a/Plugin/pom.xml b/Plugin/pom.xml deleted file mode 100644 index c057507c..00000000 --- a/Plugin/pom.xml +++ /dev/null @@ -1,141 +0,0 @@ - - - 4.0.0 - - fr.robie.craftengineconverter - CraftEngineConverter - 0.0.2 - - - Plugin - - - CraftEngineConverter-${plugin.finalVersion} - - - org.apache.maven.plugins - maven-shade-plugin - - - package - - shade - - - false - false - ${project.build.directory}/${project.build.finalName}.jar - - - fr.robie.craftengineconverter:* - com.tcoded:FoliaLib - org.bstats:bstats-bukkit - org.bstats:bstats-base - fr.maxlego08.sarah:sarah - com.github.1robie.MessageFlow:message-flow - fr.robie:yamllibrary - com.github.1robie.paper-dispatch:paper-dispatch - - - - - com.tcoded.folialib - fr.robie.craftengineconverter.lib.folialib - - - org.bstats - fr.robie.craftengineconverter.lib.bstats - - - fr.maxlego08.sarah - fr.robie.craftengineconverter.lib.sarah - - - fr.robie.messageflow - fr.robie.craftengineconverter.lib.messageflow - - - - - *:* - - META-INF/MANIFEST.MF - - - - - - - - - - - - - fr.robie.craftengineconverter - BOM - - - - com.github.1robie.MessageFlow - message-flow - - - - io.papermc.paper - paper-api - - - - net.momirealms - craft-engine-core - - - net.momirealms - craft-engine-bukkit - - - - org.bstats - bstats-bukkit - compile - - - - org.bstats - bstats-base - compile - - - - org.reflections - reflections - - - - fr.robie - yamllibrary - compile - - - - com.github.1robie.paper-dispatch - paper-dispatch - compile - - - - - org.junit.jupiter - junit-jupiter - - - - org.yaml - snakeyaml - - - - \ No newline at end of file diff --git a/README.md b/README.md index 591befc0..b9e84c59 100644 --- a/README.md +++ b/README.md @@ -325,7 +325,6 @@ CraftEngineConverter/ ├── API/ # Public API for other plugins ├── Common/ # Shared utilities and core logic ├── Hooks/ # Plugin integration modules -│ ├── BOM/ # Bill of Materials │ ├── Nexo/ # Nexo plugin integration │ ├── ItemsAdder/ # ItemsAdder plugin integration │ ├── PacketEvents/ # PacketEvents integration diff --git a/build-logic/build.gradle.kts b/build-logic/build.gradle.kts new file mode 100644 index 00000000..96833185 --- /dev/null +++ b/build-logic/build.gradle.kts @@ -0,0 +1,7 @@ +plugins { + `kotlin-dsl` +} + +kotlin { + jvmToolchain(21) +} diff --git a/build-logic/settings.gradle.kts b/build-logic/settings.gradle.kts new file mode 100644 index 00000000..116e2a02 --- /dev/null +++ b/build-logic/settings.gradle.kts @@ -0,0 +1,10 @@ +dependencyResolutionManagement { + repositoriesMode = RepositoriesMode.FAIL_ON_PROJECT_REPOS + + repositories { + gradlePluginPortal() + mavenCentral() + } +} + +rootProject.name = "build-logic" diff --git a/build-logic/src/main/kotlin/catalog.kt b/build-logic/src/main/kotlin/catalog.kt new file mode 100644 index 00000000..5e317d94 --- /dev/null +++ b/build-logic/src/main/kotlin/catalog.kt @@ -0,0 +1,24 @@ +import org.gradle.api.Project +import org.gradle.api.artifacts.MinimalExternalModuleDependency +import org.gradle.api.artifacts.VersionCatalog +import org.gradle.api.artifacts.VersionCatalogsExtension +import org.gradle.api.provider.Provider +import org.gradle.kotlin.dsl.getByType + +/** + * Type-safe `libs.*` accessors are not generated inside an included build, so convention plugins + * reach the consuming build's `gradle/libs.versions.toml` through the public + * [VersionCatalogsExtension] API instead. No reflection tricks, no `LibrariesForLibs` hack. + */ +internal val Project.libs: VersionCatalog + get() = extensions.getByType().named("libs") + +internal fun VersionCatalog.library(alias: String): Provider = + findLibrary(alias).orElseThrow { + IllegalStateException("No library '$alias' declared in gradle/libs.versions.toml") + } + +internal fun VersionCatalog.version(alias: String): String = + findVersion(alias).orElseThrow { + IllegalStateException("No version '$alias' declared in gradle/libs.versions.toml") + }.requiredVersion diff --git a/build-logic/src/main/kotlin/craftengineconverter.hook-conventions.gradle.kts b/build-logic/src/main/kotlin/craftengineconverter.hook-conventions.gradle.kts new file mode 100644 index 00000000..c2e5d3be --- /dev/null +++ b/build-logic/src/main/kotlin/craftengineconverter.hook-conventions.gradle.kts @@ -0,0 +1,11 @@ +plugins { + `java-library` + id("craftengineconverter.java-conventions") +} + +dependencies { + api(project(":Common")) + + compileOnly(libs.library("paper-api")) + compileOnly(libs.library("message-flow")) +} diff --git a/build-logic/src/main/kotlin/craftengineconverter.java-conventions.gradle.kts b/build-logic/src/main/kotlin/craftengineconverter.java-conventions.gradle.kts new file mode 100644 index 00000000..eac3412c --- /dev/null +++ b/build-logic/src/main/kotlin/craftengineconverter.java-conventions.gradle.kts @@ -0,0 +1,128 @@ +import org.gradle.api.tasks.testing.logging.TestExceptionFormat + +plugins { + `java-library` +} + +repositories { + mavenLocal { + content { includeModule("fr.robie", "yamllibrary") } + } + + mavenCentral() + + // Paper + maven("https://repo.papermc.io/repository/maven-public/") { + name = "papermc" + } + + // CraftEngine + maven("https://repo.momirealms.net/releases") { + name = "momirealmsReleases" + mavenContent { releasesOnly() } + content { includeGroup("net.momirealms") } + } + maven("https://repo.momirealms.net/snapshots") { + name = "momirealmsSnapshots" + mavenContent { snapshotsOnly() } + content { includeGroup("net.momirealms") } + } + + // PacketEvents + maven("https://repo.codemc.io/repository/maven-releases/") { + name = "codemcReleases" + mavenContent { releasesOnly() } + content { includeGroup("com.github.retrooper") } + } + + // PlaceholderAPI + maven("https://repo.extendedclip.com/releases/") { + name = "extendedclip" + mavenContent { releasesOnly() } + content { includeGroup("me.clip") } + } + + // Nexo + maven("https://repo.nexomc.com/releases") { + name = "nexo" + mavenContent { releasesOnly() } + content { + includeGroup("com.nexomc") + includeGroup("team.unnamed") + includeGroupByRegex("me\\.gabytm\\.util.*") + } + } + + // ItemsAdder + maven("https://maven.devs.beer/") { + name = "matteodev" + content { includeGroup("dev.lone") } + } + + // FoliaLib + maven("https://repo.tcoded.com/releases") { + name = "tcodedReleases" + mavenContent { releasesOnly() } + content { includeGroup("com.tcoded") } + } + + // Sarah (database library) + maven("https://repo.groupez.dev/releases") { + name = "groupez" + mavenContent { releasesOnly() } + content { includeGroupByRegex("fr\\.maxlego08.*") } + } + + // MessageFlow, paper-dispatch + maven("https://jitpack.io") { + name = "jitpack" + content { includeGroupByRegex("com\\.github\\.1robie.*") } + metadataSources { artifact() } + } + + maven("https://central.sonatype.com/repository/maven-snapshots/") { + name = "centralSnapshots" + mavenContent { snapshotsOnly() } + } +} + +java { + toolchain { + languageVersion = JavaLanguageVersion.of(libs.version("java").toInt()) + } +} + +configurations { + testImplementation { + extendsFrom(compileOnly.get()) + } +} + +tasks.withType().configureEach { + options.encoding = "UTF-8" + options.release = libs.version("java").toInt() +} + +tasks.withType().configureEach { + (options as StandardJavadocDocletOptions).encoding = "UTF-8" +} + +tasks.withType().configureEach { + filteringCharset = "UTF-8" +} + +tasks.withType().configureEach { + useJUnitPlatform() + testLogging { + events("failed") + exceptionFormat = TestExceptionFormat.FULL + showStackTraces = true + } +} + +tasks.withType().configureEach { + isPreserveFileTimestamps = false + isReproducibleFileOrder = true + dirPermissions { unix("rwxr-xr-x") } + filePermissions { unix("rw-r--r--") } +} diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 00000000..57379c63 --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,17 @@ +// +// Root build script. +// +// Deliberately almost empty: there is no `allprojects {}` / `subprojects {}` block here. +// Cross-project configuration is what makes Gradle builds slow and un-cacheable, so shared +// setup lives in the convention plugins under `build-logic/` and each module applies the one +// it needs. `group` and `version` come from gradle.properties and are inherited by every project +// automatically, which is what the Maven section used to do. +// + +plugins { + base +} + +// Maven's clean package. `clean` is not part of it because Gradle is +// incremental - run `./gradlew clean build` explicitly if you really want a from-scratch build. +defaultTasks("build") diff --git a/gradle.properties b/gradle.properties new file mode 100644 index 00000000..089bbc16 --- /dev/null +++ b/gradle.properties @@ -0,0 +1,44 @@ +group = fr.robie.craftengineconverter +version = 0.0.2 + + +plugin.author = 1robie +plugin.description = A plugin to convert configurations to CraftEngine format +plugin.apiVersion = 1.21 +plugin.mainClass = fr.robie.craftengineconverter.CraftEngineConverter +plugin.bootstrapper = fr.robie.craftengineconverter.CraftEngineConverterBootstrapper +plugin.loader = fr.robie.craftengineconverter.CraftEngineConverterLoader + +runServer.jvmArgs = -Xms2G -Xmx2G -Dfile.encoding=UTF-8 + +# --- HotSwap / DCEVM ------------------------------------------------------------------------------ +# Nothing here is bundled - see DEVELOPMENT.md for the three levels of HotSwap. +# +# Level 1 (method bodies) needs none of this: just Debug 'runServer' and press Ctrl+F9. +# +# Level 2 (add/remove methods and fields) needs a JVM with enhanced class redefinition. IntelliJ's +# bundled JetBrains Runtime is one. Point Gradle at it from your *own* user-level properties file - +# never commit a machine path here - by adding to ~/.gradle/gradle.properties (outside the repo): +# org.gradle.java.installations.paths = /jbr +# Then uncomment these three: +# runServer.javaVersion = 25 +# runServer.javaVendor = JetBrains +# runServer.jvmArgs = -Xms2G -Xmx2G -Dfile.encoding=UTF-8 -XX:+AllowEnhancedClassRedefinition +# +# Level 3 (HotswapAgent) is optional and rarely worth it for a Paper plugin. If you want it, add +# `-XX:HotswapAgent=external` to runServer.jvmArgs above and uncomment these two. `disablePlugin` +# is required: HotswapAgent's Log4j2 plugin cannot instrument Paper's log4j (Paper loads it in a +# separate URLClassLoader) and floods the console with CannotCompileException stack traces. +# runServer.javaAgent = C:/Users/you/.hotswap/hotswap-agent.jar +# runServer.javaAgentArgs = disablePlugin=Log4j2 + +#################################################################################################### +# Gradle +#################################################################################################### +org.gradle.jvmargs = -Xmx3G -XX:MaxMetaspaceSize=1G -Dfile.encoding=UTF-8 +org.gradle.parallel = true +org.gradle.caching = true + +# Verified on this project against `build` and `runServer`, including the paperweight-userdev +# setup pipeline. Turn it off with `--no-configuration-cache` if a plugin upgrade regresses it. +org.gradle.configuration-cache = true diff --git a/gradle/gradle-daemon-jvm.properties b/gradle/gradle-daemon-jvm.properties new file mode 100644 index 00000000..004a0fae --- /dev/null +++ b/gradle/gradle-daemon-jvm.properties @@ -0,0 +1,12 @@ +#This file is generated by updateDaemonJvm +toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/bc7c5a81f3d680de7b32b5671550e6fa/redirect +toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/06a33bd735fe2a3eaad523052759de91/redirect +toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/bc7c5a81f3d680de7b32b5671550e6fa/redirect +toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/06a33bd735fe2a3eaad523052759de91/redirect +toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/1963e5739fd691761c528d9c9417be8d/redirect +toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/0c90b78f3825f6e979da37db7c92ebaa/redirect +toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/bc7c5a81f3d680de7b32b5671550e6fa/redirect +toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/06a33bd735fe2a3eaad523052759de91/redirect +toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/476d3c08f4989328dee56d22e202d98d/redirect +toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/4170a8049ea45591acc1d566ebcb3193/redirect +toolchainVersion=21 diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml new file mode 100644 index 00000000..d0b249c8 --- /dev/null +++ b/gradle/libs.versions.toml @@ -0,0 +1,73 @@ +# +# Central version catalog. +# +# This replaces the / block of the old root pom.xml. +# Every version used by the build lives here and nowhere else. +# +[versions] +# Toolchain / language level (was maven.compiler.release) +java = "21" + +# Paper. `paper` is used both for `paper-api` (non-paperweight modules) and for the +# paperweight dev-bundle (the :Plugin module). Keep the two in sync. +paper = "1.21.11-R0.1-SNAPSHOT" +# Plain Minecraft version, used by the `runServer` development server. +minecraft = "1.21.11" + +craftengine = "26.5-SNAPSHOT" + +adventure = "4.26.1" +bstats = "3.2.1" +folialib = "0.5.1" +itemsadder = "4.0.10" +junit = "6.0.3" +messageflow = "main-SNAPSHOT" +nexo = "1.20.1" +packetevents = "2.11.2" +paperdispatch = "1.0.2" +placeholderapi = "2.12.2" +reflections = "0.10.2" +sarah = "1.23" +snakeyaml = "2.6" +yamllibrary = "1.0-SNAPSHOT" + +# Build plugins +paperweight = "2.0.0-beta.21" +runPaper = "3.0.2" +shadow = "9.6.1" + +[libraries] +# --- Paper ------------------------------------------------------------------- +paper-api = { module = "io.papermc.paper:paper-api", version.ref = "paper" } + +# --- CraftEngine ------------------------------------------------------------- +craftengine-core = { module = "net.momirealms:craft-engine-core", version.ref = "craftengine" } +craftengine-bukkit = { module = "net.momirealms:craft-engine-bukkit", version.ref = "craftengine" } + +# --- Shaded at build time (relocated into the final jar) ---------------------- +bstats-base = { module = "org.bstats:bstats-base", version.ref = "bstats" } +bstats-bukkit = { module = "org.bstats:bstats-bukkit", version.ref = "bstats" } +folialib = { module = "com.tcoded:FoliaLib", version.ref = "folialib" } +message-flow = { module = "com.github.1robie.MessageFlow:message-flow", version.ref = "messageflow" } +paper-dispatch = { module = "com.github.1robie.paper-dispatch:paper-dispatch", version.ref = "paperdispatch" } +sarah = { module = "fr.maxlego08.sarah:sarah", version.ref = "sarah" } +yamllibrary = { module = "fr.robie:yamllibrary", version.ref = "yamllibrary" } + +# --- Provided by the server / by CraftEngine at runtime ---------------------- +adventure-api = { module = "net.kyori:adventure-api", version.ref = "adventure" } +itemsadder = { module = "dev.lone:api-itemsadder", version.ref = "itemsadder" } +nexo = { module = "com.nexomc:nexo", version.ref = "nexo" } +packetevents-spigot = { module = "com.github.retrooper:packetevents-spigot", version.ref = "packetevents" } +placeholderapi = { module = "me.clip:placeholderapi", version.ref = "placeholderapi" } +reflections = { module = "org.reflections:reflections", version.ref = "reflections" } +snakeyaml = { module = "org.yaml:snakeyaml", version.ref = "snakeyaml" } + +# --- Test -------------------------------------------------------------------- +junit-bom = { module = "org.junit:junit-bom", version.ref = "junit" } +junit-jupiter = { module = "org.junit.jupiter:junit-jupiter" } +junit-platform-launcher = { module = "org.junit.platform:junit-platform-launcher" } + +[plugins] +paperweight-userdev = { id = "io.papermc.paperweight.userdev", version.ref = "paperweight" } +run-paper = { id = "xyz.jpenilla.run-paper", version.ref = "runPaper" } +shadow = { id = "com.gradleup.shadow", version.ref = "shadow" } diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000000000000000000000000000000000000..b1b8ef56b44f16b14dc800fa8103a6d89abb526f GIT binary patch literal 48462 zcma&NV{|3jwk;gnwr$(CRk3Z`Sy9Ed?Nn^ruGlsztklcC=e7I2x9>aqJFB(1eyu-q z%|3b`eLzVT6buar3JMAc2#EOW{C^)LAZQ?YaW!FjX$1*JIcZUG1yyl%HEd!6f#E+}*Jo*NafvM<-FbE0;-_L#rp}qdn%JEoAVNlEB#J^Oq`mU_#*ev4HLmc> zjXz_hFft^><#omb;Zer-%wm4hxo!wjuX3hBldg(^-RiOleKin`>KHfL3P*{k?(rji(#j2Cc0K509#>qu=-T&B!-5EBi(+ zIuTD-qfcAYgS@`Fb2^-p)4#o6A3z0&fp?~cV=CRsAeCmO4ZQ5kKgC%0el=Q&Rhd#k zaGmAbUW8uKC}-C0s~2);d{;mpsNBx9rn__66W{AhaSvJEK+c0b6ARO+l(CI7E|S5x zhaYP--@F<|99X&)9`q^2(^-Zu^Tzfm)v|gkTJHQ!G*zIg5hzoygeXZoYUEJ;iFkE# zq^r$*c|>Hmn3GapzcDYnjgSFiO^NFyTR5AH#mh%zRToMpEi(r)1$5)h455DuV}0al z!*psWuL@Ke-2gvftfMEGf9YEi^<{B@qru zINgo+YsE&LN?)1qItJoNhISp-fZ86`XR#*6xcvM~_7=JHUX;K9*=Gu5X~ zix|O2d=&C#u_w{=B$eCpJ4L*6i7={j+{Og~`Emz@&98}6s<-p^)`0fXE4cJBP{>)Ltb>JwcqI>yz z0-r-SEhC@p)XOoh|1|XgjFaREHfsu4dAGVz*k#m+V<4 zHqvlud6=;#QWHUoTR_a8Y8+heN?M%n1@0YLiaN@GuOPNd26tik7eKulTx?mM-R!1H znB6+H{^krFXg_b{y=QeCT~qR3T4}l+b!Oz9;~|3*6F<3?#|DYYW&1RtFE)ILZ!`85 zVmvrZkLTzf31unH7Cc5E0iFShqlBE9hgEnRJH1juII*vyp&xd!g`q}X_6WT6E$hhQ`Vdp9k^<)VS?lj!cTh z7FQcQAVA@jL^cXod8cnhKG2TS9+;QU6Kq>}UOY3&TL9gXbl{Fv8@WsF=z7>X0To@$ zY@Oi1uc|MdJ$>Kn{@!g_e`-I&Tpwfg9cr>(iakDX1qciCG_1y!Di#4_)lE!bWJbrp z5aUonb6m-?tiQyR_`P#~SOu+tb_ev6JO>EbEhHK@KbeT0_FDo>dl9bMg)>xmCNB*g zG5NC8ABavuTEZVGW6jP*nAqRt3W?7Iigc-EE~zpNJXRAE z>`~RO9$892j&I1kV;9U)xT8^}IeV`n{}QDtj2o-RBt`DGZUOO;O*lFCb_vpyGh*;95PfeGu!dyrmZ9VJ3Z*upg z6R-3Lr%_55$Hw1^{+KWx0#z`T7O6sXo1h;m?B_ur`X2bFz-SzDrL zpk^@B<+I6imc@7vip za%1jMB7q@1j# zz{u?YojZMW{5j$@h=v4iu2mTu7IzI|)Sxn!74=*J>1a&?Xjt z2%JhSi#4huEcD9qdR9Lj4vwmfnL{%+vQ{f-KgYeqin(OPd8+(g*Uq#TLxQjD4 zLCL%ul(V&PAPlAx8D`@K8Rc`{GPecQ<)d=KWel0ejFeeXGQ6o7601B!!I@RY&eDriADD6wP6DcFKDLZ|lO#YwnrNCZ)zRJpdxX_nPZa4j#$j6v!h|6p!dH}MY6#B`@%6=) z-HigguDACKBULnon^FKzazF|Y1{t(U5rUGnEU|}djVsWT-F>@@mNx?_$kF51QF4C5 zStKR$^3(fw85(4HGs9{mUTtn1)3PwxTN?6}j;32&vJ^BiPHfndLkdU5sOemXKGyCZ z@<7j(k>DNeo~QXyJkFWk!7(y1SB%nA3{v~P2c8ooKa4auM!el!Q_=;lJ$c5ADqE+^ zX8*|A99v;jWPrm(8=h;2ZAj|(vVbx~wQ{N%v;eYLD_BB2LAEWCs@xauyBDl(_HIBvA(XJ7B1E;O zJYCJ8xFJh7f5sr;Y#Wp_`$4Z_H4e9bGiBp?Qu&2!@%Bl2dT5evfFO*^hLDiBu2%Jl z*WAlL5PaQ7skJa(qVysky}DQquZ8U?2@UyJ8zB#=U_E>MgE%XA$CtfL31m$rATJvC zs@!crc0=128PM=Zp zW_5Czv9))n_8Ru?{pxM2F8^r%*O41}RnONbSj*piG%`nyF>6ky=|;B&k8iot(J=kyoU3p<_zaAX(1ijzf*uXA zZ_5jeC{Lks+&QeFIlmzZi3+fsF4fNW^~kvC4Q*T-vrNP!x9xnen12lZQM=1_MdW76LKX(GuW`%T~dM^YX6+ras|Xy4Qhfcq=D+z-P-ea z`T;^gj3+grr3^hwqcNTJErl$z+k>{bYFm6QV%7Opth?9+>|Dn)O@`7F@=j-XSqGPW zjUAu%b3Er@;j1%RZxVDhI3sakg-gvTLOSV7;FV6ED=(5;UG??=WADZw^=$4AyFh#}VMe3afM^pF zFa}-nM8X=K?Jy02*o02@6k{ z%O!hBhjXlXKdhy3A{xGB<##e|j3^dFv~~%v2_H{t(mN7NVeS~51?D&Ozbxa`qwZ_4 z;C#Q#fL1sua%ggucgIEHZtcY=Ag&GgE|h7Q{77D!WUq`;SSGEE0pU;aoj<7-JCAvf zduN=(tx3Mb+EUXKoax|v;8b@#HJ&Q|!g4ryrl|R>WlAv?IH`bk)I24;eE4NIq@SLK31LD4+w~#3iN{=<`<1R!t^$@K5>U6%W=%8_ANuR5 zs(IDuI18ftirTDARnGmF%;iz+4{MlMihJw_l!0Y)NttXC_t+s)V<EY>=Xin*nGX79k6vQ?beRk zy_J>@YSC_gMIG$yjO-y&o>S6xtfT27aSs>e|`x(f2R1bM}*518~%x>1Yct=18b&Z>GiS*>VB$+i2876zL)1cT zN33g=g|>xWE2)dds5m2+8Vy)m-u@NHOlGYxxjam21r1;xWtT0TgqKZrl}*LSkqFt4 zNTI1=3o%C*!-i;iWnlca$stRdwITA1?#fD~5OIqIQAM18BwO_u>hqL&OAANiF|8rG z_IZ9mp?FA-{Gq9+Ky<#NgL1gWJixfO0ziP$4T4G>vsvqC-NQh+A64F4! z-(t<=AbPSG%`mTl6BJtH~3RmvPhQlE-EUkEoBIP(_WMN zK~Fe!siee{M*ns1hkp5(2}vX#%u+T!Abh=<_gEx_QW?h4V@B>uOCEetEe01tl)^`V z(=cOLmuOB;8&&m%_6pcyrt83UXkJ`f9I&0KxY09}RTTs!l^_7~8$tPA%Hm#&$k0;# zF;O0zCGo0IN)X~SyKDoY1DW{Ulce|V9w=ld;U`z$t$>8U!Gu8V?_LAJAudt3eI#*! z2i9~F=kP5m>!bmb%1e~b1!1gz01Py(Yw5gOsFN#o1a&d|=PpgN(#UVreY9^99I0iG zaYE@>(C^V7pnoB~#w$2C1_TIb1N5Je&iao?S2A*TF>@vpHg`31{uk<9{zf_}s&z%dL-Fo)C$yl$%pAdqU!HJgp zh_{m1imk{&{ScyeuziqZHu5cto0{S}^BlXu% z0~;>_yHGd#?Kt8ErxK)z6ojj5SacQobw)-8`c!$HOI*V6eyqou{1Upm%_p!BY^t(D zDtn(oQ!jff`ddGSD;P8Hes!v)OKW-*>mS&#i0ow87;h>(=Cu0>b4)|=EegbN5=Xkh z9Ge13=3z#sk+fT<)PuUUf_%Nx@l!P?t*mni^94p^Ax6b2SVL5U>9dHH!H4DL4}@?@ z?Gpq$C**OmWliYA{5s<|EZ@QI2{-K#brFxfA~AIqq&-WSALHWQ8}%mvaNFasrtnE{ zg=sB4-RF!?)nf{>Wo~kNFgYefoFHBcSr*;iF9B!R=5Np|jv>Uf+mcarG-XGy*kP{z zISVyoPcl_9cOg-@613Qx16OGF#sH&2NTHDa_}vyidmxS~pMfY#AeQvu?AXpWNzi7A z*6&7a7!C9HRU+N{>WYTh0GXoBnXw{lQby^XShgDOw@e8TP}9Y*oFV4MVF#@Ds2A+A zXBEt3a@-IIl)TOcXx;0P;|ihR%Tq@DXeG5p-O{!T7Sg$s1 z8OA4iOx-!>6eK^x{jU-0SvByimK|nZik5zKIvvWVGE)4=x^&5Nx%Qgje!k3VoizaB zip#?$u(R8u{wUFC>tVR8oA%7fs?xEu(gYn>y6BB%vwPR9&RoZE%%RK! zl#Qnkl^+Y*Y4L{Xk(YX&aGj|zSpqO_;C3CTepA!L#4EXO|(eA`Fi+2EQ3!C zo^SpVP?{chQ3uaxu7y>w213e22cdA#l-M2kStPE%sq6vE4M*?3At!S7tIp(tQg(Ml zECjeJw8)*#LYYk_+Txv3rxsH9jJZBRrHp29yJ(^;_PEdn%#U1q`r89}38;XeF{ee& zsZEsUbJ{LtwOjU{vjL(Wvs2!Bx;#^Mzld&TjS@oo3kk=0P36MC-Ie6eHNN&{8b^s z0@jcbdejrrj!>r#Wu=3H1dgjeOI}NkhmE}K+UK&M>%7b!n&{0Zixk%^)6#@=V~IZN zxG>9kl&STQth}qScidfg58d2dF|v_U<@+V^eE@$4x;7oS3)MvWusA?9+%rN>aY#eA_6 zic@S(@e9$9tQM-&-7>X8~#n{5G}nuOu=dSyN+b~jA;_SExZ1H9Q1A}}Rz;XtXUIOP0~ zZzS|~T+%de-nGI$s?wxaJoe+99vmo%xm8o8SNEsAqAE)4LNvHc-1AX24C4k4u3vZmov^_VcxgGxapV(8)_K(^8= z2d{xCrmk(x&514Ly?e{Mf6}h3=oeP7+ZE{%B^c-kK8g0W{tYw3q%zty_Rd@1nbnyHMwabNp-sSyzpV4v>QsnKcQjF67%g~n&3t^1MesVxCzfJ5b=SOI#YfPP^^JGQw=9L1RCMFbrU{8O0LWOUdBK#j&{`tzXX zpe2_{+-8$a+o#%8MUlL4$yK`*--z&3{@Y?jP!m{g5nM+Ht=bD3o}Ok~sBQ_!^!->! z?NDVtyLXzmGYCEmjSCDK*q?Aq1;8fz9l9|z@~l{)R6GfKELc^(nV+TjjI^n0M+S0i z@YOu*Tk>|M6a0_n$(E;#^1Zgif<-CpYiMvyT+Y*9Z?&~IKSwsLa5Q#p_?FqK3lKIw zlp6Hk%lio6)yq>m-`QT2Nj-q!aX7~Hlm^Xh6FNbw z$#ri(Kk*GUHXORu@`aYQU@ zB~S-oIO^~abRPocemkm!W73dbb!j^_xgo_@#W#6p12>w^{){VfeX?U71Xyn9&E zHa1#*!4c;?r}jv7dMN`g#&R_S215)dccDOJr=uz%LIz@zia+LIFjRakROr?P zQ|Xw0Pa8o7&W=fw17`+SqepsQ-Os5v3ncD5|N?N(AHH&`>hLY+CLOluJ z_ErpaT49zK(UcdNmQ%iA-`jS`A_1c|$W86{d_T_T2V-HH3xUqpX0QJSH%i>1i>#vK z&y{;5)^pMB=u;&_DEWakQU>j&+opIrBf~2GUh{`kG{|Z&2Z}5dwG}>Y{W_uQHaR$_ zYH%}$c`CGC-FGCetRdQ@RZ2-%ucC_|R?mHzYEnqC%u9zRBH8wx7po`=EVPMpq+hL2 zTdjVhQn$)++17^cn;<3=bxJy0Z$U;i3AqJMPJO&SuieU&0eVX?eLEEI7Av@#PV_ZQ zsa>I>B5HE996O$z6HyJfhEt^aC><@AnzeN`xs@lv>^pPFtcodrcGyqPSB?#C`Piu0 zh5=hAW|OtT9hs*G?7}@*mG_f7ae@-Nz4{qvne66kco^uD$(JbCo2ttqUm-SMy@kx% z!eDt?5>w5)M!E#C!b#Iu9GqyhUs|QoYWHtR{4espRS-LUt=viY2iygF=-j3kcU#uF z{ka2=zsOuLR}s;&PbbrB`zty&NfZpV*Y;~i*W$EH0JOGS&FMS%VK@)f*%OOrcU3P9 zq4zjhMpx}oc`PWtP!o5Bdlp=(A***TZwVwuZbuB1Pibv5uiHvW{PsE-k5IfCgUz~l z0nMeZU0R>(ajoQ0G%Il)z0BgRR*bsdz5NcqJ<)niF6|PUO0i}<4)q>6wx4K(5>Y_I z4$WMkbCOQFs(krBnl zx85i0*7%Zm(&nKNP?AQ}d~6@?D9dO%@}ouN2paSR;zyUqJuw)1SRy=g%o;g(BD|Bh ztnKV(4fcBgDJ~M@%}n-6ow3xOhnC>C^d?PbS(9=TnO)k5p+W;pu2F4eiG7ts zJVL4M(NiZPQDy*9`H>-P0GWY#=UTnh8feiNF}hCs`8^ZDKy;XIL^9K4Ps&y^#DQSE z-?J z@YOQ9NQi>ZP>^ix5K`R07kWj?`R(B?E*OyR1$Vd;8p%2Y2zEYt4CJM~gVX%MO(E1B zzXhsHn~R1ifq9~dtzuH!*3&W;r`D(Sjrc)m#EI%`Car;CMWcU0c+0r?O!)HpjEvyP zb^;pO-Bn6e-+>dS^o{q&8yEH9v}vuXX`W;NPRlwJdX|59`z?~z{pFE!^u{3k{KkJ55^ zD;F0ldy9W*`d5YP|0(E6|K%}9|D^SIq>wO)4^cJ+yCa&xl*3}hpvcQ1eP_k;@>tz= zOZnw)#fxHc81jPcTM#)jgy|0?n0(jd3IPu-lJ&Tm`#F1)o$GTwYp@dlqy-qiHFCHS zKgikMUx|%x=_%B)>n_y^+HvD2=nP`}-G_0A7)I$yc4`tXS-On8qOkNp>Q^$|Ew%Jm zYx34*(*Z3SF}xw$CA?nG9O3ZH7l)@Dp4EyH>8eXDb}AFz)k*T53iA~gRu&e15u@|% z9Rw?69nQOeJhv^^unjd-VGFwbDzf9K{i(U{xxHyM@-aI+0qP{TU0G~w+Fs>taL#Ik z4+92(Z7n%+okd478;__0GkE`&(C`k8h@?UNnM=F%A~2|TKo)q9F<5`s)KwxJRw~k; z4giS~|8AIVG;rde6I^W6m9fliR^7YT*>&x7wv^?xu(5p45n{|2F>x%?9Jq+~Tqo9# zChbeGm@9!(s;uIKae_4h@`~yIj`Tqct+-M>d>~2PCiQ?UmFUioyy&~h_DTBQ--W|q zqA^UaJMTz4tEggQ*_cQ_LA7j7bLyz8#cpGggy;YBVk!%oSdufoh5-FYAQ)v=d$Bi`G$^~ zm!O;En#M9uCykPzLZ5SHa%?hDHP5P;T4HN0L6J*r9DAvC1WWPOrd{*obfr3yJ?Kl3 z^_6dnXRoi4<$Tr!=4mhHg6ig~BatHR zv%ZMJr-`8w_JyFEzUSQdp0HT>|9QQG?IXj$7Rbx4E)%HauDyY!tedHP ztIbq;D)ckd-eirAHOG7icBH23*ApHA@nG*Jdh}~G?L5C^Xw^+nLWG+>hRi&(fnpY5 z?^hj4si6I{m1u^%i_yk$tco}28X8|}g5*tAEZYF37$f(+xT%XvO^`i^Ig}%cydrwF zlpL!xdO->&@q|8MiJrAxt;z2CP*a+EvV`_2& z<1=p{zjhmmYVkpx#RV=#zuy&7^2Trn=H$nT{OBVF*0z|QH!NxBF%gbqT!BEx zKB!SsSUwSo1Zr?kMM%N)@hG=&m`vRQ6QK6=oIvnUI+|C)dGKM@jNwqG2Xi8;YCUHYRh? zbl@DN-za)+0F9kw>Yv=ioL)01uFp7@AVEB0AH-nmB%j$RC_totFy4BKd;OPCMUMBb zu3oUUK`|{AvkM+@KPZD4Tn$(VlQi&aWV*Uf@DO|FQjLOoVw&C@z~Um*h%Ka-C=n4H z@(Lf&MDJXNS{3Hs@J)11(zo9tGp>wS^b9{Q1WN=Ktn>ZieRZS?k`gb7P4n?cl^7^* zG5-oARAG#i<*z`J0ski%;QCLD-T$AbOHq<{KxIb4=QJRn@MGj=ns0WhZX+uX z=oTjz`o-VviMt1mB0W1vA*7oq1ENz{<*-EU)U;r*ODfV!G-?hdnzhM@rRZ=|qaFTN zX*t~$gc-)M7GS{#34R-n`B)eAPfebN46~61R?j^(Pg3TXR1PyQrO7Mf@xf<3VL0`4 zh(i?-SktJu8Oj?KIy4p@%5ZH;P&p5LB8 z^}7P)9h}vUP+1Hd3nNzNcbR`%1>dSZbWhiXe-CcB+s9e)_w<{bypZ(@cQT`P@ch=d zSOPhExgI31MVFPsClEXe>$~qYQ+d}7(!BE*9y%AjQ47BMDt=#>`1ie)|ES{pFFdHa zI)CK`f3x>)DtZnm!f5=e@g;3iK^jf!RU6hpjYu^V#q0uWLuJ-6={Ua3gDi9#*P7;- z`rm*5)n{2QE{UZ01PVy@_9(amogzzOwYcVgp2>LsJ(}hKbX_!ayZ7=U{!p{BHussVj(W z2z3$zu7h$KK<%}P0YBJ+)0unV*xD&6GusXqs=M=Cl&fP@Ttzfq?>H9TW#qDId+C7? zhD;;HOxDJR4dc_xI7-b6N6nZ@bUWueDk<_9Rju2I*o(i)M0&~%C^ zc)a<25M<^NrsjAccydV2HJu_-1W>b;xrB~Mi@c7FrW-94$-GnKXvF7( zA68!d!gkIo8(URS{(u{zRtrF}B$9@*)KH9POqOW-B$za4Sg-A&PM*on$>$o#L7pH~ z&YW8oJX3T!!@2r4Rr6ac0ZDbtB1b5yc$5}7oZSDvGF0FWTpZ#r7@GfM^MmC-p{9Qj z_JmmlTxO(^(NHqBc$ECU$jQp^;)%xnyr$qvNTd`R@j$8JppDCGQAHQ7?fja9McCUZ^;``VW$1+G#=<;K{_OfH- z_$fp~S3K`;jPNNZnkB@=DFQy3{6+Bq9nOf3~dr4q8zD_t{P4-^%<4kj!U z0aj`=#@G*w?!4fpM? z8Pwb15(Ka*TtDN-2aWK>*hh{R_C}*e*vSTkHdM(ETM!JrJ=1h?(_WL}2p#QXjrKZ_ z0k_yu^;~)#*r>sQP7d_4VBRvWJCzw#TxA{*hktwQI3ST{8{>3$KHJIgMGK6I!d}Q zinmfq&RLRxX8P)_@@vVr0gPu7*)uU<%xS{|Eg;*w1}2=C&?7B zSX?OLt-gZO+<4@tLeF+K0~*|xwMD__KxWgGfsUpj)KyeCM3J-f*uxe|xk;Dlqq%1< zL(PaY@U(>Z#k!C!B45JlmE^~wHSH;r1c^kWTG9_VT~1LN6$a6Yg@kNF?&b0hs+5Dw=0j zR(wcEYmdfgojx+Hzu89*C}4$I7^?^vYKhF(`>=MC)VeeFR}}?j#XeLnp8OhW9%9ND zt6utD8DHnQj5@YJv+$USdN{8apQir2)Z{8_s!BABmG2O#pz5lSh|gf#CI8X4I|U4g zhQwk=VEV+j+-KNxuIk96Bi%^(Sf9}A7o$zHJ5mV~)qP))QQY&^>9}z9z9)PWpw>8T z7#NWNEtnUoUl{DP5(lmy<3;tpLJ3hG|;CGB`3**uH0tf9>;7w;Aq9SRVg1FDpI5y~rY#B|eCNpAXD z9692@_%$t2^nu&4lU~(~_iVf|Cs|mXs-xKlY$-~FZB$!oDK#)JgHZCG)ySDURM=@(i zCpd{Er89|l&)(&5>L6LuWY3yC6)`jPz(Po8pY=AYIBnx3y2Qx6*sT42mpR$zwx!!< zHHCc~tbF^-bje?bo#~Q59Dmw_-VcliCn^FfI*EV)U1NkNA`6Cm=^%j`%M?1Zxa=1U zn#DPNc32&XHHfUfmPx*J+3_GA&g-_pd#wO=Q^5bdhzmm)>s@yO0q|>ROV(hkhJWf@ zqWjI#+9Wx%C+!kp&kxX|XPS5m9CBC&3r>}SwdFd#YF_W78A*CN6mFC)qzOjM);Z&v z#MjdXXMw63v*tbvY+$tDmuHNFunOlRM#qe|eV&|$98!xy{n)-=N?lrkr0_}U^sz|x zs0y);(2Dooa;(9zHzRi=I{GSVcv!6jl%ck@)>JODfR? z%aI)0HvbhzY9K7eYsntq#JvWzj$WCuoyGoPY7;LSPfZlFiWU)X?(-p}s4FXQcpIp00;%Jv;k0t@2vBu4i;rh-?{z}cHTLL9Rz zT8r(1Ws*H~EyH+adP$cGv|7HkeS9p6eOEI*`idH3twkEJ*72|ey4JgISglGV0Vo@qe#)f-=|g%l$S&Onwl@mmdn|sjXXYaQ4MlfzjiK1* zY&hWQyc9?G2}2s1fYnQ}LXpq{!&Kr97d?=a?_xXAU0SXrZE?T+=9os2*v9%Csph*M zW{}m4+PIRmHEI;<=c5$PMrfg#MTs);4Tb_0**o}*cimSWRcxo(;G&&NV+-?W7v*%4ACG#t5J zQP=$g-(mN*;B6s)d9JNkF0#Zz_WA>J;{=2a!IJsiqCV!YLjJ(wUJ`3b$>qcZ!HjDT z2xm;fMSbtJ|3o~tc!jJ+U8a)vX@NcxU8y#u!Puq%R~{sps0msRFO2!GM4}786S7* zxgNmf{q@|Sdnf6_he>gEGX7Hn)uih5nL&&t4`O{?V;;bdl1U~9RAnjNmt~1UPC3mh zrR8ZtHzz1(yOYSK$OjKf;InJ+7mH$WfqI^OG3dhA+S!YmIgRv>2H78?<6A=~%E{ug^P+^b*+f=j32&Nv&Ypq?DcH&Busg^AUDE|p; z8(tQxZs1+0gUX<5~Ah zT0cGckI5%nM~d`uaMJ$o%2bt^##I0UdaQ2>-bpsP4P1Vk8r7EOSr+a!D*Z4shiKFL z35Lvs^i;#;G{%ksUUo8(Nj2DY?u5->J8kqS_#{B`HqS(UkzR|K5&6XI_#FH4?$ znMXeTb$nmr1`|{n*#5H1T%vtU4-H)vrtAchme!ZG#@c+Hrf4uxx$;VU(Dr~N-ich4 zMKpdwot^bPY#kBILFgi?i3W_kV%vn2J+%R5x}TL8I?B~o#VXlmr?i=y`yJi-><;X* zPCDrsU51x;mkr+t18lPs=6)r^gEh2$saaA!qv_< zKQP13J}ptHaUjT_(*x+P}wfV-}57aU3rp#3AB&~e3%y}0ju#22u5@mUIT!GA{* zd%-e2DTmr#$(P6^$&N0oCgR)F9IPR~!Q!x6YI*7dx6LR6n8tj(#1~!0rofeMtT#g* zW%-p@V09>&o>iz0j66K^soJWg(o9#T(8Xx-P3?;J|t~nIDSGPq(?-B zOoNnc5HZhsW(m6!J+yj~kjmjV6GKvhO>%^v5`O2I@4B$Z!~DgelYWdC4P>YfmI$TR zq`atDEhIt5ua)PS;Yz1`FX@3Na6j^uBx_rNKTmgboWGwE6O5;iQiN6Q8>ZX%ApVJS zTEf6oj=@?7klS(JaijG|(gO@dTgxB3#H)4&?+@VWkTc)dl;qK|uv;WRI*cG2`6PiF z4+svy+Bfn&Fs57Jz6i!C(w$w@VWPAbRGak~oN>3vUg|Mmk0NpfURt0*DSJ_e*Gi8I zqshW4F}L&aS8x~4*#{4vOc`gKW99cx*L^69fgPj#?++q9LidItd}<@&#E{ZGz7g|c zFX$uKJ;Qv^NpN*e&EL;l@1br8j8oxO3e`g<911L_jr~Xb0)t$x$A~dFay9(}gt4&L zyb=1<`|)_7(!^xJ14xLBGKXO3`R^_;F01 zG70TiF<5(=pRsJYj!^XjLl_vFJOQPhN#Pkr#G0-m#xG>q)GAHjE4WFhe7Zi83;gte zdDv6+)qrgh3F0}$gPmtb9-Ff1m|xDD$6jX)Dcd5Ms-(@nKM_3)2+hfh6@Cs@-=%Z_ zIinf|ck6rN{EOadGmJ-rzvxZnAL)(mf108HL2v&m)%=a*?3CnX2ZfOQY?ha_11m@UzRqlkhrVbQ@0M(tSSTerx}IH@Dn2={w$iGqU#`v}PuV7I&A9JYNP%sqMn z1bTq*Ok{V>SlVH8H*4X-lO?VzaDQzAaLvc1tTL+To)YOuj^V8mQ?)K-FT(s_!ds-O zeb$rKRR-~g^+_aiGtH6kbJ)!K^ie;ipJ8e;>iy2}73i(1RY-~!(tk2zPj;pwB4k1a zVa~7lF^EE`UH=#eb**88zBH%!WkO0S?_Zu0KpRtXN+XMsAwfT56IZI}&cs+R5N~p3 zlQH7o$(zsQQBPIRmD)i>TfdcgCSKbVVD;VCmO3l1VNbV&rWc9o>Pk>ex!)Nap%NtP z&kKIFMm@k9-HeXj2$((SmG+a-dXvl7q(7n=8)cELHf!@Le+X)=++(}pKC*dcns?>G zVa*fV{2FDIJNaK_jq)WE9MvxiTm6sI%YUn|S=oP0Z`vE#GMZa`4V5byxmv0@8@Zb~ zyBOJuTAG>Im^uIL@!ZrWJy6xL{%n;pEwY87Y^xYSfmmgRcgcEDfz4TJ#{;n|g>8(> zv$(RLnp4oD1Mj>H@ar|0RCy}E{GwvuKOf1FS}O&z-Q)MmCVEK{p~b2xFj@lTn}#s4xg7h+r;n$TZDlT2AXAv z7R^$J?R|*xL^>7HI}e>7{HszA#Y_e8=~8*3zy_J$ejuhByeI0I!w-&%MW7Q-FGMKU z8qPm&IdU3w#^#`d%Vcn&q^w;EEr|w2F@ax^`R;a@p>l`U-T%~f&^`#zG}qdSV)A<0 z^*U=#=#o&gd{o+*s#j$xf+2y^t1Wj9_h}(DNi^aK#jI}z)v1rk-H)gocbgc`wB*?$ zfg~22r!^VEN+n>U8|3{Ebe#!9k|dF8lV*9c&9H~&g|$Ymc-2O^j9w$Q^I)ldd}5zv zQkBFDS2TxDn`p}-{-`br?tUCgyfr0Wbf3QeATbp=9sN|e90U^eVOu0~VT$1A5))@C zPcwzUn7bP^Gd~hLA@8EwiklMmlc^(;uPE%tLecC-iZ$_~jNJnZYn1A%r}=VE(-LG; znh6Q+b;zKz_N7)0SH7t~u#)e>Pr194w7xp;V&CpmJw5j6zBO%yB zjVf*iveYaWlrE~+p8YYym=-QmTd_F!`)ATishn6(oD}hTE2AqnVPF_os`ca^ET@@Z zoo~4YJASOBn<;8#(#3G>n1E)&@JA^3LV7mK^kaJ$((~ASWup3G(%#8O%xFX8XSiN~ zUF0&gDyT`FzIjtA`<-+9RXEKbwu%RtcrG!#-aoN0aj)i z(G|=#b_!z{o1}cIyw#n=j~Ac|NnR@<-CW$c%JFBFTi5JW0BX#4k2o2w{L0EglSN7E zFUcmFVF&U6NBA7!t`Lut>faDk>pW>Lz9BSzsqWvnI<+L#wg=zw+aeL6=70S773#Rq zG@fVM9=1ZibB`>L>hKz>rHG}`pX;dZD>I!_x~u>jsx3;0d$`Q%t7d<8^lkl8w0WZ3 z(HGiok6h^#G2EzIH}G*;!U8FW>@|C+wE+z{@e{wwWEkzUEiT0aDJo2JwZR{zcX$Bz ze2pzE&vKCc6@vE*GIv1LZ=qSg~HR)Jf|ljt#^m2hZF4z|32*7{hd|u`C7{C zjG>}`{SC3Dnc~5%D4yBa!V@}xSBtQ$ZWY^qs3)9jTuIXYMgPF5E0*&A0B(=JEntcVgC%ZO4UKHyuzuSblKNHWJ}OzVpeS z?8|{P8FtkJ=~%YMf1h*@o-YsZkLVQU!43cY~nWEmBt#&Ar%7WClZK8 zSe-!M)B8((tj^wSIm3?e5oe&mQs6BAE#Y7K*^boU^Z#aITL%-H zul5Gx*FKM}n~RnE*Ko3}nXrk8nTw0Ok-d?{|KMda<$n9cFHzkfb4wa&Dp0x>XjayP zg-KZ^Ayey*gb`NecHls@$a-2|Z!Xe^@P`uYYo`Q*jKzDQGPFf^GDQ5rd(-X3n)&f|bD>?`-DktKL<0hWK!cPS>L^@|VH6## zG*0#NtGfzpZpt+e{yL@K$|Lg*JfO%I+hp&kR;NxOJ+y2H49xZA7=^RKObPZi6 zL&R70!l_{PTFcxI#h+WsO^Y<`hE*z1vg9n7nG-6n0xBU8F8yDd}=?${Kl$qim3(S98@^W*vvSs{l zU}!oUIXap-i#nT`er(?avm4Q4-snuM&-cwu#-M{K8n;l1gP$ z3sw?`ls1z%eb%&mNBvLuEci8}-Q`|kUw6;F0-pHb?+A)+BLSn7_@my}6u%J=Ub~(* zU1n~wcfO|73IBZF;|Bhy$0FeO^>lmmZz?ZuZC8$p6<>B{Lsp-*mS05IVU00ergKWv z(LIsLS=?(>QLLQQ?bdTpyO?iiEL`;>(XJw^lA*7FCd|$g@c3VRy#tUf-Lfs*_HNs@ zZQC|>+qT`k+qP}nwz1o`ZNC1_y*J{2=fCentcZ%LwW?M`<;L&dcdwa@4GT@LCkltq=Xfy+OasOLT!lXrqy` zEW9YuDcfQtJ$oJ|Ln|b|q*_a|YPgCbBBfQ|5;-1(P3R`sK~3T`TtVV6yrtDbioJKI zPDV1BAaj#O~V^ll>$# zNC?nv_r5RiH^A2t<)qzcvns9Qd$_UU$`jN;KUSNqMCQiCFCi3A$*D#(v=FXCqz$SB zyC8vjHyJhMy$5kCi}FBy0NdSCJa6{q(|*9I^zwX1NHX*dHOIDB8bsI3_{(*-kkQV@ng|lWd*nWx!(xQ1stGMcRDjH=YUQvY2^uCZuO%-0Jw5az*F1nW_|h zR~z5DT4j&Z7527|#z9b}pmRW}p^|OrU(TWox^&Kn>YUn%%JlZJ^16vzy|O|GnZsf3 zSXEMjOhuYZlh*ikE0&zHt5va@6&GI{1&D+NPop@Tss&f!V4;}nqX@iOvdonoDa}J_ zE-u%qrrUpYVYSGU5NeXJr?#B#3dkObD8uk*U|u*zS;T2YgAk;_kdF0s4A6A*YGO4)#dKwYLQi+*i=C3N85d93 zAe#Lng7EX?@}-FPvIdp0y!`J@^1tg|IHwZ=C-i6LW7u!d>#==7<(?=6?caFCo;)AM zwwV6XHIU7}%D3 z75#&7SiVq=f6k4N*gy{?o~K9`+fsId8Co*62ksPHLm=SB>G)@44I(Fbs1stfE==|e z5WM)k7Hs~OwT#*$%<~0|BEb_6HV0F0=kYy;P zdAZbN(@{*9FL}4bSi-&#J^2;N`G{J?KFD@i^8BEXQq3$Q#~shvw_cx5r%ZlgHz2&Y z*cU<9UD1(G6qg=Yx{LRix``xh^Yi7@j|r7hm00t{(0ei78ZQbt`JV={$XlXvX91YH zxbI<;-YQG@9xrY>Ar~yWklR>hQ-X6TUxD-S!;~b9lu;Tu@f59S=euifnkTO2C*G;S z@TJZ5{$VG<^ThBbq_74=9q9r7DxC6VBngr@olJ}~W87-NEagn(;M*)7Oj2!(TG+}U zsLu!TV4B7DH{}gtanAHawLkpH5_$jk$0~;0`rM1Hjkl;4D-KsjXTl<*z|E`_8Nlb6 zroi&vNu(socja8wZ}9J>;D}esqgs4BR?_u7ZyELz2k%GQjtG%Vx+yeS&QI*AK1Q~e z;1-8)WjT?WqB>et(n%42u5UPI+!F^B7Hx#oW{i;??}{9#vpvk}lwvHPB$=-+pnIAL zGBd3sTO%TRGFw?`Nh>DzU#VeO7C?`w!-QT4ZgBE!WsS1clJ&i=m$ zHn^;?BNx^_wESMCsSKfxi542WFvUJUh%GpT-JP-b+D|wh`H$h4?*AT6uKyK)=>%&^oOXr5Al10+ld z9x<66pEk?hlV|$s!otJ~_Kz3DcB~XFzWq<@HMwvNFc2}VQuS$6g{U$+nN4G0`E zua0)-H1D8k;mm6E{(!pNomCz*qxv$pI3NvG>(+Q4AcJvK#K8 zb9SOKS@GC!pN|JW#<}*37GFj>D1wi~_)k#-N5izNy0%(q7hMm?oL_Ju8jMFGA9bKb zv$!gbC9lC0>Unx?+*3GF(6ZZH<(4j|5-Om02Y2z2IG_&xn+2Z`6;N1An(~^lQwwUQ zOiKj)?fuj7EGlb8nv@wDs4us&o=Bt%l*TAhB{h=R+Pddpm83-ms{V0T&ofYt=D7dS=Kr=V{~wzR|1=j_+3Fh+3mcp0J6k#Z&$+yVt*OJ$s$BYK zRx!5u|IH#%N;9@dV#r@$o(;Dy3GBon{2-)SK+R!>`0yL(nq~lFeelQy_)_BZt2i}m z8rSXb0|MpaMQpG<_IaUCD@=+=`KtLmC}H1)-vV;8Y!fw&`K2B6oou$QOj%XL`Ye$dX*5~GV? zjoCc8{4m*B_lFn=K@#mp@(*Vga>;sjA3Ds|(a_aGGbuFi)9-z>)&hY^h=PM>jvvAt z$Q7Zfbr%lPeu2OFHW3uNyavs`ezAXnB`OuCGx+U1e%!gwF?S3T3XLaG+BzOfiLB-f zLsTI!R2nT{#3)Z+EHpqiKXE$CK-~2S!*Tvgi)l{*o7SZiuHQf&N=jK$gt6|+nF)`Gm z!Txq?dNfctW^}=z-436nDud8w974=Iuf~cqED93ykXqf1w8FZK9fiO>iyHhGH6`Xa zy99CYP)x3@)FSqPdVt-Br1$H%x6;EwpuBzZ?#_D^RUI0KPMzf^_Q2rPhK)0jFB8Xm zlV*;2seylEHqM|s4!E5>k-zx$17R0R2*LcwM(ea^%K>Rf92id$mc6SChy+Lhh?+zh zvO6({dx7GOFjsuW1#TIks9C3Y1NS^K;IL#Bmt5WRAnNcc>QhlO{Vj2vmon)s*asQd z33&IEDekAAXHibwHHW4Kjin6FB;UgbL))#+*%fRgjq!Uy)J$xt^A4P* z=wpGU$DPMXW)DL%DW!nu39E+G5tKB@YM$r#?rOf~PwEaIWOZ?-rZteokPGZsqWYS4;B z|0LjjIbp)2Q9#;HApIi0rAAv&MKYgXU3KhsoOYe|YT)zr{({<}EXL67@nFgE$g8n) zlwsHK7H3m?1l)9j7MVEeKIFU&$Urel=||l_I+%2%vpEWGJ4%Ae=4~9emV-GN((dey zu%{X&7)-JZ@$2L0Yqtni7;-H%fWs%8= z=kT2S6oOA<-_q!hTShh=6tYB`my{cf^+Lx>yzS~3hAy^=8Fn4^M9*a;F$7-pPb`5WTTi>BH<(hQt<2d>L}bEO@qeR~R5CV6M#}U~hOs$t?sI z7o&N-naKA!$TJ z>&^XTo(>zGjv|b*XTI$ut5?7&&KtRH*Xif1`>gBEp7*Joo(B{{&6%EYr?;2euFLC6 zyxINGDCvA&Z9Ke6+p?I9Q!BMcUI`b0h}(?yqWH@VsM zQOR!?^5j*fLK3_B=$34i3+r{u7IgD)M~W2q7y3L-307k;BupXtBuqlRxD3=-rhwa9 z?bS^@iS*Hnd^;p2cOp}nC~VDSN?;3$3z!yI^$)`1W?UAhtCjjqn>M&ph0;8EaiL{z zu|C4KQm1Ko&6~iXk*x&^ph_a+*qDsevtmcT;T0k>1Tvc@2_|YU#phijBjGm~(FAS> zlUlF>J!lV+cX^mbgNt|q+%c)}o#I2L8tL)BII4PpHABevx1oqq4Fk=enLf)lPJppehzt;iO9UQ2qK{ycJZ}25$Em8#QCj@IGeY)Ih;t1C_j5#Indn9> z?q%Mr*&t<`FGYDnXUw!Q9F(&(vc=j2NyA|}`{O%(aBk4&ic|F*CyG^zcJTh7Jbkku znj-MdZ0aPz3?=kXncCW=-<;dP;J9T1y-C;{aJj^)J(P2N6H-0wO?ZvS=U!GHKVCK< z=aWv?u%5>H&8MwXa49`eLmGW<%;nt}*#2=)K*`axE(dLvH|fGa6F34#8tRY?cr_y0 ze3Ys0rp;JgADiP65s|!r+v;Bhhv}`Vm{n>M24Hc%zOJ&UhG2A;(vSJbsM4>fU{u2_ z-6VIhEcV`qxROML_k8tmxBr)-{ z0Nki4Ka!>@`U^UZ)eJ*+dVEKh%hU52puWKbEG44AD>zWsBPQobQCa)OTlz41wS`U5 zA(_e!#MIkQ_D?<^L@2G~TpSiQGc{2i*D?M}9=ed6<%52)rPN_&_Zz}kJyQ*xrss+n z+*}R)Uzw_8MN}8>Nin$jkrHrz;R3n*HT*JD&M9fIRS?wRHq#A#i(f4q5+z;_5Ij)k z55fi>(u^$A=GCiS!o_k6hWVWf;@9>(C^LB-^lw%JYn+7v`}UC04jw=#dbI?>PxGb< z^hYM;a|^$Xv8HwRyEFBlC0EGDeVFD zsI=F15ChE=aHP6tL~Ao9#WHh`H@ZcicgWiJi5Wg12JkaFg6%fLuw^#2^+FGSBYJC) zcLQaBfXhJJeIf<*h>U>kVP9*cRCfKc<$@qO~wd*)<>-)SK6P zJ@I^4#us1Hf$yt#&=?VaIkhDY^^W;!&OFd#L5S3wEK(42b#OVRSI3Yn=DLC>djb3m zOx*FMX7ymI4;B56>=L7Cv?Opmx_j#kUAIX{b-S2c8Z$v=gOMvo?-ij^Qg7+-IsiMdRFM)v7G{O9O zb{zD!lmDA*H)}70ZFQ4xTkLM$F*jknM@CK!9fA;1rEyA1T;kT|rRhl7MQ@3Z8K3<$ zthbXo^c6w1sy3usEhrD|+wtJ{DqW>!SzzMAYG&n5P_48!FI7^!mt^UsJ=Ii%VFz|f zC`{_0n8zVxPB%8P&U9wpG3=awF3lq(pY)ZY+X0iPX>u?nXvOVKqHlZ!kPr!p?==9sB_~DS`Wz) z-C{l?ZU7>v`xhem*b=STWhZXwe7a@WUN>CeYu(sj2^yMe+X__p(O0XKfx z%AXEQxVFsfTzy)ozm#eCQhr*;4iF$jVCn@40VgXeH%1E z29UQ3y$aVZ3TOp-E~*g`Gz^slv`Lf|RO$MFBa@P)tKRuI=cc?XxIqzmXgmw~OWv_3 z79M~sk*g{jtNxD4ShkFGO@d3`N{)-(L`+B$P3o{T)|L%BE`c71nj=koezdtBY4~a%t^5r3-m!3Kj%V`9dB?v%w?BxOI$&~!jUNWa z@o8Q~I6n%f3*aDLLYK<|4FU2X@*``7jnlDRq5+VebLwb4vJVL_1XDYFTUc;$dW3relP0}p?81NZ&{!uRJU{&9)O%uEL4Mkts~ z&T=;)Kjl_c^Tc3YX*8y9Lb`*cpyU^wFHkn{Z--k1SA~|n0bO2_YwyEVv91paW(>>D z5A?fn$`0!!94mEWTUFmE5+yocu&wZDj;aE3+jOFJ95*T%`pKWaqKNiaixt!T^#`@p zHlA$6Fj^5&7!Hb19 zHyE9zQWe<12XmH)8IDIOtwPeM zHRd&LKn-qMRQRtyy5LYzR9#*8JDBD2K-E^^INa=#S{XA+rW5XKtg>7Nn^Of&Vhir! z+P>KycTUF|e~Hw_vAX%ap<+u9o9)jcAVaw~|4zkmS zZa8>nl~i|D8zjQ^%<{;ZR6cbVD>%?nlBzUD&(9h}VOpBkVW!AuVW!MGuz;OfTWE_| z{yi!0mE#74$DH%4$iv357s-5PS(g3aXJUS?=I-+Jz4Y{Czu2{VMepL1!wV0l8b0k) zSH~&|HJ~YYm{WKY&gKO*WNzB=l|JE3C?T`VIh$Fi$wHFx68QWYRy%ziF%z4Zc<{>B zjkGSyv*i{+F*O@tKQ!EDM%7xw!z{Yx)~Woo$kr{Z7+t7ve;X$MoE{R-LVe22TZY;% zOIFYRqSw}4;Mcno^z?O*G8Q`&wbgNV%>E*DX{fnqK*lP#K0dvcU3endLW%GugLOH< z>Y{oG#ECe$UPvO#$t@?@GA5JFE*6oY@?+$jRxnx(BiZ8q{AuRkwymR+;{*D6-bh*) z-5@PC8lo`?K**Ec9*n$U>OJRjK0H$J@vnMoQZa4ti zMegzJ2oft=1Y+aEG$4JE9{t_I{tH*SwKVixk$IyL|hvQq*qu&_4C6X zp>36)v+qAXl|OfXL8koN-RrhNjjA36)N;pjmTkOO>jg}c>35j<2gH)fb7QYv#8VV2-AXJ1-O{Vpi$uIz3lMp3dl`?Wwpp>|6_$}|ROmbQ- z+O3VID2pdMNR%dc(_#%+-P-%bNIb5Irk&d>rOY(_mq8%P;dkWuH0mR4vhl=r?rV5g z%=n2Yz2%@f5#I6!(KxF>D%1-3IyJU|VW-!(l$}cWBQtobb>#9D+>HlD>@kp+qgiCj zU_Y+2nP+9m^gw~vIRygs?R~aXBZ*Vk8cFZj_&b8(pTaY{Y}cTT z*fRuKeL3=89rk16#2TNQ%KL}Ryx)%5M0MHy=A(uL9M*f_;^wBL-FO~J+@|(7I)GQF zGxu8y$fzRDE)xoI0MCR3S^FKd3Mzir$&35HZu)9V$~5*Kk^r{%vt!7ISD#%fswRS1 z7x8ugQ&u(usOPXbN5Z5URhEFc|NLc;g}f4JzVjlUxu&$T#yH-Omy4s=$~b=B<)v}= z;R7RHY}oe#TExRVjM2_)jF*Q3%G{)3ZZqgSTa^}wnjk_InITrx)tW> zN_A5pLZ9CogVv`5^1_9Jm_n4I&Od-1kC6YSPp-Oxyt0!D zIplg&zC_?4NKvoQui_?BUY3EYOP5n0W0#hYf21a%4Fg1xeEs;w-CE2d_X6pd9A`2e zuiIRY)}Lqe0J(eXdpq{`UG}5w@h=I2qwDlnybY&n3-F)3(mWK*z~Y1=sqQ352UCF4 zQlI=T^y5Lp>gG~>1T94`()}Z4=w<|*zIWTL=+#(!PT$k6nPOoI-RVk#s?iWB=$tTc z;v`#9_oLoCy7W1j8Mn^hfr?}kDKcERb3jxH4>hafqve(?N%m6{o48;*Aj`VQb5)Ul zHK-31_Fm*+OH8EXSzh8{$7fljqN=ahTv<75(Rp-SR$Zz#EMGFOcXfT5%J^HHx8x@r zP2)nIWHes~>%OVy%4>O3(0{X?N*ukyQv5>kKb>M|32-D&p%1(V8j7s?3w|Lp63nOV z937ts^a~AioVI92W$?353}~XMK~{A}5JkKH5b=n9Ciq@IDBAB;Z!IUAV+ciiDvH*j zMD^3Dk+a${QM5$azio{#f^OHOx>LnJ+5kbRm4^N`5ii4(4>XD|b?3s1jrWv1Z}MFy zT9v+!?Ds9SiLUpcRnr?JG+C=^SKkC=BwXt~F8Tyir)=)czcAl$Z)2R5pR!H;e=OVl z8*}D=$~ONscK(|=^G~^sSitaqkw<2U?vov$hY7)fa=I8~62|7IuK10w(qZq9BnSjK zt$S9yI^QU{77(-&cteiu27n8-8*tNC&-dMPS#upD2hi$Q=J$O0#Os?xwTN{WtSzZC zp0+5nsTrDO-C3RykP7Y)6z8U{uiQ@973Pg|STBrbPO4R4VU>jA3ZJD%OK)mD`u%Bq zjUA|-$B9L(11X}nY*naJ%@8ESe`WsFWU8vR= z2;2}9@)$?_zbc_riw26%Kg!e8Kd<=z-OEDxpIr0*^LqcyFQ+uzy_6rD_)MF*+Au)L zK+sV!gc8RX!}1A93BeHY86igj>{s@tCS@2Inb@Wg|3Ir$G(TxPHZ`*>y-_zsskEEv zlcqu`YL%;Yn6XuOyEIg6vQ;HLymz>grb&Gw(*q#A5?6USh=@|D2=%(`I*cmsk7f^9^}}P? z?OW5EW$5ivagZURMyiQ!)dSTd0?Cq6Pu{r&OKRfiuu+&nj(M|bhppFk4ze_}sSz1;);PvKNiaE=q^G|5w^Vy2SN zBs0Xts91C^d0dq<=JmXesd8D;1K5UvF9?WTYl6d%lJqXxN`Pj}5LxPgSRE$%)Se9Nn;^;MLmXCiH$)23AiNRlj3 zB5S`@U11=y{xj(rqgS3zSUD^dhUILAwb|IZt>UN#gv=Rm63ig{MK*6HQPQQC{?1ODO*flB7}Q(AO3hFI}(g&O+0tS_v* zssss=fjAF6c7M%h{bJFcbm>-<=R>Xa4X{qGb3|a97zk+R8pO+p(k2^QM<;%(sz0y~ zRB?%#!Lct8vXEtAzqvF2#xo$NsieLB9TCSs^E_?X{@2BD7<@uv#vvJzQhJD^v3!dT zl|$vIA|g+p5nMz|Au5{UAyp|$2kfI)S~hhN0%yOnr(#(o-&bKg$Y+VeF{*sx3Du~N znZWwrE{QHx{GA?2J*uLTQ+AKA)Nbt+N2AXvftlF`pev3SOJ$4`MSDf=HiGkA5i0UO zd~$T7PLbVXMt2^U57wmD5}@X1U>&QO#B&jZ0J18_+exP+Z@5Me9xd0Jbq&L^e7(>X zNNZ(5fx4(0i?cEE=!j+2!b@EfJXIo&j};GwfS*019h#N=Yt|*|0J4`!D5 zN_q7;3^d-)FNmK&7&H^rwGK+yh}q{Hpt?|PFC?Fm#mlG5xknmlrQ>IgB05c3KF~=a zh6K*nAvP~CiOXlXY$wlxYQ8_)WN;>NeiQS5Mb-&Nuox?GER-8$-`li(QhmzUy}Keq zW@+_RPM`C|bx|r{2{VLpv4kQKehI>QOprT%3zknCxVb_F`5u!3W#trOn>06Z6D*XH z=M)M2!jWK4RGLfuttE%E2P@F6hVZljI&jmjn43^ zPJ~{D)br75_H1XB8(ej-Emk3-$#Qk8x9>hEB<9vjxJQ=EG&)&*v=3TD&pvVnxeR-) z?Lb+YlOky39f%jYERz8;%h7@zQH?O%8>!r^nUZ(>IPqq+lbCHA8Ax24#IZ@dwzGe_ zNr{+ocSoD-L2*Xdg%@t^OiJbgq#@1W&4(>T_SLJKpM5HrJSQaRRfbG&uyI9+T~>My zyWR{C12~~%bhg$$vJk%xRx<*^v~v)B^3%hV33i~-tUvA5Sfb|5i=rmc9n>)2!GqKa z^P&<_F>DtK$|77CJ5xuKX-Q%!OtxP3n%EsDQrn82M%6F*?l55XtzSVcMPQG0ZuQjl zmq*Ic&aackwk$S6PqbQ!TT;VJDSX~x&h0RoXfrD8&a{@qUZfVn6$ilU9V(GVzCpk^ zP$Zf;Ui%dnVGK2;ueF6kZ zFhW{mY7j^Tftei%owFtP`AO&4M?tOT( z;Htw$hS6rDA9#f<0l{2DA~U)NOfScqg!^m^q#5Caibizsnh)JfGIIAiSiC=S%J|_X-AWeS|ich7A5v3!>zaS0qG@+}6 zF+61ADkXR}zFbZ1mX?PdOp=@C9DI^|;2Tz^0qedK3>_4z?WYMY85qL(rt=Zq14q`G zmX)L~hGa0K_F1zeK5O`YjYkt&x-#C=rX%}-v%xC}Z95zssU#Mk{YR8Je z@U4Wha=tl!xo6aPg=VsfWT-Uw*s!bATd!Jrcam6JES#?b>09?3j3HtW9zjdZo{@vm z;Qsw!K~TU*LK!uvRJbS;OkNH2Wt%Y^x3I4&v!zodO!!r6#`%hm7yl~tBXG|sE%(t= zztYj^vC$ivB^+7S$l7s@do8-L_omu&g;hi4Q7^#p%DB);DAqKLC_yf{M--fbVCW4Q zpLSAJpyR=Jw|FpZ7!OY9&`o&H;FE5C-006%H7z?V^+c?EUl19l4m+%pxM%W-d$e~- zt(|&Ex@CFK^ihfbnmM|@OUuO+x=YOaa6Up`MZSv=z+ zj&v;Xfs>|(JoZyyf*n#2H&qEvkEBqz1th01TIY?cy1siJEZd%upf04|88q_e^UcqIJI$qO^tX{0Q=;ytn*d0;d>W zpbMg2hvsXQ_P18QOkwPq?4dM+V|(uRBPZ<<$bpw08v0vS$9$VUpbm=Fv(IMqMe~ij zM>0rOq>iZMoC}d%y?jB;97(AMLyv&6Zzi(5LIvB?<#Ywf0)mZ_~Rdangdl z&@8jcCHuwoEo63_;{rqY2HFx=n@YZylX9a} zl&P9Yv{)Lgc|b3Q1o2l|SANshLidoYfmF5?I`bsF`E$9kGP};}K?$qva#L^~CH` z!TFGfb4WF(Bq_ENC#V_OREgx>tR!Qa(Jg2?b%7g;M5AE-&>&(JHfZkcmN2s4eJeN!nCrcl9Way`gTk=o|nGo|BD1pGHLvB0ih$H-WM^@K##RBrgEQ`4$CSNzg z8QjInTy|bpvXE2PqeM9*$mGvZ!Ps7Fn?$@*V_0OIlsGq$7xq#m0A&oC)8WX5OB{I{& z&m4D92ULj=J&5P>4A>lRn(KPS@|aiq-&TfHnOC`uYpkgbZ!za!sgrKX&HmC&DR$Qw znLUwmqe#(ab!;OBsne)NG--Cm>qV#<+25uf(vCyt?AGIMoJse#4t}n3bFn42(girok)X zsLlF0m3f3uPV@^VjN3J zs7vW$dREOUH=t;vnxK-_6qp*ejG&zM*m*>v9wu&xniWe@+eJ-67VZtoVET-b0X5{6 zr(c*Y=7z@KB`=B#zMR8)M_(&sn@t?LtNkyD`lrk0nJapT+`Ued`PVEyOY{v7f2Alh zxP{mY>C3kmqt~@Sx9=weAH3PUD&9e;-4Z?DM%u2JrA~7?nOo3Fg!@?ilHRb~Q9Vh0 zS~k)vttP$Xy9A>{?$-j{oKIM^!~^qOk9nFfO9U;uX<{Z}MGPU&T0}pPw4d7EHF*^c z(1Qo888T#p5hW(|Q-(yg#r6vVzhg0gpd>56bb9oH0wu}%3M)p2fxFLEy>QG4R_-h8 zU+Al?!eBv?3%sHzLA?4>j0E@%7$S|RYf_S$ylY+ z4n%*ot_mG#p83HvVERPUjJRH!Ay-9T%yQe2biJr+b%|?XeE(`??bZyWEqp{h5`F<$ z|26&q>X&o$0crC>TI-zNN~}*w7-kFnefLs z2fQs{{%-wM-9ryBgJ*Iuv&{5yuKy+Eoc^si>??Jju|gyAn_Uf`ajXB1%g`EBtwiQ1 zx^awk%lc*V?-yf2mx&<2oHk?3d{TaxpMu&Sc>d+t2h>+*DNg;iw%P+Pbq56MHt1{8 zuC!j;1YlpBL2hXi-rks7|L=db0Mz7?nWiEF08stMZRP$Sn6!kAqm#as74d%`|J5u1 zZ`hY{-1iNNl z1=2bj@r1^~3~TeQTAAId%fY2ha|!FRU6VMpiAkkk@VViqVwhBxz8SBI0v70InyyD6 z3Bn|Jj3nVomoatTh{xa7jx;yvi_UnW_#l*M<|9E)rOc4j#iVycL>cKHTtp3#k-nKL z+7?|mS#aSINetxl?nE8)%Zyk>!C1k`<{`huyPwZD2`YbK4!99|Okznl56^r1}88nU&cpyn*~f zRP2FGaX0@#FpvKuii!WfqnQ6~#DBA2l_uoxjK6W&?wmdns)%IKg2?m;9KE4d3H+J4 z{P-@21_oU4WQ76zv4`7rf2c8VBqkLlTWX8sn;VP7*r9$|Zvr<123Vyh&st-dNnOt) zxtL4AjW-w3bde9fPrdt&)f0toUJ2&UdD?Duy5Ap7dEF=0V82i93p+Kxkri{*^!QAa z`)V#?MO?Egc}EaN?0rV`N9>*U}noU~6E-WouZiR;Mgh z;i}OVBurvrDpRj7!i%ICbMj)VT&(w5JB7dEWs8$MSfbZaa1D^jw$rlh41JSI!*+g5 zc`HjldKt~dEdKiq-t`OW#SHiFi#h4kU3|pR`S;CF5SvpIp|Cl8#>|qEO zL6o_yj`uN0$wSqXQfj)_qWIKrnS3$j-u8y`GrF8k5xy*m3E_xC>4xG+3@28lsi2dl zG->G?bNPxG)$u+RlKOK*4722EnDvKFTfCP}MVn#i1AP7T_HVVXeMTs4JO zpT_!OPG@)cEQ+es9a7Q~8ZJxuwg`RN6PqI_ZGrR{=g#vc28nWQy+I8dcb5dFR^-u; z&&P%sTVJJ;F`R;9s*$hDbF31St>mkHWdp=P*}5fF!x?lQhPw$TMi}e=#xDm^PWJok zBklIX+F!cN8)z!@No~Er@9ywmEwj?-&7I}xh?Aw0SPtK(3EQ+5LHqwwu+}k1p;#vH zrvh`dw3QgL-4@kIQ!Av--?{@#~s8|+dQ;(;Mo#ndpY6spn{3TJBv8{Ee0%vgX2)N zCCV1=Y(p9TH+hpYR^mG9QF6nF>tHb9wDPpXRlL7F+QvVV*IK(W=+D|wiR-*I;elS7 zY`O=x^{a5b-2CDtug6c%+y!Jb>;Y$1|5k+KbP-$ndnLz+PK~0IJ6_kenCmP!NG!nT z0oX@l4sD#DBU$@kjnc{sh4baeOf!mqY{x0?+@X-P%tFTkGt+fK8Xnl}SW!g#bX7&^ z+2;eo?q}&im*rirs}E*eubvzp8ZZ##(eDL0O^$sfaX!0;rmj^d#vG<0v5$vbadqkM z;c@S>jXq)Rz%lvuo_XtEk0U!0-X%0LG%_Oo&y;sC!y!Vzbv!1e%gjo7+E(!P5CXQg zglw~&%zv|GAITU4^EUXYL*ba5L|+fG{n2f#<$P`;XXQzw!rFG>1xIQtjYXPCx$0Tg z_y1H9*k8*NMu;cG(T9I5k|_z+!6-KvLctWLG?awCF`Wto6>5{_B*kX_J!#TlRfW|Q zTxT2;H#0}=YR;55U1N;$dTp5H%;k}GCmbbyfA00QK5!SnK;wWT_=y7G3YX(F_2ej zekKG-;-FFYlnsInfBS-ue-l(=JyzlnCV;dv+bFa!pd>$1xZyr37BgGGzr|0+^O~0j z15^}t&e-E6dU|#)QNVmuka5beLq1^$=n5hx6Mg@fLV!rjf(f07zjUyE!{MRr^$O81 z9c&-SdtEZ{pn(T}h6ZnUS7wPMBn?d!5HMe!BHRBbb05=@24O?2h_`+1 zSkky=Y6p<;hK&MFs_UV3Pi4-ZFlQ5qOdAaJ4>=1O04Q<~*!bCF?FPS~o{er4?b z@BAktYAQF=_~SF#TF%vAsN~HdgBetV+7Sn}tl<@KS7SOg0f&fC(;da%oL1YWSL+*m zGM#5P_te#*^#`lcd2E#Bzrd<*Ozyihcs6GM{UIN@;iOnS-MRs~qr?3IfIIow<-ibm z1axfeXk3WdOtrvL9~RrkL@RPE27Wm{vO5xg=Y{Si6xRMyB}nHWVL(7VUs(tiyCf+=eFX z^v*e{k1Tj6MkZdZ0LiaYY^zFpCUo+Dxx=bBlNeU*IS#VeeOAzI)Vt^$zh$j^EZMHM z**h+Kz~xZ6N@mz-#ETTbxO`K|Nr-N;@=2jQ#7ZgkFx(W;GWygjB|Jx@jU+qS`t!IrL_@Mh#X_TZx%@ z^4p_*L+-*ol_Bw(5gpCY^}j0qLkVl4eKqJivQEuSwK~_wQU=a?(Pr}B&EB% zySux)K|s1&x?55}O1is2>5>k~O$h(?yyyFj*W>Z~9|mI&_Fz2Mnsd!nbFSyU4NmP* zk_r34gxePNOJ$h6cykvyCw$qW0>}3|r&9U*AFcQWu@^Z90;YM#zVCO^+rx zNH@pXoqevqr|SqP@$wvXr8J@&d_JP>=uXmMSW8G@sN0shx}NXhJ^U;k3^P3*Y9*{X zT_){Q>`WUL%w79gi?=u4Dq=QB^rnC>Qexc!1mCKET58qi_4>ylhJterN@VVP&{9R} zf`VGjgzL=<92XlYXsi4V{!C1%tpasaKFas6LJV)K-=vfm;P_v(pq!FX4Y?&YsVKhO zR%%faHzRDbQ!M3E;64T2WnRzcuczPxKYjJ4E?oK+r6|}!&xa}zY4)CB2A?|sZ9Z0a z|7}5bo3I!eu5axh5J}j*49lzaa_Zc8rw3g>pdb(cSDK@($H8DyJ~4-_*`cwZ$s? ze5h6-?o%Yb`5-tXa|0?FF6Y2tk6?PhbB~VSfa6cTW01)6;9^4dE+jka44m<(+qOx| zS7+%A4{cV1vYAlL_6DE@7TAVxXLfPEJy)0APHnPc=nL6sYxCkc(#=FY#J=VU)@bgA z0_~_L;7&Dz1PtGWxfn&<4}Ma94p>_udw=f*7k4kv58VQ0lC!J^kehlmGtWV4Mi6UiYHz1L*lE`k@;g5_yK$-= zZtu<-NFGqxlm4JpB#T7g%Ex-iNmQO!&y7g$cHfwbO|=&7md}4l4Mn9|n24rEQ^>Ux zYO+gTedMAD(2~_1Q6k*FOpy38A*yn7gLcbXj?+s+U;2tl$BG4xn$@hHmfNzSfuA*V zDR8OI{FbT?yi6r34Q}@hSTAGKo2ggB19-#DmV2x|Zadz2|rHCQV8f=qYq3S-XQKr)V!L{fbjC(JB{i1oZ ziF#JsGKmxT>@0|5a3}*}b2#dWUIr!i`8n>4;r7E*)&qvB!SvEbZkC%_T$i>HF_iTK znSw(apn9nYdcK)KaXd!E__$?es}T}>(H*ztldjGo3~FxJOQHIwDEbA;V7L2u0y+iR zI z`Ta|+1SVzj1fro-ACvhOxw!`lkeVnt+5zUv+2Q>l6W3DEHS!?GkLeUc=jF=*DYi;4 zgAmXvqwtL98S&@oBP*(OL2;6Q!{jJ!x!SIzc(UKP=n25KVnzea3MJKb=3u8Cm>iLlc zo>?@$-95+WQf~)EAZt_5R=Kx&-+eesXf5(h%iWVsgV-k<5sR4Bt?SzA!_Si!Vs17{ z{6tvfF)5Sptk|88Zta~Yi^wNgFB3D>72<4rA$j}O^elvaJgTjo4ShF~YmiNpHeGbr zyKXGp)-!&Ibd!z^zbI+4QbF?)fGbwcwDyLFza9Z}=ghoEC1>_-5DRf*_-4`0`D_3% z-j$9^NUELnMfu|?&hgFGHu3n@;Oi!chfyGFC1tj zysM2L<;pVB&eZILeivP-DG6^E!_0P@Pv$*0)yMcNP8S ztipdgy#t~iDVyOeruzZb?;xzt0NZ53utk9^3ZvN}(iFQco`XI5+!2~Bt*g7s$UI9V zqTk}E=N|5KTZK~u!6+3ngR++0rc2UcL~b2^1ySOpH^5EkBa;19dk^IoLT_D(^eYV? zh)u!~KjQmm97L8GO!T6q$6zM-+4)P@I(QCal||#8B$YWzh+EnD6~{;lGD;KM(2Z~x zbfm^>#(c>3<`9QS(Mb$0_NoT37Om8`p*ft5u4+)-eY&scXqIdG8ph(=r%k3w~PVLOXd zvY%SJgzTUS)}20bSmIE#Ku2ArE#^+hFkz~5s)Jq}y~;DcyBxahE*PlD`+}A(u^rn<&8zczVDn%^A5dk-Vy_mr0qL*uM z+kH(G>dhnCDc>o`r?(AIs+^*rfe)ECTkV3CYD3Q#19fXQhe<>BD4P`WFJ{4fglrGp zMC#o(hLNzR_6BG%EOWFS0kBYlhLR^aX`ly0}L;y&ATq9Kgir+g(JSTR7eC^Kd70rtk@Qwh@u3M8?jc zvgkQ+ER2q@6iY?Es?2yUOPXy52HHmmw09OlCy8i1JSX$cFQ?Kz?WxLaD*;xXXdOZ= zBkjariS2=U=4{ztOD4WdLby%7@-N=%81G7r_onmAC}*~wh&dH`ElcXAaT1YCg!*3c zydPyIQxoLY1}B)t!AYV-sVm|=v@yqXQI~?W4Le?d1`+uZEGOQ|ee*VGf zrT|&74wW?}lFB{`V02N9RseY6=RHwR+vczuOFPU6KW$IutXl`cwNkIGa12qG zrJ%bP3TNk7J?}yS3x6XEWxoN1EKl;n-Jr)OR82@8A-lLcqJ0m!DhivFnJu)P!CIZozRj3Dupfu>UuxP6njtRWN0x(t)#GPjJ(W*QX;@KZebajIc;dm zCW~hL0jRsrD=aVq-P|3Oy{?-lW2lzd!ihrjVFr)oLbOS5oQOiE*S-!;?Lbx&bB@wB zIBCNkoH#5Y8I#5PlHx>EpLUEIfBnTV;pU3R%nfkZ z!YFhE-!>M@7lKEDX})s?nHWmd;*DDNM6GEm7PaY{ePtQ7vU*E6^Yo7t_xmKXg?pIw zLetbL($kGYR?TwDFJ{6?y@??DP->A;k*WI-u5h`r_Fj=a1?c8CaYv_fx+w3Y&sz)# z5l!Eerg8T>?FtY$ym)%@xf}a@V)bx@rCghzp-=;#(K|s@NOO*IZA)NzB23n8Oyp`N z6Y_)!pjq5GpOl;|9mspLVAjuk4Swf>dB>Z+oWGfksTiJHt6LL8{)`TN&}5mlo&S@f zn?k$j;4E88b8ms}U06xznINvR%znonws$*X0nXu~KR;D&0=; zq1MxLBj~1VFmZ3_rpJ&0B|edG0LL4z$TA%JtOE-~IHfCXompV+wy z8-&6rt-RaR;6BG2HZ5IoYkQ!W1K80!*5H1C5|T&@US7!VmLWU9nG%2IR0sf%g(q;p zir%R2#OCiM-FRbfu?u|_l)-Q7I{}F_K#B)nXF9wXSLm-9xO`&}clEL58GaMK6`1Uo zQKob~3zs=o{h-kD;27bhfCkdw{8=X?mD$rB(iIfJLV2z}Inma$btemM>{3VY_dH`c zRmH*W_;0{4Bi*0y!=kq3gCg}!KzsqQv(?<&2%Y|52_E_JZZE7axCF6;pWKz-h9;(1 zFEg|lBDp{TkLtU9pc8X{8!)$h;lT}wYiX`cFvH{sCC$IJ1nrkGsX1R-c54t zLc9jBHVaK(PZqQAK)*w|rQxaCi@4yDsR;BKp_0+QMY4^V@oQdty=y?g5jigp7$EqZ zjDUR~x@7qfAlguTFi<0JZx{E(?05$3ZrE!(`+7JwC(6-O)0zPfL-;9#k~GMZLtGy?nM#)>2+T`kNj ze-Cd%!Vd{3rx0cOIo+1L-plN7F!@)*0?vWum?{xsvwILKF<=UycOWzqNrt^1DAHo{ z&>l4+Ab^}}aY{#leq4;cq6#<-V$Ho7UKVZ81@Wh+CFOY)SxBEZUOMd5^n&4mJBI5y zhiL&%RP$EK=dU%dsx>v_%dKWSAnH{~OU>To6_twC8@+RTFwOV zjN#5sZh{G`WWFrn$+vV8xa_EdxGegTh$iG5fdf8|IkR2eF_u{^F!2%tv7EYty{ytY zfTzxF4)ngPoP_WTG|Fer08u&Q$%>o}_7yWw_VUke{^I-nDIPLL`#{~ep5)0hW*8ez z$=vvIc7ys0bTt^Z4cC$pSAr8jP+)*}S0n5;J4~41b{%cIM*fv_$1_a{7~CzEGF*%a zmo!~DyV(mH=a!>N6aTXY|l>8fd_G+w#(nF|q5jcLBA z13?#dl>PPCA}RNzqD6oVO(@OKym{I-Pa5JmLRwqW$FBiUBnL+P2)@~J(ec|s_sm!R2@$OKicGYN*2GqU(J&T z{Lqn)*=vxuAX1Gv0Dk!C`pCTtlDrGq_gKcHI?^jian>rS^UL?G0{-ilaNK#DTyw56 z{Mo5FbQ?Hew~5Kllovle5o!-n7?EA%~9 z%jQnBip8H@%a9KGo;gZW59-6s%P>_Y62@fk&z9tt_3vec<8wZNl}y-DPVJOG|Iin_ z626Fx(_8z21@R?Y6h3=m$wyZ(m0~u^gGm$C_>_E9bIWd}w}}Fi6`vO0&SEgSdVWB! z70oGSTwI5)%Dq)n3w0Upp_=|g;_;3OZw=}>WJUsdX*M=A4EsAwYD>0ZPrKc^Y`%(P zR4QJgyJNu4aNup&3279U6_ zdbsfLmw#jb+-(ai0SJf=$M4ESh--^XS307Zgwt`pJ8{}aNm%u@LRcdGx zw~H)F7#NIpX{7#kW5V(1H5 zz5AdL#5;!Xs~elu2h{fX{pR6_V=3+&^ruJ{iTx$`s^O_)RYD@?{ol+}(o43PDCFcy z>6@z&ig(9lnQ&Je#^YG*qG0nV5izc-nDi1Oya!vptC5L&xq!LbWas62!Jk9@Hgg$u zcf|NzytpAfC_?Eo)ZG&ywyD+)KyrtAk@F|5=o#Mda4t2W8yW1la)U@5zE9jn2t8L( zX81%5B2%>F4iIQQ*!=|^;t?PSN?@8gFwrSJ@S3$#y8xt&xUbuD-u=7}9#eLWR72-qTT@xu+BTcA6}iClYMq3D|3PS&w~_olnHK zbbUG}X3XIIUV2VpcbYSqR^lWK`E;G4pb|N_JYdhO-P9g;3Pq zx#XGZHE!5Xc?m~}&3$AbIXJZLI=xQV><&VT5CXbQ&*Kz10ue(bo$2A61QOcN*>`p;EOKRNXLPtn*{8w3F-Cleb(>;Dq;Q;C(4 zd?J7xq=(1C&}V+H(IjuWE!QWIPhSF^7YZk!fUfOIo+QzqwU^5k7P>3Y8U%-;?GA!O zHYcntF5ohIP^By2K2uO|W-gA~czK@O*61M(U{K*rXX`j+=FR!L5*bC z8%ZNoC}V;XL!Kpb>sP)JkSj_sf;rwMx2$<+g%bK77T7~8tSw-VD@GV=JA)2g5Hs@& zN(X^2sMAj;J;5fpbBvQ$s%Wr@mKo`t|+60qbQv%_fRc(1N8*2fDS zc~Y)?i3pyo`Y`?2GK=TmHMB1Sk?@)-KhzR}Oj=qWo(Ut-uUx}_lC%xNatZzBfmEBJ zSB2ILfPtS-VxP5RivoeD?|F1}MKFC}S2DXwe+>&i*)@^(pNc<0Ylm@t;ENoizkQkG z#jnpbKyf#qNVcsT*VPwT{GWW9AfDFmg(z^eN2;&JR3~wRYIg?8~`b z6w+Q}ETeZ#j>1Z?z5425VK$AnXI=J;)o?YW1AC@*n=7rc0xy8rmLo~Jcb!bgn3ceG zv1@S2g~rpP*}ia;hD~CRV%Kn2XA_Ux$o_4-22CZ*sM5r!eGy6Peeyw==5WHgAUBr! zfvRYibkq^Pj~pB0`BIi)Xx#xu3H)+%OM`sS+HY@3+2tFUh{#~*CgyA#2A6>lqfn z6S5O{6{Wk3D3`MS+HG^VfwulGBaN;h`#huNIg<4%zjQE;0edb^GBt_26eM9Eg~2<= z%x&8wNd;sz2J(b`T`Vn+b%GZu!pg_&@u44I_b|jc_M^Ast*GX% z~cER`C{E`DzN*%y4r>@ti4A$Le2~6EEK|BE&%nFopIQQ zN!-D9pX<=ija}?3M}Wur)SnR4!Q^=N{TZI>K-5OX+PuZ@ecEdP)O|3 z;Z49IgbEtgSJg(*(Aa^$Aoi=5ZV6^_E4HzP)mn?bbRzqSk-Q@}P! zU^@l7uS{R0FQ1#*uh%#!jP+VDBI7|deK+xz-o;cMwsFQa_N6oU`m|HL^uTLD=QXI? zqFiDND9*>fT!W9Zuh{5;R})jH-(6Au;dQ~kD`bIM)20??E{+DjC_(m7K9a=~L+3%m zmtNX7LSUw(wb78YdD4gQYKDwb0w6BK=Xyc%RRPAvWSvJs>w0h2R385!%w)PxhWr&M01bMie zx>a1ez2u_4;Q$qR#^a%(z`bD;W}PcbW;gZp$;XJ(jj16;20aY3xp5(V_)^EWM`}Gr zK#ADYB0DVWY&9JP_oH)FDL~K(Y0HNT%jo5+7MAC6`q*B*BqP)IfOA zSs1}p4ht#5?g87B?XYTl`HxLvWh($kg4e|Fz2Zvohr;hXR?n)(=s&V%ugp%$J_YTVFooJk<#&j9b704}aM+b!QM* zY2B{6NUDF@2GpzM?B-{6Ghg#rk|qw*Qr=FO%CA^HN`cxwni?*?^I8;o%^2I|#b!@H z!~kFZVrVLm*xR}zG$0!nJB)j{!+gufR3EieNl0$mvb9e%%PXc-huMH^XTw*p?1 zYyBDhW(uaF%N2hMyCTWakzvUi@hY_+R8p{u`b*vcrP^U z_*g|+yWK|d2olI`sQ^ThBwo*25*7;P@yH3tB(f9HU$-isz0RnuWHIEzUyNIb?n@Re zv$Du(b|ul3b3Fq0U>?6%DxBrqHZ@M!(Q9Sr<$XXSD&RZR=lmi8#WaVOpR03FJ!gJX7}xq)vi!L65L~h`COI7w7PQN!xMG^TmKZsOTAK%u z#7EYSymBa>Y&`4@Ffm&lxog|JGhG>BPx$u;Ig zhanra)@5TBV{@8(le)od=MZScTHK2=8cikHIuNW>^0PQLiQ-@U95r?P0sc?spnX8XB-Fwp8ZN9nk*gQNY==j2)0kCP> zDS3wH9LV%ani_3bU2|xy#zAU$rwL<`uAe~6y>{(&G8kQVUiZh>m`rur~bZ0XVL~QQ(q<_ClM)5o8+`+95hA?X0lOj&2f6?i%}xEm~y3R zZA1w3h^*;MJ*GFdRrP9o(a}EeSy$0MRB1H>ND#EI?o(ILX|D1yXsML7Jz;PiQelZ+ zp!i9t0BZQ}Y0c!zH|4A21GdDR7i)Cpg{XY}^=@lm1vWb9>y^p4F^Fj{5|XH~U(`1y zf0U&kUb4c0uQ(#`!MNRwE;%*DP}`saRhM}Q@8)WSInEKkDq_N)ih@A^4cDIuzpTR1 zg1^TRqQx;vVRq~}7XnA(a3&`_p-X}Rp+M!R82&a9yRuU2)qbcH!*(OuBG-ZxL$7^3 zk&b$I^~5I@OdQRRR`nvwa|Z8Ax*#R#RSH|9#$u7?>1oDhG*RHFDlwSr4bi&61QLwz zDLzl|vh{cbR+{+2Riced&uLkYy9`dK_ScE8u`N&ueqg2cUruA%=)P)#35CF58vwV> zIFPBlmMmvWShXzwjAC;X9Q9dnE`&F@@U8Utn=nx1ySEfLX(0((;LiiMhO*{o z332vyIVs;A+_1A?y(oW|?Fl2oUa(^_iON_+oYqiYgd}-iq2eyFl8e*2C7b|Q$7#)w zm1s2=sH^Fdv2u>d+BWU{?4KqFr-5CP>KbEH1xpYDVVij6M-c8AG=ym^@?d!I(P`9u z(W@77VDq{wy0<#R`)C@Tr;x*YPD61$^u=U&KnFrtLk+}c7XYQ}!}&%5t49-o8#I6j z8$BWc@|_PmISg)MZFq}`=(Tu&Y0*gn=!zUT%R6}HnzGC1I3zr#o#GHqMQG@>OzQj7okNAF z(psjhjkl6sE-6TI^GhnVg0K&Qnd~;28l$D{!$=pSZL9m)_hz5f__8{k;McQxsl7yL zoV4+ZL@DetHhsB+u&|Sr*#=j%+t!eitu!F$RMK>tLL_&GeKR_!oe^eQ=FnS3U9fs4 zI?FrCXlH>RT``+eW}G!(+Yec7JR&Y?WJi( zmoa%r*|6?kWI2MyMWFR&UR94W?=gsTJxJ}_*g_YkdUWL!owBrj-lX=Hx;)8+BIbFr zftcCqOWQ7{96mH7cGBrD==xgg7+$j^gyKT_a)O9QZ?{T>TX!jrkd>J#Cm|;2;tO2| z=43{SY5NJhTQKQ*&oeNy$u#WO!de&b$r+usOzH|f+vA&o_9PCcYXVad((7s>b=O!Z zxvTY)LL%1i&SDV@+C7(o`!I)3_ln}{m?q?=Y~@fKh>zj!lY5>N_O3$Ml2U5KPx+(7 zN0LYrf4JaN?NRvbXSVht{+PCc8`(XyfG??_f2D8e;jKH>`WI|T!;WbjqP9zrm*ZR7KW`bM%aMZ4>;lijsSslVlc+pT}&WfxFuQSMv0}uM1%mqJA$7GWa z6pIIode$f6LrBHlm1tMmunGE`=P4W`HIGYvT#t8kYINF0AA{{c=jGrCMA7YO`<&7m znPRW=3T+R(iyAEZD5LAgt+0a^)JQ95Y} zArV<65fxQBr;(Bl?f2HlYs0 ziGdJ%;O|#epl^W;RG_kRG@~>7OHhi=$l8MLJ1b@ZM>7{2pdviba?Qm47dPlXx4gn5 zAS((u#k2^#&-gl#^es}6f5-WyC+g41pS(8g(F7)M06uYiwe0*BfoQ)={+9!*<1+zM zpe4zFKtG#={Y zWh|VWfPQ@cp#n$BpCHi$Fq3A1NJ*f0`j5@bc=iX#zgcbujwXNJ%$8|Sv|Ql8_W^R* zf9Tq6-~sy2ga7Yw^MCDC&}KYbVj#*CIDmc}rk9j|j8g*IG1;2^%l?~tkPAUa! zoPSK-#rj{#|LUpVSk(V~Fn@15{M8crTjX;6d-DGbxPRIH@BK7?9A#=eKOijruWrUa zH|Ben#;-;|-(p?xH>CfwTj$T*@7>LQyk=br|G@pFquD<@LjKJ8-uCLNSK7B=k^Fbg zA3CS~4E^4B>8qpGw|FJ}1N48^U;fBn>u1XM)-XTrI(OM$QvTNt=KtpC^fUK+i;S=aQLge^)V~~G-zzMBoxuDS=O(|*`v;1gKX3c@GJ`*k za60qfF#ev4`Df+EpE=)Gb$=Bt{1(v`f5!Qj&icO6_{Yu)@%|;?4@$*8G>EADkeqE{m7WL`BO#91q`=2-V`_;N1uP(+}zs&l(<<*~)e?RN~b;0jj z5a;|l`5!F*{S5hjw(!SY+EDOI$ls&#chmVlGroU@`a19UEsRQj$M}a?NO>s;-~$;5 R2np~f1o-$>Q}y+){|A@R9n$~+ literal 0 HcmV?d00001 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 00000000..e3ec95fa --- /dev/null +++ b/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,8 @@ +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-9.6.1-bin.zip +distributionSha256Sum=9c0f7faeeb306cb14e4279a3e084ca6b596894089a0638e68a07c945a32c9e14 +networkTimeout=10000 +validateDistributionUrl=true +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew new file mode 100644 index 00000000..203529cb --- /dev/null +++ b/gradlew @@ -0,0 +1,248 @@ +#!/bin/sh + +# +# Copyright © 2015 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 +# + +############################################################################## +# +# gradlew start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh gradlew +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/3d91ce3b8caaf77ad09f381f43615b715b53f72c/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# +############################################################################## + +# Attempt to set APP_HOME + +# Resolve links: $0 may be a link +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac +done + +# This is normally unused +# shellcheck disable=SC2034 +APP_BASE_NAME=${0##*/} +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD=maximum + +warn () { + echo "$*" +} >&2 + +die () { + echo + echo "$*" + echo + exit 1 +} >&2 + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; +esac + + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD=$JAVA_HOME/jre/sh/java + else + JAVACMD=$JAVA_HOME/bin/java + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD=java + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +fi + +# Increase the maximum file descriptors if we can. +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. + # shellcheck disable=SC2039,SC3045 + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac +fi + +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) + + # Now convert the arguments - kludge to limit ourselves to /bin/sh + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) + fi + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg + done +fi + + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' + +# Collect all arguments for the java command: +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments, +# and any embedded shellness will be escaped. +# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be +# treated as '${Hostname}' itself on the command line. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ + "$@" + +# Stop when "xargs" is not available. +if ! command -v xargs >/dev/null 2>&1 +then + die "xargs is not available" +fi + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' + +exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat new file mode 100644 index 00000000..7e60b729 --- /dev/null +++ b/gradlew.bat @@ -0,0 +1,82 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem +@rem SPDX-License-Identifier: Apache-2.0 +@rem + +@if "%DEBUG%"=="" @echo off +@rem ########################################################################## +@rem +@rem gradlew startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables, and ensure extensions are enabled +setlocal EnableExtensions + +set DIRNAME=%~dp0 +if "%DIRNAME%"=="" set DIRNAME=. +@rem This is normally unused +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if %ERRORLEVEL% equ 0 goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +"%COMSPEC%" /c exit 1 + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. 1>&2 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2 +echo. 1>&2 +echo Please set the JAVA_HOME variable in your environment to match the 1>&2 +echo location of your Java installation. 1>&2 + +"%COMSPEC%" /c exit 1 + +:execute +@rem Setup the command line + + + +@rem Execute gradlew +@rem endlocal doesn't take effect until after the line is parsed and variables are expanded +@rem which allows us to clear the local environment before executing the java command +endlocal & "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* & call :exitWithErrorLevel + +:exitWithErrorLevel +@rem Use "%COMSPEC%" /c exit to allow operators to work properly in scripts +"%COMSPEC%" /c exit %ERRORLEVEL% diff --git a/pom.xml b/pom.xml deleted file mode 100644 index c05bc913..00000000 --- a/pom.xml +++ /dev/null @@ -1,339 +0,0 @@ - - - 4.0.0 - - fr.robie.craftengineconverter - CraftEngineConverter - 0.0.2 - pom - - CraftEngineConverter - - API - Common - Hooks - Plugin - - - - - dev-build - - -Dev - - - - - - UTF-8 - UTF-8 - UTF-8 - 21 - 21 - 21 - - 1robie - A plugin to convert configurations to CraftEngine format - 1.21 - fr.robie.craftengineconverter.CraftEngineConverter - fr.robie.craftengineconverter.CraftEngineConverterBootstrapper - fr.robie.craftengineconverter.CraftEngineConverterLoader - - ${project.version}${dev.suffix} - - - 26.5-SNAPSHOT - - - - - - - fr.robie.craftengineconverter - API - ${project.version} - - - fr.robie.craftengineconverter - Common - ${project.version} - - - fr.robie.craftengineconverter - BOM - ${project.version} - - - - com.github.1robie.MessageFlow - message-flow - main-SNAPSHOT - compile - - - - fr.robie - yamllibrary - 1.0-SNAPSHOT - provided - - - - com.github.1robie.paper-dispatch - paper-dispatch - 1.0.2 - - - - - io.papermc.paper - paper-api - 1.21.11-R0.1-SNAPSHOT - provided - - - - - org.bstats - bstats-bukkit - 3.2.1 - - - - - org.bstats - bstats-base - 3.2.1 - - - - - com.github.retrooper - packetevents-spigot - 2.11.2 - provided - - - - - net.momirealms - craft-engine-core - ${dependency.craftengine.version} - provided - - - net.momirealms - craft-engine-bukkit - ${dependency.craftengine.version} - provided - - - - - me.clip - placeholderapi - 2.12.2 - provided - - - - - com.nexomc - nexo - 1.20.1 - - - dev.triumphteam - triumph-gui - - - provided - - - - - dev.lone - api-itemsadder - 4.0.10 - provided - - - - - net.kyori - adventure-api - 4.26.1 - provided - - - - - fr.maxlego08.sarah - sarah - 1.23 - compile - - - - - com.tcoded - FoliaLib - 0.5.1 - compile - - - - - org.junit.jupiter - junit-jupiter - 6.0.3 - test - - - - - org.yaml - snakeyaml - 2.6 - provided - - - - org.reflections - reflections - 0.10.2 - provided - - - - - - clean package - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.15.0 - - ${maven.compiler.source} - ${maven.compiler.target} - ${maven.compiler.release} - ${project.build.sourceEncoding} - - - - - org.apache.maven.plugins - maven-resources-plugin - 3.5.0 - - ${project.build.sourceEncoding} - - - - - org.apache.maven.plugins - maven-jar-plugin - 3.5.0 - - - - org.apache.maven.plugins - maven-surefire-plugin - 3.5.5 - - - - org.apache.maven.plugins - maven-install-plugin - 3.1.4 - - - - org.apache.maven.plugins - maven-shade-plugin - 3.6.2 - - - - - - - src/main/resources - true - - - - - - - - jitpack.io - https://jitpack.io - - - - - papermc-repo - https://repo.papermc.io/repository/maven-public/ - - - - - tcoded-releases - https://repo.tcoded.com/releases - - - - - placeholderapi - https://repo.extendedclip.com/releases/ - - - - - codemc-releases - https://repo.codemc.io/repository/maven-releases/ - - - - - nexo-repo - https://repo.nexomc.com/releases - - - - - matteodev - https://maven.devs.beer/ - - - - - xiaomomi's plugins-releases - XiaoMoMi's Plugin Repository - https://repo.momirealms.net/releases - - - xiaomomi's plugins-snapshots - XiaoMoMi's Plugin Repository - https://repo.momirealms.net/snapshots - - - - - groupez - https://repo.groupez.dev/releases - - - - - central-snapshots - https://central.sonatype.com/repository/maven-snapshots/ - - - diff --git a/settings.gradle.kts b/settings.gradle.kts new file mode 100644 index 00000000..08a82714 --- /dev/null +++ b/settings.gradle.kts @@ -0,0 +1,49 @@ +// +// Settings for the CraftEngineConverter multi-module build. +// +// Replaces the and sections of the old root pom.xml. +// +// Repositories are NOT declared here. paperweight-userdev registers extra repositories +// (mache, the plugin remapper, and the decompiler/param-mapping repos named by the dev bundle's +// own metadata) directly on the :Plugin project. Gradle cannot merge settings repositories with +// project repositories - whichever `RepositoriesMode` is chosen, one side is discarded - so a +// settings-level repository block would either be ignored for :Plugin or would silently break +// paperweight's setup pipeline. They therefore live in the `craftengineconverter.java-conventions` +// convention plugin, which is still a single declaration site for the whole build. +// + +pluginManagement { + repositories { + gradlePluginPortal() + // paperweight (and Paper plugin markers) are published here too. + maven("https://repo.papermc.io/repository/maven-public/") { + name = "papermc" + } + } + + // Convention plugins live in their own included build instead of buildSrc: editing one then + // only re-runs what actually depends on it, and IntelliJ imports it as a separate, + // properly-typed Gradle project. + includeBuild("build-logic") +} + +plugins { + // Lets Gradle download a matching JDK on its own when the required toolchain (Java 21) is not + // installed locally. Without this, a machine with only a newer JDK fails with + // "No matching toolchain found". + id("org.gradle.toolchains.foojay-resolver-convention") version "1.0.0" +} + +rootProject.name = "CraftEngineConverter" + +// Module layout is identical to the Maven one; Gradle derives the directories from the paths. +include( + ":API", + ":Common", + ":Hooks", + ":Hooks:PacketEvent", + ":Hooks:PlaceholderAPI", + ":Hooks:Nexo", + ":Hooks:ItemsAdder", + ":Plugin", +) From 2bbc3307626ff74380e6b769a708c7fb214786ed Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Wed, 5 Aug 2026 10:52:42 +0200 Subject: [PATCH 038/116] chore: append -XX:HotswapAgent=external automatically when a runServer agent is set --- Plugin/build.gradle.kts | 1 + gradle.properties | 14 ++++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Plugin/build.gradle.kts b/Plugin/build.gradle.kts index 8d4c7526..01ed908a 100644 --- a/Plugin/build.gradle.kts +++ b/Plugin/build.gradle.kts @@ -131,6 +131,7 @@ tasks.withType().configureEach { jvmArgs(runServerJvmArgs.get()) runServerJavaAgent.orNull?.let { agent -> + jvmArgs("-XX:HotswapAgent=external") val agentArgs = runServerJavaAgentArgs.orNull?.takeIf(String::isNotBlank) jvmArgs(if (agentArgs == null) "-javaagent:$agent" else "-javaagent:$agent=$agentArgs") } diff --git a/gradle.properties b/gradle.properties index 089bbc16..2de7de6a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -25,12 +25,14 @@ runServer.jvmArgs = -Xms2G -Xmx2G -Dfile.encoding=UTF-8 # runServer.javaVendor = JetBrains # runServer.jvmArgs = -Xms2G -Xmx2G -Dfile.encoding=UTF-8 -XX:+AllowEnhancedClassRedefinition # -# Level 3 (HotswapAgent) is optional and rarely worth it for a Paper plugin. If you want it, add -# `-XX:HotswapAgent=external` to runServer.jvmArgs above and uncomment these two. `disablePlugin` -# is required: HotswapAgent's Log4j2 plugin cannot instrument Paper's log4j (Paper loads it in a -# separate URLClassLoader) and floods the console with CannotCompileException stack traces. -# runServer.javaAgent = C:/Users/you/.hotswap/hotswap-agent.jar -# runServer.javaAgentArgs = disablePlugin=Log4j2 +# Level 3 (HotswapAgent) is optional and rarely worth it for a Paper plugin. The agent path is +# per-user and never committed - put these two in your own ~/.gradle/gradle.properties (outside the +# repo) and the build appends `-XX:HotswapAgent=external` to the server JVM automatically: +# runServer.javaAgent = C:/Users//.hotswap/hotswap-agent.jar +# runServer.javaAgentArgs = disablePlugin=Log4j2 +# `disablePlugin` is required: HotswapAgent's Log4j2 plugin cannot instrument Paper's log4j (Paper +# loads it in a separate URLClassLoader) and floods the console with CannotCompileException stack +# traces. #################################################################################################### # Gradle From 4180cca38a365934e92042f8fb31def03b9e95f7 Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Wed, 5 Aug 2026 11:01:52 +0200 Subject: [PATCH 039/116] feat: support per-user runServer JVM flags via runServer.jvmArgsExtra for HotSwap --- Plugin/build.gradle.kts | 7 +++++-- gradle.properties | 15 ++++++++------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/Plugin/build.gradle.kts b/Plugin/build.gradle.kts index 01ed908a..b59aaefc 100644 --- a/Plugin/build.gradle.kts +++ b/Plugin/build.gradle.kts @@ -109,6 +109,10 @@ val runServerJvmArgs: Provider> = providers.gradleProperty("runServ .map { args -> args.split(' ').filter(String::isNotBlank) } .orElse(emptyList()) +val runServerJvmArgsExtra: Provider> = providers.gradleProperty("runServer.jvmArgsExtra") + .map { args -> args.split(' ').filter(String::isNotBlank) } + .orElse(emptyList()) + val runServerJavaAgent: Provider = providers.gradleProperty("runServer.javaAgent") val runServerJavaAgentArgs: Provider = providers.gradleProperty("runServer.javaAgentArgs") @@ -129,9 +133,8 @@ tasks.withType().configureEach { } } - jvmArgs(runServerJvmArgs.get()) + jvmArgs(runServerJvmArgs.get() + runServerJvmArgsExtra.get()) runServerJavaAgent.orNull?.let { agent -> - jvmArgs("-XX:HotswapAgent=external") val agentArgs = runServerJavaAgentArgs.orNull?.takeIf(String::isNotBlank) jvmArgs(if (agentArgs == null) "-javaagent:$agent" else "-javaagent:$agent=$agentArgs") } diff --git a/gradle.properties b/gradle.properties index 2de7de6a..f371e3fc 100644 --- a/gradle.properties +++ b/gradle.properties @@ -17,17 +17,18 @@ runServer.jvmArgs = -Xms2G -Xmx2G -Dfile.encoding=UTF-8 # Level 1 (method bodies) needs none of this: just Debug 'runServer' and press Ctrl+F9. # # Level 2 (add/remove methods and fields) needs a JVM with enhanced class redefinition. IntelliJ's -# bundled JetBrains Runtime is one. Point Gradle at it from your *own* user-level properties file - -# never commit a machine path here - by adding to ~/.gradle/gradle.properties (outside the repo): +# bundled JetBrains Runtime is one. All of this is per-user and never committed - put it in your own +# ~/.gradle/gradle.properties (outside the repo): # org.gradle.java.installations.paths = /jbr -# Then uncomment these three: -# runServer.javaVersion = 25 -# runServer.javaVendor = JetBrains -# runServer.jvmArgs = -Xms2G -Xmx2G -Dfile.encoding=UTF-8 -XX:+AllowEnhancedClassRedefinition +# runServer.javaVersion = 25 +# runServer.javaVendor = JetBrains +# runServer.jvmArgsExtra = -XX:+AllowEnhancedClassRedefinition +# `runServer.jvmArgs` is committed, so JBR-only flags (which crash stock JVMs) go in the per-user +# `runServer.jvmArgsExtra` instead, which the build appends. # # Level 3 (HotswapAgent) is optional and rarely worth it for a Paper plugin. The agent path is # per-user and never committed - put these two in your own ~/.gradle/gradle.properties (outside the -# repo) and the build appends `-XX:HotswapAgent=external` to the server JVM automatically: +# repo) and the build attaches the agent to the server JVM automatically: # runServer.javaAgent = C:/Users//.hotswap/hotswap-agent.jar # runServer.javaAgentArgs = disablePlugin=Log4j2 # `disablePlugin` is required: HotswapAgent's Log4j2 plugin cannot instrument Paper's log4j (Paper From dab7827f5747ebc93086948fd795e33cdef0ddba Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Wed, 5 Aug 2026 11:02:16 +0200 Subject: [PATCH 040/116] chore: add logs directory to .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 86716932..c0cd3ca4 100644 --- a/.gitignore +++ b/.gitignore @@ -120,6 +120,7 @@ buildNumber.properties # Common working directory run/ +logs/ /AGENTS.md .classpath .factorypath From 72ee93dd3ee682dba371ae46fd7f5d7f1212c7ea Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Wed, 5 Aug 2026 11:04:25 +0200 Subject: [PATCH 041/116] fix: use LinkedHashMap for stateOverrides in BlockEntry builder --- .../bedrock/mapping/block/BlockMappingConfiguration.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/block/BlockMappingConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/block/BlockMappingConfiguration.java index 53937dee..678ceca1 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/block/BlockMappingConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/block/BlockMappingConfiguration.java @@ -113,7 +113,7 @@ public Builder withStateOverride(String state, BlockDefinition override) { } public BlockEntry build() { return new BlockEntry(this.name, this.base, this.includeInCreativeInventory, this.onlyOverrideStates, - Map.copyOf(this.stateOverrides)); + new LinkedHashMap<>(this.stateOverrides)); } } } From 38291ab7eefbc792d82c4c3dcb4845490bc171a7 Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Wed, 5 Aug 2026 11:06:58 +0200 Subject: [PATCH 042/116] feat: add creativeGroup property to BedrockOptions for enhanced serialization --- .../mapping/item/option/BedrockOptions.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/option/BedrockOptions.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/option/BedrockOptions.java index 75dcc70d..6e1184de 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/option/BedrockOptions.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/option/BedrockOptions.java @@ -2,6 +2,7 @@ import com.google.gson.JsonArray; import com.google.gson.JsonObject; +import org.jetbrains.annotations.Nullable; import java.util.HashSet; import java.util.Set; @@ -12,7 +13,7 @@ public class BedrockOptions { private boolean displayHandheld = false; private int protectionValue = 0; private CreativeCategory creativeCategory = CreativeCategory.NONE; - //TODO: creative_group + private String creativeGroup; private final Set tags = new HashSet<>(); public JsonObject serialize() { @@ -32,6 +33,9 @@ public JsonObject serialize() { if (this.creativeCategory != CreativeCategory.NONE) { jsonObject.addProperty("creative_category", this.creativeCategory.name().toLowerCase()); } + if (this.creativeGroup != null && this.creativeCategory != CreativeCategory.NONE) { + jsonObject.addProperty("creative_group", this.creativeGroup); + } if (!this.tags.isEmpty()) { JsonArray tagsArray = new JsonArray(); for (String tag : this.tags) { @@ -42,6 +46,16 @@ public JsonObject serialize() { return jsonObject; } + public BedrockOptions setCreativeGroup(String creativeGroup) { + this.creativeGroup = creativeGroup; + return this; + } + + @Nullable + public String getCreativeGroup() { + return this.creativeGroup; + } + public BedrockOptions setIcon(String icon) { this.icon = icon; return this; From a93a670de2cdaff514009306333ebccdbe9cbe5f Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Wed, 5 Aug 2026 11:24:08 +0200 Subject: [PATCH 043/116] feat: start debug --- .../mapping/block/BlockDefinition.java | 141 +++- .../bedrock/asset/VanillaAssets.java | 125 ++++ .../bedrock/block/BlockGeometryBuilder.java | 229 +++++++ .../bedrock/block/BlockStateMapper.java | 614 +++++++++++++++--- .../bedrock/display/DisplayPresets.java | 162 +++++ .../bedrock/geometry/BedrockGeometry.java | 107 ++- .../bedrock/geometry/DisplayContext.java | 53 ++ .../bedrock/geometry/GeometryMapper.java | 370 ++++++++++- .../bedrock/geometry/JavaBlockModel.java | 120 +++- .../bedrock/geometry/JavaModelResolver.java | 200 ++++++ .../bedrock/geometry/VanillaBlockShapes.java | 126 ++++ .../bedrock/texture/TexturePipeline.java | 111 +++- 12 files changed, 2211 insertions(+), 147 deletions(-) create mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/asset/VanillaAssets.java create mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/block/BlockGeometryBuilder.java create mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/display/DisplayPresets.java create mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/geometry/DisplayContext.java create mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/geometry/JavaModelResolver.java create mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/geometry/VanillaBlockShapes.java diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/block/BlockDefinition.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/block/BlockDefinition.java index 0b204434..1d9b9002 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/block/BlockDefinition.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/block/BlockDefinition.java @@ -5,6 +5,7 @@ import org.jetbrains.annotations.Nullable; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Optional; @@ -15,12 +16,25 @@ public class BlockDefinition { private final int lightDampening; private final boolean placeAir; private final Transformation transformation; + private final List collisionBoxes; + private final Box selectionBox; public BlockDefinition( @Nullable GeometryWithMaterials geometry, Optional friction, int lightEmission, int lightDampening, boolean placeAir, @Nullable Transformation transformation ) { + this(geometry, friction, lightEmission, lightDampening, placeAir, transformation, null, null); + } + + public BlockDefinition( + @Nullable GeometryWithMaterials geometry, + Optional friction, int lightEmission, int lightDampening, + boolean placeAir, @Nullable Transformation transformation, + @Nullable List collisionBoxes, @Nullable Box selectionBox + ) { + this.collisionBoxes = collisionBoxes; + this.selectionBox = selectionBox; this.geometry = geometry; this.friction = friction; this.lightEmission = lightEmission; @@ -44,6 +58,18 @@ public JsonObject serialize() { if (this.transformation != null && !this.transformation.isIdentity()) { obj.add("transformation", this.transformation.serialize()); } + // One box serialises as an object, several as an array. Several is the point: a stair's two parts union + // to a full cube, so a single box gives it a full-block hitbox — which is what it had. + if (this.collisionBoxes != null && !this.collisionBoxes.isEmpty()) { + if (this.collisionBoxes.size() == 1) { + obj.add("collision_box", this.collisionBoxes.getFirst().serialize()); + } else { + JsonArray boxes = new JsonArray(); + for (Box box : this.collisionBoxes) boxes.add(box.serialize()); + obj.add("collision_box", boxes); + } + } + if (this.selectionBox != null) obj.add("selection_box", this.selectionBox.serialize()); return obj; } @@ -54,18 +80,51 @@ public static class Builder { private int lightDampening = 15; private boolean placeAir = true; private Transformation transformation = Transformation.IDENTITY; + private java.util.List collisionBoxes; + private Box selectionBox; + /** + * A solid cube, shaded like any vanilla block: face dimming and ambient occlusion on, which is what a + * non-light-emitting block gets in vanilla. Both have to be stated, because Geyser defaults them to + * {@code false} and a custom block without them looks flat beside its neighbours. + */ public Builder withFullBlockGeometry(String texture, String renderMethod) { - MaterialInstances instances = new MaterialInstances.Builder() - .withInstance("*", texture, renderMethod, true, true) - .build(); - this.geometry = new GeometryWithMaterials(new Geometry("minecraft:geometry.full_block"), instances); + return this.withFullBlockGeometry(texture, renderMethod, Map.of()); + } + + /** + * A solid cube whose faces may differ. + *

+ * {@code up}, {@code down}, {@code north}, {@code south}, {@code east} and {@code west} are material + * instance names Bedrock has built in, and a Java cube parent defines exactly those keys — so a log's end + * grain, a melon's top or a safe's front reach the right face directly. Without this every side wore one + * texture and a log was indistinguishable from bark-all-over wood. + * + * @param faceTextures per-face shortnames by Bedrock face name; any face left out falls back to + * {@code texture} + */ + public Builder withFullBlockGeometry(String texture, String renderMethod, Map faceTextures) { + MaterialInstances.Builder instances = new MaterialInstances.Builder() + .withInstance("*", texture, renderMethod, true, true); + for (Map.Entry face : faceTextures.entrySet()) { + if (face.getValue() == null || face.getValue().equals(texture)) continue; + instances.withInstance(face.getKey(), face.getValue(), renderMethod, true, true); + } + this.geometry = new GeometryWithMaterials( + new Geometry("minecraft:geometry.full_block"), instances.build()); return this; } - public Builder withCrossGeometry(String texture, String renderMethod) { + /** + * The two crossed planes vanilla uses for plants. + *

+ * Shading is deliberately off and the render method single-sided: {@code geometry.cross} flickers unless + * its faces are back-face culled, and shading a plane by which way it points makes one half of the cross + * darker than the other. This is the setup vanilla crops use. + */ + public Builder withCrossGeometry(String texture) { MaterialInstances instances = new MaterialInstances.Builder() - .withInstance("*", texture, renderMethod, true, true) + .withInstance("*", texture, "alpha_test_single_sided", false, false) .build(); this.geometry = new GeometryWithMaterials(new Geometry("minecraft:geometry.cross"), instances); return this; @@ -76,14 +135,70 @@ public Builder withCustomGeometry(String identifier, MaterialInstances instances return this; } + /** + * A state that renders nothing at all. + *

+ * This is how a pack hides the vanilla block a custom one is built on: it points that vanilla state at an + * empty model, and on Java the state draws nothing. Bedrock has no "no geometry" option, so the equivalent + * is a geometry with a bone and no cubes plus a fully transparent texture — the recipe in + * {@code bedrock-wiki/blocks/fake-blocks.md}. + *

+ * Every part of this matters. Without {@code light_dampening: 0} the invisible state still darkens the + * block below it; without the zero boxes it keeps whatever collision the overridden Java block had, so the + * player walks into thin air; and the instance needs {@code alpha_test} with dimming and ambient occlusion + * off, or the transparent texture is shaded and culls its neighbours' faces. + * + * @param geometryIdentifier a cubeless geometry, shared across every invisible state + * @param transparentTexture a shortname whose PNG is fully transparent + */ + public Builder withInvisibleGeometry(String geometryIdentifier, String transparentTexture) { + MaterialInstances instances = new MaterialInstances.Builder() + .withInstance("*", transparentTexture, "alpha_test", false, false) + .build(); + this.geometry = new GeometryWithMaterials(new Geometry(geometryIdentifier), instances); + this.lightDampening = 0; + Box none = new Box(0, 0, 0, 0, 0, 0); + this.collisionBoxes = java.util.List.of(none); + this.selectionBox = none; + return this; + } + public Builder withFriction(float f) { this.friction = Optional.of(f); return this; } public Builder withLightEmission(int v) { this.lightEmission = v; return this; } public Builder withLightDampening(int v) { this.lightDampening = v; return this; } public Builder noPlaceAir() { this.placeAir = false; return this; } public Builder withTransformation(Transformation t) { this.transformation = t; return this; } + /** + * What the player collides with and what the outline traces. Left unset, Geyser infers both from the + * overridden Java block, which is only right when the pack's model happens to be that block's shape — + * so a stair-shaped model on a stair keeps a full cube and an anvil keeps the vanilla anvil's box. + */ + public Builder withBoxes(java.util.List collision, Box selection) { + this.collisionBoxes = collision; + this.selectionBox = selection; + return this; + } + public BlockDefinition build() { - return new BlockDefinition(this.geometry, this.friction, this.lightEmission, this.lightDampening, this.placeAir, this.transformation); + return new BlockDefinition(this.geometry, this.friction, this.lightEmission, this.lightDampening, + this.placeAir, this.transformation, this.collisionBoxes, this.selectionBox); + } + } + + /** + * An axis-aligned box in block space: x and z centred on the block, y from its floor. + */ + public record Box(float originX, float originY, float originZ, float sizeX, float sizeY, float sizeZ) { + public JsonObject serialize() { + JsonObject obj = new JsonObject(); + JsonArray origin = new JsonArray(); + origin.add(this.originX); origin.add(this.originY); origin.add(this.originZ); + JsonArray size = new JsonArray(); + size.add(this.sizeX); size.add(this.sizeY); size.add(this.sizeZ); + obj.add("origin", origin); + obj.add("size", size); + return obj; } } @@ -122,12 +237,14 @@ public JsonObject serialize() { } public static class Builder { - private final Map instances = new HashMap<>(); + private final Map instances = new java.util.LinkedHashMap<>(); public Builder withInstance(String key, String texture, String renderMethod, boolean faceDimming, boolean ambientOcclusion) { this.instances.put(key, new Instance(texture, renderMethod, faceDimming, ambientOcclusion)); return this; } - public MaterialInstances build() { return new MaterialInstances(Map.copyOf(this.instances)); } + public MaterialInstances build() { + return new MaterialInstances(new java.util.LinkedHashMap<>(this.instances)); + } } public record Instance(String texture, String renderMethod, boolean faceDimming, boolean ambientOcclusion) { @@ -135,15 +252,15 @@ public JsonObject serialize() { JsonObject obj = new JsonObject(); if (this.texture != null) obj.addProperty("texture", this.texture); obj.addProperty("render_method", this.renderMethod); - if (!this.faceDimming) obj.addProperty("face_dimming", false); - if (!this.ambientOcclusion) obj.addProperty("ambient_occlusion", false); + obj.addProperty("face_dimming", this.faceDimming); + obj.addProperty("ambient_occlusion", this.ambientOcclusion); return obj; } } } public record Transformation(float sx, float sy, float sz, float tx, float ty, float tz, - int rx, int ry, int rz) { + int rx, int ry, int rz) { public static final Transformation IDENTITY = new Transformation(1, 1, 1, 0, 0, 0, 0, 0, 0); public boolean isIdentity() { return this.equals(IDENTITY); } public JsonObject serialize() { diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/asset/VanillaAssets.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/asset/VanillaAssets.java new file mode 100644 index 00000000..42572190 --- /dev/null +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/asset/VanillaAssets.java @@ -0,0 +1,125 @@ +package fr.robie.craftengineconverter.converter.bedrock.asset; + +import fr.robie.messageflow.logger.Logger; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.io.InputStream; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.StandardCopyOption; +import java.util.HashMap; +import java.util.Map; +import java.util.zip.ZipEntry; +import java.util.zip.ZipFile; + +/** + * Supplies the vanilla models and textures a pack inherits but does not ship. + *

+ * A pack's models almost never describe their own shape — they say + * {@code {"parent": "block/cactus", "textures": {...}}} and inherit it. Those parents live in the client jar, so + * without them the parent chain dead-ends and the model arrives with no geometry at all: a custom block's + * inventory icon becomes a flat square instead of a cube. The same gap hides vanilla textures a pack references, + * such as {@code item/light} and the armour trim overlays. + *

+ * Files are extracted from the jar one at a time, on first request. Only the handful a pack actually names + * are ever written, which keeps the cache small and — more importantly — lets every consumer keep working in + * terms of a {@link Path}, so nothing downstream has to learn about archives. + *

+ * The pack always takes precedence over this: callers consult it only after their own assets miss, so a pack that + * overrides a vanilla model or texture keeps doing so. + */ +public final class VanillaAssets { + + /** Where an asset lives inside a client jar or an extracted assets tree. */ + private static final String ASSETS_PREFIX = "assets/"; + + private final Path cacheDir; + @Nullable + private final Path source; + private final boolean sourceIsArchive; + + // Resolved paths by relative asset path; a miss is cached as null so a jar is not searched twice for + // something it does not have — with 84 models naming item/generated, that adds up. + private final Map resolved = new HashMap<>(); + + /** + * @param cacheDir where extracted files are written, normally + * {@code /vanilla-assets/} + * @param source an assets folder, a client jar, or a resource-pack zip; {@code null} disables lookup + */ + public VanillaAssets(@NotNull Path cacheDir, @Nullable Path source) { + this.cacheDir = cacheDir; + this.source = source; + this.sourceIsArchive = source != null && Files.isRegularFile(source); + } + + /** A {@code VanillaAssets} with nothing behind it, for when no source is configured or downloaded. */ + public static VanillaAssets empty(@NotNull Path cacheDir) { + return new VanillaAssets(cacheDir, null); + } + + public boolean isAvailable() { + return this.source != null && Files.exists(this.source); + } + + @Nullable + public Path source() { + return this.source; + } + + /** + * Resolves a vanilla asset. + * + * @param relativePath namespaced asset path such as {@code minecraft/models/block/cactus.json} — that is, the + * part after {@code assets/} + * @return a readable file, or {@code null} when this source does not have it + */ + @Nullable + public Path resolve(@NotNull String relativePath) { + if (!this.isAvailable()) return null; + if (this.resolved.containsKey(relativePath)) return this.resolved.get(relativePath); + + Path found = this.sourceIsArchive ? this.extractFromArchive(relativePath) : this.fromDirectory(relativePath); + this.resolved.put(relativePath, found); + return found; + } + + /** How many distinct assets have been pulled out of the source, for reporting. */ + public int resolvedCount() { + return (int) this.resolved.values().stream().filter(java.util.Objects::nonNull).count(); + } + + private Path fromDirectory(String relativePath) { + // A folder may be the assets tree itself or the directory containing it. + for (Path candidate : new Path[]{ + this.source.resolve(relativePath), + this.source.resolve(ASSETS_PREFIX + relativePath)}) { + if (Files.isRegularFile(candidate)) return candidate; + } + return null; + } + + private Path extractFromArchive(String relativePath) { + Path target = this.cacheDir.resolve(relativePath); + // Already pulled out by an earlier conversion — the cache survives restarts. + if (Files.isRegularFile(target)) return target; + + try (ZipFile zip = new ZipFile(this.source.toFile())) { + ZipEntry entry = zip.getEntry(ASSETS_PREFIX + relativePath); + // A resource pack zip has the assets prefix; an already-extracted-then-rezipped tree may not. + if (entry == null) entry = zip.getEntry(relativePath); + if (entry == null || entry.isDirectory()) return null; + + Files.createDirectories(target.getParent()); + try (InputStream in = zip.getInputStream(entry)) { + Files.copy(in, target, StandardCopyOption.REPLACE_EXISTING); + } + return target; + } catch (Exception e) { + Logger.warn("Could not read " + relativePath + " from " + this.source.getFileName() + + ": " + e.getMessage()); + return null; + } + } +} diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/block/BlockGeometryBuilder.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/block/BlockGeometryBuilder.java new file mode 100644 index 00000000..9eeb9478 --- /dev/null +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/block/BlockGeometryBuilder.java @@ -0,0 +1,229 @@ +package fr.robie.craftengineconverter.converter.bedrock.block; + +import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.block.BlockDefinition; +import fr.robie.craftengineconverter.converter.bedrock.geometry.BedrockGeometry; +import fr.robie.craftengineconverter.converter.bedrock.geometry.GeometryMapper; +import fr.robie.craftengineconverter.converter.bedrock.geometry.JavaBlockModel; +import fr.robie.messageflow.logger.Logger; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.ArrayList; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Locale; +import java.util.Set; +import java.util.function.Function; + +/** + * Turns a Java block model into Bedrock block geometry plus the material instances that texture it. + *

+ * Needed because Bedrock offers only three built-in block models — a full cube, a crossed plane, and a deprecated + * cube — so a slab, a stairway, an anvil or a torch can only keep its shape by shipping geometry of its own. + * Geyser's block mapping accepts any geometry identifier, and the resource pack carries the model, so this is the + * supported route rather than a workaround. + */ +public final class BlockGeometryBuilder { + + /** A custom block model may not exceed this on any axis. */ + private static final float MAX_SIZE = 30.0F; + + private static final float BLOCK_UNIT = 16.0F; + + /** Geyser's documented range for a collision box, which reaches above the block. */ + private static final float MAX_COLLISION_HEIGHT = 24.0F; + + private BlockGeometryBuilder() { + throw new UnsupportedOperationException("BlockGeometryBuilder is a utility class and cannot be instantiated."); + } + + /** + * @param geometry the model to write into the pack + * @param instances the material instances the mapping must declare alongside it + */ + public record Result(@NotNull BedrockGeometry geometry, @NotNull BlockDefinition.MaterialInstances instances) {} + + /** + * @param identifier geometry identifier, without the {@code geometry.} prefix; must contain no colon + * @param model the resolved Java model, which must have elements + * @param shortnameOf maps a Java texture variable ({@code "end"}) to its {@code terrain_texture.json} + * shortname; may return {@code null} when it cannot be resolved + * @param renderMethod one render method for every instance, as the format requires + * @param blockName used only in log messages + * @return the geometry and its materials, or {@code null} when this model cannot be represented — the caller + * should fall back to a full block + */ + @Nullable + public static Result build(@NotNull String identifier, @NotNull JavaBlockModel model, + @NotNull Function shortnameOf, @NotNull String renderMethod, + @NotNull String blockName, int rotX, int rotY) { + if (model.elements().isEmpty()) return null; + if (!withinLimits(model, blockName)) return null; + + Set instanceNames = new LinkedHashSet<>(); + BedrockGeometry geometry = new GeometryMapper() + .mapRotatedBlockGeometry(identifier, model, instanceNames, rotX, rotY); + if (geometry.hasNoCubes()) return null; + + for (var entry : model.display().entrySet()) { + geometry.withDisplay(entry.getKey(), entry.getValue()); + } + + BlockDefinition.MaterialInstances.Builder instances = new BlockDefinition.MaterialInstances.Builder(); + boolean any = false; + for (String name : instanceNames) { + String shortname = shortnameOf.apply(name); + if (shortname == null) continue; + // Face dimming and ambient occlusion on, matching a vanilla non-light-emitting block. + instances.withInstance(name, shortname, renderMethod, true, true); + any = true; + } + if (!any) return null; + + // "*" catches any face the model left without an instance, so a missing one cannot render untextured. + String fallback = firstResolvable(instanceNames, shortnameOf); + if (fallback != null) instances.withInstance("*", fallback, renderMethod, true, true); + + return new Result(geometry, instances.build()); + } + + /** A geometry identifier for a block. Colons are invalid in the format, so the namespace separator goes. */ + @NotNull + public static String identifierFor(@NotNull String bedrockBlockName) { + return "blocks." + bedrockBlockName.toLowerCase(Locale.ROOT) + .replace(':', '_') + .replace('/', '_') + .replaceAll("[^a-z0-9_.]", "_"); + } + + @Nullable + private static String firstResolvable(Set names, Function shortnameOf) { + for (String name : names) { + String shortname = shortnameOf.apply(name); + if (shortname != null) return shortname; + } + return null; + } + + /** + * Bedrock rejects a block model larger than 30 units on an axis, or one that does not reach into the block's + * own 16-unit cube. Checking here means a model that would be refused falls back to a full block with a + * readable reason, instead of producing a pack the client silently drops. + */ + private static boolean withinLimits(JavaBlockModel model, String blockName) { + float minX = Float.MAX_VALUE, minY = Float.MAX_VALUE, minZ = Float.MAX_VALUE; + float maxX = -Float.MAX_VALUE, maxY = -Float.MAX_VALUE, maxZ = -Float.MAX_VALUE; + + for (JavaBlockModel.Element element : model.elements()) { + minX = Math.min(minX, Math.min(element.fromX(), element.toX())); + minY = Math.min(minY, Math.min(element.fromY(), element.toY())); + minZ = Math.min(minZ, Math.min(element.fromZ(), element.toZ())); + maxX = Math.max(maxX, Math.max(element.fromX(), element.toX())); + maxY = Math.max(maxY, Math.max(element.fromY(), element.toY())); + maxZ = Math.max(maxZ, Math.max(element.fromZ(), element.toZ())); + } + + if (maxX - minX > MAX_SIZE || maxY - minY > MAX_SIZE || maxZ - minZ > MAX_SIZE) { + Logger.warn("Block " + blockName + " spans " + (maxX - minX) + "x" + (maxY - minY) + "x" + (maxZ - minZ) + + " units, past Bedrock's " + (int) MAX_SIZE + "-unit block model limit" + + " - falling back to a full block"); + return false; + } + + // The model has to reach into its own block, but not by any particular amount: a pressed pressure plate is + // half a unit tall and perfectly legal. Demanding a whole unit of overlap rejected it and left a solid cube + // underfoot. + if (overlapWithUnit(minX, maxX) <= 0 + || overlapWithUnit(minY, maxY) <= 0 + || overlapWithUnit(minZ, maxZ) <= 0) { + Logger.warn("Block " + blockName + " sits entirely outside its own block space on at least one axis," + + " which Bedrock does not allow - falling back to a full block"); + return false; + } + + return true; + } + + private static float overlapWithUnit(float min, float max) { + return Math.min(max, BLOCK_UNIT) - Math.max(min, 0.0F); + } + + /** + * The boxes for a model whose rotation has been baked into its cubes. + *

+ * Measured from the rotated model rather than from rotated boxes, so the box cannot disagree with the geometry: + * one rotation, done once, in {@link GeometryMapper#rotateModel}. Left unrotated, a trapdoor's hitbox stayed flat + * on the floor while the open door stood upright. + * + * @param rotX degrees about X from the blockstate variant + * @param rotY degrees about Y from the blockstate variant + */ + @NotNull + public static Boxes boxesFor(@NotNull JavaBlockModel model, int rotX, int rotY) { + return boxesFor(GeometryMapper.rotateModel(model, rotX, rotY)); + } + + /** + * The collision and selection boxes matching a model's own bounds. + *

+ * Geyser infers both from the host Java block when they are absent, which is the wrong shape whenever the + * pack's model is not that block: an anvil-shaped model on {@code minecraft:anvil} keeps the vanilla anvil's box, + * and a stair keeps a full cube. Both are expressed in the same block space as the geometry — x and z centred on + * the block, y from its floor — and clamped to the ranges Geyser documents so an oversized model still yields a + * legal box. + */ + @NotNull + public static Boxes boxesFor(@NotNull JavaBlockModel model) { + // One collision box per element, not one around all of them. A stair's slab and step union to the whole + // cube, so a single box gave every stair a full-block hitbox — which is what was reported. + List collision = new ArrayList<>(); + float minX = Float.MAX_VALUE, minY = Float.MAX_VALUE, minZ = Float.MAX_VALUE; + float maxX = -Float.MAX_VALUE, maxY = -Float.MAX_VALUE, maxZ = -Float.MAX_VALUE; + + for (JavaBlockModel.Element element : model.elements()) { + float ex0 = Math.min(element.fromX(), element.toX()); + float ey0 = Math.min(element.fromY(), element.toY()); + float ez0 = Math.min(element.fromZ(), element.toZ()); + float ex1 = Math.max(element.fromX(), element.toX()); + float ey1 = Math.max(element.fromY(), element.toY()); + float ez1 = Math.max(element.fromZ(), element.toZ()); + + // A zero-thickness element — a plant's sheet — has nothing to stand on. + if (ex1 > ex0 && ey1 > ey0 && ez1 > ez0) { + collision.add(box(ex0, ey0, ez0, ex1, ey1, ez1, MAX_COLLISION_HEIGHT)); + } + + minX = Math.min(minX, ex0); minY = Math.min(minY, ey0); minZ = Math.min(minZ, ez0); + maxX = Math.max(maxX, ex1); maxY = Math.max(maxY, ey1); maxZ = Math.max(maxZ, ez1); + } + + // The outline is a single box in Geyser's schema, so it stays the union. + BlockDefinition.Box selection = box(minX, minY, minZ, maxX, maxY, maxZ, BLOCK_UNIT); + return new Boxes(collision, selection); + } + + /** + * @param collision one box per solid element, so a shape made of several parts collides as those parts + * @param selection the union, because Geyser's {@code selection_box} takes only one + */ + public record Boxes(@NotNull List collision, @NotNull BlockDefinition.Box selection) {} + + /** @param maxHeight the top of the legal range on Y — 24 for a collision box, 16 for a selection box */ + private static BlockDefinition.Box box(float minX, float minY, float minZ, + float maxX, float maxY, float maxZ, float maxHeight) { + // x and z are centred on the block, matching the geometry; y already starts at the block floor. + float originX = clamp(minX - 8.0F, -8.0F, 8.0F); + float originY = clamp(minY, 0.0F, maxHeight); + float originZ = clamp(minZ - 8.0F, -8.0F, 8.0F); + + float sizeX = clamp(maxX - minX, 0.0F, 8.0F - originX); + float sizeY = clamp(maxY - minY, 0.0F, maxHeight - originY); + float sizeZ = clamp(maxZ - minZ, 0.0F, 8.0F - originZ); + + return new BlockDefinition.Box(originX, originY, originZ, sizeX, sizeY, sizeZ); + } + + private static float clamp(float value, float min, float max) { + return Math.max(min, Math.min(max, value)); + } +} diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/block/BlockStateMapper.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/block/BlockStateMapper.java index a89b1e2e..3022cbf7 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/block/BlockStateMapper.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/block/BlockStateMapper.java @@ -6,29 +6,79 @@ import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.block.BlockDefinition; import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.block.BlockMappingConfiguration; import fr.robie.craftengineconverter.api.manager.FileCacheManager; +import fr.robie.craftengineconverter.converter.bedrock.geometry.BedrockGeometry; +import fr.robie.craftengineconverter.converter.bedrock.geometry.GeometryMapper; import fr.robie.craftengineconverter.converter.bedrock.geometry.JavaBlockModel; +import fr.robie.craftengineconverter.converter.bedrock.geometry.JavaModelResolver; +import fr.robie.craftengineconverter.converter.bedrock.texture.TexturePipeline; import fr.robie.messageflow.logger.Logger; import java.io.File; -import java.io.IOException; import java.nio.file.Path; -import java.util.HashMap; +import java.util.ArrayList; +import java.util.Collections; import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.List; import java.util.Map; +import java.util.Set; public final class BlockStateMapper { + /** + * Texture variables to try for the block's default face, best first. + *

+ * {@code particle} comes last on purpose. It is nearly always an alias for another key ({@code #side}, + * {@code #front}), and having it second meant a log's side texture won every face and the block read as + * bark-all-over wood. {@code texture} and {@code pattern} are here because pressure plates and glazed + * terracotta name their only texture that way. + */ private static final String[] TEXTURE_KEYS = { - "all", "particle", "top", "side", "bottom", "end", "front", "back", "cross", "face" + "all", "side", "texture", "pattern", "top", "bottom", "end", "front", "back", "cross", "face", + "particle" }; - private final Map modelCache = new HashMap<>(); + /** Bedrock's built-in per-face material instance names, and the Java texture variable each takes. */ + private static final String[] FACE_KEYS = {"up", "down", "north", "south", "east", "west"}; + + /** The one cubeless geometry every invisible state shares; see {@link #isInvisible}. */ + private static final String EMPTY_GEOMETRY = "geometry.blocks.empty"; + + /** Brings an angle into 0-359, so a negated 90 reads as 270 rather than -90. */ + private static int normaliseAngle(int degrees) { + return ((degrees % 360) + 360) % 360; + } + + // Shared with the item pipeline, which is what gives blocks the vanilla parents a pack inherits but does not + // ship — block/cube_all, block/cactus, block/anvil. Without them a model arrives with no geometry at all. + private JavaModelResolver modelResolver = new JavaModelResolver(); + // Used only to ask whether a texture has see-through pixels, which decides the render method. + private TexturePipeline texturePipeline; private final Map pendingBlocks = new LinkedHashMap<>(); + // Geometry generated for blocks whose shape is neither a full cube nor a cross, by identifier. + private final Map generatedGeometry = new LinkedHashMap<>(); // texture ref ("namespace:path") -> the java assets dir it was discovered under. // The dir must be captured here because ConversionContext#javaAssetsDir is reassigned // for every pack layer and no longer points at this pack by the time save() runs. private final Map discoveredTextures = new LinkedHashMap<>(); private Path currentAssetsDir; + /** Lets blocks ask whether a texture has transparency, so the render method can follow it. */ + public BlockStateMapper withTexturePipeline(TexturePipeline texturePipeline) { + this.texturePipeline = texturePipeline; + return this; + } + + /** Shares the item pipeline's resolver, and with it the vanilla-asset fallback. */ + public BlockStateMapper withModelResolver(JavaModelResolver modelResolver) { + if (modelResolver != null) this.modelResolver = modelResolver; + return this; + } + + /** Block geometry generated for shapes Bedrock has no built-in model for, keyed by identifier. */ + public Map getGeneratedGeometry() { + return java.util.Collections.unmodifiableMap(this.generatedGeometry); + } + public void addFromBlockstatesDirectory(File blockstatesDir, String namespace, Path javaAssetsDir) { File[] files = blockstatesDir.listFiles(); if (files == null) return; @@ -38,22 +88,52 @@ public void addFromBlockstatesDirectory(File blockstatesDir, String namespace, P for (File file : files) { if (!file.isFile() || !file.getName().endsWith(".json")) continue; String blockName = file.getName().substring(0, file.getName().length() - 5); - String bedrockName = namespace + ":" + blockName; + // The Java block this entry overrides, which is the key Geyser looks the mapping up by. + String javaIdentifier = namespace + ":" + blockName; + String bedrockName = bedrockNameFor(namespace, blockName); FileCacheManager.getJsonCache().getData(file.toPath()).ifPresent(root -> { if (root.has("variants")) { - this.mapVariants(blockName, bedrockName, root.getAsJsonObject("variants"), javaAssetsDir); + this.mapVariants(blockName, javaIdentifier, bedrockName, + root.getAsJsonObject("variants"), javaAssetsDir); } else if (root.has("multipart")) { - this.mapMultipart(blockName, bedrockName, root.getAsJsonArray("multipart"), javaAssetsDir); + this.mapMultipart(blockName, javaIdentifier, bedrockName, + root.getAsJsonArray("multipart"), javaAssetsDir); } }); } } - private void mapVariants(String blockName, String bedrockName, JsonObject variants, Path javaAssetsDir) { + /** + * The name of the custom block Geyser registers on the Bedrock side, which is not the Java identifier. + *

+ * Geyser prefixes this with {@code geyser_custom:}, so a name that already carries a namespace produces + * {@code geyser_custom:minecraft:anvil} - two colons, which is not a valid Bedrock identifier. The client then + * fails to register the block and every geometry component on it reports its geometry as a missing asset, which + * is what took the client down: 416 {@code [Blocks][error]} lines and a crash mid-write, plus + * {@code Invalid aux value in item ID} and a name conflict with the vanilla item of the same name. + *

+ * The namespace is folded in with an underscore rather than dropped, so two namespaces defining the same block + * name stay distinct. + */ + private static String bedrockNameFor(String namespace, String blockName) { + return sanitiseIdentifier(namespace + "_" + blockName); + } + + /** Bedrock accepts lower-case alphanumerics and underscores in an identifier, and nothing else. */ + private static String sanitiseIdentifier(String raw) { + StringBuilder out = new StringBuilder(raw.length()); + for (char c : raw.toLowerCase(java.util.Locale.ROOT).toCharArray()) { + out.append((c >= 'a' && c <= 'z') || (c >= '0' && c <= '9') ? c : '_'); + } + return out.toString(); + } + + private void mapVariants(String blockName, String javaIdentifier, String bedrockName, + JsonObject variants, Path javaAssetsDir) { BlockMappingConfiguration.BlockEntry.Builder builder = - this.pendingBlocks.computeIfAbsent(bedrockName, - k -> new BlockMappingConfiguration.BlockEntry.Builder(k)); + this.pendingBlocks.computeIfAbsent(javaIdentifier, + k -> new BlockMappingConfiguration.BlockEntry.Builder(bedrockName)); boolean hasMultipleStates = variants.keySet().size() > 1; for (String stateKey : variants.keySet()) { @@ -67,20 +147,195 @@ private void mapVariants(String blockName, String bedrockName, JsonObject varian } } - private void mapMultipart(String blockName, String bedrockName, JsonArray multipart, Path javaAssetsDir) { + private void mapMultipart(String blockName, String javaIdentifier, String bedrockName, + JsonArray multipart, Path javaAssetsDir) { BlockMappingConfiguration.BlockEntry.Builder builder = - this.pendingBlocks.computeIfAbsent(bedrockName, - k -> new BlockMappingConfiguration.BlockEntry.Builder(k)); + this.pendingBlocks.computeIfAbsent(javaIdentifier, + k -> new BlockMappingConfiguration.BlockEntry.Builder(bedrockName)); + + Map> properties = collectProperties(multipart); + + if (properties.isEmpty()) { + JavaBlockModel merged = mergeApplicableParts(multipart, Map.of(), blockName, javaAssetsDir); + if (merged != null) { + BlockDefinition def = resolveLoadedModelToDefinition(merged, blockName, blockName); + if (def != null) builder.withBase(def); + } + return; + } + + List> states = enumerateStates(properties); + builder.onlyOverrideStates(); + + for (Map state : states) { + JavaBlockModel merged = mergeApplicableParts(multipart, state, blockName, javaAssetsDir); + if (merged == null) continue; + + String stateKey = stateKey(state); + BlockDefinition def = resolveLoadedModelToDefinition( + merged, blockName, blockName + "_" + stateKey.replace(',', '_').replace('=', '_')); + if (def != null) builder.withStateOverride(stateKey, def); + } + } + + private JavaBlockModel mergeApplicableParts(JsonArray multipart, Map state, + String blockName, Path javaAssetsDir) { + JavaBlockModel merged = null; for (JsonElement partElem : multipart) { if (!partElem.isJsonObject()) continue; JsonObject part = partElem.getAsJsonObject(); if (!part.has("apply")) continue; - BlockDefinition def = this.resolveVariantToDefinition(part.get("apply"), blockName, javaAssetsDir); - if (def != null) { - builder.withBase(def); - break; + if (!partMatches(part, state)) continue; + + JsonElement apply = part.get("apply"); + String modelPath; + int rotX = 0, rotY = 0; + if (apply.isJsonArray()) { + JsonObject best = pickHighestWeight(apply.getAsJsonArray()); + if (best == null) continue; + modelPath = best.get("model").getAsString(); + if (best.has("x")) rotX = best.get("x").getAsInt(); + if (best.has("y")) rotY = best.get("y").getAsInt(); + } else if (apply.isJsonObject()) { + JsonObject obj = apply.getAsJsonObject(); + if (!obj.has("model")) continue; + modelPath = obj.get("model").getAsString(); + if (obj.has("x")) rotX = obj.get("x").getAsInt(); + if (obj.has("y")) rotY = obj.get("y").getAsInt(); + } else { + continue; + } + + JavaBlockModel partModel; + try { + partModel = this.modelResolver.load(modelPath, javaAssetsDir); + } catch (Exception e) { + Logger.warn("Failed to load model " + modelPath + " for multipart block " + blockName); + continue; + } + if (partModel == null) continue; + + if (rotX != 0 || rotY != 0) { + partModel = GeometryMapper.rotateModel(partModel, rotX, rotY); + } + + if (merged == null) { + merged = new JavaBlockModel(partModel.parent().orElse(null), partModel.ambientOcclusion()); + partModel.textures().forEach(merged::addTexture); + partModel.elements().forEach(merged::addElement); + partModel.display().forEach(merged::addDisplay); + } else { + partModel.elements().forEach(merged::addElement); + partModel.textures().forEach(merged.textures()::putIfAbsent); + partModel.display().forEach(merged.display()::putIfAbsent); + } + } + return merged; + } + + private static JsonObject pickHighestWeight(JsonArray arr) { + JsonObject best = null; + int bestWeight = -1; + for (JsonElement e : arr) { + if (!e.isJsonObject()) continue; + JsonObject candidate = e.getAsJsonObject(); + if (!candidate.has("model")) continue; + int w = candidate.has("weight") ? candidate.get("weight").getAsInt() : 1; + if (w > bestWeight) { best = candidate; bestWeight = w; } + } + return best; + } + + private static Map> collectProperties(JsonArray multipart) { + Map> properties = new LinkedHashMap<>(); + for (JsonElement partElem : multipart) { + if (!partElem.isJsonObject()) continue; + JsonObject part = partElem.getAsJsonObject(); + if (!part.has("when")) continue; + JsonObject when = part.getAsJsonObject("when"); + if (when.has("OR")) { + for (JsonElement orElem : when.getAsJsonArray("OR")) { + if (orElem.isJsonObject()) collectConditionProperties(orElem.getAsJsonObject(), properties); + } + } else { + collectConditionProperties(when, properties); + } + } + return properties; + } + + private static void collectConditionProperties(JsonObject condition, Map> properties) { + for (String key : condition.keySet()) { + String value = condition.get(key).getAsString(); + Set values = properties.computeIfAbsent(key, k -> new LinkedHashSet<>()); + for (String v : value.split("\\|")) { + values.add(v); + } + } + } + + private static List> enumerateStates(Map> properties) { + List keys = new ArrayList<>(properties.keySet()); + Collections.sort(keys); + List> valueLists = new ArrayList<>(); + for (String key : keys) { + valueLists.add(new ArrayList<>(properties.get(key))); + } + + List> result = new ArrayList<>(); + int[] indices = new int[keys.size()]; + while (true) { + Map state = new LinkedHashMap<>(); + for (int i = 0; i < keys.size(); i++) { + state.put(keys.get(i), valueLists.get(i).get(indices[i])); + } + result.add(state); + + int carry = keys.size() - 1; + while (carry >= 0) { + indices[carry]++; + if (indices[carry] < valueLists.get(carry).size()) break; + indices[carry] = 0; + carry--; + } + if (carry < 0) break; + } + return result; + } + + private static boolean partMatches(JsonObject part, Map state) { + if (!part.has("when")) return true; + JsonObject when = part.getAsJsonObject("when"); + if (when.has("OR")) { + for (JsonElement orElem : when.getAsJsonArray("OR")) { + if (orElem.isJsonObject() && conditionMatches(orElem.getAsJsonObject(), state)) return true; + } + return false; + } + return conditionMatches(when, state); + } + + private static boolean conditionMatches(JsonObject condition, Map state) { + for (String key : condition.keySet()) { + String required = condition.get(key).getAsString(); + String actual = state.get(key); + if (actual == null) return false; + boolean matched = false; + for (String alt : required.split("\\|")) { + if (alt.equals(actual)) { matched = true; break; } } + if (!matched) return false; } + return true; + } + + private static String stateKey(Map state) { + StringBuilder sb = new StringBuilder(); + for (Map.Entry e : state.entrySet()) { + if (sb.length() > 0) sb.append(','); + sb.append(e.getKey()).append('=').append(e.getValue()); + } + return sb.toString(); } private BlockDefinition resolveVariantToDefinition(JsonElement varEntry, String blockName, Path javaAssetsDir) { @@ -88,13 +343,11 @@ private BlockDefinition resolveVariantToDefinition(JsonElement varEntry, String int rotX = 0, rotY = 0; if (varEntry.isJsonArray()) { - JsonArray arr = varEntry.getAsJsonArray(); - if (arr.isEmpty()) return null; - JsonObject first = arr.get(0).getAsJsonObject(); - if (!first.has("model")) return null; - modelPath = first.get("model").getAsString(); - if (first.has("x")) rotX = first.get("x").getAsInt(); - if (first.has("y")) rotY = first.get("y").getAsInt(); + JsonObject best = pickHighestWeight(varEntry.getAsJsonArray()); + if (best == null) return null; + modelPath = best.get("model").getAsString(); + if (best.has("x")) rotX = best.get("x").getAsInt(); + if (best.has("y")) rotY = best.get("y").getAsInt(); } else if (varEntry.isJsonObject()) { JsonObject obj = varEntry.getAsJsonObject(); if (!obj.has("model")) return null; @@ -109,13 +362,12 @@ private BlockDefinition resolveVariantToDefinition(JsonElement varEntry, String } private BlockDefinition resolveModelToDefinition(String modelPath, String blockName, int rotX, int rotY, - Path javaAssetsDir) { + Path javaAssetsDir) { try { - JavaBlockModel model = this.loadModel(modelPath, javaAssetsDir); + JavaBlockModel model = this.modelResolver.load(modelPath, javaAssetsDir); if (model == null) return null; - BlockDefinition.Builder builder = new BlockDefinition.Builder() - .withTransformation(new BlockDefinition.Transformation(1, 1, 1, 0, 0, 0, rotX, rotY, 0)); + BlockDefinition.Builder builder = new BlockDefinition.Builder(); String resolvedTexture = null; for (String key : TEXTURE_KEYS) { @@ -131,14 +383,28 @@ private BlockDefinition resolveModelToDefinition(String modelPath, String blockN } if (resolvedTexture == null) resolvedTexture = blockName; - if (this.isFullBlock(model)) { - builder.withFullBlockGeometry(resolvedTexture, "opaque"); - } else if (this.isCrossModel(model)) { - builder.withCrossGeometry(resolvedTexture, "blend"); - } else if (model.elements().isEmpty()) { - builder.withFullBlockGeometry(resolvedTexture, "opaque"); - } else { - builder.withCrossGeometry(resolvedTexture, "blend"); + // A texture with see-through pixels rendered as "opaque" shows them solid, so leaves and the like need + // alpha testing. One method has to serve every instance of the block, which is why it is decided here. + String renderMethod = this.hasTransparency(model) ? "alpha_test" : "opaque"; + + // Shape decides the geometry, measured rather than counted. Counting elements only ever worked + // because models used to arrive unresolved: a stairway has two elements just as a cross does. + // Before the shape ladder: a model that draws nothing has no shape to measure, and measuring it anyway + // ends in the full-cube fallback — a solid block where the pack asked for nothing. + if (isInvisible(model)) { + this.applyInvisibleGeometry(builder, resolvedTexture); + } else if (isFullCube(model) && canUseUnitCube(model)) { + builder.withFullBlockGeometry(resolvedTexture, renderMethod, + this.faceTextures(model, rotX, rotY)); + } else if (isAllPlanar(model)) { + // Two or more flat sheets: the cross vanilla uses for plants. A quarter turn maps a cross onto + // itself, so the variant's rotation has nothing left to do. + builder.withCrossGeometry(resolvedTexture); + } else if (!this.applyGeneratedGeometry(builder, model, modelPath, blockName, renderMethod, + normaliseAngle(rotX), normaliseAngle(rotY))) { + // Its true shape could not be represented, so a solid cube is the least wrong stand-in. + builder.withFullBlockGeometry(resolvedTexture, renderMethod, + this.faceTextures(model, rotX, rotY)); } return builder.build(); @@ -148,74 +414,227 @@ private BlockDefinition resolveModelToDefinition(String modelPath, String blockN } } - private JavaBlockModel loadModel(String modelPath, Path javaAssetsDir) { - if (this.modelCache.containsKey(modelPath)) { - return this.modelCache.get(modelPath); - } + private BlockDefinition resolveLoadedModelToDefinition(JavaBlockModel model, String blockName, + String identifierHint) { + try { + BlockDefinition.Builder builder = new BlockDefinition.Builder(); + + String resolvedTexture = null; + for (String key : TEXTURE_KEYS) { + resolvedTexture = this.resolveTexture(model, key); + if (resolvedTexture != null) break; + } + if (resolvedTexture == null) { + for (String tex : model.textures().values()) { + resolvedTexture = this.resolveTextureRef(model, tex); + if (resolvedTexture != null) break; + } + } + if (resolvedTexture == null) resolvedTexture = blockName; - int colon = modelPath.indexOf(':'); - String ns = colon >= 0 ? modelPath.substring(0, colon) : "minecraft"; - String path = colon >= 0 ? modelPath.substring(colon + 1) : modelPath; - Path modelFile = javaAssetsDir.resolve(ns + "/models/" + path + ".json"); + String renderMethod = this.hasTransparency(model) ? "alpha_test" : "opaque"; + + if (isInvisible(model)) { + this.applyInvisibleGeometry(builder, resolvedTexture); + } else if (isFullCube(model)) { + builder.withFullBlockGeometry(resolvedTexture, renderMethod, + this.faceTextures(model, 0, 0)); + } else if (isAllPlanar(model)) { + builder.withCrossGeometry(resolvedTexture); + } else if (!this.applyGeneratedGeometry(builder, model, identifierHint, blockName, renderMethod, 0, 0)) { + builder.withFullBlockGeometry(resolvedTexture, renderMethod, + this.faceTextures(model, 0, 0)); + } - if (!modelFile.toFile().exists()) { - this.modelCache.put(modelPath, null); + return builder.build(); + } catch (Exception e) { + Logger.warn("Failed to resolve merged model for block " + blockName); return null; } + } - try { - JavaBlockModel model = JavaBlockModel.load(modelFile); - this.resolveParent(model, javaAssetsDir); - this.modelCache.put(modelPath, model); - return model; - } catch (IOException e) { - this.modelCache.put(modelPath, null); - return null; + /** + * The texture each face of a cube should show, by Bedrock face name. + *

+ * Java's cube parents resolve exactly these keys — {@code cube_column} binds {@code up}/{@code down} to its end + * grain and the four sides to its bark, {@code cube} binds all six separately — and Bedrock has material + * instances of the same names built in, so the two line up without a translation table. Reading them is the + * difference between a log and a featureless bark cube. + */ + private Map faceTextures(JavaBlockModel model, int rotX, int rotY) { + Map faces = new LinkedHashMap<>(); + for (String face : FACE_KEYS) { + String texture = this.resolveTexture(model, face); + // A turned cube is still a cube: the variant's rotation only decides which face wears which texture, so + // it is applied here instead of as a transformation. That avoids guessing whether Bedrock's rotation + // runs the same way round as Java's - a wrong guess is a 180-degree error on exactly two facings, and + // shows a mushroom block's or an anvil's back. + if (texture != null) faces.put(GeometryMapper.rotatedDirection(face, rotX, rotY), texture); } + return faces; } - private void resolveParent(JavaBlockModel model, Path javaAssetsDir) { - if (model.parent().isEmpty()) return; - String parentPath = model.parent().get(); - if (this.modelCache.containsKey(parentPath)) { - JavaBlockModel parent = this.modelCache.get(parentPath); - if (parent != null) this.inheritModel(model, parent); - return; + /** Whether any texture this model uses has see-through pixels. */ + private boolean hasTransparency(JavaBlockModel model) { + if (this.texturePipeline == null || this.currentAssetsDir == null) return false; + for (String ref : model.textures().values()) { + if (ref == null || ref.startsWith("#")) continue; + if (this.texturePipeline.hasTransparency(ref, this.currentAssetsDir)) return true; } + return false; + } - int colon = parentPath.indexOf(':'); - String ns = colon >= 0 ? parentPath.substring(0, colon) : "minecraft"; - String path = colon >= 0 ? parentPath.substring(colon + 1) : parentPath; - Path parentFile = javaAssetsDir.resolve(ns + "/models/" + path + ".json"); + /** + * Gives the block geometry of its own, for a shape Bedrock has no built-in model for — a slab, a stairway, an + * anvil, a torch. + * + * @return whether geometry was produced; {@code false} means the caller should fall back to a full block + */ + /** + * Points a state at the shared geometry that renders nothing, registering it on first use. + *

+ * One geometry serves every invisible state in the pack — it describes nothing, so there is nothing to vary — + * and it goes through the same {@code generatedGeometry} map as every other generated shape, which is what gets + * it written to {@code models/blocks/}. + *

+ * It carries one zero-volume cube rather than no cubes at all. Bedrock derives a block geometry's bounds + * from its cubes and then checks them against the unit cube, so a cubeless geometry has nothing to measure and + * is rejected outright: + *

+     * Schematic 'geometry.blocks.empty' is not included within the unit cube on axis x.
+     * Error with geometry component: cannot find geometry.blocks.empty geometry JSON.
+     * 
+ * A cube of zero size at the block's own origin measures as a point inside the unit cube, so the check passes, + * and having no area it draws nothing — which is the whole intent. + */ + private void applyInvisibleGeometry(BlockDefinition.Builder builder, String transparentTexture) { + this.generatedGeometry.computeIfAbsent(EMPTY_GEOMETRY.substring("geometry.".length()), identifier -> { + // BedrockGeometry's constructor adds the "geometry." prefix, so the key and the identifier agree. + BedrockGeometry empty = new BedrockGeometry(identifier) + // Every vanilla block geometry declares its texture size; without it the client has no UV space + // to resolve the cube's uv against. + .withTextureWidth(16) + .withTextureHeight(16); + empty.addBone("bone").addCube(0, 0, 0, 0, 0, 0); + return empty; + }); + builder.withInvisibleGeometry(EMPTY_GEOMETRY, transparentTexture); + } - if (!parentFile.toFile().exists()) { - this.modelCache.put(parentPath, null); - return; - } + private boolean applyGeneratedGeometry(BlockDefinition.Builder builder, JavaBlockModel model, + String modelPath, String blockName, String renderMethod, + int rotX, int rotY) { + // Named after the model, not the block. One host block's states routinely use different models — three + // pebble models all sit on minecraft:tripwire — so keying on the block name made them share one geometry + // file and left every state wearing the last one's shape. + // Keyed by rotation as well as model: the same stair at y=90 and y=180 are now different geometry, because + // the turn is baked into the cubes rather than applied by the mapping. + String identifier = BlockGeometryBuilder.identifierFor(modelPath) + + (rotX == 0 && rotY == 0 ? "" : "_x" + rotX + "y" + rotY); + BlockGeometryBuilder.Result result = BlockGeometryBuilder.build( + identifier, model, key -> this.resolveTexture(model, key), renderMethod, blockName, rotX, rotY); + if (result == null) return false; + + this.generatedGeometry.put(identifier, result.geometry()); + // No transformation: the rotation is in the cubes, and applying it again would turn the block twice. + builder.withCustomGeometry("geometry." + identifier, result.instances()); + + // Only for a shape of our own. A full cube and a cross already match what the host block implies, whereas an + // anvil or a stair on its host keeps that block's box and stands visibly apart from what is drawn. + // The same rotation the cubes were baked with, so the box lands where the model is drawn. + BlockGeometryBuilder.Boxes boxes = BlockGeometryBuilder.boxesFor(model, rotX, rotY); + builder.withBoxes(boxes.collision(), boxes.selection()); + return true; + } - try { - JavaBlockModel parent = JavaBlockModel.load(parentFile); - this.resolveParent(parent, javaAssetsDir); - this.inheritModel(model, parent); - this.modelCache.put(parentPath, parent); - } catch (IOException e) { - this.modelCache.put(parentPath, null); + /** + * Whether this model draws nothing, which is a state a pack asks for deliberately. + *

+ * Hiding the vanilla block a custom one is built on is done by pointing that vanilla state at an empty model — + * the sample pack sends {@code sugar_cane} {@code age=4} to {@code minecraft:block/empty}. Java draws nothing; + * Bedrock needs to be told, and there was no branch for it: an empty model fell all the way through the shape + * ladder into the full-cube fallback, so the state came out as a solid block. With a transparent texture + * that was merely mostly-invisible — it still dampened light and kept a collision box — and for a pack whose + * empty model names no texture at all the fallback reached the block's own name and produced an opaque cube. + *

+ * The signal is a degenerate element: {@code from == to} on some axis with zero-area UVs, which measures + * as a real element but covers nothing. That is what packs actually ship — {@code block/empty} is one such + * element with all six faces at {@code uv [0,0,0,0]}. + *

+ * A model with no elements at all deliberately does not count, even though it also draws nothing. It is + * indistinguishable from a model whose {@code parent} failed to resolve, and a missing asset must not make + * blocks disappear — that case keeps the full-cube fallback, which is what + * {@code BlockStateMapperShapeTest.aModelThatResolvesToNothingStillMapsToAFullBlock} pins. + */ + private static boolean isInvisible(JavaBlockModel model) { + if (model.elements().isEmpty()) return false; + + for (JavaBlockModel.Element element : model.elements()) { + boolean flat = element.fromX() == element.toX() + || element.fromY() == element.toY() + || element.fromZ() == element.toZ(); + if (!flat) return false; + // A zero-thickness element is still a visible sheet unless its faces sample nothing either — that is + // what separates block/empty from block/cross. + for (JavaBlockModel.Face face : element.faces()) { + if (face.u0() != face.u1() || face.v0() != face.v1()) return false; + } } + return true; } - private void inheritModel(JavaBlockModel child, JavaBlockModel parent) { - for (Map.Entry tex : parent.textures().entrySet()) { - String childTex = child.textures().get(tex.getKey()); - if (childTex == null) { - child.textures().put(tex.getKey(), tex.getValue()); - } else if (childTex.startsWith("#")) { - String resolved = this.resolveVariableReference(child, tex.getValue()); - child.textures().put(tex.getKey(), resolved != null ? resolved : tex.getValue()); - } + /** One element filling the whole block: the shape {@code minecraft:geometry.full_block} already is. */ + private static boolean isFullCube(JavaBlockModel model) { + if (model.elements().size() != 1) return false; + var el = model.elements().getFirst(); + return el.fromX() == 0 && el.fromY() == 0 && el.fromZ() == 0 + && el.toX() == 16 && el.toY() == 16 && el.toZ() == 16; + } + + /** + * Whether {@code minecraft:geometry.full_block} can actually say everything this model says. + *

+ * Being a full cube is not enough. Bedrock's built-in unit cube maps each face to its whole texture at rotation + * zero, and {@code material_instances} only chooses which texture a face uses — never how it is + * oriented or which part of it is sampled. Three things it therefore cannot express: + *

    + *
  • A per-face {@code rotation}. This is the entire visual identity of the glazed-terracotta family: + * {@code template_glazed_terracotta} turns its four sides by 90/270/0/180, and a chessboard mapped onto a + * unit cube comes out with the pattern facing the wrong way on most of its faces.
  • + *
  • Partial UVs. A face sampling a region of an atlas rather than the whole image.
  • + *
  • A {@code display} block. Bedrock renders a custom block in hand and in the inventory from the + * block's own geometry, posed by {@code item_display_transforms} — and a unit-cube block has no geometry + * file for those to live in, so the pose is simply lost.
  • + *
+ * Anything in that list routes to generated geometry instead, which already emits {@code uv_rotation}, real + * per-face UVs and {@code item_display_transforms}. A plain cube keeps the cheaper built-in shape. + */ + private static boolean canUseUnitCube(JavaBlockModel model) { + if (!model.display().isEmpty()) return false; + if (model.elements().isEmpty()) return true; + if (!isFullCube(model)) return false; + + for (JavaBlockModel.Face face : model.elements().getFirst().faces()) { + if (face.rotation() % 360 != 0) return false; + boolean wholeTexture = face.u0() == 0 && face.v0() == 0 + && face.u1() == JavaBlockModel.UV_SPACE && face.v1() == JavaBlockModel.UV_SPACE; + if (!wholeTexture) return false; } - if (child.elements().isEmpty() && !parent.elements().isEmpty()) { - for (var el : parent.elements()) child.addElement(el); + return true; + } + + /** + * Whether every element is a flat sheet — zero thickness on some axis. That, not a count of two, is what makes + * a model the crossed-planes shape: vanilla's {@code cross} and {@code sugar_cane} are two sheets, while + * {@code stairs} is two solid boxes. + */ + private static boolean isAllPlanar(JavaBlockModel model) { + if (model.elements().size() < 2) return false; + for (JavaBlockModel.Element el : model.elements()) { + boolean planar = el.fromX() == el.toX() || el.fromY() == el.toY() || el.fromZ() == el.toZ(); + if (!planar) return false; } + return true; } // Looks up a texture variable key in the model's textures map, then resolves the value. @@ -250,27 +669,6 @@ public Map getDiscoveredTextures() { return java.util.Collections.unmodifiableMap(this.discoveredTextures); } - private String resolveVariableReference(JavaBlockModel model, String value) { - if (value == null) return null; - if (value.startsWith("#")) { - String resolved = model.textures().get(value.substring(1)); - if (resolved != null && !resolved.startsWith("#")) return resolved; - return null; - } - return value; - } - - private boolean isFullBlock(JavaBlockModel model) { - if (model.elements().size() != 1) return false; - var el = model.elements().getFirst(); - return el.fromX() == 0 && el.fromY() == 0 && el.fromZ() == 0 - && el.toX() == 16 && el.toY() == 16 && el.toZ() == 16; - } - - private boolean isCrossModel(JavaBlockModel model) { - return model.elements().size() == 2; - } - public boolean isEmpty() { return pendingBlocks.isEmpty(); } diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/display/DisplayPresets.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/display/DisplayPresets.java new file mode 100644 index 00000000..65f864fe --- /dev/null +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/display/DisplayPresets.java @@ -0,0 +1,162 @@ +package fr.robie.craftengineconverter.converter.bedrock.display; + +import fr.robie.craftengineconverter.converter.bedrock.geometry.DisplayContext; +import fr.robie.craftengineconverter.converter.bedrock.geometry.JavaBlockModel; + +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.Locale; +import java.util.Map; + +/** + * The {@code display} blocks that vanilla's model parents supply, rebuilt from their names. + *

+ * Almost no custom model writes its own {@code display}. A tool says {@code {"parent": "item/handheld"}} and + * inherits the pose; a block-shaped item says {@code {"parent": "block/block"}}. Those parents live in the game + * jar, so when the vanilla assets have not been cached the parent chain dead-ends and the model arrives with no + * pose at all — every item then falls back to one hardcoded default and a sword is held like a brick. This is the + * pose counterpart to {@link fr.robie.craftengineconverter.converter.bedrock.geometry.VanillaBlockShapes}, which + * does the same job for the missing shape. + *

+ * Values are Blockbench's {@code display_presets} table verbatim, which is in turn vanilla's + * {@code item/generated}, {@code item/handheld}, {@code item/handheld_rod} and {@code block/block}. Taking them + * from Blockbench rather than transcribing them from the jar keeps one reference for the whole conversion. + *

+ * Presets are layered, because vanilla's parents are: {@code item/handheld} extends + * {@code item/generated}, so a handheld model's {@code ground} and {@code fixed} poses come from the generated + * preset. {@code forParent} returns the merged result. + */ +public final class DisplayPresets { + + /** {@code item/generated} — the flat sprite every plain item inherits. It declares no {@code gui} pose. */ + private static final Map ITEM = table( + entry(DisplayContext.GROUND, rot(0, 0, 0), tr(0, 2, 0), scale(0.5F)), + entry(DisplayContext.HEAD, rot(0, 180, 0), tr(0, 13, 7), scale(1.0F)), + entry(DisplayContext.FIXED, rot(0, 180, 0), tr(0, 0, 0), scale(1.0F)), + entry(DisplayContext.THIRD_PERSON_RIGHT, rot(0, 0, 0), tr(0, 3, 1), scale(0.55F)), + entry(DisplayContext.THIRD_PERSON_LEFT, rot(0, 0, 0), tr(0, 3, 1), scale(0.55F)), + entry(DisplayContext.FIRST_PERSON_RIGHT, rot(0, -90, 25), tr(1.13F, 3.2F, 1.13F), scale(0.68F)), + entry(DisplayContext.FIRST_PERSON_LEFT, rot(0, -90, 25), tr(1.13F, 3.2F, 1.13F), scale(0.68F))); + + /** {@code item/handheld} — tools and weapons, laid along the hand. */ + private static final Map HANDHELD = table( + entry(DisplayContext.THIRD_PERSON_RIGHT, rot(0, -90, 55), tr(0, 4.0F, 0.5F), scale(0.85F)), + entry(DisplayContext.THIRD_PERSON_LEFT, rot(0, 90, -55), tr(0, 4.0F, 0.5F), scale(0.85F)), + entry(DisplayContext.FIRST_PERSON_RIGHT, rot(0, -90, 25), tr(1.13F, 3.2F, 1.13F), scale(0.68F)), + entry(DisplayContext.FIRST_PERSON_LEFT, rot(0, 90, -25), tr(1.13F, 3.2F, 1.13F), scale(0.68F))); + + /** {@code item/handheld_rod} — fishing rods and carrot-on-a-stick, gripped at the near end. */ + private static final Map ROD = table( + entry(DisplayContext.THIRD_PERSON_RIGHT, rot(0, 90, 55), tr(0, 4.0F, 2.5F), scale(0.85F)), + entry(DisplayContext.THIRD_PERSON_LEFT, rot(0, -90, -55), tr(0, 4.0F, 2.5F), scale(0.85F)), + entry(DisplayContext.FIRST_PERSON_RIGHT, rot(0, 90, 25), tr(0, 1.6F, 0.8F), scale(0.68F)), + entry(DisplayContext.FIRST_PERSON_LEFT, rot(0, -90, -25), tr(0, 1.6F, 0.8F), scale(0.68F))); + + /** {@code block/block} — the three-quarter view a block-shaped item is shown in. */ + private static final Map BLOCK = table( + entry(DisplayContext.GUI, rot(30, 225, 0), tr(0, 0, 0), scale(0.625F)), + entry(DisplayContext.GROUND, rot(0, 0, 0), tr(0, 3, 0), scale(0.25F)), + entry(DisplayContext.FIXED, rot(0, 0, 0), tr(0, 0, 0), scale(0.5F)), + entry(DisplayContext.THIRD_PERSON_RIGHT, rot(75, 45, 0), tr(0, 2.5F, 0), scale(0.375F)), + entry(DisplayContext.THIRD_PERSON_LEFT, rot(75, 45, 0), tr(0, 2.5F, 0), scale(0.375F)), + entry(DisplayContext.FIRST_PERSON_RIGHT, rot(0, 45, 0), tr(0, 0, 0), scale(0.40F)), + entry(DisplayContext.FIRST_PERSON_LEFT, rot(0, 225, 0), tr(0, 0, 0), scale(0.40F))); + + private DisplayPresets() { + throw new UnsupportedOperationException("DisplayPresets is a utility class and cannot be instantiated."); + } + + /** + * The {@code display} block the named vanilla parent would have supplied, or an empty map when the name is not + * one this recognises. + *

+ * Matched on the name rather than looked up exactly, because vanilla has dozens of leaf parents that all + * inherit the same pose — every {@code block/cube_*}, {@code block/orientable*} and the rest extend + * {@code block/block}, and {@code item/handheld_mace} extends {@code item/handheld}. Order matters: the rod + * test has to come before the plain handheld one, since {@code item/handheld_rod} starts with + * {@code item/handheld}. + */ + public static Map forParent(String parent) { + if (parent == null) return Map.of(); + String name = normalise(parent); + + if (name.startsWith("item/handheld_rod")) return layered(ITEM, ROD); + if (name.startsWith("item/handheld")) return layered(ITEM, HANDHELD); + if (name.startsWith("block/")) return layered(Map.of(), BLOCK); + // "builtin/generated" is what a model with no parent at all is treated as. + if (name.startsWith("item/") || name.startsWith("builtin/")) return layered(Map.of(), ITEM); + return Map.of(); + } + + /** Whether {@code parent} names a vanilla parent whose pose this can rebuild. */ + public static boolean isKnown(String parent) { + return !forParent(parent).isEmpty(); + } + + /** + * {@code item/generated}'s poses — the last resort for a model that declares no {@code display} and whose + * parent chain gave no clue either. It is the pose the overwhelming majority of items inherit, so it is the + * least surprising thing to fall back to. + */ + public static Map generatedItem() { + return ITEM; + } + + /** + * {@code block/block}'s poses. Its {@code gui} entry is the familiar three-quarter view, and the last resort + * for rendering an icon from a model that names no GUI pose of its own. + */ + public static Map block() { + return BLOCK; + } + + // ---------------------------------------------------------------- internals + + /** {@code over} wins per context, exactly as a child model's own entries win over its parent's. */ + private static Map layered( + Map base, + Map over) { + Map merged = new LinkedHashMap<>(base); + merged.putAll(over); + return merged; + } + + /** + * Insertion-ordered on purpose. {@code Map.of}/{@code Map.copyOf} randomise their iteration order per JVM run, + * and these tables feed the order slots are written to a model — so using one made a block's + * {@code item_display_transforms} come out in a different order on every conversion of the same pack. + */ + @SafeVarargs + private static Map table( + Map.Entry... entries) { + Map map = new LinkedHashMap<>(); + for (Map.Entry entry : entries) { + map.put(entry.getKey(), entry.getValue()); + } + return java.util.Collections.unmodifiableMap(map); + } + + private static Map.Entry entry( + String context, float[] rotation, float[] translation, float[] scale) { + return Map.entry(context, new JavaBlockModel.DisplayTransform(rotation, translation, scale)); + } + + private static float[] rot(float x, float y, float z) { + return new float[]{x, y, z}; + } + + private static float[] tr(float x, float y, float z) { + return new float[]{x, y, z}; + } + + private static float[] scale(float uniform) { + return new float[]{uniform, uniform, uniform}; + } + + private static String normalise(String parent) { + String value = parent.toLowerCase(Locale.ROOT); + int colon = value.indexOf(':'); + if (colon >= 0) value = value.substring(colon + 1); + return value; + } +} diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/geometry/BedrockGeometry.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/geometry/BedrockGeometry.java index 7c348ffa..6d1d72f9 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/geometry/BedrockGeometry.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/geometry/BedrockGeometry.java @@ -28,19 +28,85 @@ public BedrockGeometry(String identifier) { public BedrockGeometry withDisplay(String context, float rx, float ry, float rz, float tx, float ty, float tz, float sx, float sy, float sz) { - this.display.put(context, new DisplayTransform(rx, ry, rz, tx, ty, tz, sx, sy, sz)); + this.display.put(context, new DisplayTransform(rx, ry, rz, tx, ty, tz, sx, sy, sz, + new float[]{0, 0, 0}, new float[]{0, 0, 0}, false)); return this; } + /** + * Copies a Java {@code display} entry into {@code item_display_transforms}, following Blockbench's + * {@code DisplaySlot.exportBedrock}. + *

+ * Two things are not a straight copy. The pivots are carried across rather than zeroed, because + * {@link JavaBlockModel.DisplayTransform} now parses them and Blockbench writes them on both sides. And the + * {@code gui} slot's Y rotation is turned half a circle: Bedrock's inventory camera looks at a block from + * the opposite side, which is why Blockbench's {@code applyPreset} replaces the block preset's Java + * {@code 225} with {@code 45} as soon as the project is a Bedrock block. Subtracting 180 reproduces that for + * the preset and generalises to a slot the pack author wrote by hand. + *

+ * A slot whose every channel is at its default is skipped: it would say nothing, and its presence alone bumps + * the whole file's {@code format_version} to {@code 1.21.110}. + */ + public BedrockGeometry withDisplay(String context, JavaBlockModel.DisplayTransform dt) { + float[] r = dt.rotation() != null ? dt.rotation() : new float[]{0, 0, 0}; + float[] t = dt.translation() != null ? dt.translation() : new float[]{0, 0, 0}; + float[] s = dt.scale() != null ? dt.scale() : new float[]{1, 1, 1}; + float[] rotationPivot = dt.rotationPivot() != null ? dt.rotationPivot() : new float[]{0, 0, 0}; + float[] scalePivot = dt.scalePivot() != null ? dt.scalePivot() : new float[]{0, 0, 0}; + + boolean isGui = "gui".equals(context); + float rotationY = isGui ? trimDegrees(r[1] - 180.0F) : r[1]; + + if (isDefaultSlot(r, t, s, rotationPivot, scalePivot)) return this; + + this.display.put(context, new DisplayTransform(r[0], rotationY, r[2], t[0], t[1], t[2], s[0], s[1], s[2], + rotationPivot, scalePivot, isGui)); + return this; + } + + private static boolean isDefaultSlot(float[] rotation, float[] translation, float[] scale, + float[] rotationPivot, float[] scalePivot) { + for (int axis = 0; axis < 3; axis++) { + if (rotation[axis] != 0 || translation[axis] != 0 || scale[axis] != 1 + || rotationPivot[axis] != 0 || scalePivot[axis] != 0) { + return false; + } + } + return true; + } + + /** Blockbench's {@code Math.trimDeg}: wrapped into {@code (-180, 180]}. */ + private static float trimDegrees(float degrees) { + float wrapped = degrees % 360.0F; + if (wrapped > 180.0F) wrapped -= 360.0F; + if (wrapped <= -180.0F) wrapped += 360.0F; + return wrapped; + } + public Bone addBone(String name) { Bone bone = new Bone(name); this.bones.add(bone); return bone; } + /** + * Whether this geometry would draw nothing. + *

+ * A Java item model that only names {@code textures.layer0} — {@code parent: item/handheld} and the + * like — has no {@code elements}, so converting it yields bones without cubes. Such a geometry is + * indistinguishable from a real one by presence alone, and an attachable pointing at it renders an + * invisible item, so callers need to be able to tell and fall back to a generated flat model. + */ + public boolean hasNoCubes() { + for (Bone bone : this.bones) { + if (!bone.cubes.isEmpty()) return false; + } + return true; + } + public JsonObject serialize() { JsonObject root = new JsonObject(); - root.addProperty("format_version", "1.21.0"); + root.addProperty("format_version", this.display.isEmpty() ? "1.21.0" : "1.21.110"); JsonArray geoArray = new JsonArray(); JsonObject geo = new JsonObject(); @@ -59,7 +125,7 @@ public JsonObject serialize() { for (Map.Entry entry : this.display.entrySet()) { displayObj.add(entry.getKey(), entry.getValue().serialize()); } - geo.add("display", displayObj); + geo.add("item_display_transforms", displayObj); } JsonArray bonesArray = new JsonArray(); @@ -114,6 +180,7 @@ public static class Cube { private final float[] size; private float[] rotation = new float[]{0, 0, 0}; private float[] pivot = new float[]{0, 0, 0}; + private float inflate = 0; private final Map faces = new LinkedHashMap<>(); public Cube(float ox, float oy, float oz, float sx, float sy, float sz) { @@ -123,14 +190,21 @@ public Cube(float ox, float oy, float oz, float sx, float sy, float sz) { public Cube withRotation(float x, float y, float z) { this.rotation = new float[]{x, y, z}; return this; } public Cube withPivot(float x, float y, float z) { this.pivot = new float[]{x, y, z}; return this; } + public Cube withInflate(float v) { this.inflate = v; return this; } public Cube withFace(String direction, float u, float v, float us, float vs) { - this.faces.put(direction, new Face(u, v, us, vs, null)); + this.faces.put(direction, new Face(u, v, us, vs, null, 0)); return this; } public Cube withFace(String direction, float u, float v, float us, float vs, String materialInstance) { - this.faces.put(direction, new Face(u, v, us, vs, materialInstance)); + this.faces.put(direction, new Face(u, v, us, vs, materialInstance, 0)); + return this; + } + + public Cube withFace(String direction, float u, float v, float us, float vs, + String materialInstance, int uvRotation) { + this.faces.put(direction, new Face(u, v, us, vs, materialInstance, uvRotation)); return this; } @@ -144,6 +218,9 @@ private JsonObject serialize() { if (this.pivot[0] != 0 || this.pivot[1] != 0 || this.pivot[2] != 0) { obj.add("pivot", toJsonArray(this.pivot[0], this.pivot[1], this.pivot[2])); } + if (this.inflate != 0) { + obj.addProperty("inflate", this.inflate); + } JsonObject uv = new JsonObject(); for (Map.Entry entry : this.faces.entrySet()) { @@ -151,6 +228,9 @@ private JsonObject serialize() { JsonObject faceObj = new JsonObject(); faceObj.add("uv", toJsonArray(f.u, f.v)); faceObj.add("uv_size", toJsonArray(f.us, f.vs)); + if (f.uvRotation != 0) { + faceObj.addProperty("uv_rotation", f.uvRotation); + } if (f.materialInstance != null) { faceObj.addProperty("material_instance", f.materialInstance); } @@ -163,7 +243,7 @@ private JsonObject serialize() { } } - private record Face(float u, float v, float us, float vs, String materialInstance) { + private record Face(float u, float v, float us, float vs, String materialInstance, int uvRotation) { } private static JsonArray toJsonArray(float... values) { @@ -176,13 +256,21 @@ public static class DisplayTransform { final float[] rotation; final float[] translation; final float[] scale; + final float[] rotationPivot; + final float[] scalePivot; + final boolean fitToFrame; public DisplayTransform(float rx, float ry, float rz, float tx, float ty, float tz, - float sx, float sy, float sz) { + float sx, float sy, float sz, + float[] rotationPivot, float[] scalePivot, + boolean fitToFrame) { this.rotation = new float[]{rx, ry, rz}; this.translation = new float[]{tx, ty, tz}; this.scale = new float[]{sx, sy, sz}; + this.rotationPivot = rotationPivot; + this.scalePivot = scalePivot; + this.fitToFrame = fitToFrame; } private JsonObject serialize() { @@ -190,6 +278,11 @@ private JsonObject serialize() { obj.add("rotation", toJsonArray(this.rotation[0], this.rotation[1], this.rotation[2])); obj.add("translation", toJsonArray(this.translation[0], this.translation[1], this.translation[2])); obj.add("scale", toJsonArray(this.scale[0], this.scale[1], this.scale[2])); + obj.add("rotation_pivot", toJsonArray(this.rotationPivot[0], this.rotationPivot[1], this.rotationPivot[2])); + obj.add("scale_pivot", toJsonArray(this.scalePivot[0], this.scalePivot[1], this.scalePivot[2])); + if (this.fitToFrame) { + obj.addProperty("fit_to_frame", true); + } return obj; } } diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/geometry/DisplayContext.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/geometry/DisplayContext.java new file mode 100644 index 00000000..36e0a871 --- /dev/null +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/geometry/DisplayContext.java @@ -0,0 +1,53 @@ +package fr.robie.craftengineconverter.converter.bedrock.geometry; + +import java.util.Locale; + +/** + * The names of Java's {@code display} contexts, and the one place their spelling is normalised. + *

+ * Java accepts two legacy spellings — {@code firstperson} and {@code thirdperson}, from before the hands were + * split — and packs in the wild still use them. Normalising here rather than at each read means a model written + * either way poses identically, instead of silently losing its pose in whichever branch forgot the alias. + */ +public final class DisplayContext { + + public static final String THIRD_PERSON_RIGHT = "thirdperson_righthand"; + public static final String THIRD_PERSON_LEFT = "thirdperson_lefthand"; + public static final String FIRST_PERSON_RIGHT = "firstperson_righthand"; + public static final String FIRST_PERSON_LEFT = "firstperson_lefthand"; + public static final String GUI = "gui"; + public static final String HEAD = "head"; + public static final String GROUND = "ground"; + public static final String FIXED = "fixed"; + + private DisplayContext() { + throw new UnsupportedOperationException("DisplayContext is a utility class and cannot be instantiated."); + } + + /** + * The canonical name for a context as written in a model, or {@code null} when it names no Java context. + *

+ * The bare legacy names resolve to the right hand, which is what the client does with them. + */ + public static String canonical(String written) { + if (written == null) return null; + return switch (written.toLowerCase(Locale.ROOT).trim()) { + case "thirdperson", THIRD_PERSON_RIGHT -> THIRD_PERSON_RIGHT; + case THIRD_PERSON_LEFT -> THIRD_PERSON_LEFT; + case "firstperson", FIRST_PERSON_RIGHT -> FIRST_PERSON_RIGHT; + case FIRST_PERSON_LEFT -> FIRST_PERSON_LEFT; + case GUI -> GUI; + case HEAD -> HEAD; + case GROUND -> GROUND; + case FIXED -> FIXED; + default -> null; + }; + } + + /** The right-hand context a left-hand one falls back to, or {@code null} when it is not a left-hand context. */ + public static String mirrorOf(String context) { + if (THIRD_PERSON_LEFT.equals(context)) return THIRD_PERSON_RIGHT; + if (FIRST_PERSON_LEFT.equals(context)) return FIRST_PERSON_RIGHT; + return null; + } +} diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/geometry/GeometryMapper.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/geometry/GeometryMapper.java index 47e3af15..5c1940c6 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/geometry/GeometryMapper.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/geometry/GeometryMapper.java @@ -7,6 +7,19 @@ public class GeometryMapper { private static final float[] CENTRE_OFFSET = {8.0F, 0.0F, 8.0F}; + /** + * The point a held item's pose animation turns it about: the model's own centre. + *

+ * Java applies a {@code display} transform and then shifts the model by half a block, so the transform pivots + * on model coordinate {@code (8, 8, 8)} — the centre. Cubes here are written at Java minus + * {@link #CENTRE_OFFSET}, which puts that centre at {@code (0, 8, 0)} in bone space. + *

+ * It has to be the same for every item geometry. The Java-model path used to set no pivot at all while the + * generated flat and lattice geometries set {@code (0, 8, -0.25)}, so one animation posed a 3D item and a 2D + * item about two different points. + */ + private static final float[] ITEM_PIVOT = {0.0F, 8.0F, 0.0F}; + public BedrockGeometry mapGeometry(String identifier, JavaBlockModel model, int textureWidth, int textureHeight) { BedrockGeometry geo = new BedrockGeometry(identifier) .withVisibleBoundsWidth(4.0F) @@ -16,7 +29,8 @@ public BedrockGeometry mapGeometry(String identifier, JavaBlockModel model, int .withTextureHeight(textureHeight); BedrockGeometry.Bone bone = geo.addBone("bone") - .withBinding("q.item_slot_to_bone_name(context.item_slot)"); + .withBinding("q.item_slot_to_bone_name(context.item_slot)") + .withPivot(ITEM_PIVOT[0], ITEM_PIVOT[1], ITEM_PIVOT[2]); for (JavaBlockModel.Element element : model.elements()) { this.mapElement(element, bone, textureWidth, textureHeight); @@ -25,7 +39,218 @@ public BedrockGeometry mapGeometry(String identifier, JavaBlockModel model, int return geo; } + /** + * The same conversion as {@link #mapGeometry}, for a block rather than a held item. + *

+ * Two differences, both small and both necessary. The bone carries no binding: {@code item_slot_to_bone_name} + * is an attachable query and means nothing on a block. And each face is given a material instance named after + * the Java texture variable it uses, because that is how a block points its faces at different textures — a + * log's {@code end} on the top and bottom, {@code side} around it. + * + * @param instanceNames receives, per face, the Java texture variable that face samples (e.g. {@code "end"}), + * so the caller can build the matching {@code material_instances} + */ + public BedrockGeometry mapBlockGeometry(String identifier, JavaBlockModel model, + java.util.Set instanceNames) { + BedrockGeometry geo = new BedrockGeometry(identifier) + .withTextureWidth((int) JavaBlockModel.UV_SPACE) + .withTextureHeight((int) JavaBlockModel.UV_SPACE); + + BedrockGeometry.Bone bone = geo.addBone("bone"); + + for (JavaBlockModel.Element element : model.elements()) { + this.mapElement(element, bone, (int) JavaBlockModel.UV_SPACE, (int) JavaBlockModel.UV_SPACE, + model, instanceNames, false); + } + + return geo; + } + + /** + * A model with a blockstate's {@code x}/{@code y} rotation baked into the cubes. + *

+ * The alternative is Geyser's {@code transformation}, and it cannot be trusted for a combined rotation: Java + * applies {@code x} then {@code y}, and composing the two in the other order negates the {@code y} turn. That is + * why a stair was right on two facings and showed its back on the other two — only its {@code half=top} variants + * carry {@code x: 180}. Baking removes the ordering question entirely, and as a bonus reproduces {@code uvlock} + * (which Geyser has no field for) because each face keeps the UV it was authored with. + *

+ * Exact, because a blockstate rotation is always a multiple of 90 degrees: a box maps onto a box, and a face + * normal onto another axis. + */ + public BedrockGeometry mapRotatedBlockGeometry(String identifier, JavaBlockModel model, + java.util.Set instanceNames, int rotX, int rotY) { + BedrockGeometry geo = new BedrockGeometry(identifier) + .withTextureWidth((int) JavaBlockModel.UV_SPACE) + .withTextureHeight((int) JavaBlockModel.UV_SPACE); + + BedrockGeometry.Bone bone = geo.addBone("bone"); + for (JavaBlockModel.Element element : rotateModel(model, rotX, rotY).elements()) { + this.mapElement(element, bone, + (int) JavaBlockModel.UV_SPACE, (int) JavaBlockModel.UV_SPACE, model, instanceNames, false); + } + return geo; + } + + /** + * The same model with every element turned, so callers that need the rotated bounds — the collision and + * selection boxes — measure exactly the shape that was drawn instead of repeating the rotation themselves. + */ + public static JavaBlockModel rotateModel(JavaBlockModel model, int rotX, int rotY) { + if (rotX == 0 && rotY == 0) return model; + JavaBlockModel rotated = new JavaBlockModel(model.parent().orElse(null), model.ambientOcclusion()); + rotated.setGuiLightFront(model.guiLightFront()); + model.textures().forEach(rotated::addTexture); + for (JavaBlockModel.Element element : model.elements()) { + rotated.addElement(rotateElement(element, rotX, rotY)); + } + return rotated; + } + + /** Turns one element about the block centre, carrying each face round to the direction it now points. */ + private static JavaBlockModel.Element rotateElement(JavaBlockModel.Element element, int rotX, int rotY) { + if (rotX == 0 && rotY == 0) return element; + + float[] from = {element.fromX(), element.fromY(), element.fromZ()}; + float[] to = {element.toX(), element.toY(), element.toZ()}; + + float[] min = {Float.MAX_VALUE, Float.MAX_VALUE, Float.MAX_VALUE}; + float[] max = {-Float.MAX_VALUE, -Float.MAX_VALUE, -Float.MAX_VALUE}; + for (float x : new float[]{from[0], to[0]}) { + for (float y : new float[]{from[1], to[1]}) { + for (float z : new float[]{from[2], to[2]}) { + float[] p = {x - 8.0F, y - 8.0F, z - 8.0F}; + rotate(p, rotX, rotY); + for (int axis = 0; axis < 3; axis++) { + min[axis] = Math.min(min[axis], p[axis] + 8.0F); + max[axis] = Math.max(max[axis], p[axis] + 8.0F); + } + } + } + } + + JavaBlockModel.Element rotated = new JavaBlockModel.Element(min[0], min[1], min[2], max[0], max[1], max[2]); + for (JavaBlockModel.Face face : element.faces()) { + rotated.addFace(rotatedDirection(face.direction(), rotX, rotY), face.texture(), + face.u0(), face.v0(), face.u1(), face.v1(), + rotatedFaceRotation(face.direction(), face.rotation(), rotY), face.tintIndex()); + } + // The element's own rotation goes round with it. Its pivot is a point like any other, and its axis maps onto + // another axis because the turn is a multiple of 90 degrees; when that axis comes out pointing the other way + // the angle has to change sign with it, or the part would tilt the wrong way. + element.rotation().ifPresent(r -> { + float[] pivot = {r.ox() - 8.0F, r.oy() - 8.0F, r.oz() - 8.0F}; + rotate(pivot, rotX, rotY); + float[] axis = switch (r.axis()) { + case "x" -> new float[]{1, 0, 0}; + case "y" -> new float[]{0, 1, 0}; + default -> new float[]{0, 0, 1}; + }; + rotate(axis, rotX, rotY); + int dominant = 0; + for (int i = 1; i < 3; i++) if (Math.abs(axis[i]) > Math.abs(axis[dominant])) dominant = i; + String newAxis = switch (dominant) { + case 0 -> "x"; + case 1 -> "y"; + default -> "z"; + }; + float angle = axis[dominant] < 0 ? -r.angle() : r.angle(); + rotated.setRotation(pivot[0] + 8.0F, pivot[1] + 8.0F, pivot[2] + 8.0F, angle, newAxis, r.rescale()); + }); + return rotated; + } + + /** + * A face's texture rotation after a variant's Y rotation is baked in. + *

+ * Turning a block about Y carries the four side faces onto one another, and each keeps its own texture upright + * as it goes — so their {@code rotation} is unchanged. The top and bottom faces are the exception: the axis of + * the turn runs through them, so the turn happens within the face's own plane and shows up as a quarter + * turn of its texture. Down turns the opposite way to up, since it is seen from the other side. + *

+ * Without this a glazed-terracotta-style block shows the same pattern orientation on top for all four of its + * facings, instead of the pattern following the block round. + */ + public static int rotatedFaceRotation(String direction, int faceRotation, int rotY) { + int turn = switch (direction) { + case "up" -> rotY; + case "down" -> -rotY; + default -> 0; + }; + return ((faceRotation + turn) % 360 + 360) % 360; + } + + /** + * Where a face points after the rotation, found by turning its normal and snapping to the nearest axis. Derived + * rather than tabulated so it cannot disagree with how the corners moved. + */ + public static String rotatedDirection(String direction, int rotX, int rotY) { + float[] normal = switch (direction) { + case "north" -> new float[]{0, 0, -1}; + case "south" -> new float[]{0, 0, 1}; + case "west" -> new float[]{-1, 0, 0}; + case "east" -> new float[]{1, 0, 0}; + case "up" -> new float[]{0, 1, 0}; + case "down" -> new float[]{0, -1, 0}; + default -> null; + }; + if (normal == null) return direction; + + rotate(normal, rotX, rotY); + int axis = 0; + for (int i = 1; i < 3; i++) { + if (Math.abs(normal[i]) > Math.abs(normal[axis])) axis = i; + } + boolean positive = normal[axis] > 0; + return switch (axis) { + case 0 -> positive ? "east" : "west"; + case 1 -> positive ? "up" : "down"; + default -> positive ? "south" : "north"; + }; + } + + /** + * X then Y, the order a blockstate applies them in, and negated. + *

+ * Vanilla builds a variant's rotation as {@code rotationYXZ(-y, -x, 0)}, so a blockstate's angles turn the model + * the opposite way round to a plain right-handed rotation. Two checks against vanilla agree: {@code block/stairs} + * has its raised step on the east and is the {@code facing=east} variant, while {@code facing=south} is + * {@code y: 90} — so {@code y: 90} must carry east to south, which only the negated form does. Applying them + * as given carried east to north, a 180-degree error on exactly two of the four facings, which is why a stair + * showed its back on two of them. + */ + private static void rotate(float[] p, int rotX, int rotY) { + if (rotX != 0) { + double a = Math.toRadians(-rotX); + double y = p[1] * Math.cos(a) - p[2] * Math.sin(a); + double z = p[1] * Math.sin(a) + p[2] * Math.cos(a); + p[1] = (float) y; + p[2] = (float) z; + } + if (rotY != 0) { + double a = Math.toRadians(-rotY); + double x = p[0] * Math.cos(a) + p[2] * Math.sin(a); + double z = -p[0] * Math.sin(a) + p[2] * Math.cos(a); + p[0] = (float) x; + p[2] = (float) z; + } + } + private void mapElement(JavaBlockModel.Element element, BedrockGeometry.Bone bone, int texW, int texH) { + this.mapElement(element, bone, texW, texH, null, null, true); + } + + /** + * @param mirrorX whether to mirror the element along X. + *

+ * True for a held item, because Bedrock entity models are authored mirrored relative to Java. + * False for a block, which sits in world space where Bedrock's axes match Java's — + * mirroring one moves it to the opposite side of its own block and reverses its texture, which + * is what put doors in the wrong half of their frame and crossed a flower's 45-degree sheets the + * wrong way. A symmetric shape such as a cactus hides the difference entirely. + */ + private void mapElement(JavaBlockModel.Element element, BedrockGeometry.Bone bone, int texW, int texH, + JavaBlockModel model, java.util.Set instanceNames, boolean mirrorX) { float fromX = element.fromX(); float fromY = element.fromY(); float fromZ = element.fromZ(); @@ -47,26 +272,33 @@ private void mapElement(JavaBlockModel.Element element, BedrockGeometry.Bone bon Math.abs(to[2] - from[2]) }; - origin[0] = -(origin[0] + size[0]); + if (mirrorX) origin[0] = -(origin[0] + size[0]); BedrockGeometry.Cube cube = bone.addCube(origin[0], origin[1], origin[2], size[0], size[1], size[2]); for (JavaBlockModel.Face face : element.faces()) { - this.mapFace(face, cube, texW, texH, from, to); + String instance = model == null ? null : materialInstanceFor(face, model); + if (instance != null && instanceNames != null) instanceNames.add(instance); + this.mapFace(face, cube, texW, texH, from, to, instance); } element.rotation().ifPresent(rot -> { + // A Java rotation origin is already in the same 0-16 model units as from/to, so it only needs + // recentring — dividing by 1/16 multiplied it by 16 and threw the pivot far outside the model, + // which visibly flung any rotated cube away from the rest of the item. float[] rotOrigin = { - rot.ox() / 0.0625F - CENTRE_OFFSET[0], - rot.oy() / 0.0625F - CENTRE_OFFSET[1], - rot.oz() / 0.0625F - CENTRE_OFFSET[2] + rot.ox() - CENTRE_OFFSET[0], + rot.oy() - CENTRE_OFFSET[1], + rot.oz() - CENTRE_OFFSET[2] }; - rotOrigin[0] = -rotOrigin[0]; + if (mirrorX) rotOrigin[0] = -rotOrigin[0]; cube.withPivot(rotOrigin[0], rotOrigin[1], rotOrigin[2]); + // Blockbench's Java→Bedrock export negates X and Y rotation to compensate for its X-axis + // coordinate mirror. Items mirror X, so they need that compensation. Blocks do not mirror X + // (task #72), so their rotation passes through unchanged. Z is never negated. float bedrockAngle = switch (rot.axis()) { - case "x" -> -rot.angle(); - case "y" -> rot.angle(); + case "x", "y" -> mirrorX ? -rot.angle() : rot.angle(); case "z" -> rot.angle(); default -> rot.angle(); }; @@ -77,11 +309,42 @@ private void mapElement(JavaBlockModel.Element element, BedrockGeometry.Bone bon default -> new float[]{0, 0, 0}; }; cube.withRotation(rotVec[0], rotVec[1], rotVec[2]); + + if (rot.rescale()) { + float scaleFactor = 1.0F / (float) Math.cos(Math.toRadians(rot.angle())); + float minDim = Math.min(size[0], Math.min(size[1], size[2])); + float inflate = (scaleFactor - 1.0F) * minDim / 2.0F; + if (inflate > 0.001F) cube.withInflate(inflate); + } }); } + /** + * The material instance a block face should use: the Java texture variable it names, with the {@code #} + * dropped. A face naming a literal texture rather than a variable has no instance to share and returns null. + */ + private static String materialInstanceFor(JavaBlockModel.Face face, JavaBlockModel model) { + String texture = face.texture(); + if (texture == null || !texture.startsWith("#")) return null; + + String key = texture.substring(1); + // Follow the variable to make sure it actually binds to something; the name of the first bound key is + // what the material instance is called. + String value = model.textures().get(key); + for (int hop = 0; hop < 8 && value != null && value.startsWith("#"); hop++) { + key = value.substring(1); + value = model.textures().get(key); + } + return value == null ? null : key; + } + private void mapFace(JavaBlockModel.Face face, BedrockGeometry.Cube cube, int texW, int texH, float[] from, float[] to) { + this.mapFace(face, cube, texW, texH, from, to, null); + } + + private void mapFace(JavaBlockModel.Face face, BedrockGeometry.Cube cube, int texW, int texH, + float[] from, float[] to, String materialInstance) { String dir = face.direction(); float u0 = face.u0(); float v0 = face.v0(); @@ -104,14 +367,18 @@ private void mapFace(JavaBlockModel.Face face, BedrockGeometry.Cube cube, int te uvSizeV = v1 - v0; } - float widthMul = (float) texW / 16.0F; - float heightMul = (float) texH / 16.0F; + int uvRotation = ((face.rotation() % 360) + 360) % 360; + + // Java UVs span 0-16 whatever the texture's resolution (see JavaBlockModel.UV_SPACE), so they are + // rescaled into whatever space this geometry declares. + float widthMul = texW / JavaBlockModel.UV_SPACE; + float heightMul = texH / JavaBlockModel.UV_SPACE; uvOriginU *= widthMul; uvOriginV *= heightMul; uvSizeU *= widthMul; uvSizeV *= heightMul; - cube.withFace(dir, uvOriginU, uvOriginV, uvSizeU, uvSizeV); + cube.withFace(dir, uvOriginU, uvOriginV, uvSizeU, uvSizeV, materialInstance, uvRotation); } public static String getMeaningfulMaterialInstanceName(String face, String texture, int elementIndex) { @@ -123,6 +390,23 @@ public static String getMeaningfulMaterialInstanceName(String face, String textu * (e.g. the texture file failed to load). Produces the old zero-depth flat plane. * Prefer {@link #createFlatItemGeometry(String, BufferedImage)}. */ + /** + * A zero-depth, two-sided plane covering the whole texture rect. + *

+ * The right shape for an item whose animation frames have different silhouettes. Extrusion bakes + * one silhouette into walls and slabs, but a single geometry serves every frame, so any frame that is + * not that shape renders wrong: pixels outside the baked mask have no face to draw on, and walls baked + * where a smaller frame has nothing stand away from the visible pixels, leaving the shape looking + * unclosed. A plane has no walls and no mask, so each frame's own alpha shapes it exactly. + */ + public static BedrockGeometry createFlatItemPlane(String identifier, int textureWidth, int textureHeight) { + return createFlatItemGeometry(identifier, textureWidth, textureHeight); + } + + /** + * @deprecated prefer {@link #createFlatItemGeometry(String, BufferedImage)} for still textures, or + * {@link #createFlatItemPlane(String, int, int)} when frames change silhouette. + */ @Deprecated public static BedrockGeometry createFlatItemGeometry(String identifier, int textureWidth, int textureHeight) { BedrockGeometry geo = new BedrockGeometry(identifier) @@ -134,7 +418,7 @@ public static BedrockGeometry createFlatItemGeometry(String identifier, int text BedrockGeometry.Bone bone = geo.addBone("bone") .withBinding("q.item_slot_to_bone_name(context.item_slot)") - .withPivot(0, 8.0F, -0.25F); + .withPivot(ITEM_PIVOT[0], ITEM_PIVOT[1], ITEM_PIVOT[2]); BedrockGeometry.Cube cube = bone.addCube(-8.0F, 0, -0.5F, 16.0F, 16.0F, 0); @@ -144,6 +428,64 @@ public static BedrockGeometry createFlatItemGeometry(String identifier, int text return geo; } + /** + * A grid of one 1-unit-deep cube per texture pixel, each cube UV-mapped to that single pixel on all + * six faces. + *

+ * This is the only shape that is genuinely correct for an animated item. Extrusion + * ({@link #createFlatItemGeometry(String, BufferedImage)}) bakes one frame's silhouette into slabs and + * boundary walls, so every other frame renders wrong; a plane + * ({@link #createFlatItemPlane(String, int, int)}) is shape-agnostic but flat. Here every pixel owns a + * closed box, and a box whose pixel is transparent is discarded whole by the alpha-test material — so + * the silhouette comes from the texture at render time, per frame, in 3D, with real extruded sides. + *

+ * Because nothing about the geometry depends on any particular texture, one lattice serves every + * animated item of the same frame size and the identifier should be derived from the size rather + * than the item. + *

+ * Transparent pixels are deliberately not skipped: doing so would reintroduce the dependency on + * one frame's mask and defeat the entire point. + *

+ * The bone name, binding, pivot and the 16×16×1 box it occupies match + * {@link #createFlatItemGeometry(String, BufferedImage)} exactly, so existing animations, render + * controllers and attachable scripts apply unchanged. + */ + public static BedrockGeometry createPixelLatticeGeometry(String identifier, int texW, int texH) { + BedrockGeometry geo = new BedrockGeometry(identifier) + .withVisibleBoundsWidth(4.0F) + .withVisibleBoundsHeight(4.0F) + .withVisibleBoundsOffset(0.0F, 0.75F, 0.0F) + .withTextureWidth(texW) + .withTextureHeight(texH); + + BedrockGeometry.Bone bone = geo.addBone("bone") + .withBinding("q.item_slot_to_bone_name(context.item_slot)") + .withPivot(ITEM_PIVOT[0], ITEM_PIVOT[1], ITEM_PIVOT[2]); + + float unitX = 16.0F / texW; + float unitY = 16.0F / texH; + float depth = 1.0F; + float zOrigin = -depth / 2.0F; + + for (int y = 0; y < texH; y++) { + for (int x = 0; x < texW; x++) { + BedrockGeometry.Cube cube = bone.addCube( + -8.0F + x * unitX, + 16.0F - (y + 1) * unitY, + zOrigin, + unitX, unitY, depth); + + for (String face : new String[]{"north", "south", "east", "west", "up"}) { + cube.withFace(face, x, y, 1, 1, "#layer0_south_0"); + } + // The down face samples the same pixel with V flipped, as vanilla-style item lattices do. + cube.withFace("down", x, y + 1, 1, -1, "#layer0_south_0"); + } + } + + return geo; + } + /** * Builds a flat-item geometry that is extruded to a depth of 1 model unit, following the * exact silhouette of the texture's alpha channel instead of a single zero-depth plane. @@ -175,7 +517,7 @@ public static BedrockGeometry createFlatItemGeometry(String identifier, Buffered BedrockGeometry.Bone bone = geo.addBone("bone") .withBinding("q.item_slot_to_bone_name(context.item_slot)") - .withPivot(0, 8.0F, -0.25F); + .withPivot(ITEM_PIVOT[0], ITEM_PIVOT[1], ITEM_PIVOT[2]); boolean[][] opaque = new boolean[texH][texW]; for (int y = 0; y < texH; y++) { diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/geometry/JavaBlockModel.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/geometry/JavaBlockModel.java index 06c3e629..34ca45fe 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/geometry/JavaBlockModel.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/geometry/JavaBlockModel.java @@ -14,8 +14,13 @@ public class JavaBlockModel { private final String parent; private final boolean ambientOcclusion; - private final Map textures = new HashMap<>(); + private boolean guiLightFront = false; + // Insertion-ordered, not hashed: both maps decide the order things are written to the Bedrock pack — texture + // variables become material instances, display contexts become item_display_transforms — and a hashed order + // makes two conversions of the same pack differ for no reason. + private final Map textures = new LinkedHashMap<>(); private final List elements = new ArrayList<>(); + private final Map display = new LinkedHashMap<>(); public JavaBlockModel(String parent, boolean ambientOcclusion) { this.parent = parent; @@ -24,13 +29,40 @@ public JavaBlockModel(String parent, boolean ambientOcclusion) { public Optional parent() { return Optional.ofNullable(this.parent); } public boolean ambientOcclusion() { return this.ambientOcclusion; } + public boolean guiLightFront() { return this.guiLightFront; } + public void setGuiLightFront(boolean front) { this.guiLightFront = front; } public Map textures() { return this.textures; } public List elements() { return this.elements; } + /** + * A named display transform, e.g. {@code gui} — how the client poses the model in that context. Only + * matters when something has to reproduce a client-side render, which for this converter means the + * pre-rendered inventory icon: Bedrock has no way to render geometry into a slot, so the icon is a sprite + * drawn at conversion time and it has to be posed the same way Java would pose it. + */ + public Map display() { return this.display; } + + public Optional display(String context) { + return Optional.ofNullable(this.display.get(context)); + } + + /** + * The coordinate space face UVs are expressed in: always {@code 16}, whatever the texture's resolution. + *

+ * Named rather than inlined because the constant is the whole subtlety. A model may carry Blockbench's + * {@code texture_size} field, which looks like it redefines this space and does not — vanilla has no such + * field and Blockbench exports UVs already scaled into 0-16. Reading UVs in a declared 32-unit space halves + * them and samples the wrong half of every face, which shows up as holes in a model rather than as an + * obvious mis-colour. + */ + public static final float UV_SPACE = 16.0F; + public void addTexture(String key, String value) { this.textures.put(key, value); } public void addElement(Element element) { this.elements.add(element); } + public void addDisplay(String context, DisplayTransform transform) { + this.display.put(context, transform); } public static JavaBlockModel load(Path path) throws IOException { try (Reader reader = Files.newBufferedReader(path)) { @@ -45,6 +77,12 @@ public static JavaBlockModel parse(JsonObject json) { JavaBlockModel model = new JavaBlockModel(parent, ao); + // "texture_size" is deliberately ignored. It is a Blockbench field, not part of the vanilla model + // format, and vanilla always reads UVs as 0-16 spanning the whole texture whatever its resolution. + // Blockbench exports UVs already scaled into that space — every UV in a model declaring + // texture_size [32, 32] still stops at 16 — so honouring the field halves every coordinate and + // samples the wrong half of each face. + if (json.has("textures")) { JsonObject tex = json.getAsJsonObject("textures"); for (String key : tex.keySet()) { @@ -58,9 +96,44 @@ public static JavaBlockModel parse(JsonObject json) { } } + if (json.has("display")) { + JsonObject display = json.getAsJsonObject("display"); + for (String context : display.keySet()) { + // Normalised on the way in so every reader can look a context up by its canonical name. A pack + // using the legacy "thirdperson" spelling would otherwise lose its pose in whichever branch did + // not think to check for the alias. + String canonical = DisplayContext.canonical(context); + if (canonical == null) continue; + model.addDisplay(canonical, parseDisplay(display.getAsJsonObject(context))); + } + } + + if (json.has("gui_light")) { + model.setGuiLightFront("front".equals(json.get("gui_light").getAsString())); + } + return model; } + private static DisplayTransform parseDisplay(JsonObject json) { + return new DisplayTransform( + triple(json, "rotation", 0), + triple(json, "translation", 0), + triple(json, "scale", 1), + triple(json, "rotation_pivot", 0), + triple(json, "scale_pivot", 0)); + } + + private static float[] triple(JsonObject json, String key, float fallback) { + float[] values = {fallback, fallback, fallback}; + if (!json.has(key)) return values; + JsonArray array = json.getAsJsonArray(key); + for (int i = 0; i < 3 && i < array.size(); i++) { + values[i] = array.get(i).getAsFloat(); + } + return values; + } + private static Element parseElement(JsonObject json) { JsonArray from = json.getAsJsonArray("from"); JsonArray to = json.getAsJsonArray("to"); @@ -70,6 +143,10 @@ private static Element parseElement(JsonObject json) { to.get(0).getAsFloat(), to.get(1).getAsFloat(), to.get(2).getAsFloat() ); + if (json.has("shade") && !json.get("shade").getAsBoolean()) { + element.setShade(false); + } + if (json.has("rotation")) { JsonObject rot = json.getAsJsonObject("rotation"); float[] origin = {0, 0, 0}; @@ -99,7 +176,11 @@ private static Element parseElement(JsonObject json) { uv[3] = uvArr.get(3).getAsFloat(); } int rotation = face.has("rotation") ? face.get("rotation").getAsInt() : 0; - element.addFace(dir, texture, uv[0], uv[1], uv[2], uv[3], rotation); + // -1 means "no tint". Java multiplies a tint colour into the face at render time, so an icon + // rendered without it comes out the wrong colour — the sofa's cushions are white instead of + // olive. + int tintIndex = face.has("tintindex") ? face.get("tintindex").getAsInt() : -1; + element.addFace(dir, texture, uv[0], uv[1], uv[2], uv[3], rotation, tintIndex); } } @@ -109,6 +190,7 @@ private static Element parseElement(JsonObject json) { public static class Element { private final float fromX, fromY, fromZ; private final float toX, toY, toZ; + private boolean shade = true; private final List faces = new ArrayList<>(); private Optional rotation = Optional.empty(); @@ -117,12 +199,20 @@ public Element(float fromX, float fromY, float fromZ, float toX, float toY, floa this.toX = toX; this.toY = toY; this.toZ = toZ; } + public boolean shade() { return this.shade; } + public void setShade(boolean shade) { this.shade = shade; } + public void setRotation(float ox, float oy, float oz, float angle, String axis, boolean rescale) { this.rotation = Optional.of(new ElementRotation(ox, oy, oz, angle, axis, rescale)); } public void addFace(String direction, String texture, float u0, float v0, float u1, float v1, int rotation) { - this.faces.add(new Face(direction, texture, u0, v0, u1, v1, rotation)); + this.addFace(direction, texture, u0, v0, u1, v1, rotation, -1); + } + + public void addFace(String direction, String texture, float u0, float v0, float u1, float v1, + int rotation, int tintIndex) { + this.faces.add(new Face(direction, texture, u0, v0, u1, v1, rotation, tintIndex)); } public float fromX() { return this.fromX; } @@ -137,5 +227,27 @@ public void addFace(String direction, String texture, float u0, float v0, float public record ElementRotation(float ox, float oy, float oz, float angle, String axis, boolean rescale) {} } - public record Face(String direction, String texture, float u0, float v0, float u1, float v1, int rotation) {} + /** + * @param tintIndex which of the model definition's tints applies to this face, or {@code -1} for none + */ + public record Face(String direction, String texture, float u0, float v0, float u1, float v1, int rotation, + int tintIndex) {} + + /** + * One entry of a model's {@code display} block: how the client poses the model in a given context. + * Rotation is in degrees, translation in model units, scale a multiplier — each XYZ. + *

+ * The two pivots are Blockbench extras rather than vanilla fields, and they are honoured because Blockbench + * writes them into the Java {@code display} block whenever they are non-zero — so a model authored there + * carries them and dropping them would pose it differently from its preview. They are in blocks, not + * model units; see {@code Transform.withPivots}. + */ + public record DisplayTransform(float[] rotation, float[] translation, float[] scale, + float[] rotationPivot, float[] scalePivot) { + + /** Without pivots, which is every vanilla model and most custom ones. */ + public DisplayTransform(float[] rotation, float[] translation, float[] scale) { + this(rotation, translation, scale, new float[]{0, 0, 0}, new float[]{0, 0, 0}); + } + } } diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/geometry/JavaModelResolver.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/geometry/JavaModelResolver.java new file mode 100644 index 00000000..82c27c5c --- /dev/null +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/geometry/JavaModelResolver.java @@ -0,0 +1,200 @@ +package fr.robie.craftengineconverter.converter.bedrock.geometry; + +import fr.robie.craftengineconverter.converter.bedrock.asset.VanillaAssets; +import fr.robie.craftengineconverter.converter.bedrock.display.DisplayPresets; +import fr.robie.messageflow.logger.Logger; + +import java.io.IOException; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * Loads Java models from an asset tree, following {@code parent} chains and caching the result. + *

+ * Both blockstates and item model definitions reference models, never textures directly — a + * Java item model definition names something like {@code default:item/topaz_bow}, and the texture only + * appears inside {@code assets/default/models/item/topaz_bow.json} as + * {@code {"parent": "item/bow", "textures": {"layer0": "item/custom/topaz_bow"}}}. Resolving that + * indirection is what turns a model reference into files that can be copied into the pack. + *

+ * Failed lookups are cached as {@code null} so a missing or malformed model is only read from disk once. + */ +public final class JavaModelResolver { + + // Keyed by the model reference as written ("default:item/topaz_bow"), value null when unresolvable. + private final Map cache = new HashMap<>(); + // Parents whose shape had to be guessed, so the notice is logged once each rather than once per item. + private final java.util.Set rebuiltShapes = new java.util.HashSet<>(); + private VanillaAssets vanillaAssets; + + /** + * Supplies the vanilla models a pack inherits but does not ship — {@code block/cactus}, {@code block/anvil} + * and the rest. Consulted only after the pack's own assets miss, so a pack overriding a vanilla model still + * wins. + */ + public JavaModelResolver withVanillaAssets(VanillaAssets vanillaAssets) { + this.vanillaAssets = vanillaAssets; + return this; + } + + /** Loads a model by reference, with its {@code parent} chain already merged in. */ + public JavaBlockModel load(String modelPath, Path javaAssetsDir) { + if (this.cache.containsKey(modelPath)) { + return this.cache.get(modelPath); + } + + Path modelFile = this.locate(modelPath, javaAssetsDir); + if (modelFile == null) { + this.cache.put(modelPath, null); + return null; + } + + try { + JavaBlockModel model = JavaBlockModel.load(modelFile); + this.resolveParent(model, javaAssetsDir); + this.cache.put(modelPath, model); + return model; + } catch (IOException e) { + this.cache.put(modelPath, null); + return null; + } + } + + /** + * Finds a model file: the pack first, then the vanilla assets. + * + * @return the file, or {@code null} when neither source has it + */ + private Path locate(String modelPath, Path javaAssetsDir) { + Path inPack = resolveFile(modelPath, javaAssetsDir); + if (inPack.toFile().exists()) return inPack; + + return this.vanillaAssets == null ? null : this.vanillaAssets.resolve(assetPath(modelPath)); + } + + /** {@code "block/cactus"} to {@code "minecraft/models/block/cactus.json"}. */ + private static String assetPath(String modelPath) { + int colon = modelPath.indexOf(':'); + String namespace = colon >= 0 ? modelPath.substring(0, colon) : "minecraft"; + String path = colon >= 0 ? modelPath.substring(colon + 1) : modelPath; + return namespace + "/models/" + path + ".json"; + } + + /** + * Every texture reference a model declares, with {@code #variable} indirections dropped. + *

+ * Returned values are raw Java references ({@code item/custom/topaz_bow} or + * {@code namespace:path}), in declaration order and de-duplicated. + */ + public List texturesOf(String modelPath, Path javaAssetsDir) { + JavaBlockModel model = this.load(modelPath, javaAssetsDir); + if (model == null) return List.of(); + + List textures = new ArrayList<>(); + for (String ref : model.textures().values()) { + // A leftover "#other_key" means the variable was never bound; there is nothing to copy. + if (ref == null || ref.startsWith("#")) continue; + if (!textures.contains(ref)) textures.add(ref); + } + return textures; + } + + private void resolveParent(JavaBlockModel model, Path javaAssetsDir) { + if (model.parent().isEmpty()) return; + String parentPath = model.parent().get(); + + // A vanilla parent lives in the game jar, not in the pack. + JavaBlockModel parent; + if (this.cache.containsKey(parentPath)) { + parent = this.cache.get(parentPath); + } else { + Path parentFile = this.locate(parentPath, javaAssetsDir); + if (parentFile == null) { + this.cache.put(parentPath, null); + parent = null; + } else { + try { + parent = JavaBlockModel.load(parentFile); + this.resolveParent(parent, javaAssetsDir); + this.cache.put(parentPath, parent); + } catch (IOException e) { + this.cache.put(parentPath, null); + parent = null; + } + } + } + + if (parent != null) { + inherit(model, parent); + return; + } + + // Nothing shipped the parent and no vanilla assets are available, so its shape and its pose can only be + // guessed from its name. A cube is still far closer than the flat square the icon would otherwise fall + // back to — see VanillaBlockShapes for why this is a stopgap. + // + // Keyed on the parent being unresolved rather than on the cache missing: an unresolvable parent is cached + // as null, so checking the cache would rebuild the shape for the first item naming block/cube_all and + // leave every other one flat. + boolean rebuiltShape = VanillaBlockShapes.addCube(model, parentPath); + boolean rebuiltPose = inheritPresetDisplay(model, parentPath); + if ((rebuiltShape || rebuiltPose) && this.rebuiltShapes.add(parentPath)) { + Logger.debug("Rebuilt " + parentPath + " from its name; cache the vanilla assets" + + " (/cec bedrock vanilla-assets) for its real shape and pose"); + } + } + + /** + * Fills the pose a missing vanilla parent would have supplied, from {@link DisplayPresets}. + *

+ * Without this an offline conversion poses every item the same way, because a model saying + * {@code {"parent": "item/handheld"}} and nothing else arrives with an empty {@code display} map. Per context, + * not wholesale, for the same reason {@link #inherit} is: a model may override {@code gui} alone. + * + * @return whether any context was filled in + */ + private static boolean inheritPresetDisplay(JavaBlockModel model, String parentPath) { + boolean filled = false; + for (var preset : DisplayPresets.forParent(parentPath).entrySet()) { + if (model.display(preset.getKey()).isEmpty()) { + model.addDisplay(preset.getKey(), preset.getValue()); + filled = true; + } + } + return filled; + } + + // A child's own entries win; the parent only fills gaps and resolves the child's #variables. + private static void inherit(JavaBlockModel child, JavaBlockModel parent) { + for (Map.Entry tex : parent.textures().entrySet()) { + String childTex = child.textures().get(tex.getKey()); + if (childTex == null || childTex.startsWith("#")) { + child.textures().put(tex.getKey(), tex.getValue()); + } + } + if (child.elements().isEmpty() && !parent.elements().isEmpty()) { + for (var element : parent.elements()) child.addElement(element); + } + // Most models never write a display block of their own — the GUI pose comes from a vanilla parent + // such as item/generated or block/block, so without this the icon renderer would have nothing to + // pose by. Per context, not wholesale: a child may override "gui" alone and inherit the rest. + for (var entry : parent.display().entrySet()) { + if (child.display(entry.getKey()).isEmpty()) { + child.addDisplay(entry.getKey(), entry.getValue()); + } + } + if (!child.guiLightFront() && parent.guiLightFront()) { + child.setGuiLightFront(true); + } + } + + private static Path resolveFile(String modelPath, Path javaAssetsDir) { + int colon = modelPath.indexOf(':'); + String namespace = colon >= 0 ? modelPath.substring(0, colon) : "minecraft"; + String path = colon >= 0 ? modelPath.substring(colon + 1) : modelPath; + return javaAssetsDir.resolve(namespace + "/models/" + path + ".json"); + } +} diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/geometry/VanillaBlockShapes.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/geometry/VanillaBlockShapes.java new file mode 100644 index 00000000..3ed32350 --- /dev/null +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/geometry/VanillaBlockShapes.java @@ -0,0 +1,126 @@ +package fr.robie.craftengineconverter.converter.bedrock.geometry; + +import java.util.Locale; +import java.util.Map; + +/** + * Rebuilds the cube that a vanilla block-model parent would have supplied. + *

+ * A custom block almost never declares its own geometry — it says + * {@code {"parent": "block/cube_all", "textures": {"all": "block/custom/topaz_ore"}}} and inherits the shape from + * vanilla. Those parents live in the game jar, not in the pack, so the parent chain dead-ends and the model comes + * out with no elements at all. For the inventory icon that is the difference between the familiar three-faced + * block and a single flat square, so the cube is reconstructed here from the parent's name. + *

+ * Only genuinely cube-shaped parents are listed. {@code block/cross} and {@code block/sugar_cane} are crossed + * planes, and Java draws their items as flat sprites too — so leaving them out is not an omission, it is + * what matches the client. + */ +public final class VanillaBlockShapes { + + /** + * Which texture key each face takes, per parent. Keys are the vanilla parents' own + * {@code textures} names, so a pack that fills them in for the parent it named will resolve. + */ + private static final Map> SHAPES = Map.ofEntries( + Map.entry("block/cube_all", faces("all", "all", "all")), + Map.entry("block/cube_mirrored_all", faces("all", "all", "all")), + Map.entry("block/leaves", faces("all", "all", "all")), + Map.entry("block/tinted_cube_all", faces("all", "all", "all")), + Map.entry("block/cube_column", faces("end", "end", "side")), + Map.entry("block/cube_column_horizontal", faces("end", "end", "side")), + Map.entry("block/cube_column_mirrored", faces("end", "end", "side")), + Map.entry("block/cube_bottom_top", faces("top", "bottom", "side")), + Map.entry("block/cube_top", faces("top", "side", "side")), + Map.entry("block/cactus", faces("top", "bottom", "side")), + Map.entry("block/template_glazed_terracotta", faces("pattern", "pattern", "pattern")), + Map.entry("block/cube", Map.of( + "up", "up", "down", "down", + "north", "north", "south", "south", "east", "east", "west", "west")), + Map.entry("block/orientable", Map.of( + "up", "top", "down", "top", + "north", "front", "south", "side", "east", "side", "west", "side")), + Map.entry("block/orientable_with_bottom", Map.of( + "up", "top", "down", "bottom", + "north", "front", "south", "side", "east", "side", "west", "side"))); + + /** The order faces are emitted in, so a rebuilt shape serialises the same way every run. */ + private static final String[] FACE_ORDER = {"north", "south", "east", "west", "up", "down"}; + + private static Map faces(String up, String down, String side) { + return Map.of("up", up, "down", down, "north", side, "south", side, "east", side, "west", side); + } + + /** + * Per-face texture rotations, for the handful of vanilla parents whose whole appearance is a rotation rather + * than a texture. + *

+ * Only {@code template_glazed_terracotta} needs this, and it needs it badly: the parent turns its four sides by + * different quarter-turns, which is what makes a glazed-terracotta pattern continue around the block. Rebuilding + * the cube without them — as this did — leaves every face at rotation zero, so a chessboard or any patterned + * block of that family reads wrong in game while looking right in Blockbench, which has the real parent. + *

+ * Same caveat as {@link #SHAPES}: with the vanilla assets cached the real parent resolves and none of this runs. + */ + private static final Map> FACE_ROTATIONS = Map.of( + "block/template_glazed_terracotta", Map.of( + "north", 90, "south", 270, "west", 0, "east", 180, "up", 0, "down", 0)); + + private VanillaBlockShapes() { + throw new UnsupportedOperationException("VanillaBlockShapes is a utility class and cannot be instantiated."); + } + + /** Whether {@code parent} names a vanilla parent whose shape is a full cube. */ + public static boolean isCube(String parent) { + return parent != null && SHAPES.containsKey(normalise(parent)); + } + + /** + * Gives {@code model} the full 1x1x1 cube its parent would have, with each face pointed at the texture key + * that parent uses. A key the model does not define falls back to another it does, so a model naming only + * {@code side} still renders rather than losing faces. + * + * @return whether an element was added + */ + public static boolean addCube(JavaBlockModel model, String parent) { + Map layout = SHAPES.get(normalise(parent)); + if (layout == null || model == null || !model.elements().isEmpty()) return false; + + JavaBlockModel.Element cube = new JavaBlockModel.Element(0, 0, 0, 16, 16, 16); + boolean any = false; + // A fixed order rather than the layout map's own. Those layouts are Map.of, whose iteration order the JDK + // deliberately randomises per run, and faces are serialised in the order they are added — so iterating the + // map made a rebuilt block's geometry file differ between two conversions of the same pack. + Map rotations = FACE_ROTATIONS.getOrDefault(normalise(parent), Map.of()); + for (String direction : FACE_ORDER) { + String textureKey = layout.get(direction); + if (textureKey == null) continue; + String key = resolveKey(model, textureKey); + if (key == null) continue; + // Whole-texture UVs: a vanilla cube parent maps each face to the entire image. No tint index — + // leaves and grass are tinted by biome in Java, and a sprite cannot follow a biome, so the texture's + // own colour is the least wrong answer. + cube.addFace(direction, "#" + key, 0, 0, 16, 16, rotations.getOrDefault(direction, 0), -1); + any = true; + } + if (!any) return false; + + model.addElement(cube); + return true; + } + + private static String resolveKey(JavaBlockModel model, String preferred) { + if (model.textures().containsKey(preferred)) return preferred; + for (String fallback : new String[]{"all", "side", "end", "top", "particle", "0"}) { + if (model.textures().containsKey(fallback)) return fallback; + } + return model.textures().isEmpty() ? null : model.textures().keySet().iterator().next(); + } + + private static String normalise(String parent) { + String value = parent.toLowerCase(Locale.ROOT); + int colon = value.indexOf(':'); + if (colon >= 0) value = value.substring(colon + 1); + return value; + } +} diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/texture/TexturePipeline.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/texture/TexturePipeline.java index 1a2371a1..d3210b00 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/texture/TexturePipeline.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/texture/TexturePipeline.java @@ -15,6 +15,42 @@ public class TexturePipeline { private final Map textureCache = new HashMap<>(); private final List processedTextures = new ArrayList<>(); + private final Map transparencyCache = new HashMap<>(); + /** Reported once each, because one texture is asked about once per state or variant that uses it. */ + private final Set missingTextures = new java.util.LinkedHashSet<>(); + private final Set trimFallbacks = new java.util.LinkedHashSet<>(); + private fr.robie.craftengineconverter.converter.bedrock.asset.VanillaAssets vanillaAssets; + + /** + * Supplies vanilla textures a pack references but does not ship. Consulted only after the pack's own assets + * miss, so a pack overriding a vanilla texture still wins. + */ + public TexturePipeline withVanillaAssets( + fr.robie.craftengineconverter.converter.bedrock.asset.VanillaAssets vanillaAssets) { + this.vanillaAssets = vanillaAssets; + return this; + } + + /** + * The modern per-slot trim sheet a legacy per-material trim texture maps onto, or {@code null} when the path is + * not a trim overlay at all. + *

+ * {@code trims/items/helmet_trim_gold} to {@code trims/items/helmet_trim}. Matched on the directory as well as + * the suffix so an unrelated texture that happens to end in {@code _trim_something} is left alone. + */ + private static String trimSheetFor(String textureFilePath) { + if (!textureFilePath.startsWith("trims/items/")) return null; + int trim = textureFilePath.lastIndexOf("_trim_"); + return trim < 0 ? null : textureFilePath.substring(0, trim + "_trim".length()); + } + + /** One line about trim overlays that fell back to the greyscale sheet, rather than one per material. */ + public void reportTrimFallbacks() { + if (this.trimFallbacks.isEmpty()) return; + Logger.info(this.trimFallbacks.size() + " armour trim overlay(s) fell back to vanilla's greyscale sheet" + + " - the pack names per-material files that vanilla no longer ships, so trims keep their shape" + + " but not their colour"); + } public Optional resolveTexture(String modelPath, String bedrockKey, Path javaAssetsDir) { String cacheKey = modelPath; @@ -27,8 +63,43 @@ public Optional resolveTexture(String modelPath, String bedro String namespace = this.extractNamespace(modelPath); Path sourceFile = javaAssetsDir.resolve(namespace + "/textures/" + textureFilePath + ".png"); if (!Files.exists(sourceFile)) { - Logger.warn("Texture not found: " + sourceFile.toAbsolutePath()); - return Optional.empty(); + // A pack may reference a vanilla texture it does not ship — item/light for a light block, or the + // trims/items overlays for armour trims. Those live in the client jar. + Path vanilla = this.vanillaAssets == null + ? null + : this.vanillaAssets.resolve(namespace + "/textures/" + textureFilePath + ".png"); + + // Armour trim overlays were renamed. Vanilla used to ship one file per material + // (trims/items/helmet_trim_gold.png); it now ships a single greyscale sheet per slot + // (trims/items/helmet_trim.png) and tints it from a palette at render time. A pack written against + // the older layout names files that no longer exist — which was 50-odd warnings and a broken texture + // per trim. The sheet is the right shape, just not the right colour, which beats a missing texture. + if (vanilla == null) { + String sheet = trimSheetFor(textureFilePath); + if (sheet != null && this.vanillaAssets != null) { + vanilla = this.vanillaAssets.resolve(namespace + "/textures/" + sheet + ".png"); + if (vanilla != null) { + textureFilePath = sheet; + this.trimFallbacks.add(sheet); + } + } + } + + if (vanilla == null) { + // Deduplicated: one model's texture is asked about once per state that uses it, and a pack + // missing a file would otherwise report it dozens of times. + if (this.missingTextures.add(textureFilePath)) { + Logger.warn("Texture not found: " + sourceFile.toAbsolutePath()); + } + return Optional.empty(); + } + sourceFile = vanilla; + + // Pull the .mcmeta out too, if there is one. detectAnimation below looks for it as a sibling of the + // png, which holds for a folder source but not for a jar: assets are extracted from an archive one at + // a time, on request, so a file nobody asks for never lands in the cache. Over 200 vanilla textures + // ship a .mcmeta, and without this every one of them a pack inherits arrives as a still image. + this.vanillaAssets.resolve(namespace + "/textures/" + textureFilePath + ".png.mcmeta"); } Optional animation = this.detectAnimation(sourceFile); @@ -40,6 +111,42 @@ public Optional resolveTexture(String modelPath, String bedro return Optional.of(info); } + /** + * Whether a texture has any pixel that is not fully opaque. + *

+ * Decides a block's render method: a leaf or a ladder drawn with {@code opaque} shows its see-through pixels as + * solid, so a texture with alpha needs {@code alpha_test}. Cached per reference, since one texture is asked + * about once per block state that uses it. + */ + public boolean hasTransparency(String textureRef, Path javaAssetsDir) { + Boolean cached = this.transparencyCache.get(textureRef); + if (cached != null) return cached; + + boolean transparent = false; + Optional resolved = this.resolveTexture(textureRef, textureRef, javaAssetsDir); + if (resolved.isPresent()) { + try { + BufferedImage image = ImageIO.read(resolved.get().sourcePath().toFile()); + if (image != null && image.getColorModel().hasAlpha()) { + outer: + for (int y = 0; y < image.getHeight(); y++) { + for (int x = 0; x < image.getWidth(); x++) { + if ((image.getRGB(x, y) >>> 24) != 0xFF) { + transparent = true; + break outer; + } + } + } + } + } catch (Exception e) { + Logger.debug("Could not read " + textureRef + " to check for transparency: " + e.getMessage()); + } + } + + this.transparencyCache.put(textureRef, transparent); + return transparent; + } + public boolean copyTexture(CachedTextureInfo info, Path outputTexturesDir) { try { Path targetPath = outputTexturesDir.resolve(info.bedrockTexturePath().replace("textures/", "") + ".png"); From ce3d246a9f8b3a296eaffde2845531598b77ba46 Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Wed, 5 Aug 2026 11:30:11 +0200 Subject: [PATCH 044/116] refactor: replace BedrockPredicate with ConditionPredicate in item predicate classes --- .../predicate/condition/BrokenPredicate.java | 3 +-- .../condition/ConditionPredicate.java | 18 ++++++++++++++++++ .../condition/CustomModelDataPredicate.java | 3 +-- .../predicate/condition/DamagedPredicate.java | 3 +-- .../condition/FishingRodCastPredicate.java | 3 +-- .../condition/HasComponentPredicate.java | 3 +-- 6 files changed, 23 insertions(+), 10 deletions(-) create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/condition/ConditionPredicate.java diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/condition/BrokenPredicate.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/condition/BrokenPredicate.java index 2a3e6d83..457926df 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/condition/BrokenPredicate.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/condition/BrokenPredicate.java @@ -1,8 +1,7 @@ package fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate.condition; -import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate.BedrockPredicate; -public class BrokenPredicate extends BedrockPredicate { +public class BrokenPredicate extends ConditionPredicate { public BrokenPredicate(boolean expected) { super(expected); diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/condition/ConditionPredicate.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/condition/ConditionPredicate.java new file mode 100644 index 00000000..793b8e6c --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/condition/ConditionPredicate.java @@ -0,0 +1,18 @@ +package fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate.condition; + +import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate.BedrockPredicate; + +/** + * Base for the boolean predicates Geyser groups under {@code "type": "condition"}. + *

+ * Mirrors {@code RangeDispatchPredicate}, which tags its type in the constructor rather than leaving it + * to every subclass. Without the tag the serialized predicate carries only a {@code property} and + * Geyser cannot tell which predicate family it belongs to. + */ +public abstract class ConditionPredicate extends BedrockPredicate { + + protected ConditionPredicate(boolean expected) { + super(expected); + this.withType(Type.CONDITION); + } +} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/condition/CustomModelDataPredicate.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/condition/CustomModelDataPredicate.java index 03843759..0c5d56c0 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/condition/CustomModelDataPredicate.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/condition/CustomModelDataPredicate.java @@ -1,9 +1,8 @@ package fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate.condition; import com.google.gson.JsonObject; -import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate.BedrockPredicate; -public class CustomModelDataPredicate extends BedrockPredicate { +public class CustomModelDataPredicate extends ConditionPredicate { private final int index; public CustomModelDataPredicate(int index) { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/condition/DamagedPredicate.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/condition/DamagedPredicate.java index fcea1081..d186bd6c 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/condition/DamagedPredicate.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/condition/DamagedPredicate.java @@ -1,8 +1,7 @@ package fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate.condition; -import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate.BedrockPredicate; -public class DamagedPredicate extends BedrockPredicate { +public class DamagedPredicate extends ConditionPredicate { public DamagedPredicate() { super(true); } diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/condition/FishingRodCastPredicate.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/condition/FishingRodCastPredicate.java index a732d29f..f71ba0b4 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/condition/FishingRodCastPredicate.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/condition/FishingRodCastPredicate.java @@ -1,8 +1,7 @@ package fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate.condition; -import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate.BedrockPredicate; -public class FishingRodCastPredicate extends BedrockPredicate { +public class FishingRodCastPredicate extends ConditionPredicate { public FishingRodCastPredicate() { super(true); diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/condition/HasComponentPredicate.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/condition/HasComponentPredicate.java index 9d36b13f..6a6c762b 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/condition/HasComponentPredicate.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/condition/HasComponentPredicate.java @@ -1,9 +1,8 @@ package fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate.condition; import com.google.gson.JsonObject; -import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate.BedrockPredicate; -public class HasComponentPredicate extends BedrockPredicate { +public class HasComponentPredicate extends ConditionPredicate { private final String component; public HasComponentPredicate(String component) { From d5ab647afe39f0d7acb07a55af2d328ff17c1f9b Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Wed, 5 Aug 2026 11:31:30 +0200 Subject: [PATCH 045/116] refactor: use TreeMap for itemMappings to maintain natural ordering of materials --- .../bedrock/mapping/MappingsConfiguration.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/MappingsConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/MappingsConfiguration.java index 039c4d32..674100eb 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/MappingsConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/MappingsConfiguration.java @@ -8,15 +8,12 @@ import org.jetbrains.annotations.NotNull; import java.nio.file.Path; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; public class MappingsConfiguration { private static final int formatVersion = 2; - private final Map> itemMappings = new HashMap<>(); + private final Map> itemMappings = new TreeMap<>(Comparator.comparing(Material::name)); public MappingsConfiguration addItemMapping(@NotNull ItemMapping itemMapping) { this.itemMappings.computeIfAbsent(itemMapping.getJavaMaterial(), k -> new ArrayList<>()).add(itemMapping); From aee46b49a39f701e1e176bfcd40050f772efb2bc Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Wed, 5 Aug 2026 11:32:00 +0200 Subject: [PATCH 046/116] feat: add CreativeGroupRules and VanillaItemGroups for item group mapping --- .../item/option/CreativeGroupRules.java | 214 ++++++++++++++++++ .../item/option/VanillaItemGroups.java | 112 +++++++++ 2 files changed, 326 insertions(+) create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/option/CreativeGroupRules.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/option/VanillaItemGroups.java diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/option/CreativeGroupRules.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/option/CreativeGroupRules.java new file mode 100644 index 00000000..1d9383c8 --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/option/CreativeGroupRules.java @@ -0,0 +1,214 @@ +package fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.option; + +import fr.robie.messageflow.logger.Logger; +import fr.robie.yamllibrary.ConfigurationSection; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.ArrayList; +import java.util.List; +import java.util.Locale; +import java.util.regex.Pattern; +import java.util.regex.PatternSyntaxException; + +/** + * Author-declared rules assigning converted items to a creative-menu group by matching their + * CraftEngine item id. + *

+ * {@link VanillaItemGroups} can only ever infer a group from the item's base material, which is often + * nothing useful: a custom ore built on {@code nether_brick} inherits no group at all, even though + * {@code itemGroup.name.ore} exists and is plainly where it belongs. The pack author is the one who knows + * their own naming convention — {@code *_ore}, {@code *_log} — so they get to state it, and matching happens + * on the id ({@code default:topaz_ore}) rather than the material. + *

+ * Rules are ordered as written in the configuration and the first match wins, so a narrow rule must + * precede a broad one. A rule matches ids two ways, and may use either or both: + *

    + *
  • {@code wildcards} — {@code *_ore}, where {@code *} is any run of characters and {@code ?} is one. + * Describes the whole id, with the namespace optional, as {@code blacklisted-paths} does.
  • + *
  • {@code patterns} — Java regex applied with {@link java.util.regex.Matcher#find()}, so {@code _ore$} + * and {@code .*_ore} both work.
  • + *
+ * Both are case-insensitive. They are separate keys rather than one auto-detected key because a bare + * {@code topaz} means "contains topaz" as a regex but "is exactly topaz" as a wildcard, and guessing wrong + * would quietly change what a rule matches. + *

+ * Only vanilla group names work — a custom group lives in a behavior pack, which Geyser cannot send — so a + * name {@link VanillaItemGroups} does not know is warned about at load time rather than silently ignored by + * the client. + */ +public final class CreativeGroupRules { + + private static final CreativeGroupRules EMPTY = new CreativeGroupRules(List.of()); + + private final List rules; + + private CreativeGroupRules(@NotNull List rules) { + this.rules = rules; + } + + public static CreativeGroupRules empty() { + return EMPTY; + } + + /** + * Reads the rules from a {@code creative-groups} section. Every rule is validated here, once, so a typo + * is reported at startup instead of producing a silently ungrouped pack; a rule that cannot be used is + * skipped and the rest still apply. + */ + public static CreativeGroupRules parse(@Nullable ConfigurationSection section) { + if (section == null) return EMPTY; + + List parsed = new ArrayList<>(); + // getKeys(false) preserves the order the keys appear in the file, which is what makes + // "first match wins" a promise the author can rely on. + for (String name : section.getKeys(false)) { + ConfigurationSection ruleSection = section.getConfigurationSection(name); + if (ruleSection == null) { + Logger.warn("creative-groups." + name + " is not a section - ignoring it"); + continue; + } + + String group = ruleSection.getString("group"); + if (group == null || group.isBlank()) { + Logger.warn("creative-groups." + name + " has no 'group' - ignoring it"); + continue; + } + if (!VanillaItemGroups.isKnownGroup(group)) { + Logger.warn("creative-groups." + name + " uses group '" + group + "', which is not a vanilla" + + " Bedrock group - the client will ignore it, since custom groups need a behavior" + + " pack and Geyser cannot send those"); + } + + List patternStrings = ruleSection.getStringList("patterns"); + List wildcardStrings = ruleSection.getStringList("wildcards"); + if (patternStrings.isEmpty() && wildcardStrings.isEmpty()) { + Logger.warn("creative-groups." + name + " has no 'wildcards' or 'patterns' - ignoring it"); + continue; + } + + List patterns = new ArrayList<>(); + for (String wildcard : wildcardStrings) { + patterns.add(wildcardToPattern(wildcard)); + } + for (String patternString : patternStrings) { + try { + patterns.add(Pattern.compile(patternString, Pattern.CASE_INSENSITIVE)); + } catch (PatternSyntaxException e) { + // Writing "*_ore" under 'patterns' is the natural mistake, and as a regex it is simply + // invalid, so say where it belongs instead of only reporting the syntax error. + String hint = looksLikeWildcard(patternString) + ? " - it looks like a wildcard, so list it under 'wildcards' instead of 'patterns'" + : " - skipping that pattern: " + e.getDescription(); + Logger.warn("creative-groups." + name + " has an invalid regex '" + patternString + "'" + hint); + } + } + if (patterns.isEmpty()) { + Logger.warn("creative-groups." + name + " has no usable pattern - ignoring it"); + continue; + } + + parsed.add(new Rule(name, group, ruleSection.getString("category"), patterns)); + } + + return parsed.isEmpty() ? EMPTY : new CreativeGroupRules(List.copyOf(parsed)); + } + + /** + * Compiles a wildcard into the equivalent regex: {@code *} stands for any run of characters, {@code ?} for + * exactly one, and everything else is literal. + *

+ * The result is anchored, so a wildcard describes the whole id rather than any part of it — which is + * what {@code *_ore} plainly means. The namespace is optional in that match, following the same convention + * as {@code blacklisted-paths}: {@code topaz_*} matches {@code default:topaz_ore} without the author + * having to spell out {@code *:topaz_*}. + *

+ * A wildcard can never fail to compile, which is the main reason to keep it a separate key from + * {@code patterns} rather than guessing which of the two an author meant. + */ + static Pattern wildcardToPattern(@NotNull String wildcard) { + StringBuilder regex = new StringBuilder("^(?:[^:]*:)?"); + StringBuilder literal = new StringBuilder(); + for (char c : wildcard.toCharArray()) { + if (c != '*' && c != '?') { + literal.append(c); + continue; + } + if (!literal.isEmpty()) { + regex.append(Pattern.quote(literal.toString())); + literal.setLength(0); + } + regex.append(c == '*' ? ".*" : "."); + } + if (!literal.isEmpty()) regex.append(Pattern.quote(literal.toString())); + + return Pattern.compile(regex.append('$').toString(), Pattern.CASE_INSENSITIVE); + } + + private static boolean looksLikeWildcard(@NotNull String pattern) { + return pattern.indexOf('*') >= 0 || pattern.indexOf('?') >= 0; + } + + /** + * Normalises whatever the configuration layer holds for the {@code creative-groups} key. The key is + * typed loosely so that its written-back default stays a plain YAML mapping rather than a serialized + * Java object — see {@code ConfigurationKey.CREATIVE_GROUPS}. + */ + public static CreativeGroupRules from(@Nullable Object configValue) { + if (configValue instanceof CreativeGroupRules rules) return rules; + if (configValue instanceof ConfigurationSection section) return parse(section); + return EMPTY; + } + + public boolean isEmpty() { + return this.rules.isEmpty(); + } + + public int size() { + return this.rules.size(); + } + + /** + * The first rule matching {@code itemId}, or {@code null} when none does. + * + * @param itemId a CraftEngine item id such as {@code default:topaz_ore} + */ + @Nullable + public Rule match(@Nullable String itemId) { + if (itemId == null || itemId.isBlank()) return null; + for (Rule rule : this.rules) { + for (Pattern pattern : rule.patterns()) { + if (pattern.matcher(itemId).find()) return rule; + } + } + return null; + } + + /** + * @param name the rule's key in the configuration, used only in log messages + * @param group the vanilla group name to emit, e.g. {@code itemGroup.name.ore} + * @param category an optional {@code creative_category} override; without it the material-derived + * category still applies, and the group would be dropped if that came out as none + * @param patterns every wildcard and regex of the rule, already compiled — a wildcard arrives here as the + * anchored regex it is equivalent to, so matching needs to know no difference + */ + public record Rule(@NotNull String name, @NotNull String group, @Nullable String category, + @NotNull List patterns) { + + /** + * The declared category as a {@link BedrockOptions.CreativeCategory}, or {@code null} when the rule + * declares none or names one that does not exist. + */ + @Nullable + public BedrockOptions.CreativeCategory resolvedCategory() { + if (this.category == null || this.category.isBlank()) return null; + try { + return BedrockOptions.CreativeCategory.valueOf(this.category.toUpperCase(Locale.ROOT)); + } catch (IllegalArgumentException e) { + Logger.warn("creative-groups." + this.name + " uses unknown category '" + this.category + + "' - falling back to the category derived from the item's material"); + return null; + } + } + } +} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/option/VanillaItemGroups.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/option/VanillaItemGroups.java new file mode 100644 index 00000000..3af24c14 --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/option/VanillaItemGroups.java @@ -0,0 +1,112 @@ +package fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.option; + +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; +import fr.robie.messageflow.logger.Logger; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.io.InputStream; +import java.io.InputStreamReader; +import java.nio.charset.StandardCharsets; +import java.util.Collections; +import java.util.HashMap; +import java.util.Locale; +import java.util.Map; +import java.util.Set; + +/** + * Maps a vanilla Bedrock item to the creative-menu group it belongs to. + *

+ * A group is the expandable stack the creative menu shows — every helmet under one + * {@code itemGroup.name.helmet} entry rather than eight separate slots — and the recipe book uses it to + * locate an item. Since every converted item is based on a vanilla item, that base item's own group is the + * natural one for it: a custom pair of boots built on {@code chainmail_boots} belongs with the boots. + *

+ * Only vanilla groups are possible. Custom groups are declared in a behavior pack + * ({@code BP/item_catalog/crafting_item_catalog.json}) and Geyser cannot send behavior packs, so a made-up + * group name would simply be ignored. When a base item has no vanilla group — {@code bow}, + * {@code fishing_rod} and the like belong to no family — the key is omitted rather than invented. + *

+ * The table is generated from the Bedrock wiki's vanilla-item-group data (vendored under + * {@code concepts/bedrock-wiki/public/assets/tables/items/vanilla-item-groups/}) and shipped as a resource, + * since {@code concepts/} is documentation and is not on the runtime classpath. + *

+ * Group names are emitted unprefixed ({@code itemGroup.name.boots}), matching Geyser's own + * documented examples. The Bedrock wiki lists them namespaced ({@code minecraft:itemGroup.name.boots}); + * Geyser is what consumes this file, so its spelling wins. + */ +public final class VanillaItemGroups { + + private static final String RESOURCE = "/bedrock/vanilla_item_groups.json"; + private static Map groups; + private static volatile Set knownGroups; + + private VanillaItemGroups() { + throw new UnsupportedOperationException("VanillaItemGroups is a utility class and cannot be instantiated."); + } + + /** + * The creative group for a vanilla item, or {@code null} when it belongs to none. + * + * @param itemName a vanilla item name, with or without the {@code minecraft:} prefix + */ + @Nullable + public static String groupFor(@Nullable String itemName) { + if (itemName == null || itemName.isBlank()) return null; + String name = itemName.toLowerCase(Locale.ROOT); + if (name.startsWith("minecraft:")) name = name.substring("minecraft:".length()); + return load().get(name); + } + + public static int size() { + return load().size(); + } + + /** + * Whether {@code group} is a group name some vanilla item actually uses. + *

+ * Used to catch a typo in author-declared rules ({@link CreativeGroupRules}) at load time: an unknown + * group is not an error the client reports, it simply has no effect, so the only chance to say anything + * useful is before the pack is written. + */ + public static boolean isKnownGroup(@Nullable String group) { + if (group == null || group.isBlank()) return false; + return knownGroups().contains(group); + } + + /** + * Every group name in use by a vanilla item. + */ + public static Set knownGroups() { + if (knownGroups == null) { + synchronized (VanillaItemGroups.class) { + if (knownGroups == null) { + knownGroups = Set.copyOf(load().values()); + } + } + } + return knownGroups; + } + + private static synchronized Map load() { + if (groups != null) return groups; + + Map loaded = new HashMap<>(); + try (InputStream in = VanillaItemGroups.class.getResourceAsStream(RESOURCE)) { + if (in == null) { + Logger.warn("Missing " + RESOURCE + " - items will have no creative group"); + } else { + JsonObject json = JsonParser.parseReader( + new InputStreamReader(in, StandardCharsets.UTF_8)).getAsJsonObject(); + for (String key : json.keySet()) { + loaded.put(key.toLowerCase(Locale.ROOT), json.get(key).getAsString()); + } + } + } catch (Exception e) { + Logger.error("Failed to read " + RESOURCE, e); + } + groups = Collections.unmodifiableMap(loaded); + return groups; + } +} From f2325c0907c47b0e9f06a4b9850b4226b0af6426 Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Wed, 5 Aug 2026 12:37:58 +0200 Subject: [PATCH 047/116] refactor: change flipbookTextures to use LinkedHashMap for improved data management --- .../texture/FlipbookTextureConfiguration.java | 24 +++++++------------ .../bedrock/texture/FlipbookTextureData.java | 3 +++ 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/texture/FlipbookTextureConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/texture/FlipbookTextureConfiguration.java index a9162a04..fbd07934 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/texture/FlipbookTextureConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/texture/FlipbookTextureConfiguration.java @@ -1,21 +1,18 @@ package fr.robie.craftengineconverter.api.configuration.bedrock.texture; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; import com.google.gson.JsonArray; -import fr.robie.messageflow.logger.Logger; +import fr.robie.craftengineconverter.api.manager.FileCacheManager; import org.jetbrains.annotations.NotNull; -import java.nio.file.Files; import java.nio.file.Path; -import java.util.ArrayList; -import java.util.List; +import java.util.LinkedHashMap; +import java.util.Map; public class FlipbookTextureConfiguration { - private final List flipbookTextures = new ArrayList<>(); + private final Map flipbookTextures = new LinkedHashMap<>(); public FlipbookTextureConfiguration addFlipbookTexture(@NotNull FlipbookTextureData data) { - this.flipbookTextures.add(data); + this.flipbookTextures.put(data.getAtlasTile(), data); return this; } @@ -23,17 +20,12 @@ public boolean isEmpty() { return this.flipbookTextures.isEmpty(); } - private static final Gson GSON = new GsonBuilder().setPrettyPrinting().disableHtmlEscaping().create(); - public void save(@NotNull Path directory) { JsonArray array = new JsonArray(); - for (FlipbookTextureData data : this.flipbookTextures) { + for (FlipbookTextureData data : this.flipbookTextures.values()) { array.add(data.serialize()); } - try (var writer = Files.newBufferedWriter(directory.resolve("flipbook_textures.json"))) { - GSON.toJson(array, writer); - } catch (Exception e) { - Logger.error("Failed to write flipbook_textures.json", e); - } + + FileCacheManager.saveJsonToFile(directory.resolve("flipbook_textures.json"), array); } } diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/texture/FlipbookTextureData.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/texture/FlipbookTextureData.java index eae745fc..25de84db 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/texture/FlipbookTextureData.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/texture/FlipbookTextureData.java @@ -32,6 +32,9 @@ public FlipbookTextureData( public String atlasTile() { return this.atlasTile; } public String flipbookTexture() { return this.flipbookTexture; } + public String getAtlasTile() { + return this.atlasTile; + } public JsonObject serialize() { JsonObject obj = new JsonObject(); From 67ba833e36ef6ac56b0a95138ee0e924f1beea9c Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Wed, 5 Aug 2026 13:28:57 +0200 Subject: [PATCH 048/116] refactor: update ManifestConfiguration to use builder pattern and improve resource pack handling --- .../bedrock/ItemTextureConfiguration.java | 4 + .../bedrock/ManifestConfiguration.java | 755 ++++++++++++++---- .../api/manager/FileCacheManager.java | 2 +- .../converter/bedrock/BedrockConverter.java | 4 +- .../converter/bedrock/ConversionContext.java | 13 +- 5 files changed, 592 insertions(+), 186 deletions(-) diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/ItemTextureConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/ItemTextureConfiguration.java index 38ebf336..c489e09a 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/ItemTextureConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/ItemTextureConfiguration.java @@ -35,6 +35,10 @@ public boolean isEmpty() { return this.textures.isEmpty(); } + public List getTextures() { + return this.textures; + } + public ItemTextureConfiguration addTextureData(@NotNull TextureData textureData) { this.textures.add(textureData); return this; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/ManifestConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/ManifestConfiguration.java index 67e43a1b..98317101 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/ManifestConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/ManifestConfiguration.java @@ -5,256 +5,661 @@ import com.google.gson.JsonObject; import fr.robie.craftengineconverter.api.manager.FileCacheManager; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; import java.nio.file.Path; -import java.util.ArrayList; -import java.util.List; -import java.util.UUID; - -public class ManifestConfiguration { - private static final int formatVersion = 2; - - private final String packName; - private String packDescription; - private UUID packUUID; - private int[] packVersion = {1, 0, 0}; - private int[] minEngineVersion = {1, 21, 0}; - private PackScope scope; - - private UUID resourcePackUUID; - private String resourcePackVersion; +import java.util.*; + +public final class ManifestConfiguration { + public static final int[] DEFAULT_PACK_VERSION = {1, 0, 0}; + public static final int[] DEFAULT_MIN_ENGINE_VERSION = {1, 21, 0}; + public static final int FORMAT_VERSION = 2; + + // Header + final String packName; + final String packDescription; + final UUID packUUID; + final int[] packVersion; + final int[] minEngineVersion; + final int @Nullable [] baseGameVersion; + final boolean allowRandomSeed; + final boolean lockTemplateOptions; + final boolean platformLocked; + final @Nullable PackScope scope; + + // Module + final ModuleType moduleType; + final UUID moduleUUID; + final @Nullable String scriptEntry; + + // Dependencies + final List dependencies; + + // Capabilities + final Set capabilities; + + // Subpacks + final List subpacks; // Metadata - private final List authors = new ArrayList<>(); - private String license; - private String productType; - private String url; - - public ManifestConfiguration(@NotNull String packName) { - this.packName = packName; + final List authors; + final @Nullable String license; + final @Nullable String productType; + final @Nullable String url; + final Map> generatedWith; + + private ManifestConfiguration(Builder builder) { + this.packName = builder.packName; + this.packDescription = builder.packDescription; + this.packUUID = builder.packUUID != null ? builder.packUUID : UUID.randomUUID(); + this.packVersion = builder.packVersion; + this.minEngineVersion = builder.minEngineVersion; + this.baseGameVersion = builder.baseGameVersion; + this.allowRandomSeed = builder.allowRandomSeed; + this.lockTemplateOptions = builder.lockTemplateOptions; + this.platformLocked = builder.platformLocked; + this.scope = builder.scope; + + this.moduleType = builder.moduleType; + UUID muuid = builder.moduleUUID; + if (muuid == null || muuid.equals(this.packUUID)) { + do { muuid = UUID.randomUUID(); } while (muuid.equals(this.packUUID)); + } + this.moduleUUID = muuid; + this.scriptEntry = builder.scriptEntry; + + this.dependencies = List.copyOf(builder.dependencies); + this.capabilities = Collections.unmodifiableSet(new LinkedHashSet<>(builder.capabilities)); + this.subpacks = List.copyOf(builder.subpacks); + + this.authors = List.copyOf(builder.authors); + this.license = builder.license; + this.productType = builder.productType; + this.url = builder.url; + this.generatedWith = deepCopyGeneratedWith(builder.generatedWith); } - public ManifestConfiguration setPackDescription(String packDescription) { - this.packDescription = packDescription; - return this; + /** Builder pre-configured for a resource pack ({@code type: "resources"}). */ + public static ResourcePackBuilder resourcePack(@NotNull String name) { + return new ResourcePackBuilder(name); } - public ManifestConfiguration setPackUUID(UUID packUUID) { - this.packUUID = packUUID; - return this; + /** Builder pre-configured for a behavior pack ({@code type: "data"}). */ + public static BehaviorPackBuilder behaviorPack(@NotNull String name) { + return new BehaviorPackBuilder(name); } - public ManifestConfiguration setPackVersion(String packVersion) { - this.packVersion = parseVersion(packVersion); - return this; + /** Builder pre-configured for a world template ({@code type: "world_template"}). */ + public static WorldTemplateBuilder worldTemplate(@NotNull String name) { + return new WorldTemplateBuilder(name); } - public ManifestConfiguration setPackVersion(int major, int minor, int patch) { - this.packVersion = new int[]{major, minor, patch}; - return this; + /** Builder pre-configured for a script pack ({@code type: "script"}). */ + public static ScriptPackBuilder scriptPack(@NotNull String name) { + return new ScriptPackBuilder(name); } - public ManifestConfiguration setMinEngineVersion(String minEngineVersion) { - this.minEngineVersion = parseVersion(minEngineVersion); - return this; + /** Builder pre-configured for a skin pack ({@code type: "skin_pack"}). */ + public static SkinPackBuilder skinPack(@NotNull String name) { + return new SkinPackBuilder(name); } - public ManifestConfiguration setMinEngineVersion(int major, int minor, int patch) { - this.minEngineVersion = new int[]{major, minor, patch}; - return this; + public void saveManifest(@NotNull Path directory) { + JsonObject json = new JsonObject(); + json.addProperty("format_version", FORMAT_VERSION); + + json.add("header", this.buildHeader()); + json.add("modules", this.buildModules()); + + if (!this.dependencies.isEmpty()) { + JsonArray deps = new JsonArray(); + this.dependencies.forEach(deps::add); + json.add("dependencies", deps); + } + + if (!this.capabilities.isEmpty()) { + JsonArray caps = new JsonArray(); + this.capabilities.forEach(c -> caps.add(c.key())); + json.add("capabilities", caps); + } + + if (!this.subpacks.isEmpty()) { + json.add("subpacks", this.buildSubpacks()); + } + + JsonObject metadata = this.buildMetadata(); + if (!metadata.isEmpty()) json.add("metadata", metadata); + + FileCacheManager.saveJsonToFile(directory.resolve("manifest.json"), json); } - private static int[] parseVersion(String version) { - String[] parts = version.split("\\."); - int major = parts.length > 0 ? safeParseInt(parts[0]) : 1; - int minor = parts.length > 1 ? safeParseInt(parts[1]) : 0; - int patch = parts.length > 2 ? safeParseInt(parts[2]) : 0; - return new int[]{major, minor, patch}; + private JsonObject buildHeader() { + JsonObject header = new JsonObject(); + header.addProperty("name", safeText(this.packName, "Unnamed Pack")); + header.addProperty("description", safeText(this.packDescription, "Converted pack")); + header.addProperty("uuid", this.packUUID.toString()); + header.add("version", toJsonArray(safeVersion(this.packVersion, DEFAULT_PACK_VERSION))); + header.add("min_engine_version", toJsonArray(safeVersion(this.minEngineVersion, DEFAULT_MIN_ENGINE_VERSION))); + + if (this.baseGameVersion != null) + header.add("base_game_version", toJsonArray(safeVersion(this.baseGameVersion, DEFAULT_MIN_ENGINE_VERSION))); + if (this.allowRandomSeed) + header.addProperty("allow_random_seed", true); + if (this.lockTemplateOptions) + header.addProperty("lock_template_options", true); + if (this.platformLocked) + header.addProperty("platform_locked", true); + if (this.scope != null) + header.addProperty("pack_scope", this.scope.key()); + + return header; } - private static int safeParseInt(String s) { - try { return Integer.parseInt(s); } catch (NumberFormatException e) { return 0; } + private JsonArray buildModules() { + JsonArray modules = new JsonArray(); + JsonObject module = new JsonObject(); + + module.addProperty("type", this.moduleType.key()); + module.addProperty("description", safeText(this.packDescription, "Converted pack")); + module.addProperty("uuid", this.moduleUUID.toString()); + module.add("version", toJsonArray(safeVersion(this.packVersion, DEFAULT_PACK_VERSION))); + + if (this.moduleType == ModuleType.SCRIPT) { + module.addProperty("language", "javascript"); + if (this.scriptEntry != null) module.addProperty("entry", this.scriptEntry); + } + + modules.add(module); + return modules; } - public ManifestConfiguration setScope(PackScope scope) { - this.scope = scope; - return this; + private JsonArray buildSubpacks() { + JsonArray arr = new JsonArray(); + for (Subpack sp : this.subpacks) { + JsonObject obj = new JsonObject(); + obj.addProperty("folder_name", sp.folderName()); + obj.addProperty("name", sp.name()); + if (sp.memoryTier() != null) obj.addProperty("memory_tier", sp.memoryTier()); + arr.add(obj); + } + return arr; } + private JsonObject buildMetadata() { + JsonObject metadata = new JsonObject(); - public ManifestConfiguration addAuthor(String author) { - if (author != null && !author.isEmpty()) { - this.authors.add(author); + if (!this.authors.isEmpty()) { + JsonArray arr = new JsonArray(); + this.authors.forEach(arr::add); + metadata.add("authors", arr); + } + if (this.license != null) metadata.addProperty("license", this.license); + if (this.productType != null) metadata.addProperty("product_type", this.productType); + if (this.url != null) metadata.addProperty("url", this.url); + + if (!this.generatedWith.isEmpty()) { + JsonObject gw = new JsonObject(); + this.generatedWith.forEach((tool, versions) -> { + JsonArray vArr = new JsonArray(); + versions.forEach(vArr::add); + gw.add(tool, vArr); + }); + metadata.add("generated_with", gw); } - return this; + + return metadata; } - public ManifestConfiguration setAuthors(List authors) { - this.authors.clear(); - if (authors != null) { - this.authors.addAll(authors); + /** + * Parses a Java Edition {@code pack.mcmeta} root object and returns a + * {@link ResourcePackBuilder} pre-populated with the extracted data. + * + *

Handled fields: + *

    + *
  • {@code pack.description} — string, array, or JSON text component
  • + *
  • {@code pack.pack_format} — mapped heuristically to {@code min_engine_version}
  • + *
+ */ + public static ResourcePackBuilder fromJavaPackFormat(@NotNull JsonObject json) { + JsonObject pack = json.getAsJsonObject("pack"); + if (pack == null) + throw new IllegalArgumentException("Invalid Java pack format: missing 'pack' object"); + + String name = "Unnamed Pack"; + String description = null; + + JsonElement descEl = pack.get("description"); + if (descEl != null) { + if (descEl.isJsonArray()) { + JsonArray arr = descEl.getAsJsonArray(); + if (!arr.isEmpty()) { + name = plainText(arr.get(0)); + if (arr.size() > 1) { + StringBuilder sb = new StringBuilder(); + for (int i = 1; i < arr.size(); i++) { + if (i > 1) sb.append(' '); + sb.append(plainText(arr.get(i))); + } + description = sb.toString(); + } + } + } else if (descEl.isJsonPrimitive()) { + name = descEl.getAsString(); + } else if (descEl.isJsonObject()) { + name = plainText(descEl.getAsJsonObject()); + } } - return this; - } - public List getAuthors() { - return new ArrayList<>(this.authors); + ResourcePackBuilder builder = ManifestConfiguration.resourcePack(name); + if (description != null) builder.description(description); + + return builder; } - public String getLicense() { - return this.license; + private static String plainText(JsonObject component) { + StringBuilder sb = new StringBuilder(); + JsonElement own = component.get("text"); + if (own != null && own.isJsonPrimitive()) sb.append(own.getAsString()); + JsonElement extra = component.get("extra"); + if (extra != null && extra.isJsonArray()) + for (JsonElement child : extra.getAsJsonArray()) sb.append(plainText(child)); + String plain = sb.toString().trim(); + return plain.isEmpty() ? "Unnamed Pack" : plain; } - public ManifestConfiguration setLicense(String license) { - this.license = license; - return this; + private static String plainText(JsonElement element) { + if (element.isJsonPrimitive()) return element.getAsString(); + if (element.isJsonObject()) return plainText(element.getAsJsonObject()); + if (element.isJsonArray()) { + StringBuilder sb = new StringBuilder(); + for (JsonElement child : element.getAsJsonArray()) sb.append(plainText(child)); + return sb.toString(); + } + return ""; } - public String getProductType() { - return this.productType; + static int[] safeVersion(int[] version, int[] fallback) { + if (version == null || version.length != 3) return fallback; + boolean allZero = true; + for (int part : version) { + if (part < 0) return fallback; + if (part != 0) allZero = false; + } + return allZero ? fallback : version; } - public ManifestConfiguration setProductType(String productType) { - this.productType = productType; - return this; + static String safeText(String text, String fallback) { + if (text == null || text.isBlank()) return fallback; + String cleaned = text.replaceAll("\\s+", " ").trim(); + return cleaned.length() > 256 ? cleaned.substring(0, 256) : cleaned; } - public String getUrl() { - return this.url; + static int[] parseVersion(String version) { + String[] parts = version.split("\\."); + return new int[]{ + parts.length > 0 ? safeParseInt(parts[0]) : 1, + parts.length > 1 ? safeParseInt(parts[1]) : 0, + parts.length > 2 ? safeParseInt(parts[2]) : 0 + }; } - public ManifestConfiguration setUrl(String url) { - this.url = url; - return this; + private static int safeParseInt(String s) { + try { return Integer.parseInt(s.trim()); } catch (NumberFormatException e) { return 0; } } - public ManifestConfiguration setResourcePackUUID(UUID resourcePackUUID) { - this.resourcePackUUID = resourcePackUUID; - return this; + static JsonArray toJsonArray(int[] values) { + JsonArray arr = new JsonArray(); + for (int v : values) arr.add(v); + return arr; } - public ManifestConfiguration setResourcePackVersion(String resourcePackVersion) { - this.resourcePackVersion = resourcePackVersion; - return this; + private static Map> deepCopyGeneratedWith(Map> src) { + Map> copy = new LinkedHashMap<>(); + src.forEach((k, v) -> copy.put(k, List.copyOf(v))); + return Collections.unmodifiableMap(copy); } - public void saveManifest(@NotNull Path directory) { - JsonObject json = new JsonObject(); - json.addProperty("format_version", formatVersion); + /** + * Base builder. All common fields live here. + * + * @param the concrete builder subtype, for fluent chaining + */ + @SuppressWarnings("unchecked") + public abstract static class Builder> { + final String packName; + + // Header + String packDescription = "Generated by CraftEngineConverter"; + @Nullable UUID packUUID; + int[] packVersion = DEFAULT_PACK_VERSION.clone(); + int[] minEngineVersion = DEFAULT_MIN_ENGINE_VERSION.clone(); + int @Nullable [] baseGameVersion; + boolean allowRandomSeed = false; + boolean lockTemplateOptions = false; + boolean platformLocked = false; + @Nullable PackScope scope; + + // Module + final ModuleType moduleType; + @Nullable UUID moduleUUID; + @Nullable String scriptEntry; + + // Dependencies + final List dependencies = new ArrayList<>(); + + // Capabilities + final Set capabilities = new LinkedHashSet<>(); + + // Subpacks + final List subpacks = new ArrayList<>(); + + // Metadata + final List authors = new ArrayList<>(); + @Nullable String license; + @Nullable String productType; + @Nullable String url; + final Map> generatedWith = new LinkedHashMap<>(); + + protected Builder(@NotNull String packName, @NotNull ModuleType moduleType) { + this.packName = Objects.requireNonNull(packName, "packName"); + this.moduleType = Objects.requireNonNull(moduleType, "moduleType"); + } + + public B description(@NotNull String description) { + this.packDescription = description; + return (B) this; + } + + public B packUUID(@NotNull UUID uuid) { + this.packUUID = uuid; + return (B) this; + } + + public B packVersion(int major, int minor, int patch) { + this.packVersion = new int[]{major, minor, patch}; + return (B) this; + } + + public B packVersion(@NotNull String version) { + this.packVersion = parseVersion(version); + return (B) this; + } + + public B minEngineVersion(int major, int minor, int patch) { + this.minEngineVersion = new int[]{major, minor, patch}; + return (B) this; + } + + public B minEngineVersion(@NotNull String version) { + this.minEngineVersion = parseVersion(version); + return (B) this; + } + + public B platformLocked(boolean platformLocked) { + this.platformLocked = platformLocked; + return (B) this; + } + + public B moduleUUID(@NotNull UUID uuid) { + this.moduleUUID = uuid; + return (B) this; + } + + /** + * Adds a pack dependency by UUID and optional display name. + * Version may be passed as a triple or as a semver string. + */ + public B addDependency(@NotNull UUID uuid, @Nullable String name, int major, int minor, int patch) { + JsonObject dep = new JsonObject(); + dep.addProperty("uuid", uuid.toString()); + if (name != null && !name.isBlank()) dep.addProperty("name", name); + dep.add("version", toJsonArray(new int[]{major, minor, patch})); + this.dependencies.add(dep); + return (B) this; + } + + public B addDependency(@NotNull UUID uuid, int major, int minor, int patch) { + return this.addDependency(uuid, null, major, minor, patch); + } + + /** + * Adds a Minecraft engine module dependency (e.g. {@code @minecraft/server}). + * {@code version} must be a semver string such as {@code "1.0.0"}. + */ + public B addEngineDependency(@NotNull String moduleName, @NotNull String version) { + JsonObject dep = new JsonObject(); + dep.addProperty("module_name", moduleName); + dep.addProperty("version", version); + this.dependencies.add(dep); + return (B) this; + } + + public B addEngineDependency(@NotNull UUID uuid, @NotNull String moduleName, @NotNull String version) { + JsonObject dep = new JsonObject(); + dep.addProperty("uuid", uuid.toString()); + dep.addProperty("module_name", moduleName); + dep.addProperty("version", version); + this.dependencies.add(dep); + return (B) this; + } + + public B addCapability(@NotNull Capability capability) { + this.capabilities.add(capability); + return (B) this; + } + + public B capabilities(@NotNull Collection caps) { + this.capabilities.clear(); + this.capabilities.addAll(caps); + return (B) this; + } + + /** + * Adds a subpack entry. + * + * @param folderName the subfolder inside the pack (e.g. {@code "Low"}) + * @param name the display name shown in settings + * @param memoryTier RAM tier threshold; pass {@code null} to omit the field + */ + public B addSubpack(@NotNull String folderName, @NotNull String name, @Nullable Integer memoryTier) { + this.subpacks.add(new Subpack(folderName, name, memoryTier)); + return (B) this; + } + + + public B addAuthor(@NotNull String author) { + if (!author.isBlank()) this.authors.add(author.trim()); + return (B) this; + } + + public B authors(@NotNull List authors) { + this.authors.clear(); + this.authors.addAll(authors); + return (B) this; + } + + public B license(@NotNull String license) { + this.license = license; + return (B) this; + } + + public B productType(@NotNull String productType) { + this.productType = productType; + return (B) this; + } - json.add("header", this.createHeader()); - json.add("modules", this.createModules()); + public B url(@NotNull String url) { + this.url = url; + return (B) this; + } - JsonObject metadata = this.createMetadata(); - if (!metadata.isEmpty()) { - json.add("metadata", metadata); + /** + * Records a tool version in {@code metadata.generated_with}. + * Tool names must be ≤ 32 simple characters per the Bedrock spec. + */ + public B addGeneratedWith(@NotNull String toolName, @NotNull String version) { + if (toolName.length() > 32) + throw new IllegalArgumentException("generated_with tool name must be ≤ 32 characters"); + this.generatedWith.computeIfAbsent(toolName, k -> new ArrayList<>()).add(version); + return (B) this; } - Path filePath = directory.resolve("manifest.json"); - FileCacheManager.saveJsonToFile(filePath, json); + public ManifestConfiguration build() { + return new ManifestConfiguration(this); + } + + public ManifestConfiguration saveManifest(@NotNull Path directory) { + ManifestConfiguration config = this.build(); + config.saveManifest(directory); + return config; + } } - private JsonObject createHeader() { - JsonObject header = new JsonObject(); + /** + * Builder for resource packs ({@code type: "resources"}). + * Exposes {@code pack_scope} and subpack support. + */ + public static final class ResourcePackBuilder extends Builder { - header.addProperty("name", this.packName); - if (this.packDescription != null) { - header.addProperty("description", this.packDescription); + ResourcePackBuilder(@NotNull String name) { + super(name, ModuleType.RESOURCES); } - header.addProperty("uuid", (this.packUUID != null ? this.packUUID : UUID.randomUUID()).toString()); - header.add("version", toJsonArray(this.packVersion)); - header.add("min_engine_version", toJsonArray(this.minEngineVersion)); - if (this.scope != null) { - header.addProperty("scope", this.scope.name().toLowerCase()); + + /** + * Sets {@code pack_scope} — at which level this resource pack can be applied. + * Defaults to {@link PackScope#ANY} when omitted. + */ + public ResourcePackBuilder scope(@NotNull PackScope scope) { + this.scope = scope; + return this; } - return header; } - private JsonArray createModules() { - JsonArray modules = new JsonArray(); - JsonObject module = new JsonObject(); - UUID resourceUUID = this.resourcePackUUID; - UUID mainUUID = this.packUUID; - if (resourceUUID == null || resourceUUID.equals(mainUUID)) { - do { - resourceUUID = UUID.randomUUID(); - } while (resourceUUID.equals(mainUUID)); - } - module.addProperty("type", "resources"); - if (this.packDescription != null) { - module.addProperty("description", this.packDescription); - } - module.addProperty("uuid", resourceUUID.toString()); - module.add("version", toJsonArray(this.packVersion)); - modules.add(module); - return modules; + /** + * Builder for behavior packs ({@code type: "data"}). + */ + public static final class BehaviorPackBuilder extends Builder { + + BehaviorPackBuilder(@NotNull String name) { + super(name, ModuleType.DATA); + } } - private JsonObject createMetadata() { - JsonObject metadata = new JsonObject(); - if (!this.authors.isEmpty()) { - JsonArray authorsArray = new JsonArray(); - for (String author : this.authors) { - authorsArray.add(author); - } - metadata.add("authors", authorsArray); + /** + * Builder for world templates ({@code type: "world_template"}). + * Exposes world-template-specific header fields. + */ + public static final class WorldTemplateBuilder extends Builder { + + WorldTemplateBuilder(@NotNull String name) { + super(name, ModuleType.WORLD_TEMPLATE); } - if (this.license != null) { - metadata.addProperty("license", this.license); + + /** + * Sets {@code base_game_version} — locks the world to a specific vanilla version. + */ + public WorldTemplateBuilder baseGameVersion(int major, int minor, int patch) { + this.baseGameVersion = new int[]{major, minor, patch}; + return this; } - if (this.productType != null) { - metadata.addProperty("product_type", this.productType); + + /** + * Sets {@code allow_random_seed} — whether players can create the world with a random seed. + */ + public WorldTemplateBuilder allowRandomSeed(boolean allow) { + this.allowRandomSeed = allow; + return this; } - if (this.url != null) { - metadata.addProperty("url", this.url); + + /** + * Sets {@code lock_template_options} — hides world settings from the player. + */ + public WorldTemplateBuilder lockTemplateOptions(boolean lock) { + this.lockTemplateOptions = lock; + return this; } - return metadata; } - public static ManifestConfiguration fromJavaPackFormat(@NotNull JsonObject json) { - JsonObject pack = json.getAsJsonObject("pack"); + /** + * Builder for script packs ({@code type: "script"}). + * Requires a script entry point; exposes engine dependency helpers. + */ + public static final class ScriptPackBuilder extends Builder { - if (pack == null) { - throw new IllegalArgumentException("Invalid Java pack format: missing 'pack' object"); + ScriptPackBuilder(@NotNull String name) { + super(name, ModuleType.SCRIPT); } - ManifestConfiguration configuration = null; - JsonElement description = pack.get("description"); + /** + * Sets the relative path to the main script file (e.g. {@code "scripts/main.js"}). + * The {@code language} field is always {@code "javascript"} per the spec. + */ + public ScriptPackBuilder entry(@NotNull String entryPath) { + this.scriptEntry = entryPath; + return this; + } + } - if (description != null) { - if (description.isJsonArray()) { - JsonArray arr = description.getAsJsonArray(); - if (!arr.isEmpty()) { - String first = arr.get(0).getAsString(); - configuration = new ManifestConfiguration(first); - if (arr.size() > 1) { - StringBuilder sb = new StringBuilder(); - for (int i = 1; i < arr.size(); i++) { - sb.append(arr.get(i).getAsString()); - if (i < arr.size() - 1) { - sb.append(" "); - } - } - configuration.setPackDescription(sb.toString()); - } - } - } else if (description.isJsonPrimitive()) { - configuration = new ManifestConfiguration(description.getAsString()); - } + /** + * Builder for skin packs ({@code type: "skin_pack"}). + */ + public static final class SkinPackBuilder extends Builder { + + SkinPackBuilder(@NotNull String name) { + super(name, ModuleType.SKIN_PACK); } + } + + public enum PackScope { + ANY("any"), + GLOBAL("global"), + WORLD("world"); + private final String key; - return configuration != null ? configuration : new ManifestConfiguration("Unnamed Pack"); + PackScope(String key) { + this.key = key; + } + + public String key() { + return this.key; + } } - private static com.google.gson.JsonArray toJsonArray(int[] values) { - com.google.gson.JsonArray arr = new com.google.gson.JsonArray(); - for (int v : values) arr.add(v); - return arr; + public enum ModuleType { + RESOURCES("resources"), + DATA("data"), + WORLD_TEMPLATE("world_template"), + SKIN_PACK("skin_pack"), + PERSONA_PIECE("persona_piece"), + SCRIPT("script"); + private final String key; + + ModuleType(String key) { + this.key = key; + } + + public String key() { + return this.key; + } } - public enum PackScope { - ANY, - GLOBAL, - WORLD + public enum Capability { + CHEMISTRY("chemistry"), + EDITOR_EXTENSION("editorExtension"), + EXPERIMENTAL_CUSTOM_UI("experimental_custom_ui"), + SCRIPT_EVAL("script_eval"), + RAYTRACED("raytraced"), + PBR("pbr"); + private final String key; + + Capability(String key) { + this.key = key; + } + + public String key() { + return this.key; + } } -} + + public record Subpack(@NotNull String folderName, @NotNull String name, @Nullable Integer memoryTier) {} +} \ No newline at end of file diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/manager/FileCacheManager.java b/API/src/main/java/fr/robie/craftengineconverter/api/manager/FileCacheManager.java index f36425a1..ea2c301c 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/manager/FileCacheManager.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/manager/FileCacheManager.java @@ -67,7 +67,7 @@ public static FileCache getJsonCache() { return jsonCache; } - public static void saveJsonToFile(@NotNull Path path, @NotNull JsonObject json) { + public static void saveJsonToFile(@NotNull Path path, @NotNull JsonElement json) { try (var writer = Files.newBufferedWriter(path)) { GSON.toJson(json, writer); } catch (Exception e) { diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockConverter.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockConverter.java index fc57002a..6280f686 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockConverter.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockConverter.java @@ -251,8 +251,8 @@ private void convertPackDirectory(@NotNull File inputFolder, @NotNull File outpu FileUtils.copyFile(file, dest); } else if (fileName.equalsIgnoreCase("pack.mcmeta")) { FileCacheManager.getJsonCache().getEntryFile(file.toPath()).ifPresent(jsonObjectFileCacheEntry -> { - ManifestConfiguration configuration = ManifestConfiguration.fromJavaPackFormat(jsonObjectFileCacheEntry.getData()); - ctx.withManifest(configuration); + ManifestConfiguration.ResourcePackBuilder resourcePackBuilder = ManifestConfiguration.fromJavaPackFormat(jsonObjectFileCacheEntry.getData()); + ctx.withManifest(resourcePackBuilder.build()); hasManifest.set(true); }); } diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/ConversionContext.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/ConversionContext.java index 29767524..363f43f4 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/ConversionContext.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/ConversionContext.java @@ -17,15 +17,15 @@ import fr.robie.craftengineconverter.converter.bedrock.animation.BedrockRenderControllers; import fr.robie.craftengineconverter.converter.bedrock.attachable.BedrockAttachableContext; import fr.robie.craftengineconverter.converter.bedrock.block.BlockStateMapper; -import fr.robie.craftengineconverter.converter.bedrock.geometry.BedrockGeometry; import fr.robie.craftengineconverter.converter.bedrock.font.FontMapper; -import fr.robie.craftengineconverter.converter.bedrock.waypoint.WaypointStyleMapper; -import fr.robie.craftengineconverter.converter.bedrock.lang.LanguageMapper; +import fr.robie.craftengineconverter.converter.bedrock.geometry.BedrockGeometry; import fr.robie.craftengineconverter.converter.bedrock.geometry.GeometryMapper; import fr.robie.craftengineconverter.converter.bedrock.geometry.JavaBlockModel; +import fr.robie.craftengineconverter.converter.bedrock.lang.LanguageMapper; import fr.robie.craftengineconverter.converter.bedrock.sound.SoundMapper; import fr.robie.craftengineconverter.converter.bedrock.texture.CachedTextureInfo; import fr.robie.craftengineconverter.converter.bedrock.texture.TexturePipeline; +import fr.robie.craftengineconverter.converter.bedrock.waypoint.WaypointStyleMapper; import org.bukkit.Material; import java.io.File; @@ -61,11 +61,8 @@ public ConversionContext(Path customMappingsDir, Path texturesDir, Path packDir) this.customMappingsDir = customMappingsDir; this.texturesDir = texturesDir; this.packDir = packDir; - this.manifest = new ManifestConfiguration("CraftEngineConverter Pack") - .setPackDescription("Generated by CraftEngineConverter") - .setPackUUID(java.util.UUID.randomUUID()) - .setPackVersion(1, 0, 0) - .setMinEngineVersion(1, 21, 0); + this.manifest = ManifestConfiguration.resourcePack("CraftEngineConverter Pack").build(); + this.texturesConfig.setResourcePackName("CraftEngineConverter") .setTextureName("atlas.items"); this.terrainTexturesConfig.setResourcePackName("CraftEngineConverter") From e777e4628faadff595066d68a2cc6d347560cfb3 Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Wed, 5 Aug 2026 13:40:10 +0200 Subject: [PATCH 049/116] refactor: convert TintConfiguration implementations to records and enhance constant color handling --- .../TrimMaterialSelectConfiguration.java | 15 +++ .../tints/ConstantTintConfiguration.java | 16 ++- .../CustomModelDataTintConfiguration.java | 11 +++ .../models/tints/DyeTintConfiguration.java | 16 ++- .../item/models/tints/TintColors.java | 58 +++++++++++ .../item/models/tints/TintConfiguration.java | 14 +++ .../loader/ConfigurationTrees.java | 67 +++++++++++++ .../loader/JsonConfigurationAdapter.java | 97 +++++++++++++++++++ .../models/ModelConfigurationRegistry.java | 16 ++- .../model/SimpleModelConfigurationLoader.java | 1 + ...TrimMaterialSelectConfigurationLoader.java | 23 +++++ 11 files changed, 327 insertions(+), 7 deletions(-) create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/select/TrimMaterialSelectConfiguration.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/tints/TintColors.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/ConfigurationTrees.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/JsonConfigurationAdapter.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/TrimMaterialSelectConfigurationLoader.java diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/select/TrimMaterialSelectConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/select/TrimMaterialSelectConfiguration.java new file mode 100644 index 00000000..df7a618a --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/select/TrimMaterialSelectConfiguration.java @@ -0,0 +1,15 @@ +package fr.robie.craftengineconverter.api.configuration.item.models.select; + +/** + * Selects a model by the armour trim material applied to the item. + *

+ * Case values are resource locations (for example {@code minecraft:gold}) rather than a closed enum, + * so they stay {@link String}s. Geyser can represent this directly as a {@code match} predicate on + * {@code trim_material}. + */ +public class TrimMaterialSelectConfiguration extends SelectModelConfiguration { + + public TrimMaterialSelectConfiguration() { + super("minecraft:trim_material"); + } +} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/tints/ConstantTintConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/tints/ConstantTintConfiguration.java index 19597828..a9bb873d 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/tints/ConstantTintConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/tints/ConstantTintConfiguration.java @@ -4,14 +4,24 @@ import java.util.LinkedHashMap; import java.util.Map; +import java.util.OptionalInt; -public class ConstantTintConfiguration implements TintConfiguration { - private final Object value; - +public record ConstantTintConfiguration(Object value) implements TintConfiguration { public ConstantTintConfiguration(@NotNull Object value) { this.value = value; } + @Override + @NotNull + public Object value() { + return this.value; + } + + @Override + public OptionalInt constantColor() { + return TintColors.toRgb(this.value); + } + @Override public Map serialize() { Map map = new LinkedHashMap<>(); diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/tints/CustomModelDataTintConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/tints/CustomModelDataTintConfiguration.java index 2868ce1e..ce6a56f4 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/tints/CustomModelDataTintConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/tints/CustomModelDataTintConfiguration.java @@ -4,6 +4,7 @@ import java.util.LinkedHashMap; import java.util.Map; +import java.util.OptionalInt; public class CustomModelDataTintConfiguration implements TintConfiguration { private final int index; @@ -14,6 +15,16 @@ public CustomModelDataTintConfiguration(int index, @Nullable Object defaultValue this.defaultValue = defaultValue; } + @Nullable + public Object getDefaultValue() { + return this.defaultValue; + } + + @Override + public OptionalInt constantColor() { + return TintColors.toRgb(this.defaultValue); + } + @Override public Map serialize() { Map map = new LinkedHashMap<>(); diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/tints/DyeTintConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/tints/DyeTintConfiguration.java index 42177ed9..91e307ca 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/tints/DyeTintConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/tints/DyeTintConfiguration.java @@ -4,14 +4,24 @@ import java.util.LinkedHashMap; import java.util.Map; +import java.util.OptionalInt; -public class DyeTintConfiguration implements TintConfiguration { - private final Object defaultValue; - +public record DyeTintConfiguration(Object defaultValue) implements TintConfiguration { public DyeTintConfiguration(@Nullable Object defaultValue) { this.defaultValue = defaultValue; } + @Override + @Nullable + public Object defaultValue() { + return this.defaultValue; + } + + @Override + public OptionalInt constantColor() { + return TintColors.toRgb(this.defaultValue); + } + @Override public Map serialize() { Map map = new LinkedHashMap<>(); diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/tints/TintColors.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/tints/TintColors.java new file mode 100644 index 00000000..cc60f96b --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/tints/TintColors.java @@ -0,0 +1,58 @@ +package fr.robie.craftengineconverter.api.configuration.item.models.tints; + +import org.jetbrains.annotations.Nullable; + +import java.util.Collection; +import java.util.OptionalInt; + +public final class TintColors { + + private TintColors() { + throw new UnsupportedOperationException("TintColors is a utility class and cannot be instantiated."); + } + + public static OptionalInt toRgb(@Nullable Object value) { + if (value == null) return OptionalInt.empty(); + + if (value instanceof Number number) { + return OptionalInt.of(number.intValue() & 0xFFFFFF); + } + + if (value instanceof Collection collection) { + return fromComponents(collection.stream().map(String::valueOf).toArray(String[]::new)); + } + + if (value instanceof String text) { + String trimmed = text.trim(); + if (trimmed.isEmpty()) return OptionalInt.empty(); + if (trimmed.contains(",")) return fromComponents(trimmed.split(",")); + + try { + if (trimmed.startsWith("#")) { + return OptionalInt.of(Integer.parseInt(trimmed.substring(1), 16) & 0xFFFFFF); + } + return OptionalInt.of(Integer.parseInt(trimmed) & 0xFFFFFF); + } catch (NumberFormatException e) { + return OptionalInt.empty(); + } + } + + return OptionalInt.empty(); + } + + private static OptionalInt fromComponents(String[] parts) { + if (parts.length < 3) return OptionalInt.empty(); + try { + int r = clamp(Integer.parseInt(parts[0].trim())); + int g = clamp(Integer.parseInt(parts[1].trim())); + int b = clamp(Integer.parseInt(parts[2].trim())); + return OptionalInt.of((r << 16) | (g << 8) | b); + } catch (NumberFormatException e) { + return OptionalInt.empty(); + } + } + + private static int clamp(int component) { + return Math.clamp(component, 0, 255); + } +} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/tints/TintConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/tints/TintConfiguration.java index b537be97..1d5d3f8c 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/tints/TintConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/models/tints/TintConfiguration.java @@ -1,7 +1,21 @@ package fr.robie.craftengineconverter.api.configuration.item.models.tints; import java.util.Map; +import java.util.OptionalInt; public interface TintConfiguration { Map serialize(); + + /** + * The one RGB colour this tint always resolves to, when it has one. + *

+ * Needed by the pre-rendered inventory icon: Bedrock cannot render a model into a slot, so the sprite is + * drawn at conversion time and the tint has to be multiplied in there — but a sprite is one fixed image, + * so only a tint that does not depend on runtime state can be honoured. A dye or constant tint qualifies; + * {@code grass}, {@code team}, {@code potion} and {@code firework} do not, and return empty so the caller + * can leave the face untinted rather than invent a colour. + */ + default OptionalInt constantColor() { + return OptionalInt.empty(); + } } diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/ConfigurationTrees.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/ConfigurationTrees.java new file mode 100644 index 00000000..06fdcfff --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/ConfigurationTrees.java @@ -0,0 +1,67 @@ +package fr.robie.craftengineconverter.api.configuration.loader; + +import fr.robie.yamllibrary.ConfigurationSection; +import fr.robie.yamllibrary.MemoryConfiguration; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +/** + * Converts between {@link ConfigurationSection} and plain {@code Map}/{@code List} trees. + *

+ * The converter passes {@code ConfigurationSection} around, but the template engine and the JSON adapter + * both need to walk and rebuild raw trees. Keeping both directions here means the + * {@code MemoryConfiguration.createSection(path, map)} detail — which recursively turns nested maps into + * child sections — lives in one place. + */ +public final class ConfigurationTrees { + + private ConfigurationTrees() { + throw new UnsupportedOperationException("ConfigurationTrees is a utility class and cannot be instantiated."); + } + + /** + * Wraps a map tree as a detached {@link ConfigurationSection}. + *

+ * The section is parented to a throwaway {@link MemoryConfiguration}; only the returned section is of + * interest, so the path it is created under is arbitrary. + */ + @NotNull + public static ConfigurationSection toSection(@NotNull Map map) { + return new MemoryConfiguration().createSection("root", map); + } + + /** Copies a section into a plain, insertion-ordered map tree. */ + @NotNull + public static Map toMap(@NotNull ConfigurationSection section) { + Map out = new LinkedHashMap<>(); + for (String key : section.getKeys(false)) { + out.put(key, toValue(section.get(key))); + } + return out; + } + + @Nullable + private static Object toValue(@Nullable Object value) { + if (value instanceof ConfigurationSection nested) { + return toMap(nested); + } + if (value instanceof Map map) { + Map out = new LinkedHashMap<>(); + for (Map.Entry entry : map.entrySet()) { + out.put(String.valueOf(entry.getKey()), toValue(entry.getValue())); + } + return out; + } + if (value instanceof List list) { + List out = new ArrayList<>(list.size()); + for (Object element : list) out.add(toValue(element)); + return out; + } + return value; + } +} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/JsonConfigurationAdapter.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/JsonConfigurationAdapter.java new file mode 100644 index 00000000..c606e6ea --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/JsonConfigurationAdapter.java @@ -0,0 +1,97 @@ +package fr.robie.craftengineconverter.api.configuration.loader; + +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonPrimitive; +import fr.robie.yamllibrary.ConfigurationSection; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +/** + * Views a {@link JsonObject} as a {@link ConfigurationSection}. + *

+ * Java item model definitions ({@code assets//items/*.json}) describe exactly the same + * structure that CraftEngine expresses in YAML under an item's {@code model:} key, and the + * {@code ModelConfiguration} loaders already read both spellings of every key + * ({@code on-true} / {@code on_true}) and both the bare and {@code minecraft:}-prefixed type names. + * They are therefore already capable of parsing Java's JSON — they just cannot accept it, because they + * take a {@code ConfigurationSection}. + *

+ * Adapting the input here means the whole loader tree works on Java resource packs unchanged, rather + * than every loader needing a parallel JSON overload. + */ +public final class JsonConfigurationAdapter { + + private JsonConfigurationAdapter() { + throw new UnsupportedOperationException("JsonConfigurationAdapter is a utility class and cannot be instantiated."); + } + + /** + * Wraps {@code json} in a detached {@link ConfigurationSection}. + *

+ * See {@link ConfigurationTrees#toSection(Map)} for how the map becomes a section tree. + */ + @NotNull + public static ConfigurationSection toSection(@NotNull JsonObject json) { + return ConfigurationTrees.toSection(toMap(json)); + } + + /** The JSON tree as a plain map, for callers that want to work on it directly. */ + @NotNull + public static Map toMap(@NotNull JsonObject json) { + Map map = new LinkedHashMap<>(); + for (Map.Entry entry : json.entrySet()) { + map.put(entry.getKey(), toValue(entry.getValue())); + } + return map; + } + + @Nullable + private static Object toValue(@NotNull JsonElement element) { + if (element.isJsonObject()) { + // Nested maps are turned into child sections by createSection, so plain maps suffice here. + return toMap(element.getAsJsonObject()); + } + if (element.isJsonArray()) { + JsonArray array = element.getAsJsonArray(); + List list = new ArrayList<>(array.size()); + for (JsonElement child : array) { + list.add(toValue(child)); + } + return list; + } + if (element.isJsonPrimitive()) { + return toPrimitive(element.getAsJsonPrimitive()); + } + return null; + } + + @NotNull + private static Object toPrimitive(@NotNull JsonPrimitive primitive) { + if (primitive.isBoolean()) return primitive.getAsBoolean(); + if (primitive.isString()) return primitive.getAsString(); + + String raw = primitive.getAsString(); + if (raw.indexOf('.') < 0 && raw.indexOf('e') < 0 && raw.indexOf('E') < 0) { + try { + return Integer.valueOf(raw); + } catch (NumberFormatException ignored) { + try { + return Long.valueOf(raw); + } catch (NumberFormatException ignored2) { + } + } + } + try { + return Double.valueOf(raw); + } catch (NumberFormatException ignored) { + return raw; + } + } +} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/ModelConfigurationRegistry.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/ModelConfigurationRegistry.java index fe1f3324..f9757b08 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/ModelConfigurationRegistry.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/ModelConfigurationRegistry.java @@ -8,9 +8,16 @@ import java.util.HashMap; import java.util.Map; +import java.util.Set; public class ModelConfigurationRegistry { private static final Map> LOADERS = new HashMap<>(); + private static final Set BEDROCK_UNREPRESENTABLE_TYPES = Set.of("special"); + + private static String stripNamespace(String type) { + int colon = type.indexOf(':'); + return colon < 0 ? type : type.substring(colon + 1); + } private ModelConfigurationRegistry() { throw new UnsupportedOperationException("ModelConfigurationRegistry is a utility class and cannot be instantiated."); @@ -28,7 +35,14 @@ public static ModelConfiguration load(@Nullable ConfigurationSection section) { String type = section.getString("type", "model"); ModelConfigurationLoader loader = LOADERS.get(type); if (loader == null) { - Logger.warn("Unknown model type '" + type + "', skipping."); + loader = LOADERS.get(stripNamespace(type)); + } + if (loader == null) { + if (BEDROCK_UNREPRESENTABLE_TYPES.contains(stripNamespace(type))) { + Logger.debug("Model type '" + type + "' has no Bedrock equivalent, using a plain definition"); + } else { + Logger.warn("Unknown model type '" + type + "', skipping."); + } return null; } return loader.load(section); diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/model/SimpleModelConfigurationLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/model/SimpleModelConfigurationLoader.java index d921dbe6..abb44e63 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/model/SimpleModelConfigurationLoader.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/model/SimpleModelConfigurationLoader.java @@ -20,6 +20,7 @@ public class SimpleModelConfigurationLoader implements ModelConfigurationLoader< @Override public @Nullable ModelConfiguration load(@NotNull ConfigurationSection section) { String path = section.getString("path"); + if (path == null) path = section.getString("model"); if (path == null) { return null; } diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/TrimMaterialSelectConfigurationLoader.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/TrimMaterialSelectConfigurationLoader.java new file mode 100644 index 00000000..9c54939e --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/loader/models/select/TrimMaterialSelectConfigurationLoader.java @@ -0,0 +1,23 @@ +package fr.robie.craftengineconverter.api.configuration.loader.models.select; + +import fr.robie.craftengineconverter.api.annotations.AutoSelectModelConfigurationLoader; +import fr.robie.craftengineconverter.api.configuration.item.models.select.SelectModelConfiguration; +import fr.robie.craftengineconverter.api.configuration.item.models.select.TrimMaterialSelectConfiguration; +import fr.robie.yamllibrary.ConfigurationSection; +import org.jetbrains.annotations.NotNull; + +@AutoSelectModelConfigurationLoader({"trim_material", "minecraft:trim_material"}) +public class TrimMaterialSelectConfigurationLoader extends AbstractSelectModelConfigurationLoader { + + public TrimMaterialSelectConfigurationLoader() { + super(); + } + + @Override + public SelectModelConfiguration load(@NotNull ConfigurationSection section) { + TrimMaterialSelectConfiguration configuration = new TrimMaterialSelectConfiguration(); + configuration.setFallback(this.loadFallback(section)); + this.loadCases(section, configuration::addCase, Object::toString); + return configuration; + } +} From d5eff7e9a1ef1fe895e3c418b72ffa117640c44d Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Wed, 5 Aug 2026 13:50:05 +0200 Subject: [PATCH 050/116] feat: implement template engine with argument resolution and placeholder handling --- .../api/configuration/ConfigurationKey.java | 45 ++- .../template/ArgumentString.java | 339 ++++++++++++++++++ .../template/TemplateArgument.java | 121 +++++++ .../template/TemplateEngine.java | 327 +++++++++++++++++ .../template/TemplateException.java | 16 + .../api/manager/FileCacheManager.java | 19 +- .../services/org.reflections.scanners.Scanner | 1 - 7 files changed, 859 insertions(+), 9 deletions(-) create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/template/ArgumentString.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/template/TemplateArgument.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/template/TemplateEngine.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/template/TemplateException.java delete mode 100644 API/src/main/resources/META-INF/services/org.reflections.scanners.Scanner diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/ConfigurationKey.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/ConfigurationKey.java index 532f3bd4..118ea130 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/ConfigurationKey.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/ConfigurationKey.java @@ -1,6 +1,8 @@ package fr.robie.craftengineconverter.api.configuration; import com.google.gson.reflect.TypeToken; +import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.option.CreativeGroupRules; +import fr.robie.craftengineconverter.api.configuration.loader.ConfigurationTrees; import fr.robie.craftengineconverter.api.enums.ArmorConverter; import fr.robie.craftengineconverter.api.enums.ConverterOption; import fr.robie.craftengineconverter.api.enums.Languages; @@ -41,8 +43,47 @@ public enum ConfigurationKey { } return d.get(); }), - DEFAULT_MATERIAL("default-material", new TypeToken<>() { - }, () -> Material.PAPER), + DEFAULT_MATERIAL("default-material", new TypeToken() { + }, () -> (Object) "auto", (o, d) -> { + if (o instanceof Material material) return material; + if (o instanceof String name) { + if (name.isBlank() || name.equalsIgnoreCase("auto")) return "auto"; + String value = name.contains(":") ? name.substring(name.indexOf(':') + 1) : name; + try { + return Material.valueOf(value.trim().toUpperCase(Locale.ROOT)); + } catch (IllegalArgumentException ignored) { + return "auto"; + } + } + return d.get(); + }), + CREATIVE_GROUPS("creative-groups", new TypeToken() { + }, () -> (Object) new LinkedHashMap(), (o, d) -> { + if (o instanceof ConfigurationSection section) return CreativeGroupRules.parse(section); + return CreativeGroupRules.empty(); + }), + VANILLA_ASSETS_DOWNLOAD("vanilla-assets.download", new TypeToken<>() { + }, () -> true), + VANILLA_ASSETS_VERSION("vanilla-assets.version", new TypeToken<>() { + }, () -> "auto"), + VANILLA_ASSETS_PATH("vanilla-assets.path", new TypeToken<>() { + }, () -> ""), + RENDER_ITEM_ICONS("render-item-icons", new TypeToken<>() { + }, () -> true), + ITEM_ICON_SIZE("item-icon-size", new TypeToken<>() { + }, () -> 64), + SHORTEN_PACK_PATHS("shorten-pack-paths", new TypeToken<>() { + }, () -> true), + HELD_ITEM_ANCHORS("held-item-anchors", new TypeToken() { + }, () -> (Object) new LinkedHashMap(), (o, d) -> { + if (o instanceof ConfigurationSection section) return section; + if (o instanceof Map map) { + Map copy = new LinkedHashMap<>(); + map.forEach((key, value) -> copy.put(String.valueOf(key), value)); + return ConfigurationTrees.toSection(copy); + } + return d.get(); + }), DISABLE_DEFAULT_ITALIC("disable-default-italic", new TypeToken<>() { }, () -> true), ARMOR_CONVERTER_TYPE("armor-converter-type", new TypeToken<>() { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/template/ArgumentString.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/template/ArgumentString.java new file mode 100644 index 00000000..1c4827c7 --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/template/ArgumentString.java @@ -0,0 +1,339 @@ +package fr.robie.craftengineconverter.api.configuration.template; + +import fr.robie.messageflow.logger.Logger; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.ArrayList; +import java.util.List; +import java.util.Locale; +import java.util.Map; + +/** + * A config string with its {@code ${placeholder}} positions already located. + *

+ * CraftEngine templates are parameterised with {@code ${name}} placeholders, and a single value can mix + * literal text with several of them ({@code minecraft:item/custom/${material}_${part}}). Parsing is done + * once, up front, so that resolving a template is a walk over pre-split parts rather than a regex pass over + * every string every time — which matters because a template is re-resolved for every item that uses it. + *

+ * Keys are parsed too, not just values: a template may name a key by placeholder, and a placeholder that + * resolves to {@code null} drops its entry — that is how CraftEngine omits a key conditionally. + * + *

Syntax

+ *
    + *
  • {@code ${name}} — an unbound argument resolves to nothing and drops its entry, with a warning
  • + *
  • {@code ${name:-fallback}} — used when the argument is unbound
  • + *
  • {@code ${name^}} — capitalise; {@code ${name^^}} — upper-case
  • + *
  • {@code \$} — a literal dollar
  • + *
  • {@code \{} and {@code \}} — literal braces inside a placeholder
  • + *
+ * Brace depth is tracked, so braces nested inside a placeholder do not end it early. An unclosed + * {@code ${} is treated as ordinary text rather than raising — a malformed string should not abort a + * conversion. + */ +public interface ArgumentString { + + /** The string as authored, used for error messages. */ + String rawValue(); + + /** + * Resolves against {@code arguments}. + * + * @return the resolved value, or {@code null} to signal that the owning entry should be dropped + */ + @Nullable + Object resolve(@NotNull String node, @NotNull Map arguments); + + /** Text with no placeholders. */ + final class Literal implements ArgumentString { + private final String value; + + private Literal(String value) { + this.value = value; + } + + public static Literal of(String value) { + return new Literal(value); + } + + @Override + public String rawValue() { + return this.value; + } + + @Override + public Object resolve(@NotNull String node, @NotNull Map arguments) { + return this.value; + } + + @Override + public boolean equals(Object o) { + return o instanceof Literal other && this.value.equals(other.value); + } + + @Override + public int hashCode() { + return this.value.hashCode(); + } + + @Override + public String toString() { + return "Literal(" + this.value + ")"; + } + } + + /** A single {@code ${...}} reference. */ + final class Placeholder implements ArgumentString { + private final String name; + private final String rawText; + private final String fallback; + private final boolean hasFallback; + private final boolean capitalize; + private final boolean upperCase; + + /** + * Strips one layer of matching quotes from a fallback. + *

+ * A config writes {@code ${fence_type:-"oak"}_fence} and means the block {@code oak_fence}. The quotes are + * ordinary characters inside a YAML plain scalar, so keeping them produced the id {@code "oak"_fence}, + * which matches no block — the fence's host state, and so the whole fence, resolved to nothing. + */ + private static String unquote(String fallback) { + if (fallback.length() < 2) return fallback; + char first = fallback.charAt(0); + char last = fallback.charAt(fallback.length() - 1); + boolean quoted = (first == '"' || first == '\'') && first == last; + return quoted ? fallback.substring(1, fallback.length() - 1) : fallback; + } + + private Placeholder(String content) { + this.rawText = "${" + content + "}"; + + int separator = content.indexOf(":-"); + String namePart; + if (separator < 0) { + namePart = content; + this.fallback = null; + this.hasFallback = false; + } else { + namePart = content.substring(0, separator); + this.fallback = unquote(content.substring(separator + 2)); + this.hasFallback = true; + } + + // "^^" must be tested before "^", since both end with a caret. + if (namePart.endsWith("^^")) { + this.capitalize = false; + this.upperCase = true; + this.name = namePart.substring(0, namePart.length() - 2); + } else if (namePart.endsWith("^")) { + this.capitalize = true; + this.upperCase = false; + this.name = namePart.substring(0, namePart.length() - 1); + } else { + this.capitalize = false; + this.upperCase = false; + this.name = namePart; + } + } + + public static Placeholder of(String content) { + return new Placeholder(content); + } + + public String name() { + return this.name; + } + + @Override + public String rawValue() { + return this.rawText; + } + + @Override + public Object resolve(@NotNull String node, @NotNull Map arguments) { + Object value; + TemplateArgument argument = arguments.get(this.name); + if (argument != null) { + value = argument.resolve(node, arguments); + } else if (this.hasFallback) { + value = parse(this.fallback).resolve(node, arguments); + } else { + boolean insideTemplateBody = node.contains("${") || node.contains("template["); + if (insideTemplateBody) { + Logger.debug("Template argument " + this.rawText + " at " + node + + " is unbound while resolving a template body; omitting that entry"); + } else { + Logger.warn("Template argument " + this.rawText + " at " + node + + " is unbound; omitting that entry"); + } + return null; + } + + if (value == null) return null; + if (this.upperCase) return String.valueOf(value).toUpperCase(Locale.ROOT); + if (this.capitalize) return capitalise(String.valueOf(value)); + return value; + } + + private static String capitalise(String value) { + if (value.isEmpty()) return value; + return Character.toUpperCase(value.charAt(0)) + value.substring(1); + } + + @Override + public boolean equals(Object o) { + return o instanceof Placeholder other && this.rawText.equals(other.rawText); + } + + @Override + public int hashCode() { + return this.rawText.hashCode(); + } + + @Override + public String toString() { + return "Placeholder(" + this.name + ")"; + } + } + + /** Literal text and placeholders interleaved; the parts are concatenated on resolve. */ + final class Composite implements ArgumentString { + private final ArgumentString[] parts; + private final String rawText; + + private Composite(String rawText, ArgumentString[] parts) { + this.rawText = rawText; + this.parts = parts; + } + + public static Composite of(String rawText, List parts) { + return new Composite(rawText, parts.toArray(new ArgumentString[0])); + } + + @Override + public String rawValue() { + return this.rawText; + } + + @Override + public Object resolve(@NotNull String node, @NotNull Map arguments) { + StringBuilder result = new StringBuilder(); + boolean any = false; + for (ArgumentString part : this.parts) { + Object resolved = part.resolve(node, arguments); + if (resolved != null) { + result.append(resolved); + any = true; + } + } + return any ? result.toString() : null; + } + + @Override + public boolean equals(Object o) { + return o instanceof Composite other && this.rawText.equals(other.rawText); + } + + @Override + public int hashCode() { + return this.rawText.hashCode(); + } + + @Override + public String toString() { + return "Composite(" + this.rawText + ")"; + } + } + + /** + * Splits {@code input} into literal and placeholder parts. + *

+ * A string with no {@code ${} returns a {@link Literal}, which is the overwhelmingly common case and + * costs one scan. + */ + @NotNull + static ArgumentString parse(@Nullable String input) { + if (input == null || input.isEmpty()) { + return Literal.of(""); + } + + List parts = new ArrayList<>(); + StringBuilder literal = new StringBuilder(); + int length = input.length(); + int i = 0; + + while (i < length) { + char c = input.charAt(i); + + if (c == '$' && i + 1 < length && input.charAt(i + 1) == '{') { + Scanned scanned = scanPlaceholder(input, i + 2); + if (scanned == null) { + literal.append(c); + i++; + continue; + } + if (!literal.isEmpty()) { + parts.add(Literal.of(literal.toString())); + literal.setLength(0); + } + parts.add(Placeholder.of(scanned.content())); + i = scanned.closeIndex() + 1; + } else if (c == '\\' && i + 1 < length && input.charAt(i + 1) == '$') { + literal.append('$'); + i += 2; + } else { + literal.append(c); + i++; + } + } + + if (!literal.isEmpty()) { + parts.add(Literal.of(literal.toString())); + } + + return switch (parts.size()) { + case 0 -> Literal.of(""); + case 1 -> parts.getFirst(); + default -> Composite.of(input, parts); + }; + } + + /** A placeholder body and the index of the brace that closed it. */ + record Scanned(String content, int closeIndex) {} + + /** + * Scans the body of a placeholder opened just before {@code start}. + * + * @return the body and closing index, or {@code null} if unterminated + */ + @Nullable + private static Scanned scanPlaceholder(String input, int start) { + StringBuilder content = new StringBuilder(); + int depth = 1; + int length = input.length(); + + for (int j = start; j < length; ) { + char c = input.charAt(j); + if (c == '\\' && j + 1 < length && (input.charAt(j + 1) == '{' || input.charAt(j + 1) == '}')) { + content.append(input.charAt(j + 1)); + j += 2; + } else if (c == '{') { + depth++; + content.append(c); + j++; + } else if (c == '}') { + if (--depth == 0) { + return new Scanned(content.toString(), j); + } + content.append(c); + j++; + } else { + content.append(c); + j++; + } + } + return null; + } +} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/template/TemplateArgument.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/template/TemplateArgument.java new file mode 100644 index 00000000..dd04ffba --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/template/TemplateArgument.java @@ -0,0 +1,121 @@ +package fr.robie.craftengineconverter.api.configuration.template; + +import fr.robie.messageflow.logger.Logger; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.List; +import java.util.Locale; +import java.util.Map; + +/** + * A value bound to a template placeholder. + *

+ * Most arguments are plain scalars, lists or maps. A map argument carrying a {@code type:} key is + * instead a computed argument, dispatched by {@link #fromValue}. + */ +public interface TemplateArgument { + + /** Resolves this argument. May return {@code null}, which drops the entry that referenced it. */ + @Nullable + Object resolve(@NotNull String node, @NotNull Map arguments); + + /** An argument that resolves to nothing, dropping whatever entry referenced it. */ + TemplateArgument NULL = (node, arguments) -> null; + + /** + * Wraps an already-resolved config value as an argument. + *

+ * A map with a {@code type:} key selects a computed argument. CraftEngine registers twelve such types, + * but its own shipped templates use exactly one ({@code condition}), so only the structural kinds and + * {@code condition} are implemented; the rest warn once and fall back to being treated as plain data, + * which is correct for anything that does not actually need computing. + */ + @NotNull + static TemplateArgument fromValue(@Nullable Object value) { + if (value == null) return NULL; + + if (value instanceof Map map) { + Object type = map.get("type"); + if (type instanceof String typeName) { + return computed(stripNamespace(typeName), map); + } + return new Structural(map); + } + if (value instanceof List list) { + return new Structural(list); + } + return new Structural(value); + } + + private static String stripNamespace(String type) { + int colon = type.indexOf(':'); + return (colon < 0 ? type : type.substring(colon + 1)).toLowerCase(Locale.ROOT); + } + + private static TemplateArgument computed(String type, Map map) { + return switch (type) { + case "condition" -> new Condition(map); + case "plain", "object", "map", "list" -> new Structural(map); + case "null" -> NULL; + default -> { + Logger.warn("Unsupported template argument type '" + type + "' - treating it as plain data, which may leave a placeholder unresolved"); + yield new Structural(map); + } + }; + } + + /** A plain scalar, list or map, resolved as-is. */ + final class Structural implements TemplateArgument { + private final Object value; + + Structural(Object value) { + this.value = value; + } + + @Override + public Object resolve(@NotNull String node, @NotNull Map arguments) { + return this.value; + } + + @Override + public String toString() { + return "Structural(" + this.value + ")"; + } + } + + /** + * Picks between two values on a boolean. + *

+ * {@code {type: condition, condition: ${flag:-false}, on_true: a, on_false: b}} — the one computed + * argument type CraftEngine's own templates use. The condition has already had its placeholders + * resolved by the time it arrives here, so this is a string-truthiness test. + */ + final class Condition implements TemplateArgument { + private final Object condition; + private final Object onTrue; + private final Object onFalse; + + Condition(Map map) { + this.condition = map.get("condition"); + this.onTrue = map.containsKey("on_true") ? map.get("on_true") : map.get("on-true"); + this.onFalse = map.containsKey("on_false") ? map.get("on_false") : map.get("on-false"); + } + + @Override + public Object resolve(@NotNull String node, @NotNull Map arguments) { + return isTrue(this.condition) ? this.onTrue : this.onFalse; + } + + private static boolean isTrue(Object value) { + if (value == null) return false; + if (value instanceof Boolean bool) return bool; + return Boolean.parseBoolean(String.valueOf(value).trim()); + } + + @Override + public String toString() { + return "Condition(" + this.condition + ")"; + } + } +} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/template/TemplateEngine.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/template/TemplateEngine.java new file mode 100644 index 00000000..a17cecaf --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/template/TemplateEngine.java @@ -0,0 +1,327 @@ +package fr.robie.craftengineconverter.api.configuration.template; + +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.*; + +/** + * Resolves CraftEngine config templates. + *

+ * A CraftEngine item can inherit most of its definition from a reusable template, parameterised by + * arguments: + *

+ * items:
+ *   default:topaz_boots:
+ *     template: default:armor/topaz
+ *     arguments: { equipment_part: boots, equipment_material: topaz }
+ * templates:
+ *   default:armor/topaz:
+ *     material: chainmail_${equipment_part}
+ * 
+ * Without resolution, {@code material:} is simply absent from the item and it converts against the wrong + * base Java item. This is a port of CraftEngine's {@code TemplateManagerImpl}, keeping its merge semantics + * exactly, because packs are authored against those semantics. + * + *

Recognised keys

+ *
    + *
  • {@code template} / {@code templates} — one id or a list; multiple are deep-merged in order
  • + *
  • {@code arguments} — bound values; a parent's argument wins over a child's re-declaration
  • + *
  • {@code overrides} — replaces: {@code putAll} for maps, whole-list replacement for lists
  • + *
  • {@code merges} — deep-merges for maps, appends for lists
  • + *
+ * Keys left alongside {@code template} are folded in as merges — CraftEngine tolerates that mistake, so + * mirroring it avoids silently dropping such config. When a template resolves to something that is not a + * map or list, precedence is {@code overrides} then {@code merges} then the last template. + *

+ * Two arguments are always available: {@code __NAMESPACE__} and {@code __ID__}, taken from the id of the + * object being resolved. + *

+ * Pre-parsing. {@link #preprocess} converts every string in the tree — keys included — into an + * {@link ArgumentString} once. A key or value whose placeholder resolves to {@code null} is dropped, + * which is how CraftEngine omits config conditionally. + */ +public final class TemplateEngine { + + private static final String TEMPLATE = "template"; + private static final String TEMPLATES = "templates"; + private static final String ARGUMENTS = "arguments"; + private static final String OVERRIDES = "overrides"; + private static final String MERGES = "merges"; + private static final Set RESERVED = Set.of(TEMPLATE, TEMPLATES, ARGUMENTS, OVERRIDES, MERGES); + + private final Map templates = new LinkedHashMap<>(); + + /** + * Registers a template body. Templates are collected from every config file before any item is + * resolved, because a template may live in a different file from the items using it. + */ + public void register(@NotNull String id, @Nullable Object rawBody) { + this.templates.put(id, preprocess(rawBody)); + } + + public boolean isEmpty() { + return this.templates.isEmpty(); + } + + public int size() { + return this.templates.size(); + } + + public boolean has(@NotNull String id) { + return this.templates.containsKey(id); + } + + /** + * Resolves {@code input} for the object identified by {@code id}, which supplies + * {@code __NAMESPACE__} and {@code __ID__}. + * + * @param id a namespaced id such as {@code default:topaz_boots} + */ + @Nullable + public Object resolve(@NotNull String id, @Nullable Object input) { + int colon = id.indexOf(':'); + String namespace = colon < 0 ? "minecraft" : id.substring(0, colon); + String value = colon < 0 ? id : id.substring(colon + 1); + return this.resolve(input, Map.of( + "__NAMESPACE__", TemplateArgument.fromValue(namespace), + "__ID__", TemplateArgument.fromValue(value))); + } + + /** Resolves {@code input} against explicit arguments. */ + @Nullable + public Object resolve(@Nullable Object input, @NotNull Map arguments) { + return this.process("", preprocess(input), arguments); + } + + /** + * Converts a raw config tree into one where every string has been parsed into an + * {@link ArgumentString}. Idempotent, so already-preprocessed trees pass through unchanged. + */ + @Nullable + public static Object preprocess(@Nullable Object value) { + return switch (value) { + case null -> null; + case ArgumentString ignored -> value; + case Map map -> { + Map out = new LinkedHashMap<>(); + for (Map.Entry entry : map.entrySet()) { + out.put(ArgumentString.parse(String.valueOf(entry.getKey())), preprocess(entry.getValue())); + } + yield out; + } + case List list -> { + List out = new ArrayList<>(list.size()); + for (Object element : list) out.add(preprocess(element)); + yield out; + } + case String string -> ArgumentString.parse(string); + default -> value; + }; + } + + @SuppressWarnings("unchecked") + @Nullable + private Object process(String node, @Nullable Object value, Map arguments) { + return switch (value) { + case null -> null; + case Map map -> this.processMap(node, (Map) map, arguments); + case List list -> { + List out = new ArrayList<>(list.size()); + for (int i = 0; i < list.size(); i++) { + out.add(this.process(node + "[" + i + "]", list.get(i), arguments)); + } + yield out; + } + case ArgumentString argument -> argument.resolve(node, arguments); + default -> value; + }; + } + + @Nullable + private Object processMap(String node, Map input, + Map arguments) { + Object templateRef = lookup(input, TEMPLATE); + if (templateRef == null) templateRef = lookup(input, TEMPLATES); + + if (templateRef == null) { + Map out = new LinkedHashMap<>(); + for (Map.Entry entry : input.entrySet()) { + ArgumentString rawKey = entry.getKey(); + String childNode = node.isEmpty() ? rawKey.rawValue() : node + "." + rawKey.rawValue(); + Object key = rawKey.resolve(childNode, arguments); + if (key == null) continue; + out.put(key.toString(), this.process(childNode, entry.getValue(), arguments)); + } + return out; + } + return this.applyTemplates(node, templateRef, input, arguments); + } + + private Object applyTemplates(String node, Object templateRef, Map input, + Map parentArguments) { + Object rawArguments = lookup(input, ARGUMENTS); + Map arguments = rawArguments instanceof Map argumentMap + ? this.mergeArguments(node + "." + ARGUMENTS, castKeys(argumentMap), parentArguments) + : parentArguments; + + List resolvedTemplates = new ArrayList<>(); + List ids = templateRef instanceof List list ? new ArrayList<>(list) : List.of(templateRef); + for (int i = 0; i < ids.size(); i++) { + String childNode = node + "." + TEMPLATE + "[" + i + "]"; + Object rawId = this.process(childNode, ids.get(i), arguments); + if (rawId == null) continue; // A null id skips that template. + String id = rawId.toString(); + if (!this.templates.containsKey(id)) { + throw new TemplateException("Unknown template '" + id + "' referenced at " + childNode); + } + Object resolved = this.process(childNode, this.templates.get(id), arguments); + if (resolved != null) resolvedTemplates.add(resolved); + } + + Object overrides = null; + Object rawOverrides = lookup(input, OVERRIDES); + if (rawOverrides != null) { + overrides = this.process(node + "." + OVERRIDES, rawOverrides, arguments); + } + + Object merges = null; + Object rawMerges = lookup(input, MERGES); + if (rawMerges != null) { + merges = this.process(node + "." + MERGES, rawMerges, arguments); + } + + Map strays = new LinkedHashMap<>(); + for (Map.Entry entry : input.entrySet()) { + ArgumentString rawKey = entry.getKey(); + if (RESERVED.contains(rawKey.rawValue())) continue; + String childNode = node + "." + rawKey.rawValue(); + Object key = rawKey.resolve(childNode, parentArguments); + if (key == null) continue; + strays.put(key.toString(), this.process(childNode, entry.getValue(), arguments)); + } + if (!strays.isEmpty()) { + if (merges instanceof Map existing) strays.putAll(castToStringMap(existing)); + merges = strays; + } + + return combine(resolvedTemplates, overrides, merges); + } + + /** Folds the resolved templates together with the overrides and merges. */ + @Nullable + private static Object combine(List templates, @Nullable Object overrides, @Nullable Object merges) { + if (templates.isEmpty()) { + if (overrides instanceof Map map) { + Map out = new LinkedHashMap<>(castToStringMap(map)); + if (merges instanceof Map mergeMap) deepMerge(out, castToStringMap(mergeMap)); + return out; + } + if (overrides instanceof List list) { + List out = new ArrayList<>(list); + if (merges instanceof List mergeList) out.addAll(mergeList); + return out; + } + if (overrides != null) return overrides; + return merges; + } + + Object first = templates.getFirst(); + if (first instanceof Map) { + Map out = new LinkedHashMap<>(); + for (Object template : templates) { + if (template instanceof Map map) deepMerge(out, castToStringMap(map)); + } + if (overrides instanceof Map map) out.putAll(castToStringMap(map)); + if (merges instanceof Map map) deepMerge(out, castToStringMap(map)); + return out; + } + if (first instanceof List) { + List out = new ArrayList<>(); + for (Object template : templates) { + if (template instanceof List list) out.addAll(list); + } + if (overrides instanceof List list) { + out.clear(); + out.addAll(list); + } + if (merges instanceof List list) out.addAll(list); + return out; + } + if (overrides != null) return overrides; + if (merges != null) return merges; + return templates.getLast(); + } + + /** + * Merges a child's arguments over its parent's, with the parent winning. + *

+ * That direction is deliberate and matches CraftEngine: a template declares defaults, and the item + * using it passes the values that must take effect, so an inner template cannot clobber what the + * caller supplied. + */ + private Map mergeArguments(String node, Map childArguments, + Map parentArguments) { + Map result = new LinkedHashMap<>(parentArguments); + for (Map.Entry entry : childArguments.entrySet()) { + Object key = entry.getKey().resolve(node, result); + if (key == null) continue; + String name = key.toString(); + if (result.containsKey(name)) continue; // Parent wins. + result.put(name, TemplateArgument.fromValue(this.process(node + "." + name, entry.getValue(), result))); + } + return result; + } + + /** + * Recursively merges {@code source} into {@code target}. + *

+ * Nested maps merge, lists concatenate, scalars replace. A {@code $$}-prefixed key forces replacement + * instead of merging, with one {@code $} stripped — CraftEngine's escape hatch for a template that must + * discard what it inherited rather than add to it. + */ + @SuppressWarnings("unchecked") + private static void deepMerge(Map target, Map source) { + for (Map.Entry entry : source.entrySet()) { + String key = entry.getKey(); + Object value = entry.getValue(); + + if (key.length() > 2 && key.charAt(0) == '$' && key.charAt(1) == '$') { + target.put(key.substring(2), value); + continue; + } + + Object existing = target.get(key); + if (existing instanceof Map existingMap && value instanceof Map valueMap) { + Map merged = new LinkedHashMap<>(castToStringMap(existingMap)); + deepMerge(merged, castToStringMap(valueMap)); + target.put(key, merged); + } else if (existing instanceof List existingList && value instanceof List valueList) { + List merged = new ArrayList<>(existingList); + merged.addAll(valueList); + target.put(key, merged); + } else { + target.put(key, value); + } + } + } + + /** Finds a reserved key in a pre-parsed map, whose keys are {@link ArgumentString}s. */ + @Nullable + private static Object lookup(Map input, String key) { + for (Map.Entry entry : input.entrySet()) { + if (key.equals(entry.getKey().rawValue())) return entry.getValue(); + } + return null; + } + + @SuppressWarnings("unchecked") + private static Map castKeys(Map map) { + return (Map) map; + } + + @SuppressWarnings("unchecked") + private static Map castToStringMap(Map map) { + return (Map) map; + } +} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/template/TemplateException.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/template/TemplateException.java new file mode 100644 index 00000000..7abf4e5f --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/template/TemplateException.java @@ -0,0 +1,16 @@ +package fr.robie.craftengineconverter.api.configuration.template; + +/** + * A template could not be resolved — an unknown template id, or a {@code ${placeholder}} with neither a + * bound argument nor a fallback. + *

+ * Thrown rather than skipped because a half-resolved template would emit an item with a + * {@code ${...}} still in its material or texture path, which fails later and much less legibly. Callers + * catch this per item so one bad template does not abort the whole conversion. + */ +public class TemplateException extends RuntimeException { + + public TemplateException(String message) { + super(message); + } +} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/manager/FileCacheManager.java b/API/src/main/java/fr/robie/craftengineconverter/api/manager/FileCacheManager.java index ea2c301c..7695cdae 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/manager/FileCacheManager.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/manager/FileCacheManager.java @@ -13,10 +13,8 @@ import java.nio.file.Path; public class FileCacheManager { - private static final Gson GSON = new GsonBuilder() - .setPrettyPrinting() - .disableHtmlEscaping() - .create(); + private static final Gson GSON = createGsonBuilder(true).create(); + private static final Gson COMPACT_GSON = createGsonBuilder(false).create(); private static final FileCache yamlCache = new FileCache<>(100, 30, YamlConfiguration::loadConfiguration); private static final FileCache jsonCache = new FileCache<>(100, 30, file -> { @@ -67,12 +65,21 @@ public static FileCache getJsonCache() { return jsonCache; } - public static void saveJsonToFile(@NotNull Path path, @NotNull JsonElement json) { + public static void saveJsonToFile(@NotNull Path path, @NotNull JsonElement jsonElement) { try (var writer = Files.newBufferedWriter(path)) { - GSON.toJson(json, writer); + COMPACT_GSON.toJson(jsonElement, writer); } catch (Exception e) { Logger.error(Message.ERROR__JSON__LOAD_FAILURE, e, Placeholder.of("file", path.toAbsolutePath().toString(), "message", e.getMessage())); } } + private static GsonBuilder createGsonBuilder(boolean prettyPrint) { + GsonBuilder builder = new GsonBuilder() + .disableHtmlEscaping(); + if (prettyPrint) { + builder.setPrettyPrinting(); + } + return builder; + } + } \ No newline at end of file diff --git a/API/src/main/resources/META-INF/services/org.reflections.scanners.Scanner b/API/src/main/resources/META-INF/services/org.reflections.scanners.Scanner deleted file mode 100644 index 2f49d15b..00000000 --- a/API/src/main/resources/META-INF/services/org.reflections.scanners.Scanner +++ /dev/null @@ -1 +0,0 @@ -AutoTintConfigurationLoaderScanner \ No newline at end of file From d29ab0c5fc835337700497f7428d7da5e6f8131b Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Wed, 5 Aug 2026 15:41:52 +0200 Subject: [PATCH 051/116] feat: add vanilla asset management for Bedrock conversion --- .../CraftEngineConverterCommandBedrock.java | 56 ++++--- ...eConverterCommandBedrockVanillaAssets.java | 71 +++++++++ .../bedrock/asset/VanillaAssetDownloader.java | 138 ++++++++++++++++++ .../bedrock/asset/VanillaAssetStore.java | 102 +++++++++++++ 4 files changed, 349 insertions(+), 18 deletions(-) create mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/command/CraftEngineConverterCommandBedrockVanillaAssets.java create mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/asset/VanillaAssetDownloader.java create mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/asset/VanillaAssetStore.java diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/command/CraftEngineConverterCommandBedrock.java b/Plugin/src/main/java/fr/robie/craftengineconverter/command/CraftEngineConverterCommandBedrock.java index 9a3e4477..f00c7078 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/command/CraftEngineConverterCommandBedrock.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/command/CraftEngineConverterCommandBedrock.java @@ -4,6 +4,8 @@ import fr.robie.craftengineconverter.api.builder.TimerBuilder; import fr.robie.craftengineconverter.common.permission.Permission; import fr.robie.craftengineconverter.converter.bedrock.BedrockConverter; +import fr.robie.craftengineconverter.converter.bedrock.asset.VanillaAssetStore; +import fr.robie.craftengineconverter.converter.bedrock.asset.VanillaAssets; import fr.robie.messageflow.logger.Logger; import fr.robie.paperdispatch.command.CommandDispatch; import fr.robie.paperdispatch.command.CommandResultType; @@ -13,35 +15,53 @@ import org.jetbrains.annotations.NotNull; import java.io.File; +import java.util.concurrent.CompletableFuture; public class CraftEngineConverterCommandBedrock extends SubCommand { public CraftEngineConverterCommandBedrock(CraftEngineConverter plugin) { super(plugin, "bedrock", "be"); this.setPermission(Permission.COMMAND_BEDROCK_CONVERT.asPermission()); + this.addSubCommand(new CraftEngineConverterCommandBedrockVanillaAssets(plugin)); } @Override protected @NotNull CommandResultType perform(@NotNull CommandDispatch commandDispatch) { CommandSender sender = commandDispatch.getSender(); - try { - long startTime = System.currentTimeMillis(); - BedrockConverter converter = new BedrockConverter(this.plugin.getDataFolder()); - - File configFile = new File(this.plugin.getDataFolder(), "config.yml"); - if (configFile.exists()) { - YamlConfiguration config = YamlConfiguration.loadConfiguration(configFile); - converter.loadSettingsFromConfig(config); - } - - converter.convert(); - long endTime = System.currentTimeMillis(); - sender.sendMessage("§aBedrock conversion completed in " + TimerBuilder.formatTimeAuto(endTime - startTime)); - return CommandResultType.SUCCESS; - } catch (Exception e) { - Logger.error("An error occurred during Bedrock conversion.", e); - sender.sendMessage("§cAn error occurred during Bedrock conversion. Check console for details."); - return CommandResultType.FAILURE; + + CompletableFuture.runAsync(() -> this.convert(sender)) + .exceptionally(error -> { + Logger.error("An error occurred during Bedrock conversion.", error); + sender.sendMessage("§cAn error occurred during Bedrock conversion. Check console for details."); + return null; + }); + + sender.sendMessage("§7Bedrock conversion started..."); + return CommandResultType.SUCCESS; + } + + private void convert(CommandSender sender) { + long startTime = System.currentTimeMillis(); + + VanillaAssets assets = VanillaAssetStore.prepare(this.plugin.getDataFolder()); + if (assets.isAvailable()) { + Logger.info("Vanilla assets ready: " + assets.source()); + } + + BedrockConverter converter = new BedrockConverter(this.plugin.getDataFolder()); + this.loadConverterSettings(converter); + converter.convert(); + + long endTime = System.currentTimeMillis(); + sender.sendMessage("§aBedrock conversion completed in " + + TimerBuilder.formatTimeAuto(endTime - startTime)); + } + + private void loadConverterSettings(BedrockConverter converter) { + File configFile = new File(this.plugin.getDataFolder(), "config.yml"); + if (configFile.exists()) { + YamlConfiguration config = YamlConfiguration.loadConfiguration(configFile); + converter.loadSettingsFromConfig(config); } } } diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/command/CraftEngineConverterCommandBedrockVanillaAssets.java b/Plugin/src/main/java/fr/robie/craftengineconverter/command/CraftEngineConverterCommandBedrockVanillaAssets.java new file mode 100644 index 00000000..2fb39aa5 --- /dev/null +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/command/CraftEngineConverterCommandBedrockVanillaAssets.java @@ -0,0 +1,71 @@ +package fr.robie.craftengineconverter.command; + +import fr.robie.craftengineconverter.CraftEngineConverter; +import fr.robie.craftengineconverter.common.permission.Permission; +import fr.robie.craftengineconverter.converter.bedrock.asset.VanillaAssetStore; +import fr.robie.craftengineconverter.converter.bedrock.asset.VanillaAssets; +import fr.robie.messageflow.logger.Logger; +import fr.robie.paperdispatch.command.CommandDispatch; +import fr.robie.paperdispatch.command.CommandResultType; +import fr.robie.paperdispatch.command.SubCommand; +import org.bukkit.command.CommandSender; +import org.jetbrains.annotations.NotNull; + +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.concurrent.CompletableFuture; + +/** + * Fetches the vanilla models and textures that packs inherit but do not ship, up front. + *

+ * Conversion primes them on its own when they are missing, so this exists to move that cost out of a conversion + * window: an admin can prepare before a release, or refresh after changing the target version, rather than + * discovering a download mid-convert. {@code refresh} discards the cached jar first. + */ +public class CraftEngineConverterCommandBedrockVanillaAssets extends SubCommand { + + public CraftEngineConverterCommandBedrockVanillaAssets(CraftEngineConverter plugin) { + super(plugin, "vanilla-assets", "assets"); + this.setPermission(Permission.COMMAND_BEDROCK_CONVERT.asPermission()); + this.addFlag("refresh"); + } + + @Override + protected @NotNull CommandResultType perform(@NotNull CommandDispatch commandDispatch) { + CommandSender sender = commandDispatch.getSender(); + boolean refresh = commandDispatch.hasFlag("refresh"); + String version = VanillaAssetStore.targetVersion(); + + if (refresh && VanillaAssetStore.clear(this.plugin.getDataFolder())) { + sender.sendMessage("§7Discarded the cached vanilla assets for " + version); + } + + sender.sendMessage("§7Preparing vanilla assets for §f" + version + "§7..."); + + CompletableFuture.runAsync(() -> { + VanillaAssets assets = VanillaAssetStore.prepare(this.plugin.getDataFolder()); + if (!assets.isAvailable()) { + sender.sendMessage("§cCould not prepare vanilla assets for " + version + + ". Check the console; you can also set vanilla-assets.path to assets you already have."); + return; + } + sender.sendMessage("§aVanilla assets ready for " + version + " §7(" + describe(assets.source()) + ")"); + }).exceptionally(error -> { + Logger.error("Failed to prepare vanilla assets.", error); + sender.sendMessage("§cFailed to prepare vanilla assets. Check console for details."); + return null; + }); + + return CommandResultType.SUCCESS; + } + + private static String describe(Path source) { + if (source == null) return "no source"; + try { + if (Files.isDirectory(source)) return source.toString(); + return source.getFileName() + ", " + (Files.size(source) / (1024 * 1024)) + " MB"; + } catch (Exception e) { + return source.toString(); + } + } +} diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/asset/VanillaAssetDownloader.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/asset/VanillaAssetDownloader.java new file mode 100644 index 00000000..5b262953 --- /dev/null +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/asset/VanillaAssetDownloader.java @@ -0,0 +1,138 @@ +package fr.robie.craftengineconverter.converter.bedrock.asset; + +import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; +import fr.robie.messageflow.logger.Logger; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.io.InputStream; +import java.net.URI; +import java.net.http.HttpClient; +import java.net.http.HttpRequest; +import java.net.http.HttpResponse; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.StandardCopyOption; +import java.security.MessageDigest; +import java.time.Duration; + +/** + * Fetches a Minecraft client jar so the vanilla models and textures a pack inherits can be read. + *

+ * Uses Mojang's own published endpoints, the same ones the launcher uses: the version manifest names every + * version, a version's own JSON names its client jar and that jar's SHA-1. Nothing is redistributed — the plugin + * ships no Mojang files and fetches from the official source into a local cache, which is what a launcher does. + *

+ * The hash is verified. A jar that does not match is deleted rather than cached, because a truncated download + * would otherwise be indistinguishable from a version whose assets are simply missing files. + */ +public final class VanillaAssetDownloader { + private static final String MANIFEST_URL = "https://piston-meta.mojang.com/mc/game/version_manifest_v2.json"; + + private static final Duration TIMEOUT = Duration.ofMinutes(5); + + private VanillaAssetDownloader() { + throw new UnsupportedOperationException("VanillaAssetDownloader is a utility class and cannot be instantiated."); + } + + /** + * Downloads the client jar for {@code version} into {@code cacheDir}, unless it is already there. + *

+ * Blocking, and deliberately so — it is the caller's job to be off the main thread. Downloading tens of + * megabytes on the server thread would stall the server for the duration. + * + * @return the jar, or {@code null} when it could not be fetched + */ + @Nullable + public static Path download(@NotNull String version, @NotNull Path cacheDir) { + Path jar = cacheDir.resolve("client.jar"); + if (Files.isRegularFile(jar)) { + Logger.info("Vanilla assets for " + version + " are already cached"); + return jar; + } + + try (HttpClient client = HttpClient.newBuilder().connectTimeout(Duration.ofSeconds(30)).build()) { + JsonObject versionEntry = findVersion(client, version); + if (versionEntry == null) { + Logger.warn("Minecraft version " + version + " is not in Mojang's version manifest" + + " - set vanilla-assets.version to a released version, or vanilla-assets.path to assets" + + " you already have"); + return null; + } + + JsonObject download = fetchJson(client, versionEntry.get("url").getAsString()) + .getAsJsonObject("downloads").getAsJsonObject("client"); + String url = download.get("url").getAsString(); + String expectedSha1 = download.get("sha1").getAsString(); + + Logger.info("Downloading vanilla assets for " + version + " from Mojang"); + Files.createDirectories(cacheDir); + + Path partial = cacheDir.resolve("client.jar.part"); + HttpResponse response = client.send( + HttpRequest.newBuilder(URI.create(url)).timeout(TIMEOUT).build(), + HttpResponse.BodyHandlers.ofInputStream()); + if (response.statusCode() != 200) { + Logger.warn("Mojang returned HTTP " + response.statusCode() + " for the " + version + " client jar"); + return null; + } + try (InputStream in = response.body()) { + Files.copy(in, partial, StandardCopyOption.REPLACE_EXISTING); + } + + String actualSha1 = sha1Of(partial); + if (!expectedSha1.equalsIgnoreCase(actualSha1)) { + Files.deleteIfExists(partial); + Logger.warn("The downloaded " + version + " client jar is corrupt (expected sha1 " + expectedSha1 + + ", got " + actualSha1 + ") - not caching it"); + return null; + } + + Files.move(partial, jar, StandardCopyOption.REPLACE_EXISTING); + Logger.info("Cached vanilla assets for " + version + " (" + + (Files.size(jar) / (1024 * 1024)) + " MB) at " + jar); + return jar; + } catch (Exception e) { + Logger.warn("Could not download vanilla assets for " + version + ": " + e.getMessage() + + " - custom blocks will fall back to a built-in cube shape." + + " Set vanilla-assets.path to use assets you already have."); + return null; + } + } + + @Nullable + private static JsonObject findVersion(HttpClient client, String version) throws Exception { + JsonArray versions = fetchJson(client, MANIFEST_URL).getAsJsonArray("versions"); + for (JsonElement element : versions) { + JsonObject entry = element.getAsJsonObject(); + if (version.equals(entry.get("id").getAsString())) return entry; + } + return null; + } + + private static JsonObject fetchJson(HttpClient client, String url) throws Exception { + HttpResponse response = client.send( + HttpRequest.newBuilder(URI.create(url)).timeout(TIMEOUT).build(), + HttpResponse.BodyHandlers.ofString(StandardCharsets.UTF_8)); + if (response.statusCode() != 200) { + throw new IllegalStateException("HTTP " + response.statusCode() + " from " + url); + } + return JsonParser.parseString(response.body()).getAsJsonObject(); + } + + private static String sha1Of(Path file) throws Exception { + MessageDigest digest = MessageDigest.getInstance("SHA-1"); + try (InputStream in = Files.newInputStream(file)) { + byte[] buffer = new byte[8192]; + int read; + while ((read = in.read(buffer)) > 0) digest.update(buffer, 0, read); + } + StringBuilder hex = new StringBuilder(); + for (byte b : digest.digest()) hex.append(String.format("%02x", b)); + return hex.toString(); + } +} diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/asset/VanillaAssetStore.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/asset/VanillaAssetStore.java new file mode 100644 index 00000000..95a3f420 --- /dev/null +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/asset/VanillaAssetStore.java @@ -0,0 +1,102 @@ +package fr.robie.craftengineconverter.converter.bedrock.asset; + +import fr.robie.craftengineconverter.api.configuration.Configuration; +import fr.robie.craftengineconverter.api.configuration.ConfigurationKey; +import fr.robie.craftengineconverter.api.utils.MinecraftVersion; +import fr.robie.messageflow.logger.Logger; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.io.File; +import java.nio.file.Files; +import java.nio.file.Path; + +/** + * Decides where the vanilla assets come from and where they are cached. + *

+ * Split from {@link VanillaAssets} because the two answer different questions: this one reads configuration and + * may reach the network, while {@code VanillaAssets} only looks things up in whatever source it was handed. Keeping + * them apart is what lets a conversion attach a source without any risk of downloading on the calling thread. + */ +public final class VanillaAssetStore { + + private VanillaAssetStore() { + throw new UnsupportedOperationException("VanillaAssetStore is a utility class and cannot be instantiated."); + } + + /** The Minecraft version whose assets to use: the configured one, or the server's own. */ + @NotNull + public static String targetVersion() { + String configured = Configuration.get(ConfigurationKey.VANILLA_ASSETS_VERSION); + if (configured != null && !configured.isBlank() && !configured.equalsIgnoreCase("auto")) { + return configured.trim(); + } + return MinecraftVersion.getCurrentVersion().toString(); + } + + public static Path cacheDir(@NotNull File pluginFolder) { + return pluginFolder.toPath().resolve("vanilla-assets").resolve(targetVersion()); + } + + /** + * The assets already available, without touching the network: the configured path if set, else a jar a previous + * download or the {@code vanilla-assets} command left in the cache. + */ + @NotNull + public static VanillaAssets existing(@NotNull File pluginFolder) { + Path cache = cacheDir(pluginFolder); + + Path configured = configuredPath(); + if (configured != null) { + Logger.info("Using vanilla assets from " + configured); + return new VanillaAssets(cache, configured); + } + + Path jar = cache.resolve("client.jar"); + return Files.isRegularFile(jar) ? new VanillaAssets(cache, jar) : VanillaAssets.empty(cache); + } + + /** + * The assets, downloading them first if they are missing and downloading is allowed. + *

+ * Blocking. Call it off the server thread — a client jar is tens of megabytes. + */ + @NotNull + public static VanillaAssets prepare(@NotNull File pluginFolder) { + VanillaAssets existing = existing(pluginFolder); + if (existing.isAvailable()) return existing; + + if (!(boolean) Configuration.get(ConfigurationKey.VANILLA_ASSETS_DOWNLOAD)) { + Logger.info("vanilla-assets.download is off and nothing is cached, so vanilla parents cannot be" + + " resolved. Set vanilla-assets.path to assets you already have, or turn the download on."); + return existing; + } + + Path cache = cacheDir(pluginFolder); + Path jar = VanillaAssetDownloader.download(targetVersion(), cache); + return jar == null ? VanillaAssets.empty(cache) : new VanillaAssets(cache, jar); + } + + /** Removes the cached jar for the target version, so the next prepare re-downloads it. */ + public static boolean clear(@NotNull File pluginFolder) { + try { + return Files.deleteIfExists(cacheDir(pluginFolder).resolve("client.jar")); + } catch (Exception e) { + Logger.warn("Could not delete the cached vanilla assets: " + e.getMessage()); + return false; + } + } + + @Nullable + private static Path configuredPath() { + String configured = Configuration.get(ConfigurationKey.VANILLA_ASSETS_PATH); + if (configured == null || configured.isBlank()) return null; + + Path path = Path.of(configured.trim()); + if (!Files.exists(path)) { + Logger.warn("vanilla-assets.path points at " + path + ", which does not exist - ignoring it"); + return null; + } + return path; + } +} From 7aa7380431b41130a1f694e158b55ddb1a025f98 Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Wed, 5 Aug 2026 15:58:47 +0200 Subject: [PATCH 052/116] feat: enhance Bedrock animation handling with improved rounding and new attachable slot management --- .../converter/bedrock/BedrockItemLoader.java | 953 ++++++++++++------ .../converter/bedrock/ConversionContext.java | 441 +++++++- .../bedrock/DefaultMaterialResolver.java | 87 ++ .../bedrock/animation/AnimationMapper.java | 185 ++-- .../bedrock/animation/BedrockAnimation.java | 25 +- .../animation/BedrockAnimationContext.java | 57 +- .../animation/BedrockAnimationController.java | 32 - .../animation/BedrockRenderControllers.java | 72 +- .../bedrock/attachable/BedrockAttachable.java | 39 +- .../attachable/BedrockAttachableContext.java | 45 +- .../bedrock/display/AttachableSlot.java | 75 ++ .../bedrock/display/DisplayPoses.java | 94 ++ .../bedrock/display/HandAnchors.java | 135 +++ .../converter/bedrock/display/Transform.java | 294 ++++++ .../bedrock/item/ConfigFactoryExpander.java | 180 ++++ .../bedrock/item/EquipmentAssetRegistry.java | 118 +++ .../item/ItemModelDefinitionMapper.java | 102 ++ 17 files changed, 2394 insertions(+), 540 deletions(-) create mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/DefaultMaterialResolver.java create mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/display/AttachableSlot.java create mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/display/DisplayPoses.java create mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/display/HandAnchors.java create mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/display/Transform.java create mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/item/ConfigFactoryExpander.java create mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/item/EquipmentAssetRegistry.java create mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/item/ItemModelDefinitionMapper.java diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockItemLoader.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockItemLoader.java index b51ddf46..aee3cb02 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockItemLoader.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockItemLoader.java @@ -1,8 +1,5 @@ package fr.robie.craftengineconverter.converter.bedrock; -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonObject; import fr.robie.craftengineconverter.api.configuration.Configuration; import fr.robie.craftengineconverter.api.configuration.ConfigurationKey; import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.GroupDefinitionMapping; @@ -11,9 +8,12 @@ import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.LegacyItemMapping; import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.component.GenericBedrockComponent; import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.option.BedrockOptions; +import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.option.CreativeGroupRules; +import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.option.VanillaItemGroups; import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate.BedrockPredicate; import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate.condition.HasComponentPredicate; import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate.match.ChargeTypePredicate; +import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate.match.TrimMaterialPredicate; import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate.range_dispatch.BundleFullnessPredicate; import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate.range_dispatch.CountPredicate; import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate.range_dispatch.DamagePredicate; @@ -24,17 +24,21 @@ import fr.robie.craftengineconverter.api.configuration.item.models.model.GenerationConfiguration; import fr.robie.craftengineconverter.api.configuration.item.models.model.SimpleModelConfiguration; import fr.robie.craftengineconverter.api.configuration.item.models.range_dispatch.RangeDispatchModelConfiguration; -import fr.robie.craftengineconverter.api.configuration.item.models.select.ChargeTypeSelectConfiguration; -import fr.robie.craftengineconverter.api.configuration.item.models.select.ComponentSelectConfiguration; -import fr.robie.craftengineconverter.api.configuration.item.models.select.CustomModelDataSelectConfiguration; -import fr.robie.craftengineconverter.api.configuration.item.models.select.SelectModelConfiguration; +import fr.robie.craftengineconverter.api.configuration.item.models.select.*; +import fr.robie.craftengineconverter.api.configuration.item.models.tints.TintConfiguration; import fr.robie.craftengineconverter.api.configuration.loader.models.ModelConfigurationRegistry; import fr.robie.craftengineconverter.converter.bedrock.animation.AnimationMapper; import fr.robie.craftengineconverter.converter.bedrock.animation.BedrockAnimationContext; import fr.robie.craftengineconverter.converter.bedrock.animation.BedrockRenderControllers; import fr.robie.craftengineconverter.converter.bedrock.attachable.BedrockAttachableContext; +import fr.robie.craftengineconverter.converter.bedrock.display.DisplayPresets; import fr.robie.craftengineconverter.converter.bedrock.geometry.BedrockGeometry; +import fr.robie.craftengineconverter.converter.bedrock.geometry.DisplayContext; import fr.robie.craftengineconverter.converter.bedrock.geometry.GeometryMapper; +import fr.robie.craftengineconverter.converter.bedrock.geometry.JavaBlockModel; +import fr.robie.craftengineconverter.converter.bedrock.icon.ItemIconRenderer; +import fr.robie.craftengineconverter.converter.bedrock.icon.ModelTextureTinter; +import fr.robie.craftengineconverter.converter.bedrock.item.ItemModelDefinitionMapper; import fr.robie.craftengineconverter.converter.bedrock.texture.CachedTextureInfo; import fr.robie.messageflow.logger.Logger; import fr.robie.yamllibrary.ConfigurationSection; @@ -43,15 +47,24 @@ import org.jetbrains.annotations.Nullable; import java.awt.image.BufferedImage; -import java.nio.file.Files; -import java.nio.file.Path; import java.util.*; public class BedrockItemLoader { + + /** + * Above this, a pixel lattice costs more cubes than it is worth — a 128×128 frame would be 16 384 of + * them — so such an item keeps the flat plane and simply does not look three-dimensional. + */ + private static final int MAX_LATTICE_PIXELS = 4096; + private final String itemId; private final ConfigurationSection itemSection; private final ConversionContext context; private final HashSet processedModels = new HashSet<>(); + // Guards the one-predicate-less-definition-per-model rule; see buildDefinitions. + private boolean emittedBaseDefinition; + // The predicate-less definition, i.e. the item's base appearance. Used for the group's own icon. + private ItemMapping baseDefinition; private final java.util.ArrayList processedModelPaths = new java.util.ArrayList<>(); private final java.util.HashMap animationContexts = new java.util.HashMap<>(); @@ -63,17 +76,44 @@ public BedrockItemLoader(@NotNull String itemId, @NotNull ConfigurationSection i public ItemMapping load() { Material material = this.getMaterial(); - ModelConfiguration modelConfiguration = ModelConfigurationRegistry.load(this.itemSection.getConfigurationSection("model")); + + + // Since Java 1.21.4 the variant logic lives in the resource pack, at + // assets//items/.json, and is far richer than the flat "textures:" list a + // CraftEngine item config carries — the latter says which textures exist but never when each + // applies. Prefer the pack definition; fall back to a YAML "model:" section for older packs. + String itemModel = this.itemSection.isString("item-model") + ? this.itemSection.getString("item-model") + : this.itemId; + ModelConfiguration modelConfiguration = this.context.itemModelDefinitions() + .get(itemModel) + .map(ItemModelDefinitionMapper.ItemDefinition::model) + .orElse(null); + + if (modelConfiguration == null) { + modelConfiguration = ModelConfigurationRegistry.load(this.itemSection.getConfigurationSection("model")); + } if (modelConfiguration != null) { GroupDefinitionMapping rootGroup = new GroupDefinitionMapping(material, this.itemId); - if (this.itemSection.isString("item-model")) { - rootGroup.setModel(this.itemSection.getString("item-model")); - } + rootGroup.setModel(itemModel); List predicateStack = new ArrayList<>(); this.buildDefinitions(rootGroup, modelConfiguration, material, this.itemId, predicateStack); - this.collectTextureData(modelConfiguration, rootGroup, this.itemId); + + // The group needs a texture of its own for the icon Bedrock shows in the creative menu. + // Prefer the predicate-less definition — that is the item's base appearance. Falling back + // to the first definition would pick whichever variant the tree happened to list first + // (for a select, a case rather than the fallback). + ItemMapping iconSource = this.baseDefinition != null + ? this.baseDefinition + : rootGroup.getDefinitions().stream() + .filter(definition -> !definition.getTexturesData().isEmpty()) + .findFirst().orElse(null); + if (rootGroup.getTexturesData().isEmpty() && iconSource != null + && !iconSource.getTexturesData().isEmpty()) { + rootGroup.addTextureData(iconSource.getTexturesData().getFirst()); + } this.convertItem(rootGroup); return rootGroup; } @@ -106,9 +146,10 @@ public ItemMapping load() { String texturePath = this.itemSection.getString("texture"); ItemModelItemMapping mapping = new ItemModelItemMapping(material, this.itemId, this.itemId); // Extract material display transforms for accurate tool/item positioning - this.extractMaterialDisplayTransforms(material, this.itemId); - // Register pipeline artifacts first (this resolves texture, detects animation, adds artifacts) - this.registerPipelineArtifacts(texturePath, this.itemId, this.isToolMaterial(material)); + this.registerMaterialPoseAnimations(material, this.itemId); + // Register pipeline artifacts first (this resolves texture, detects animation, adds artifacts). + // No model path: a "texture:" item names only a texture, so its held form is an extruded sprite. + this.registerPipelineArtifacts(texturePath, null, this.itemId, this.isToolMaterial(material)); // Add TextureData to the mapping for Geyser icon resolution String resolvedPath = this.resolveTexturePath(texturePath); if (this.context.texturePipeline().isAnimated(texturePath)) { @@ -128,9 +169,10 @@ public ItemMapping load() { if (this.itemSection.isList("textures")) { List texturePaths = this.itemSection.getStringList("textures"); ItemModelItemMapping mapping = new ItemModelItemMapping(material, this.itemId, this.itemId); - this.extractMaterialDisplayTransforms(material, this.itemId); + this.registerMaterialPoseAnimations(material, this.itemId); for (String tex : texturePaths) { - this.registerPipelineArtifacts(tex, this.itemId, this.isToolMaterial(material)); + // As above: a "textures:" list names no model, so there is no shape to convert. + this.registerPipelineArtifacts(tex, null, this.itemId, this.isToolMaterial(material)); } if (!this.context.texturePipeline().isAnimated(texturePaths.getFirst())) { TextureData td = new TextureData(this.itemId); @@ -164,10 +206,34 @@ private void buildDefinitions(@NotNull GroupDefinitionMapping group, @Nullable M case CompositeModelConfiguration composite -> this.traverseComposite(group, composite, material, textureId, predicateStack); default -> { - ItemModelItemMapping definition = new ItemModelItemMapping(material, textureId, textureId); + // Geyser allows only ONE predicate-less definition per Java item + item model pair. + // A branch whose property has no Bedrock equivalent yields no predicate, so a tree + // full of such branches would otherwise emit several indistinguishable definitions + // for the same model — which Geyser rejects. Keep the first as the base and drop the + // rest; createSelectPredicate / createRangePredicate have already warned why. + if (predicateStack.isEmpty()) { + if (this.emittedBaseDefinition) return; + this.emittedBaseDefinition = true; + } + + // textureId is a synthesized per-variant name and is only valid as the Bedrock + // identifier, which must be unique. The Java "model" is the item model definition + // every variant shares, so it is left null here: Geyser has group members inherit the + // group's model, and writing a made-up value would point at a definition that does + // not exist. + ItemModelItemMapping definition = + new ItemModelItemMapping(material, this.uniqueIdentifier(textureId), null); for (BedrockPredicate pred : predicateStack) { definition.addBedrockPredicate(pred); } + // Register this leaf's texture against the definition itself, not the group, so each + // variant gets its own icon. Doing it here rather than in a second traversal also keeps + // one source of truth for the synthesized textureId — the two used to be computed + // separately and had already drifted apart for range_dispatch thresholds. + this.addTextureDataIfSimpleModel(modelConfiguration, definition, textureId, material); + if (predicateStack.isEmpty()) { + this.baseDefinition = definition; + } group.addDefinition(definition); } } @@ -178,9 +244,26 @@ private void traverseCondition(@NotNull GroupDefinitionMapping group, @NotNull C if (!condition.isConditionSupported()) { Logger.warn("Unsupported condition property '" + condition.getProperty() + "' for item " + material + " - condition branches will be processed without predicates"); } - String propertySuffix = "_" + condition.getProperty().replace(":", "_"); + String propertySuffix = "_" + this.identifierSuffix(condition.getProperty()); ModelConfiguration onFalse = condition.getOnFalse(); + ModelConfiguration onTrue = condition.getOnTrue(); + + // When the condition itself cannot be expressed on Bedrock, both branches would produce + // indistinguishable predicate-less definitions and only the first survives. Prefer the animated + // branch in that case: an animated texture only ever renders through the attachable, so choosing + // the still branch guarantees no animation is ever seen, whereas the animated one at least plays. + if (!condition.isConditionSupported() && onFalse != null && onTrue != null) { + boolean falseAnimated = this.isBranchAnimated(onFalse); + boolean trueAnimated = this.isBranchAnimated(onTrue); + if (trueAnimated && !falseAnimated) { + Logger.info("Item " + this.itemId + " switches on '" + condition.getProperty() + + "', which Bedrock cannot express - using its animated variant so the animation plays"); + this.buildDefinitions(group, onTrue, material, baseTextureId, new ArrayList<>(predicateStack)); + return; + } + } + if (onFalse != null) { BedrockPredicate falsePredicate = condition.getOnFalsePredicate(); List falseStack = new ArrayList<>(predicateStack); @@ -190,7 +273,6 @@ private void traverseCondition(@NotNull GroupDefinitionMapping group, @NotNull C this.buildDefinitions(group, onFalse, material, baseTextureId, falseStack); } - ModelConfiguration onTrue = condition.getOnTrue(); String trueTextureId = baseTextureId + propertySuffix; if (onTrue != null) { BedrockPredicate truePredicate = condition.getOnTruePredicate(); @@ -202,10 +284,26 @@ private void traverseCondition(@NotNull GroupDefinitionMapping group, @NotNull C } } + /** Whether a branch's leaf texture carries a Java {@code .mcmeta} animation. */ + private boolean isBranchAnimated(@NotNull ModelConfiguration branch) { + if (!(branch instanceof SimpleModelConfiguration simple) || simple.getModel() == null) return false; + if (this.context.javaAssetsDir() == null) return false; + + for (String ref : this.context.javaModelResolver().texturesOf(simple.getModel(), this.context.javaAssetsDir())) { + if (this.context.texturePipeline() + .resolveTexture(ref, this.itemId, this.context.javaAssetsDir()) + .filter(info -> info.animation().isPresent()) + .isPresent()) { + return true; + } + } + return false; + } + private void traverseSelect(@NotNull GroupDefinitionMapping group, @NotNull SelectModelConfiguration select, Material material, String baseTextureId, List predicateStack) { for (SelectModelConfiguration.Case caseEntry : select.getCases()) { String caseValue = this.caseValueToString(caseEntry.when()); - String caseTextureId = baseTextureId + "_" + this.sanitizeTextureSuffix(caseValue); + String caseTextureId = baseTextureId + "_" + this.identifierSuffix(caseValue); BedrockPredicate casePredicate = this.createSelectPredicate(select, caseEntry); List caseStack = new ArrayList<>(predicateStack); @@ -224,7 +322,12 @@ private void traverseRange(@NotNull GroupDefinitionMapping group, @NotNull Range Float scale = range.getScale(); for (RangeDispatchModelConfiguration.Entry entry : range.getEntries()) { - String entryTextureId = baseTextureId + "_" + (long) entry.threshold(); + // Truncating to a long collapses distinct fractional thresholds onto the same name — + // a bow's 0.65 and 0.9 both became "_0" — so keep the decimal, with '.' made identifier-safe. + String entryTextureId = baseTextureId + "_" + // Thresholds originate as floats, so render as float: widening to double first + // turns 0.65 into 0.6499999761581421. + + this.sanitizeTextureSuffix(Float.toString((float) entry.threshold()).replace('.', '_')); BedrockPredicate entryPredicate = this.createRangePredicate(range, entry, scale); List entryStack = new ArrayList<>(predicateStack); @@ -260,10 +363,16 @@ private BedrockPredicate createSelectPredicate(@NotNull SelectModelConfiguration return new ChargeTypePredicate(chargeType); } } + if (select instanceof TrimMaterialSelectConfiguration) { + // Case values are resource locations, kept verbatim; Geyser matches on them as-is. + return new TrimMaterialPredicate(caseEntry.when().toString()); + } if (select instanceof ComponentSelectConfiguration componentSelect) { String value = caseEntry.when().toString(); return new HasComponentPredicate(componentSelect.getComponent(), true); } + Logger.warn("Item " + this.itemId + " selects on '" + select.getProperty() + + "', which has no Bedrock equivalent - those variants collapse to the base model"); return null; } @@ -284,6 +393,11 @@ private BedrockPredicate createRangePredicate(@NotNull RangeDispatchModelConfigu case "custom_model_data": return new fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate.range_dispatch.CustomModelDataPredicate(entry.threshold(), scale); } + // Geyser's range_dispatch only covers damage, count, bundle_fullness and custom_model_data. + // Notably there is no draw-progress property, so bow and crossbow pull states (use_duration, + // crossbow/pull) cannot be represented and collapse onto the item's base model. + Logger.warn("Item " + this.itemId + " dispatches on range property '" + range.getProperty() + + "', which has no Bedrock equivalent - those variants collapse to the base model"); return null; } @@ -294,50 +408,53 @@ private String caseValueToString(Object when) { return when.toString(); } - private String sanitizeTextureSuffix(String value) { - return value.replace(":", "_").replace("/", "_").replace(" ", "_"); + /** + * Makes a Bedrock identifier that no other definition in this pack uses. + *

+ * A duplicate {@code bedrock_identifier} is a hard error in Geyser — it cannot be shared with any + * other definition — and the names are derived from model trees where two branches can easily + * sanitize down to the same string. The suffix schemes above try to keep names distinct and + * meaningful; this is the guarantee. + */ + private String uniqueIdentifier(String candidate) { + // Keep the namespace separator, sanitize the path, so "a:b/c" stays "a:b_c" rather than "a_b_c". + int colon = candidate.indexOf(':'); + String identifier = colon < 0 + ? this.sanitizeTextureSuffix(candidate) + : candidate.substring(0, colon) + ":" + this.sanitizeTextureSuffix(candidate.substring(colon + 1)); + + if (this.context.claimBedrockIdentifier(identifier)) { + return identifier; + } + for (int suffix = 2; ; suffix++) { + String attempt = identifier + "_" + suffix; + if (this.context.claimBedrockIdentifier(attempt)) { + Logger.warn("Duplicate Bedrock identifier '" + identifier + "' for item " + this.itemId + + " - emitted as '" + attempt + "'"); + return attempt; + } + } } - private void collectTextureData(ModelConfiguration modelConfiguration, GroupDefinitionMapping rootGroup, String textureId) { - this.collectTextureData(modelConfiguration, rootGroup, textureId, null); + /** + * Sanitizes a value for use as an identifier suffix, dropping a redundant {@code minecraft} + * namespace. + *

+ * Only for names — a predicate's value keeps its full resource location, because that is + * what Geyser matches against. Generated filenames concatenate several of these, and the pack is + * written under an already-deep output directory, so a path can pass Windows' 260-character limit + * and become unreadable to tools that resolve it absolutely. + */ + private String identifierSuffix(String value) { + String trimmed = value.startsWith("minecraft:") ? value.substring("minecraft:".length()) : value; + return this.sanitizeTextureSuffix(trimmed); } - private void collectTextureData(ModelConfiguration modelConfiguration, GroupDefinitionMapping rootGroup, String textureId, Material material) { - if (modelConfiguration == null) return; - - this.addTextureDataIfSimpleModel(modelConfiguration, rootGroup, textureId, material); - - if (modelConfiguration instanceof ConditionModelConfiguration condition) { - String propertySuffix = "_" + condition.getProperty().replace(":", "_"); - this.collectTextureData(condition.getOnFalse(), rootGroup, textureId, material); - this.collectTextureData(condition.getOnTrue(), rootGroup, textureId + propertySuffix, material); - } else if (modelConfiguration instanceof SelectModelConfiguration select) { - for (SelectModelConfiguration.Case caseEntry : select.getCases()) { - String caseValue = this.caseValueToString(caseEntry.when()); - String caseTextureId = textureId + "_" + this.sanitizeTextureSuffix(caseValue); - this.collectTextureData(caseEntry.model(), rootGroup, caseTextureId, material); - } - if (select.getFallback() != null) { - this.collectTextureData(select.getFallback(), rootGroup, textureId, material); - } - } else if (modelConfiguration instanceof RangeDispatchModelConfiguration range) { - for (RangeDispatchModelConfiguration.Entry entry : range.getEntries()) { - String entryTextureId = textureId + "_" + (long) entry.threshold(); - this.collectTextureData(entry.model(), rootGroup, entryTextureId, material); - } - if (range.getFallback() != null) { - this.collectTextureData(range.getFallback(), rootGroup, textureId, material); - } - } else if (modelConfiguration instanceof CompositeModelConfiguration composite) { - int index = 0; - for (ModelConfiguration child : composite.getModels()) { - String childTextureId = textureId + "_" + index; - this.collectTextureData(child, rootGroup, childTextureId, material); - index++; - } - } + private String sanitizeTextureSuffix(String value) { + return value.replace(":", "_").replace("/", "_").replace(" ", "_"); } + private static final java.util.Set SUPPORTED_COMPONENTS = java.util.Set.of( "minecraft:max_damage", "max_damage", "minecraft:max_stack_size", "max_stack_size", @@ -384,10 +501,24 @@ private void convertItem(ItemMapping itemMapping) { options.setDisplayHandheld(true); } + this.applyCreativeCategory(options, material); + if (!options.serialize().isEmpty()) { itemMapping.setBedrockOptions(options); } + // Only "model" is inherited from a group, so options have to be set on the definitions themselves. + // The category goes on the predicate-less one alone: every definition is a separate Bedrock item, so + // categorising them all would list each predicate variant separately — eleven trim variants of one + // pair of boots — where the item should appear once. + if (this.baseDefinition != null && this.baseDefinition != itemMapping) { + BedrockOptions baseOptions = this.baseDefinition.getBedrockOptions(); + if (baseOptions == null) baseOptions = new BedrockOptions(); + this.applyCreativeCategory(baseOptions, material); + if (this.isToolMaterial(material)) baseOptions.setDisplayHandheld(true); + if (!baseOptions.serialize().isEmpty()) this.baseDefinition.setBedrockOptions(baseOptions); + } + this.convertDirectProperties(itemMapping, material); this.collectComponentData(itemMapping); this.detectBlockItem(itemMapping); @@ -421,8 +552,15 @@ private void detectBlockItem(ItemMapping mapping) { String type = behaviorSection.getString("type"); if ("block_item".equals(type)) { -// mapping.addBedrockComponent(new GenericBedrockComponent("minecraft:block_placer", -// java.util.Map.of("block", mapping.getBedrockIdentifier()))); + // This component is what makes Bedrock draw the item as its block, in hand and in an item frame: + // "The block placer component will also give the item the 3D appearance of the block by default" + // (bedrock-wiki/blocks/blocks-as-items.md). Without it the item fell back to an attachable, and an + // attachable geometry has one texture per render pass — so a six-textured block like the drawer showed + // the same texture on every face, and the held form never matched the placed block. Block geometry has + // per-face material instances and gets it right, which is why the fix is to defer to it rather than to + // reproduce it. See emitHeldModel in addTextureDataIfSimpleModel for the other half. + mapping.addBedrockComponent(new GenericBedrockComponent("minecraft:block_placer", + java.util.Map.of("block", mapping.getBedrockIdentifier()))); // Also register textures as terrain textures for block items this.registerExistingTexturesAsTerrain(mapping); } else if ("furniture_item".equals(type)) { @@ -453,25 +591,31 @@ private void detectArmorItem(ItemMapping mapping, Material material) { } mapping.addBedrockComponent(new GenericBedrockComponent("minecraft:wearable", wearable)); - String equipmentTexturePath = this.findEquipmentTexture(mapping); - if (equipmentTexturePath != null) { - String safeId = mapping.getBedrockIdentifier().replace(":", "."); - BedrockAttachableContext armorAttachable = BedrockAttachableContext.createArmor( - mapping.getBedrockIdentifier(), equipmentTexturePath); - this.context.registerAttachable(safeId, armorAttachable); + // The worn model needs the armour texture the equipment asset names, not the inventory icon — an + // icon stretched over a humanoid model is unrecognisable. + String assetId = this.itemSection.getString("settings.equipment.asset_id"); + if (assetId == null || assetId.isBlank()) { + // Distinguished from naming an asset that does not exist, because the fix is different: here the item + // declares no settings.equipment.asset_id at all. Reported as "asset 'null'", which read like a bug in + // the converter rather than a gap in the config. + Logger.debug("Armour item " + this.itemId + " declares no settings.equipment.asset_id," + + " so it renders with the vanilla armour texture for its material"); + return; } - } - @Nullable - private String findEquipmentTexture(ItemMapping mapping) { - for (TextureData td : mapping.getTexturesData()) { - for (String tex : td.getTextures()) { - if (tex.startsWith("textures/")) { - return tex; - } - } + var asset = this.context.equipmentAssets().get(assetId); + if (asset.isEmpty()) { + Logger.warn("Armour item " + this.itemId + " names equipment asset '" + assetId + + "', which no equipments: section defines - it will render with no armour texture"); + return; } - return null; + + String armorTexture = this.context.copyArmorTexture(asset.get(), slotName); + if (armorTexture == null) return; + + // Keyed exactly as the writer names the file, so two registrations can never quietly collide. + this.context.registerAttachable(mapping.getBedrockIdentifier(), + BedrockAttachableContext.createArmor(mapping.getBedrockIdentifier(), slotName, armorTexture)); } private void collectComponentData(ItemMapping itemMapping) { @@ -518,6 +662,52 @@ private String armorSlotForMaterial(Material material) { return null; } + /** + * Puts the item in the creative inventory. + *

+ * The option defaults to {@code none}, which means the item appears nowhere in the creative menu, and + * Bedrock's recipe book additionally hides any item a recipe outputs unless a category is set. So a + * converted item is invisible to players browsing creative until this is filled in. + *

+ * CraftEngine's own {@code category} is one of its custom GUI groups and has no Bedrock counterpart, so + * the category is derived from the base material instead. + */ + private void applyCreativeCategory(BedrockOptions options, Material material) { + // An author-declared rule matching the item id wins: it is the only source that can know a + // "*_ore" item belongs with the ores, since the material it happens to be built on cannot say so. + CreativeGroupRules.Rule rule = + CreativeGroupRules.from(Configuration.get(ConfigurationKey.CREATIVE_GROUPS)).match(this.itemId); + + BedrockOptions.CreativeCategory declaredCategory = rule == null ? null : rule.resolvedCategory(); + if (declaredCategory != null) { + options.setCreativeCategory(declaredCategory); + } else { + String category = this.determineCreativeCategory(material); + if (category == null) return; + try { + options.setCreativeCategory( + BedrockOptions.CreativeCategory.valueOf(category.toUpperCase(Locale.ROOT))); + } catch (IllegalArgumentException e) { + Logger.warn("Unknown creative category '" + category + "' for item " + this.itemId); + return; + } + } + + if (rule != null) { + options.setCreativeGroup(rule.group()); + return; + } + + // Otherwise the base item's own group is the best guess: a custom pair of boots built on + // chainmail_boots belongs in the boots stack, both in the creative menu and for the recipe book. + // Left unset when the base item belongs to no vanilla family — inventing a group name would just be + // ignored, because custom groups need a behavior pack and Geyser cannot send those. + if (material != null) { + String group = VanillaItemGroups.groupFor(material.name()); + if (group != null) options.setCreativeGroup(group); + } + } + @Nullable private String determineCreativeCategory(Material material) { if (material == null) return null; @@ -542,200 +732,293 @@ private String stripFormatting(String input) { return stripped.isEmpty() ? null : stripped; } - private void addTextureDataIfSimpleModel(ModelConfiguration modelConfiguration, GroupDefinitionMapping groupDefinitionMapping, String textureId) { - this.addTextureDataIfSimpleModel(modelConfiguration, groupDefinitionMapping, textureId, null); + private void addTextureDataIfSimpleModel(ModelConfiguration modelConfiguration, ItemMapping target, String textureId) { + this.addTextureDataIfSimpleModel(modelConfiguration, target, textureId, null); } - private void addTextureDataIfSimpleModel(ModelConfiguration modelConfiguration, GroupDefinitionMapping groupDefinitionMapping, String textureId, Material mat) { + private void addTextureDataIfSimpleModel(ModelConfiguration modelConfiguration, ItemMapping target, String textureId, Material mat) { if (modelConfiguration instanceof SimpleModelConfiguration simpleModelConfiguration) { GenerationConfiguration generation = simpleModelConfiguration.getGeneration(); boolean hasGenerationTexture = false; if (generation != null) { TextureData textureData = generation.toTextureData(textureId); if (textureData != null) { - groupDefinitionMapping.addTextureData(textureData); + target.addTextureData(textureData); hasGenerationTexture = !textureData.getTextures().isEmpty(); } - this.handleGenerationDisplayTransforms(textureId); } String modelPath = simpleModelConfiguration.getModel(); + // Before registerPipelineArtifacts below, which consumes the pose it registers. + this.registerPoseAnimations(modelPath, textureId); if (modelPath != null) { + // A Java item model definition names a MODEL, not a texture — "default:item/topaz_bow" + // resolves to models/item/topaz_bow.json, whose textures map holds the real reference + // ("item/custom/topaz_bow"). Treating the model path as a texture path drops the + // difference and yields files that do not exist, so resolve the indirection. + List textureRefs = this.context.javaModelResolver() + .texturesOf(modelPath, this.context.javaAssetsDir()); + if (textureRefs.isEmpty()) { + // No model file, or it declared no textures. CraftEngine often names a model after + // its texture, so the path itself is the best remaining guess. + textureRefs = List.of(modelPath); + } + + // Two kinds of item build no held 3D model of their own, for the same reason: something else + // already draws them better than an attachable can. + // + // Armour's worn appearance comes from the armour attachable (see detectArmorItem), and a held + // piece falls back to its icon exactly as in vanilla. Emitting both also collided — the two + // attachables differ only in key separator but sanitise to the same filename, so one silently + // overwrote the other. + // + // A block item is drawn by Bedrock as its own block, via the minecraft:block_placer component + // added in detectBlockItem. That matters because block geometry carries per-face material + // instances and attachable geometry cannot: a six-textured block converted as an attachable came + // out with one texture on every face, and never matched the block once placed. + // + // The texture work still runs in both cases, because the inventory icon and its flipbook come + // from it. + boolean emitHeldModel = !this.isArmorMaterial(mat) && !this.isBlockItem(); + + // Artifacts first: resolving a texture is what populates the animation cache that + // isAnimated / getFrameBaseTexturePath below depend on. + // The first reference is the item's icon (layer0 of a generated item model), so it + // drives the artifacts; the rest still need copying for multi-layer models. + this.registerPipelineArtifacts(textureRefs.getFirst(), modelPath, textureId, + this.isToolMaterial(mat), emitHeldModel); + + this.renderIconFromModel(modelPath, textureId, simpleModelConfiguration); + for (int layer = 1; layer < textureRefs.size(); layer++) { + // Only layer0 becomes an item. Bedrock renders a custom item's icon from a single + // flat texture and cannot composite layers the way Java does for armour trims, so + // the remaining layers get copied but generate no attachable, geometry, animation or + // render-controller artifacts — those would be unreferenced files, and their long + // generated names push paths past the Windows limit. + this.context.copyTexture(textureRefs.get(layer), textureId + "_layer" + layer); + } + if (!hasGenerationTexture) { - String texturePath = this.modelPathToTexturePath(modelPath); - if (texturePath != null) { - TextureData textureData = new TextureData(textureId); - textureData.addTexture(texturePath); - groupDefinitionMapping.addTextureData(textureData); + TextureData textureData = new TextureData(textureId); + for (String ref : textureRefs) { + // An animated texture is split into per-frame files, so the un-framed path + // names nothing on disk; point at frame 0 as the still icon. + if (this.context.texturePipeline().isAnimated(ref)) { + textureData.addTexture( + this.context.texturePipeline().getFrameBaseTexturePath(ref) + "_0"); + continue; + } + String resolved = this.resolveTexturePath(ref); + if (resolved != null) textureData.addTexture(resolved); + } + if (!textureData.getTextures().isEmpty()) { + target.addTextureData(textureData); } } - this.registerPipelineArtifacts(modelPath, textureId, this.isToolMaterial(mat)); } } } - private void handleGenerationDisplayTransforms(String textureId) { - this.extractDisplayTransformsFromSection(this.itemSection, textureId); - } - - private void extractDisplayTransformsFromSection(ConfigurationSection section, String textureId) { - ConfigurationSection modelSection = section.getConfigurationSection("model"); - if (modelSection == null) return; - ConfigurationSection generationSection = modelSection.getConfigurationSection("generation"); - if (generationSection == null) return; - ConfigurationSection displaySection = generationSection.getConfigurationSection("display"); - if (displaySection == null) return; - - float[] fpRot = {0, 0, 0}, fpPos = {0, 0, 0}, fpScale = {1, 1, 1}; - float[] tpRot = {0, 0, 0}, tpPos = {0, 0, 0}, tpScale = {1, 1, 1}; - float[] headRot = {0, 0, 0}, headPos = {0, 0, 0}, headScale = {1, 1, 1}; - boolean hasAnyTransform = false; - - for (String viewKey : displaySection.getKeys(false)) { - ConfigurationSection view = displaySection.getConfigurationSection(viewKey); - if (view == null) continue; - - float[] rot = this.extractFloatArray(view, "rotation", 3); - float[] pos = this.extractFloatArray(view, "translation", 3); - float[] scale = this.extractFloatArray(view, "scale", 3, 1.0f); - - switch (viewKey) { - case "firstperson_righthand": - case "firstperson_lefthand": - fpRot = rot; fpPos = pos; fpScale = scale; - hasAnyTransform = true; - break; - case "thirdperson_righthand": - case "thirdperson_lefthand": - tpRot = rot; tpPos = pos; tpScale = scale; - hasAnyTransform = true; - break; - case "head": - case "fixed": - headRot = rot; headPos = pos; headScale = scale; - hasAnyTransform = true; - break; - } - } + /** + * Draws the inventory icon from the item's model, when that model is three-dimensional. + *

+ * Java ships no icon for such an item — the client renders one from the cubes — while Bedrock can only show + * a flat sprite and has no way to render geometry into a slot. The fallback of using the model's texture as + * the sprite shows a UV atlas of unwrapped faces, so the sprite has to be drawn here instead. A model with + * no {@code elements} already is a sprite and is left alone. + */ + private void renderIconFromModel(String modelPath, String textureId, SimpleModelConfiguration model) { + if (!(boolean) Configuration.get(ConfigurationKey.RENDER_ITEM_ICONS)) return; + if (this.context.javaAssetsDir() == null) return; - if (!hasAnyTransform) return; + JavaBlockModel resolved = this.context.javaModelResolver().load(modelPath, this.context.javaAssetsDir()); + if (resolved == null || resolved.elements().isEmpty()) return; - BedrockAnimationContext animCtx = AnimationMapper.mapDisplayTransforms( - textureId, "bone", - fpRot, fpPos, fpScale, - tpRot, tpPos, tpScale, - headRot, headPos, headScale - ); + int size = Configuration.get(ConfigurationKey.ITEM_ICON_SIZE); + if (size <= 0) return; - animCtx.animation().ifPresent(anim -> { - this.context.registerAnimation(textureId.replace(":", "."), anim); - }); + java.util.Map tints = this.resolveTints(model); + this.bakeTintsIntoTextures(resolved, tints); - if (!animCtx.isEmpty()) { - this.animationContexts.put(textureId, animCtx); + BufferedImage icon = new ItemIconRenderer(this::loadModelTexture).render(resolved, tints, size); + if (icon == null) { + Logger.warn("Could not render an icon for " + this.itemId + " from " + modelPath + + " - it will fall back to the model's texture, which is a UV atlas rather than a sprite"); + return; } + this.context.registerRenderedIcon(textureId, icon); } - private void extractMaterialDisplayTransforms(Material material, String textureId) { - if (this.context.javaAssetsDir() == null) return; - - String materialName = material.name().toLowerCase(Locale.ROOT); - Path modelFile = this.context.javaAssetsDir().resolve("minecraft/models/item/" + materialName + ".json"); - if (!Files.exists(modelFile)) { - // Try alternate non-vanilla namespace - modelFile = this.context.javaAssetsDir().resolve(materialName.contains(":") ? materialName.replace(":", "/models/item/") : "minecraft/models/item/" + materialName + ".json"); - if (!Files.exists(modelFile)) return; + /** + * Paints the model's dye tints into copies of its textures, so the held and worn model carries the colour + * the icon does. + *

+ * Bedrock cannot tint at runtime — Geyser cannot send a {@code dyed_color} component and an attachable + * samples its texture as-is — so without this the same item is olive in the inventory and bare wood in hand. + * Baking the item's default tint makes both match an undyed Java item, which is as close as a client + * that cannot dye anything gets. + */ + private void bakeTintsIntoTextures(JavaBlockModel model, java.util.Map tints) { + if (tints.isEmpty()) return; + + for (java.util.Map.Entry> entry : + ModelTextureTinter.regions(model, this::loadModelTexture, tints).entrySet()) { + Optional resolved = this.context.texturePipeline() + .resolveTexture(entry.getKey(), this.itemId, this.context.javaAssetsDir()); + resolved.ifPresent(info -> + this.context.registerTintRegions(info.bedrockTextureDir(), entry.getValue(), this.itemId)); } + } + + /** + * Loads a Java texture reference from the source assets. + *

+ * Reads the original rather than the copied pack file, because the copy may already have been split into + * animation frames. An animated source contributes only its first frame: a sprite is one still image, + * so the top {@code width}-tall square of the sheet is the representative frame, exactly as the icon + * naming already assumes. + */ + private BufferedImage loadModelTexture(String reference) { + Optional resolved = this.context.texturePipeline() + .resolveTexture(reference, this.itemId, this.context.javaAssetsDir()); + if (resolved.isEmpty()) return null; try { - Gson gson = new Gson(); - JsonObject model = gson.fromJson(Files.newBufferedReader(modelFile), JsonObject.class); - if (model == null) return; - - // Resolve parent model (one level deep) - if (model.has("parent") && !model.has("display")) { - String parent = model.get("parent").getAsString(); - String parentPath = parent.replace(":", "/models/") + ".json"; - Path parentFile = this.context.javaAssetsDir().resolve(parentPath); - if (Files.exists(parentFile)) { - JsonObject parentModel = gson.fromJson(Files.newBufferedReader(parentFile), JsonObject.class); - if (parentModel != null && parentModel.has("display")) { - model = parentModel; - } + BufferedImage image = javax.imageio.ImageIO.read(resolved.get().sourcePath().toFile()); + if (image == null) return null; + + CachedTextureInfo info = resolved.get(); + if (info.animation().isPresent()) { + int frameHeight = info.animation().get().frameHeight(); + if (frameHeight > 0 && frameHeight < image.getHeight()) { + return image.getSubimage(0, 0, info.animation().get().frameWidth(), frameHeight); } } + return image; + } catch (Exception e) { + return null; + } + } + + /** + * The model's tints, by index, keeping only those that resolve to one fixed colour. + *

+ * A sprite is a single image, so a tint that depends on runtime state — grass colour, team colour, a potion + * — has no answer that could be baked in. Those faces stay untinted rather than being given an invented + * colour. + */ + private java.util.Map resolveTints(SimpleModelConfiguration model) { + java.util.Map tints = new java.util.HashMap<>(); + List configured = model.getTints(); + for (int index = 0; index < configured.size(); index++) { + java.util.OptionalInt color = configured.get(index).constantColor(); + if (color.isPresent()) { + tints.put(index, color.getAsInt()); + } else { + Logger.debug("Tint " + index + " of " + this.itemId + " depends on runtime state" + + " - the rendered icon leaves that face untinted"); + } + } + return tints; + } - JsonObject display = model.getAsJsonObject("display"); - if (display == null) return; - - float[] fpRot = {0, 0, 0}, fpPos = {0, 0, 0}, fpScale = {1, 1, 1}; - float[] tpRot = {0, 0, 0}, tpPos = {0, 0, 0}, tpScale = {1, 1, 1}; - float[] headRot = {0, 0, 0}, headPos = {0, 0, 0}, headScale = {1, 1, 1}; - boolean hasAnyTransform = false; - - for (String viewKey : display.keySet()) { - JsonObject view = display.getAsJsonObject(viewKey); - if (view == null) continue; - - float[] rot = this.readJsonFloatArray(view, "rotation", 3); - float[] pos = this.readJsonFloatArray(view, "translation", 3); - float[] scale = this.readJsonFloatArray(view, "scale", 3, 1.0f); - - switch (viewKey) { - case "firstperson_righthand": - case "firstperson_lefthand": - fpRot = rot; fpPos = pos; fpScale = scale; - hasAnyTransform = true; - break; - case "thirdperson_righthand": - case "thirdperson_lefthand": - tpRot = rot; tpPos = pos; tpScale = scale; - hasAnyTransform = true; - break; - case "head": - case "fixed": - headRot = rot; headPos = pos; headScale = scale; - hasAnyTransform = true; - break; - } + /** + * Builds and registers the animations that pose this item when it is held or worn on the head. + *

+ * Two sources, layered. The model's own {@code display} block comes first, read through + * {@link fr.robie.craftengineconverter.converter.bedrock.geometry.JavaModelResolver} so its {@code parent} + * chain is already merged in — a model saying no more than {@code {"parent": "item/handheld"}} still arrives + * with the handheld pose, from the cached vanilla asset or from {@code DisplayPresets} when it is missing. + * This source was previously ignored entirely: the pose came only from CraftEngine's YAML or from the + * vanilla model of the underlying material, so a custom model's own pose never reached Bedrock. + *

+ * CraftEngine's {@code model.generation.display} is overlaid on top, because a generated model may have no + * file on disk at all and because an author writing it there is being explicit. + */ + private void registerPoseAnimations(String modelPath, String textureId) { + Map display = new HashMap<>(); + String parent = null; + + if (modelPath != null && this.context.javaAssetsDir() != null) { + JavaBlockModel resolved = this.context.javaModelResolver() + .load(modelPath, this.context.javaAssetsDir()); + if (resolved != null) { + display.putAll(resolved.display()); + // Carried so a context the model declares nothing for falls back through the same preset the + // icon uses, rather than to item/generated's flat-sprite pose. + parent = resolved.parent().orElse(null); } + } + display.putAll(this.readGenerationDisplay(this.itemSection)); - if (!hasAnyTransform) return; + if (display.isEmpty()) return; + this.registerPose(textureId, display, parent); + } - BedrockAnimationContext animCtx = AnimationMapper.mapDisplayTransforms( - textureId, "bone", - fpRot, fpPos, fpScale, - tpRot, tpPos, tpScale, - headRot, headPos, headScale - ); + /** + * Poses an item that names no model of its own, from the vanilla model of the material it is built on — a + * custom item on {@code paper} is held the way paper is held. + */ + private void registerMaterialPoseAnimations(Material material, String textureId) { + if (this.context.javaAssetsDir() == null) return; - animCtx.animation().ifPresent(anim -> { - this.context.registerAnimation(textureId.replace(":", "."), anim); - }); + String materialName = material.name().toLowerCase(Locale.ROOT); + JavaBlockModel resolved = this.context.javaModelResolver() + .load("minecraft:item/" + materialName, this.context.javaAssetsDir()); + if (resolved == null || resolved.display().isEmpty()) return; - if (!animCtx.isEmpty()) { - this.animationContexts.put(textureId, animCtx); - } - } catch (Exception e) { - Logger.warn("Could not read display transforms from material model " + materialName); - } + this.registerPose(textureId, resolved.display()); } - private float[] readJsonFloatArray(JsonObject obj, String key, int size) { - return this.readJsonFloatArray(obj, key, size, 0.0f); + private void registerPose(String textureId, Map display) { + this.registerPose(textureId, display, null); } - private float[] readJsonFloatArray(JsonObject obj, String key, int size, float defaultValue) { - JsonArray arr = obj.getAsJsonArray(key); - if (arr == null || arr.size() < size) { - float[] result = new float[size]; - java.util.Arrays.fill(result, defaultValue); - return result; - } - float[] result = new float[size]; - for (int i = 0; i < size && i < arr.size(); i++) { - result[i] = arr.get(i).getAsFloat(); + private void registerPose(String textureId, Map display, + String parent) { + BedrockAnimationContext animCtx = AnimationMapper.fromDisplay(textureId, display, parent); + if (animCtx.isEmpty()) return; + + animCtx.animation().ifPresent(anim -> this.context.registerAnimation(textureId.replace(":", "."), anim)); + this.animationContexts.put(textureId, animCtx); + } + + /** + * The pose a model with no {@code display} of its own falls back to. + *

+ * Tools take {@code item/handheld}'s poses and everything else {@code item/generated}'s, which is the same + * distinction the hand-tuned tool constants drew — except that it is now the vanilla preset rather than a + * guess, and it applies to all five slots rather than three. + */ + private BedrockAnimationContext defaultPose(String textureId, boolean isTool) { + BedrockAnimationContext animCtx = AnimationMapper.fromDisplay(textureId, + DisplayPresets.forParent(isTool ? "item/handheld" : "item/generated")); + animCtx.animation().ifPresent(anim -> this.context.registerAnimation(textureId.replace(":", "."), anim)); + return animCtx; + } + + /** CraftEngine's {@code model.generation.display}, in the same shape a Java model's {@code display} parses to. */ + private Map readGenerationDisplay(ConfigurationSection section) { + ConfigurationSection modelSection = section == null ? null : section.getConfigurationSection("model"); + ConfigurationSection generation = modelSection == null + ? null : modelSection.getConfigurationSection("generation"); + ConfigurationSection displaySection = generation == null + ? null : generation.getConfigurationSection("display"); + if (displaySection == null) return Map.of(); + + Map display = new HashMap<>(); + for (String written : displaySection.getKeys(false)) { + ConfigurationSection view = displaySection.getConfigurationSection(written); + String context = DisplayContext.canonical(written); + if (view == null || context == null) continue; + + display.put(context, new JavaBlockModel.DisplayTransform( + this.extractFloatArray(view, "rotation", 3), + this.extractFloatArray(view, "translation", 3), + this.extractFloatArray(view, "scale", 3, 1.0f), + this.extractFloatArray(view, "rotation_pivot", 3), + this.extractFloatArray(view, "scale_pivot", 3))); } - return result; + return display; } private float[] extractFloatArray(ConfigurationSection section, String key, int size) { @@ -756,27 +1039,55 @@ private float[] extractFloatArray(ConfigurationSection section, String key, int return result; } - private void registerPipelineArtifacts(String modelPath, String textureId) { - this.registerPipelineArtifacts(modelPath, textureId, false); + private void registerPipelineArtifacts(String textureRef, String modelPath, String textureId) { + this.registerPipelineArtifacts(textureRef, modelPath, textureId, false); } - private void registerPipelineArtifacts(String modelPath, String textureId, boolean isTool) { + private void registerPipelineArtifacts(String textureRef, String modelPath, String textureId, boolean isTool) { + this.registerPipelineArtifacts(textureRef, modelPath, textureId, isTool, true); + } + + /** + * Builds everything the held form of an item needs: its texture, its geometry, its pose animations, a render + * controller and an attachable. + *

+ * {@code textureRef} and {@code modelPath} are different things and must stay apart. They were one + * parameter, and since the caller had already resolved the model into its textures, what arrived was a texture + * reference — which {@code registerGeometry} then looked for under {@code models/}. That silently worked only + * for packs naming a model and its texture alike; otherwise the geometry either fell through to a flat + * extruded sprite (the anvil, whose first texture is {@code netherite_anvil_top}) or loaded a completely + * different model that happened to share the texture's name ({@code palm_button} rendering as + * {@code palm_planks}). The icon was unaffected because it is rendered from the real model, which is exactly + * why an item could look right in the inventory and wrong in the hand. + * + * @param textureRef the Java texture reference, e.g. {@code item/custom/topaz_bow} + * @param modelPath the Java model reference, e.g. {@code default:item/topaz_bow}; {@code null} for a + * texture-only item, which has no shape to convert + * @param emitHeldModel whether to build the 3D held-item model — geometry, animations, render controller + * and attachable. False for armour, which is drawn by its own armour attachable; + * the texture work still has to happen either way, since the inventory icon and its + * flipbook come from it. + */ + private void registerPipelineArtifacts(String textureRef, String modelPath, String textureId, + boolean isTool, boolean emitHeldModel) { if (!this.processedModels.add(textureId)) return; if (this.context.javaAssetsDir() == null) return; - this.processedModelPaths.add(modelPath); + this.processedModelPaths.add(textureRef); // Resolve texture first to populate the animation cache - Optional resolved = this.context.texturePipeline().resolveTexture(modelPath, textureId, this.context.javaAssetsDir()); + Optional resolved = this.context.texturePipeline().resolveTexture(textureRef, textureId, this.context.javaAssetsDir()); if (resolved.isPresent() && resolved.get().animation().isPresent()) { - this.registerAnimatedItemArtifacts(modelPath, textureId, resolved.get(), isTool); + this.registerAnimatedItemArtifacts(textureRef, modelPath, textureId, resolved.get(), isTool, emitHeldModel); } else { - this.registerStaticItemArtifacts(modelPath, textureId, isTool); + this.registerStaticItemArtifacts(textureRef, modelPath, textureId, isTool, emitHeldModel); } } - private void registerAnimatedItemArtifacts(String modelPath, String textureId, CachedTextureInfo info, boolean isTool) { + private void registerAnimatedItemArtifacts(String textureRef, String modelPath, String textureId, + CachedTextureInfo info, + boolean isTool, boolean emitHeldModel) { CachedTextureInfo.AnimationInfo anim = info.animation().get(); int frameCount = anim.totalFrameCount(); int frameW = anim.frameWidth(); @@ -785,60 +1096,99 @@ private void registerAnimatedItemArtifacts(String modelPath, String textureId, C // Extract frame PNGs from spritesheet this.context.texturePipeline().extractAnimationFrames(info, this.context.texturesDir()); - String frameBasePath = this.context.texturePipeline().getFrameBaseTexturePath(modelPath); + String frameBasePath = this.context.texturePipeline().getFrameBaseTexturePath(textureRef); + + // Everything below builds the held 3D model, which armour does not use. + if (!emitHeldModel) return; // Create geometry for the item (use safeKey so geometry identifier matches attachable). - // Use frame 0's actual pixels so the extrusion follows that frame's silhouette. + // + // One geometry serves every frame, so it can only be extruded when the frames agree on their + // silhouette. When they do not, extruding any single frame's shape leaves the others wrong — pixels + // with no face to draw on, or walls standing where that frame is empty — so use a pixel lattice + // instead, which owns no silhouette at all and lets each frame's alpha shape itself in 3D. String safeKey = textureId.replace(":", ".").replace("/", "_"); - BedrockGeometry geo = this.loadFirstFrame(info) - .map(image -> GeometryMapper.createFlatItemGeometry(safeKey, image)) - .orElseGet(() -> GeometryMapper.createFlatItemGeometry(safeKey, frameW, frameH)); - this.context.collectedGeometry().put(textureId, geo); - - // Create single render controller with all frame textures in an array - // The first texture (frame_0) is shown by default. - BedrockRenderControllers rc = BedrockRenderControllers.animated(textureId, frameCount); + String latticeId = null; + + // The model's own shape first. The silhouette and lattice geometries below exist for texture-only items, + // which have no shape to convert — but this branch used to reach them unconditionally, so a genuine 3D + // model whose texture happened to animate was thrown away and replaced by an extruded sprite. The UV space + // is one frame, because that is what the model's faces are written against. + this.context.registerGeometry(modelPath, textureId, frameW, frameH); + boolean hasModelGeometry = this.context.collectedGeometry().containsKey(textureId); + + if (hasModelGeometry) { + // Nothing to generate: the frames drive the texture through the render controller below, and the + // geometry stays the author's. + latticeId = null; + } else if (this.framesShareSilhouette(info)) { + BedrockGeometry geo = this.loadFirstFrame(info) + .map(image -> GeometryMapper.createFlatItemGeometry(safeKey, image)) + .orElseGet(() -> GeometryMapper.createFlatItemPlane(safeKey, frameW, frameH)); + this.context.collectedGeometry().put(textureId, geo); + } else if (frameW * frameH > MAX_LATTICE_PIXELS) { + Logger.warn("Item " + this.itemId + " animates through frames with different shapes, but its " + + frameW + "x" + frameH + " frames are too large for a pixel lattice" + + " - using a flat model, so it will not look three-dimensional"); + this.context.collectedGeometry().put(textureId, GeometryMapper.createFlatItemPlane(safeKey, frameW, frameH)); + } else { + // Shared across every animated item of this frame size: the lattice describes the pixel grid, + // not this item, so registering it under a size-derived key writes exactly one model file. + latticeId = "craftengine_pixel_lattice_" + frameW + "x" + frameH; + this.context.collectedGeometry().computeIfAbsent(latticeId, + key -> GeometryMapper.createPixelLatticeGeometry(key, frameW, frameH)); + } + + // Create single render controller with all frame textures in an array, one entry per tick so the + // .mcmeta frame times are honoured rather than every frame getting the same dwell. + int[] frameIndices = anim.frames().stream().mapToInt(CachedTextureInfo.FrameInfo::index).toArray(); + int[] frameTicks = anim.frames().stream().mapToInt(CachedTextureInfo.FrameInfo::time).toArray(); + BedrockRenderControllers rc = BedrockRenderControllers.animated(textureId, frameIndices, frameTicks); this.context.registerRenderController("controller.render." + safeKey, rc); // Create animated attachable referencing the single render controller BedrockAttachableContext attachCtx = BedrockAttachableContext.createAnimated( textureId, frameCount, frameBasePath); + // A lattice is shared, so the attachable has to be pointed away from the per-item geometry id + // createAnimated assumes. Its cubes are closed boxes, so back faces are never visible and the + // cheaper one-sided material applies — unlike the flat plane, which needs both sides. + if (latticeId != null) { + final String sharedGeometry = "geometry." + latticeId; + attachCtx.attachable().ifPresent(att -> { + att.withGeometry("default", sharedGeometry); + att.withMaterial("default", "entity_alphatest_one_sided"); + }); + } + // Add positioning animations to ensure the item is visible BedrockAnimationContext animCtx = this.animationContexts.get(textureId); if (animCtx == null || animCtx.isEmpty()) { - animCtx = isTool - ? AnimationMapper.createToolAnimations(textureId, "bone") - : AnimationMapper.createDefaultAnimations(textureId, "bone"); - animCtx.animation().ifPresent(a -> - this.context.registerAnimation(textureId.replace(":", "."), a) - ); + animCtx = this.defaultPose(textureId, isTool); } final BedrockAnimationContext finalCtx = animCtx; - attachCtx.attachable().ifPresent(att -> { - att.withAnimation("third_person", finalCtx.thirdPersonAnimation()); - att.withAnimation("first_person", finalCtx.firstPersonAnimation()); - att.withAnimation("head", finalCtx.headAnimation()); - att.withScript("animate", java.util.List.of( - java.util.Map.of("first_person", "context.is_first_person == 1.0 && (context.item_slot == 'main_hand' || context.item_slot == 'off_hand')"), - java.util.Map.of("third_person", "context.is_first_person == 0.0 && (context.item_slot == 'main_hand' || context.item_slot == 'off_hand')"), - java.util.Map.of("head", "context.is_first_person == 0.0 && context.item_slot == 'head'") - )); - }); + attachCtx.attachable().ifPresent(att -> + BedrockAttachableContext.applyPoseAnimations(att, finalCtx)); this.context.registerAttachable(textureId, attachCtx); } - private void registerStaticItemArtifacts(String modelPath, String textureId, boolean isTool) { - this.context.copyTexture(modelPath, textureId); + private void registerStaticItemArtifacts(String textureRef, String modelPath, String textureId, + boolean isTool, boolean emitHeldModel) { + this.context.copyTexture(textureRef, textureId); + + // Everything below builds the held 3D model, which armour does not use. + if (!emitHeldModel) return; + this.context.registerGeometry(modelPath, textureId, 16, 16); boolean hasGeometry = this.context.collectedGeometry().containsKey(textureId); - // Create default flat geometry when no Java model file exists (texture-only items) + // Create default flat geometry when the model has no shape of its own — a sprite item, whose model is + // nothing but a textures block. Extruding its silhouette is the best available stand-in. if (!hasGeometry) { String safeKey = textureId.replace(":", ".").replace("/", "_"); - BedrockGeometry fallbackGeo = this.loadStaticTexture(modelPath, textureId) + BedrockGeometry fallbackGeo = this.loadStaticTexture(textureRef, textureId) .map(image -> GeometryMapper.createFlatItemGeometry(safeKey, image)) .orElseGet(() -> GeometryMapper.createFlatItemGeometry(safeKey, 16, 16)); this.context.collectedGeometry().put(textureId, fallbackGeo); @@ -847,22 +1197,15 @@ private void registerStaticItemArtifacts(String modelPath, String textureId, boo BedrockAnimationContext animCtx = this.animationContexts.get(textureId); - String defaultTexture = this.resolveTexturePath(modelPath); + String defaultTexture = this.resolveTexturePath(textureRef); BedrockAttachableContext attachable; - if (animCtx != null && !animCtx.isEmpty()) { - attachable = BedrockAttachableContext.createWithAnimations(textureId, hasGeometry, false, animCtx, defaultTexture); - } else { - // Create default positioning animations so the item renders at a visible position - BedrockAnimationContext defaultCtx = isTool - ? AnimationMapper.createToolAnimations(textureId, "bone") - : AnimationMapper.createDefaultAnimations(textureId, "bone"); - defaultCtx.animation().ifPresent(anim -> - this.context.registerAnimation(textureId.replace(":", "."), anim) - ); - attachable = BedrockAttachableContext.createWithAnimations(textureId, hasGeometry, false, defaultCtx, defaultTexture); + if (animCtx == null || animCtx.isEmpty()) { + // So the item renders posed rather than sitting unrotated at the bone's origin. + animCtx = this.defaultPose(textureId, isTool); } + attachable = BedrockAttachableContext.createWithAnimations(textureId, hasGeometry, false, animCtx, defaultTexture); // Register per-item render controller for this static item String safeKey = textureId.replace(":", ".").replace("/", "_"); @@ -883,6 +1226,50 @@ private void registerStaticItemArtifacts(String modelPath, String textureId, boo * on output-directory naming. */ @NotNull + /** + * Whether every animation frame has the same alpha silhouette. + *

+ * Decides how the held model is built. Extrusion bakes one silhouette into slabs and boundary walls, + * and a single geometry serves all frames, so it is only correct when the frames agree on their shape — + * a rotating or flickering sprite whose outline changes cannot be extruded without artefacts on some + * frame. Compares alpha only; colour differences between frames are irrelevant to the shape. + * + * @return {@code true} when extrusion is safe, {@code false} when a flat plane is required + */ + private boolean framesShareSilhouette(@NotNull CachedTextureInfo info) { + if (info.animation().isEmpty()) return true; + try { + BufferedImage sheet = javax.imageio.ImageIO.read(info.sourcePath().toFile()); + if (sheet == null) return true; + + CachedTextureInfo.AnimationInfo anim = info.animation().get(); + int frameW = anim.frameWidth(); + int frameH = anim.frameHeight(); + int cols = Math.max(1, sheet.getWidth() / frameW); + int rows = Math.max(1, sheet.getHeight() / frameH); + if (cols * rows < 2) return true; + + for (int index = 1; index < cols * rows; index++) { + int sx = (index % cols) * frameW; + int sy = (index / cols) * frameH; + if (sx + frameW > sheet.getWidth() || sy + frameH > sheet.getHeight()) continue; + + for (int y = 0; y < frameH; y++) { + for (int x = 0; x < frameW; x++) { + boolean first = (sheet.getRGB(x, y) >>> 24) != 0; + boolean other = (sheet.getRGB(sx + x, sy + y) >>> 24) != 0; + if (first != other) return false; + } + } + } + return true; + } catch (java.io.IOException e) { + Logger.warn("Failed to read texture " + info.sourcePath() + + " while checking animation silhouettes: " + e.getMessage()); + return true; + } + } + private Optional loadFirstFrame(@NotNull CachedTextureInfo info) { try { BufferedImage sheet = javax.imageio.ImageIO.read(info.sourcePath().toFile()); @@ -959,6 +1346,8 @@ private Material getMaterial() { } catch (IllegalArgumentException ignored) { } } - return Configuration.get(ConfigurationKey.DEFAULT_MATERIAL); + // Resolved from CraftEngine's own config where possible — a wrong guess here silently files the + // item under the wrong Java item. + return this.context.defaultMaterial(); } } \ No newline at end of file diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/ConversionContext.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/ConversionContext.java index 363f43f4..402dff1b 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/ConversionContext.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/ConversionContext.java @@ -11,22 +11,32 @@ import fr.robie.craftengineconverter.api.configuration.bedrock.texture.FlipbookTextureConfiguration; import fr.robie.craftengineconverter.api.configuration.bedrock.texture.FlipbookTextureData; import fr.robie.craftengineconverter.api.configuration.bedrock.texture.TextureData; +import fr.robie.craftengineconverter.api.configuration.loader.ConfigurationTrees; +import fr.robie.craftengineconverter.api.configuration.template.TemplateEngine; +import fr.robie.craftengineconverter.api.configuration.template.TemplateException; import fr.robie.craftengineconverter.api.manager.FileCacheManager; import fr.robie.craftengineconverter.converter.bedrock.animation.BedrockAnimation; import fr.robie.craftengineconverter.converter.bedrock.animation.BedrockAnimationController; import fr.robie.craftengineconverter.converter.bedrock.animation.BedrockRenderControllers; +import fr.robie.craftengineconverter.converter.bedrock.asset.VanillaAssetStore; +import fr.robie.craftengineconverter.converter.bedrock.asset.VanillaAssets; import fr.robie.craftengineconverter.converter.bedrock.attachable.BedrockAttachableContext; import fr.robie.craftengineconverter.converter.bedrock.block.BlockStateMapper; import fr.robie.craftengineconverter.converter.bedrock.font.FontMapper; import fr.robie.craftengineconverter.converter.bedrock.geometry.BedrockGeometry; import fr.robie.craftengineconverter.converter.bedrock.geometry.GeometryMapper; import fr.robie.craftengineconverter.converter.bedrock.geometry.JavaBlockModel; +import fr.robie.craftengineconverter.converter.bedrock.icon.ModelTextureTinter; +import fr.robie.craftengineconverter.converter.bedrock.item.EquipmentAssetRegistry; +import fr.robie.craftengineconverter.converter.bedrock.item.ItemModelDefinitionMapper; import fr.robie.craftengineconverter.converter.bedrock.lang.LanguageMapper; import fr.robie.craftengineconverter.converter.bedrock.sound.SoundMapper; import fr.robie.craftengineconverter.converter.bedrock.texture.CachedTextureInfo; import fr.robie.craftengineconverter.converter.bedrock.texture.TexturePipeline; import fr.robie.craftengineconverter.converter.bedrock.waypoint.WaypointStyleMapper; +import fr.robie.yamllibrary.ConfigurationSection; import org.bukkit.Material; +import org.jetbrains.annotations.Nullable; import java.io.File; import java.nio.file.Path; @@ -51,18 +61,39 @@ public class ConversionContext { private final LanguageMapper languageMapper = new LanguageMapper(); private final FontMapper fontMapper = new FontMapper(); private final WaypointStyleMapper waypointStyleMapper = new WaypointStyleMapper(); + private final ItemModelDefinitionMapper itemModelDefinitions = new ItemModelDefinitionMapper(); + private final TemplateEngine templates = new TemplateEngine(); + private final EquipmentAssetRegistry equipmentAssets = new EquipmentAssetRegistry(); + // Geyser forbids two custom item definitions sharing a bedrock_identifier anywhere in the pack, so + // uniqueness has to be tracked across every item rather than per BedrockItemLoader. + private final java.util.Set usedBedrockIdentifiers = new java.util.HashSet<>(); + // Shared so the parent chain of a model referenced by many items is only read from disk once. + private final fr.robie.craftengineconverter.converter.bedrock.geometry.JavaModelResolver javaModelResolver = + new fr.robie.craftengineconverter.converter.bedrock.geometry.JavaModelResolver(); + // Icons drawn from a 3D model, by texture id. See registerRenderedIcon. + private final Map renderedIcons = new HashMap<>(); + // Areas to tint, by pack-relative texture path. See registerTintRegions. + private final Map> tintRegions = + new java.util.LinkedHashMap<>(); + private final Map tintedTextureOwners = new HashMap<>(); private ManifestConfiguration manifest; private final Path customMappingsDir; private final Path texturesDir; private final Path packDir; private Path javaAssetsDir; + // Needed to find CraftEngine's own config.yml, which sits in a sibling plugin folder. + private File pluginFolder; + private Material defaultMaterial; + private VanillaAssets vanillaAssets; public ConversionContext(Path customMappingsDir, Path texturesDir, Path packDir) { this.customMappingsDir = customMappingsDir; this.texturesDir = texturesDir; this.packDir = packDir; + // Blocks read models through the same resolver as items, so they inherit the vanilla-asset fallback and + // there is only one copy of the parent-chain logic to keep correct. + this.blockStateMapper.withModelResolver(this.javaModelResolver).withTexturePipeline(this.texturePipeline); this.manifest = ManifestConfiguration.resourcePack("CraftEngineConverter Pack").build(); - this.texturesConfig.setResourcePackName("CraftEngineConverter") .setTextureName("atlas.items"); this.terrainTexturesConfig.setResourcePackName("CraftEngineConverter") @@ -75,6 +106,40 @@ public ConversionContext withJavaAssetsDir(Path javaAssetsDir) { return this; } + public ConversionContext withPluginFolder(File pluginFolder) { + this.pluginFolder = pluginFolder; + this.attachVanillaAssets(); + return this; + } + + /** + * Points the model and texture resolvers at the vanilla assets, so a parent or texture the pack inherits but + * does not ship — {@code block/cactus}, {@code block/anvil}, {@code item/light} — resolves for real instead of + * dead-ending. + *

+ * Never downloads: doing so here would put network I/O on whatever thread started the conversion, which for a + * command is the server thread. {@link VanillaAssetStore#cacheDir} is where a prior download or the + * {@code vanilla-assets} command left the jar. + */ + private void attachVanillaAssets() { + if (this.pluginFolder == null) return; + + VanillaAssets assets = VanillaAssetStore.existing(this.pluginFolder); + this.vanillaAssets = assets; + this.javaModelResolver.withVanillaAssets(assets); + this.texturePipeline.withVanillaAssets(assets); + + if (!assets.isAvailable()) { + fr.robie.messageflow.logger.Logger.info("No vanilla assets cached, so a block whose shape comes from a" + + " vanilla parent falls back to a built-in cube." + + " Run \"/cec bedrock vanilla-assets\" for the real shapes."); + } + } + + public VanillaAssets vanillaAssets() { + return this.vanillaAssets; + } + public ConversionContext withManifest(ManifestConfiguration manifest) { if (manifest != null) this.manifest = manifest; return this; @@ -116,12 +181,16 @@ public Path javaAssetsDir() { return this.javaAssetsDir; } + public File pluginFolder() { + return this.pluginFolder; + } + public Map collectedGeometry() { return this.collectedGeometry; } - public Map collectedAttachables() { - return this.collectedAttachables; + public BlockStateMapper blockStateMapper() { + return this.blockStateMapper; } public void acceptMapping(ItemMapping mapping) { @@ -172,39 +241,181 @@ public void acceptMapping(ItemMapping mapping) { this.mappings.addItemMapping(mapping); - if (!mapping.getTexturesData().isEmpty()) { - TextureData firstTd = mapping.getTexturesData().getFirst(); - if (!firstTd.getTextures().isEmpty()) { - String firstTex = firstTd.getTextures().getFirst(); - String iconTex; - if (firstTex.matches(".*_\\d+$")) { - iconTex = firstTex.replaceAll("_\\d+$", "_icon"); - } else { - iconTex = firstTex + "_icon"; - } + // Icons are assigned here rather than inline: the group and each of its definitions is a separate Bedrock + // item and each needs its own, or every predicate variant renders identically. + this.assignIcon(mapping); + if (mapping instanceof GroupDefinitionMapping group) { + for (ItemMapping definition : group.getDefinitions()) { + this.assignIcon(definition); + } + } + } - String iconId = mapping.getBedrockIdentifier() + "_icon"; - TextureData iconTd = new TextureData(iconId); - iconTd.addTexture(iconTex); - this.texturesConfig.addTextureData(iconTd); + /** + * Derives an {@code _icon} texture from a mapping's first texture and points its {@code bedrock_options.icon} at + * it. + *

+ * When the item's model is three-dimensional the sprite is rendered from that model — see + * {@link #registerRenderedIcon}. Copying the model's texture is only right for an item whose texture already + * is its sprite; for a 3D model it is a UV atlas of unwrapped faces. + *

+ * An inventory icon cannot animate. {@code flipbook_textures.json} drives {@code atlas.terrain} tiles + * only, and the attachable route covers the equipped render. So an animated item animates when held and shows a + * still sprite in the inventory. + */ + private void assignIcon(ItemMapping mapping) { + if (mapping.getTexturesData().isEmpty()) return; + TextureData firstTd = mapping.getTexturesData().getFirst(); + if (firstTd.getTextures().isEmpty()) return; + + String firstTex = firstTd.getTextures().getFirst(); + java.awt.image.BufferedImage rendered = this.renderedIcons.get(iconKey(firstTd.getBedrockIdentifier())); + + // A rendered icon is named after the item, not its texture. Several items can share one texture and still + // have different models — sofa, sofa_inner and sleeper_sofa all use item/custom/sofa — so deriving the + // filename from the texture would have them overwrite each other's render. + String iconTex = rendered != null + ? "textures/item/icons/" + mapping.getBedrockIdentifier().replace(":", ".").replace("/", "_") + : firstTex.matches(".*_\\d+$") + ? firstTex.replaceAll("_\\d+$", "_icon") + : firstTex + "_icon"; + + String iconId = mapping.getBedrockIdentifier() + "_icon"; + TextureData iconTd = new TextureData(iconId); + iconTd.addTexture(iconTex); + this.texturesConfig.addTextureData(iconTd); - try { - Path srcPng = this.texturesDir.resolve(firstTex.substring("textures/".length()) + ".png"); - Path dstPng = this.texturesDir.resolve(iconTex.substring("textures/".length()) + ".png"); - java.nio.file.Files.createDirectories(dstPng.getParent()); - java.nio.file.Files.copy(srcPng, dstPng, java.nio.file.StandardCopyOption.REPLACE_EXISTING); - } catch (Exception e) { - fr.robie.messageflow.logger.Logger.warn("Could not copy icon texture: " + e.getMessage()); + try { + Path dstPng = this.texturesDir.resolve(iconTex.substring("textures/".length()) + ".png"); + java.nio.file.Files.createDirectories(dstPng.getParent()); + + if (rendered != null) { + javax.imageio.ImageIO.write(rendered, "png", dstPng.toFile()); + } else { + Path srcPng = this.texturesDir.resolve(firstTex.substring("textures/".length()) + ".png"); + java.nio.file.Files.copy(srcPng, dstPng, java.nio.file.StandardCopyOption.REPLACE_EXISTING); + } + } catch (Exception e) { + fr.robie.messageflow.logger.Logger.warn("Could not write icon texture: " + e.getMessage()); + } + + BedrockOptions opts = mapping.getBedrockOptions(); + if (opts == null) opts = new BedrockOptions(); + opts.setIcon(iconTd.getBedrockIdentifier()); + mapping.setBedrockOptions(opts); + } + + public void registerRenderedIcon(String textureId, java.awt.image.BufferedImage icon) { + if (textureId == null || icon == null) return; + this.renderedIcons.put(iconKey(textureId), icon); + } + + /** + * Records areas of a texture to tint, applied to the pack's copy once every texture has been written. + *

+ * Bedrock cannot tint at runtime, so a dye colour only reaches the held and worn model by being painted into + * the texture. Deferred rather than applied immediately because the plain copy may not have happened yet and + * would overwrite the result. + *

+ * Regions accumulate across items instead of one item's version winning: a sheet is routinely shared by + * several items that each tint their own part of it, so keeping only the first would leave every other + * item's areas plain. + * + * @param texturePath pack-relative, without extension, e.g. {@code textures/item/custom/sofa} + */ + public void registerTintRegions(String texturePath, java.util.List regions, + String itemId) { + if (texturePath == null || regions == null || regions.isEmpty()) return; + + java.util.List existing = + this.tintRegions.computeIfAbsent(texturePath, key -> new java.util.ArrayList<>()); + + for (ModelTextureTinter.TintRegion region : regions) { + // Two items wanting different colours on the same pixels cannot both be honoured — one texture holds + // one colour. Report it rather than let the loser silently wear the winner's colour. + for (ModelTextureTinter.TintRegion other : existing) { + if (other.rgb() != region.rgb() && overlaps(other, region)) { + String owner = this.tintedTextureOwners.getOrDefault(texturePath, "another item"); + fr.robie.messageflow.logger.Logger.warn(itemId + " and " + owner + " tint the same area of " + + texturePath + " different colours, and Bedrock cannot tint at runtime, so one of" + + " them will look wrong. Give them separate textures if both colours matter."); + break; } + } + existing.add(region); + } + this.tintedTextureOwners.putIfAbsent(texturePath, itemId); + } + + private static boolean overlaps(ModelTextureTinter.TintRegion a, ModelTextureTinter.TintRegion b) { + return a.x0() < b.x1() && b.x0() < a.x1() && a.y0() < b.y1() && b.y0() < a.y1(); + } + + private void writeTintedTextures() { + for (Map.Entry> entry : this.tintRegions.entrySet()) { + try { + Path png = this.texturesDir.resolve(entry.getKey().substring("textures/".length()) + ".png"); + if (!java.nio.file.Files.exists(png)) continue; + + java.awt.image.BufferedImage image = javax.imageio.ImageIO.read(png.toFile()); + if (image == null) continue; + + // Read images can be any type; force ARGB so the alpha survives the round trip. + java.awt.image.BufferedImage target = new java.awt.image.BufferedImage( + image.getWidth(), image.getHeight(), java.awt.image.BufferedImage.TYPE_INT_ARGB); + target.createGraphics().drawImage(image, 0, 0, null); + + for (ModelTextureTinter.TintRegion region : entry.getValue()) region.applyTo(target); + javax.imageio.ImageIO.write(target, "png", png.toFile()); + } catch (Exception e) { + fr.robie.messageflow.logger.Logger.warn("Could not tint texture " + entry.getKey() + + ": " + e.getMessage()); + } + } + } - BedrockOptions opts = mapping.getBedrockOptions(); - if (opts == null) { - opts = new BedrockOptions(); + /** + * Normalises a texture id for the rendered-icon map. Callers hold it in either spelling — the item pipeline + * uses {@code default:sofa}, a {@code TextureData} identifier is the sanitised {@code default.sofa} — and a + * mismatch here is invisible: the icon simply falls back to the copied texture. + */ + private static String iconKey(String textureId) { + return textureId.replace(":", ".").replace("/", "_"); + } + + /** + * Reports any {@code item_texture.json} entry whose PNG was never written. + *

+ * Such an entry is the one failure mode that is completely invisible in the output: the mapping looks + * complete, Geyser resolves the shortname, and the item simply has no icon in game. It happens when a + * model reference cannot be resolved to a texture and the model path itself is used as a fallback — so + * naming the offender here is the difference between a five-minute fix and guesswork. + */ + private void warnAboutMissingTextureFiles() { + int checked = 0; + int missing = 0; + for (TextureData data : this.texturesConfig.getTextures()) { + for (String texture : data.getTextures()) { + if (!texture.startsWith("textures/")) continue; + checked++; + Path png = this.texturesDir.resolve(texture.substring("textures/".length()) + ".png"); + if (!java.nio.file.Files.exists(png)) { + missing++; + fr.robie.messageflow.logger.Logger.warn("Icon '" + data.getBedrockIdentifier() + + "' points at " + texture + ".png, which was never written" + + " - that item will have no icon. Its model textures could not be resolved."); } - opts.setIcon(iconTd.getBedrockIdentifier()); - mapping.setBedrockOptions(opts); } } + // Stated either way, because "no warnings" and "the check never ran" look identical in a log otherwise. + // This is the whole-pack integrity check that used to live in RenderedIconPackTest; running it on every + // real conversion is strictly better than running it only in CI. + if (missing == 0) { + fr.robie.messageflow.logger.Logger.debug("All " + checked + " icon references resolve to a file"); + } else { + fr.robie.messageflow.logger.Logger.warn(missing + " of " + checked + + " icon references point at a file that was never written"); + } } public void registerRenderController(String key, BedrockRenderControllers rc) { @@ -248,6 +459,112 @@ public void convertSoundDefinitions(File javaSoundsJson, String namespace) { root, namespace, this.javaAssetsDir, this.packDir.resolve("sounds"))); } + public void addItemsDirectory(File itemsDir, String namespace) { + if (this.javaAssetsDir == null) return; + this.itemModelDefinitions.addFromItemsDirectory(itemsDir, namespace, this.javaAssetsDir); + } + + /** The CraftEngine templates collected from the item configs. */ + public TemplateEngine templates() { + return this.templates; + } + + /** Equipment assets collected from the item configs, resolving armour asset ids to their textures. */ + public EquipmentAssetRegistry equipmentAssets() { + return this.equipmentAssets; + } + + /** + * Copies an equipment asset's worn-model texture into the pack, mirroring vanilla's {@code chain_1} / + * {@code chain_2} layer naming. + * + * @return the pack-relative, extension-less texture reference, or {@code null} if the source is missing + */ + @Nullable + public String copyArmorTexture(EquipmentAssetRegistry.EquipmentAsset asset, String slot) { + String reference = asset.textureFor(slot); + Path assetsDir = asset.javaAssetsDir() != null ? asset.javaAssetsDir() : this.javaAssetsDir; + if (reference == null || assetsDir == null) return null; + + int colon = reference.indexOf(':'); + String namespace = colon < 0 ? "minecraft" : reference.substring(0, colon); + String path = colon < 0 ? reference : reference.substring(colon + 1); + Path source = assetsDir.resolve(namespace + "/textures/" + path + ".png"); + if (!java.nio.file.Files.exists(source)) { + fr.robie.messageflow.logger.Logger.warn("Armour texture not found: " + source); + return null; + } + + // "__" keeps two packs' assets of the same name apart. + String assetId = asset.id().replace(':', '_').replace('/', '_'); + String name = assetId + "_" + asset.layerFor(slot); + String relative = "models/armor/" + name; + Path destination = this.texturesDir.resolve(relative + ".png"); + try { + java.nio.file.Files.createDirectories(destination.getParent()); + java.nio.file.Files.copy(source, destination, java.nio.file.StandardCopyOption.REPLACE_EXISTING); + } catch (Exception e) { + fr.robie.messageflow.logger.Logger.error("Failed to copy armour texture " + source, e); + return null; + } + return "textures/" + relative; + } + + + /** + * Applies templates to one item's config section. + *

+ * Returns the section unchanged when the item uses no templates, so the common case allocates nothing. + * A template failure is contained to its own item — one unresolvable template should not abandon the + * rest of the pack — and is reported with the file it came from, since template ids give no hint where + * they were declared. + * + * @return the resolved section, or {@code null} if this item could not be resolved and must be skipped + */ + public ConfigurationSection resolveTemplates(String itemId, ConfigurationSection itemSection, File sourceFile) { + if (this.templates.isEmpty()) return itemSection; + try { + Object resolved = this.templates.resolve(itemId, ConfigurationTrees.toMap(itemSection)); + if (resolved instanceof Map map) { + //noinspection unchecked + return ConfigurationTrees.toSection((Map) map); + } + // An item that resolves to something other than a map is malformed; leave it as authored. + return itemSection; + } catch (TemplateException e) { + fr.robie.messageflow.logger.Logger.warn("Skipping item " + itemId + " in " + sourceFile.getName() + + ": " + e.getMessage()); + return null; + } + } + + /** + * The base Java item for a CraftEngine item that declares no {@code material:}. + *

+ * Resolved once, then cached. See {@link DefaultMaterialResolver} for the precedence. + */ + public Material defaultMaterial() { + if (this.defaultMaterial == null) { + this.defaultMaterial = DefaultMaterialResolver.resolve(this.pluginFolder); + } + return this.defaultMaterial; + } + + /** Resolves Java model references to their {@code textures} maps, following {@code parent} chains. */ + public fr.robie.craftengineconverter.converter.bedrock.geometry.JavaModelResolver javaModelResolver() { + return this.javaModelResolver; + } + + /** Reserves a Bedrock item identifier, returning {@code false} if it was already taken. */ + public boolean claimBedrockIdentifier(String identifier) { + return this.usedBedrockIdentifiers.add(identifier); + } + + /** Java item model definitions discovered in {@code assets//items/}, keyed by identifier. */ + public ItemModelDefinitionMapper itemModelDefinitions() { + return this.itemModelDefinitions; + } + public void addWaypointStyleDirectory(File dir, String namespace) { this.waypointStyleMapper.addFromWaypointStyleDirectory(dir, namespace); } @@ -348,19 +665,40 @@ private void resolveParentTextures(JavaBlockModel model, java.util.Set v } catch (Exception ignored) {} } + /** + * Maps a Java item model into held-item geometry, if it has any shape to map. + *

+ * Loaded through the shared {@link #javaModelResolver} rather than straight off disk, so a model whose + * {@code elements} come from a {@code parent} gets real geometry. Reading the file directly meant such an item + * was given a rendered three-dimensional icon — {@code renderIconFromModel} does use the resolver — and + * a flat held model, from the same source file. + * + * @param texW the UV space the model's faces are written in. For an animated texture this is one frame, + * not the whole sheet: Java animates by cycling frames through the same UV layout. + */ public void registerGeometry(String modelPath, String bedrockKey, int texW, int texH) { - if (this.javaAssetsDir == null) return; - String[] parts = modelPath.split(":", 2); - String namespace = parts.length > 1 ? parts[0] : "minecraft"; - String path = parts.length > 1 ? parts[1] : parts[0]; - Path modelFile = this.javaAssetsDir.resolve(namespace + "/models/" + path + ".json"); - if (!modelFile.toFile().exists()) return; + if (this.javaAssetsDir == null || modelPath == null) return; try { - JavaBlockModel javaModel = JavaBlockModel.load(modelFile); + JavaBlockModel javaModel = this.javaModelResolver.load(modelPath, this.javaAssetsDir); + if (javaModel == null) { + // Said out loud because the caller silently substitutes a flat extruded sprite, and an item + // rendering as a billboard of its own texture atlas is otherwise very hard to trace back here. + fr.robie.messageflow.logger.Logger.debug("No model at " + modelPath + " for " + bedrockKey + + "; its held form will be an extruded sprite"); + return; + } + GeometryMapper mapper = new GeometryMapper(); String safeKey = bedrockKey.replace(":", ".").replace("/", "_"); BedrockGeometry geo = mapper.mapGeometry(safeKey, javaModel, texW, texH); + + // A model that only names textures — parent: item/handheld or item/generated, with no + // "elements" — converts to bones with no cubes. Registering that would satisfy the + // has-geometry check downstream and suppress the generated flat model, leaving an attachable + // that points at nothing and an item that is invisible in hand. + if (geo.hasNoCubes()) return; + this.collectedGeometry.put(bedrockKey, geo); } catch (Exception e) { fr.robie.messageflow.logger.Logger.error("Failed to map geometry for " + modelPath, e); @@ -397,12 +735,19 @@ private void registerBlockTerrainTexture(String textureRef, String shortname, Pa public void saveAll() { this.mappings.saveMappings(this.customMappingsDir); this.texturesConfig.save(this.texturesDir); + this.warnAboutMissingTextureFiles(); + // Copy block textures, register in terrain_texture.json, and add flipbook if animated for (Map.Entry tex : this.blockStateMapper.getDiscoveredTextures().entrySet()) { String textureRef = tex.getKey(); String shortname = textureRef.replace("minecraft:", "minecraft/").replace(":", "/"); this.registerBlockTerrainTexture(textureRef, shortname, tex.getValue()); } + + // Last of all the texture writing, because every path above copies pristine source files into the pack and + // any one of them would overwrite a tint. One texture serving both an item and a block is enough to hit + // this: the sofa lost its dye the moment its texture was also registered as a block texture. + this.writeTintedTextures(); if (!this.terrainTexturesConfig.isEmpty()) { this.terrainTexturesConfig.save(this.texturesDir); } @@ -419,6 +764,8 @@ public void saveAll() { fr.robie.messageflow.logger.Logger.info("Saved " + this.waypointStyleMapper.size() + " waypoint style(s)"); } +// this.soundMapper.reportMissingSounds(); + this.texturePipeline.reportTrimFallbacks(); if (!this.soundMapper.isEmpty()) { try { Path soundDefPath = this.packDir.resolve("sounds/sound_definitions.json"); @@ -447,6 +794,23 @@ public void saveAll() { } } + // Block geometry lives apart from entity geometry by convention, and the two are addressed differently: + // a block's identifier is baked into the mapping, so the file name follows it rather than a texture key. + Path blockGeoDir = this.packDir.resolve("models/blocks"); + for (Map.Entry entry : this.blockStateMapper.getGeneratedGeometry().entrySet()) { + try { + java.nio.file.Files.createDirectories(blockGeoDir); + Path outPath = blockGeoDir.resolve(entry.getKey() + ".geo.json"); + FileCacheManager.saveJsonToFile(outPath, entry.getValue().serialize()); + } catch (Exception e) { + fr.robie.messageflow.logger.Logger.error("Failed to save block geometry " + entry.getKey(), e); + } + } + if (!this.blockStateMapper.getGeneratedGeometry().isEmpty()) { + fr.robie.messageflow.logger.Logger.info("Generated " + this.blockStateMapper.getGeneratedGeometry().size() + + " block geometry file(s) for shapes Bedrock has no built-in model for"); + } + Path animDir = this.packDir.resolve("animations"); for (Map.Entry entry : this.animations.entrySet()) { if (!entry.getValue().isEmpty()) { @@ -508,6 +872,11 @@ public void saveAll() { }); } } + +// if ((boolean) Configuration.get(ConfigurationKey.SHORTEN_PACK_PATHS)) { +// PackPathShortener.shorten(this.packDir); +// } +// PackPathShortener.reportLongPaths(this.packDir); } private static void writeDefaultPackIcon(java.nio.file.Path dest) throws java.io.IOException { diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/DefaultMaterialResolver.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/DefaultMaterialResolver.java new file mode 100644 index 00000000..3f10349d --- /dev/null +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/DefaultMaterialResolver.java @@ -0,0 +1,87 @@ +package fr.robie.craftengineconverter.converter.bedrock; + +import fr.robie.craftengineconverter.api.configuration.Configuration; +import fr.robie.craftengineconverter.api.configuration.ConfigurationKey; +import fr.robie.craftengineconverter.api.manager.FileCacheManager; +import fr.robie.messageflow.logger.Logger; +import org.bukkit.Material; +import org.jetbrains.annotations.Nullable; + +import java.io.File; +import java.util.Locale; + +/** + * Works out which Java item a CraftEngine item falls back to when it declares no {@code material:}. + *

+ * CraftEngine reads this from its own config (`item.default-material`, defaulting to {@code nether_brick}) + * and applies it to every item without an explicit material — which in a typical pack is most block items + * and anything driven by a template that sets the material elsewhere. Guessing wrong silently maps those + * items onto the wrong Java item, so the value has to come from the same place CraftEngine got it. + * + *

Precedence

+ *
    + *
  1. The converter's own {@code default-material}, when set to a real material — an explicit setting + * always wins.
  2. + *
  3. {@code item.default-material} from CraftEngine's {@code config.yml}, when that file can be found.
  4. + *
  5. {@code nether_brick}, CraftEngine's built-in default.
  6. + *
+ * The converter's key defaults to the sentinel {@value #AUTO} rather than a material, because + * {@code Configuration} writes its defaults back into its own file: after one run the key is always + * present, so "did the user set this?" cannot otherwise be answered. + */ +final class DefaultMaterialResolver { + private static final Material FALLBACK = Material.NETHER_BRICK; + + private DefaultMaterialResolver() { + throw new UnsupportedOperationException("DefaultMaterialResolver is a utility class and cannot be instantiated."); + } + + static Material resolve(@Nullable File pluginFolder) { + Object configured = Configuration.get(ConfigurationKey.DEFAULT_MATERIAL); + + if (configured instanceof Material material) { + Logger.info("Default item material: " + material.name().toLowerCase(Locale.ROOT) + + " (from the converter's config)"); + return material; + } + + Material fromCraftEngine = readFromCraftEngine(pluginFolder); + if (fromCraftEngine != null) { + Logger.info("Default item material: " + fromCraftEngine.name().toLowerCase(Locale.ROOT) + + " (from CraftEngine's config.yml)"); + return fromCraftEngine; + } + + Logger.info("Default item material: " + FALLBACK.name().toLowerCase(Locale.ROOT) + + " (CraftEngine's built-in default; set default-material if your server differs)"); + return FALLBACK; + } + + // CraftEngine installs alongside this plugin, so its config is a sibling: plugins/CraftEngine/config.yml + @Nullable + private static Material readFromCraftEngine(@Nullable File pluginFolder) { + if (pluginFolder == null) return null; + File pluginsDir = pluginFolder.getParentFile(); + if (pluginsDir == null) return null; + + File config = new File(pluginsDir, "CraftEngine/config.yml"); + if (!config.isFile()) return null; + + return FileCacheManager.getYamlCache().getEntryFile(config.toPath()) + .map(entry -> parse(entry.getData().getString("item.default-material"))) + .orElse(null); + } + + @Nullable + private static Material parse(@Nullable String name) { + if (name == null || name.isBlank()) return null; + // CraftEngine writes namespaced ids; only the path names a Bukkit Material. + String value = name.contains(":") ? name.substring(name.indexOf(':') + 1) : name; + try { + return Material.valueOf(value.trim().toUpperCase(Locale.ROOT)); + } catch (IllegalArgumentException e) { + Logger.warn("CraftEngine's item.default-material is '" + name + "', which is not a known material"); + return null; + } + } +} diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/animation/AnimationMapper.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/animation/AnimationMapper.java index 76aa4fc1..9d1089fb 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/animation/AnimationMapper.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/animation/AnimationMapper.java @@ -1,133 +1,82 @@ package fr.robie.craftengineconverter.converter.bedrock.animation; -public class AnimationMapper { - private static final float[] TOOL_FP_POS = {0f, 8f, 12f}; - private static final float[] TOOL_FP_ROT = {25.7519f, 13.8142f, 188.2874f}; - private static final float[] TOOL_FP_SCALE = {1f, 1f, 1f}; - - private static final float[] TOOL_TP_POS = {-0.0f, 13.0f, -6.0f}; - private static final float[] TOOL_TP_ROT = {90.0f, -55.0f + 90f, 90.0f}; - private static final float[] TOOL_TP_SCALE = {0.85f, 0.85f, 0.85f}; - - private static final float[] TOOL_H_POS = {0.0f, 28.515f, 4.585f}; - private static final float[] TOOL_H_ROT = {-0.0f, -180.0f, 0.0f}; - private static final float[] TOOL_H_SCALE = {0.655f, 0.655f, 0.655f}; - - public static BedrockAnimationContext mapDisplayTransforms(String identifier, String bone, - float[] firstPersonRot, float[] firstPersonPos, float[] firstPersonScale, - float[] thirdPersonRot, float[] thirdPersonPos, float[] thirdPersonScale, - float[] headRot, float[] headPos, float[] headScale) { - float[] fpRot = convertFirstPersonRotation(firstPersonRot); - float[] fpPos = convertFirstPersonPosition(firstPersonPos); - float[] fpScale = firstPersonScale; - - float[] tpRot = convertThirdPersonRotation(thirdPersonRot); - float[] tpPos = convertThirdPersonPosition(thirdPersonPos); - float[] tpScale = thirdPersonScale; - - float[] hRot = convertHeadRotation(headRot); - float[] hPos = convertHeadPosition(headPos); - float[] hScale = headScale; - - String safeId = identifier.replace(":", ".").replace("/", "_"); - - BedrockAnimation anim = new BedrockAnimation() - .withAnimation("animation." + safeId + ".hold_first_person", BedrockAnimation.boneAnimation(fpPos, fpRot, fpScale)) - .withAnimation("animation." + safeId + ".hold_third_person", BedrockAnimation.boneAnimation(tpPos, tpRot, tpScale)) - .withAnimation("animation." + safeId + ".head", BedrockAnimation.boneAnimation(hPos, hRot, hScale)); - - return new BedrockAnimationContext( - anim, - "animation." + safeId + ".hold_first_person", - "animation." + safeId + ".hold_third_person", - "animation." + safeId + ".head" - ); +import fr.robie.craftengineconverter.converter.bedrock.display.AttachableSlot; +import fr.robie.craftengineconverter.converter.bedrock.display.DisplayPoses; +import fr.robie.craftengineconverter.converter.bedrock.display.HandAnchors; +import fr.robie.craftengineconverter.converter.bedrock.display.Transform; +import fr.robie.craftengineconverter.converter.bedrock.geometry.JavaBlockModel; + +import java.util.EnumMap; +import java.util.Map; + +/** + * Builds the animations that pose a held custom item, from the Java model's {@code display} block. + *

+ * Bedrock has no {@code display} block for items — {@code item_display_transforms} is a block-geometry field, and + * Geyser's item mapping has no pose lever of its own — so a held item's pose is an animation per render + * context, selected by the attachable's {@code scripts.animate} conditions. That is a presentation difference, not + * a semantic one: the pose is still the model's Java {@code display} entry, composed with wherever the engine puts + * the item. + *

+ * That composition is the whole job here, and it is why this is matrix work rather than arithmetic. Rotating by the + * hand's angle and then by the model's is not the sum of the two angles, so the per-axis formulas this replaced + * ({@code {90, -r[2], -r[1]}} and friends) could only be right while one of the two rotations was trivial — and + * they silently discarded the axes that did not fit. See {@link Transform} for the rules, all ported from + * Blockbench, and {@link HandAnchors} for the constants. + */ +public final class AnimationMapper { + + private AnimationMapper() { + throw new UnsupportedOperationException("AnimationMapper is a utility class and cannot be instantiated."); } - public static BedrockAnimationContext createDefaultAnimations(String identifier, String bone) { - return createAnimations(identifier, bone, - new float[]{-3.2f, 13.63f, 1.13f}, - new float[]{-180.0f, -25.0f, 0.0f}, - new float[]{0.68f, 0.68f, 0.68f}, - new float[]{-0.0f, 13.0f, -4.0f}, - new float[]{90.0f, -55.0f, 90.0f}, - new float[]{0.85f, 0.85f, 0.85f}, - new float[]{0.0f, 28.515f, 4.585f}, - new float[]{-0.0f, -180.0f, 0.0f}, - new float[]{0.655f, 0.655f, 0.655f}); + /** + * Poses an item from its resolved Java model. + * + * @param identifier the item id, which names the animations + * @param model the model with its {@code parent} chain already merged in, so inherited poses are present + */ + public static BedrockAnimationContext fromModel(String identifier, JavaBlockModel model) { + return model == null + ? fromDisplay(identifier, Map.of()) + : fromDisplay(identifier, model.display(), model.parent().orElse(null)); } - public static BedrockAnimationContext createToolAnimations(String identifier, String bone) { - return createAnimations(identifier, bone, - TOOL_FP_POS, TOOL_FP_ROT, TOOL_FP_SCALE, - TOOL_TP_POS, TOOL_TP_ROT, TOOL_TP_SCALE, - TOOL_H_POS, TOOL_H_ROT, TOOL_H_SCALE); + /** + * Poses an item from a {@code display} map directly. + *

+ * Every slot gets an animation even when the model names no pose for it: {@link DisplayPoses#forSlot} falls + * back through the off-hand mirror to {@code item/generated}'s poses, so an item is never left unposed sitting + * at the bone's origin. + */ + public static BedrockAnimationContext fromDisplay(String identifier, + Map display) { + return fromDisplay(identifier, display, null); } - private static BedrockAnimationContext createAnimations(String identifier, String bone, - float[] fpPos, float[] fpRot, float[] fpScale, - float[] tpPos, float[] tpRot, float[] tpScale, - float[] hPos, float[] hRot, float[] hScale) { + /** + * @param parent the model's {@code parent}, so a context it declares nothing for falls back through the same + * preset the icon uses — see {@link DisplayPoses#forSlot(AttachableSlot, Map, String)} + */ + public static BedrockAnimationContext fromDisplay(String identifier, + Map display, + String parent) { String safeId = identifier.replace(":", ".").replace("/", "_"); - BedrockAnimation anim = new BedrockAnimation() - .withAnimation("animation." + safeId + ".hold_first_person", BedrockAnimation.boneAnimation(fpPos, fpRot, fpScale)) - .withAnimation("animation." + safeId + ".hold_third_person", BedrockAnimation.boneAnimation(tpPos, tpRot, tpScale)) - .withAnimation("animation." + safeId + ".head", BedrockAnimation.boneAnimation(hPos, hRot, hScale)); + BedrockAnimation animation = new BedrockAnimation(); + Map names = new EnumMap<>(AttachableSlot.class); - return new BedrockAnimationContext( - anim, - "animation." + safeId + ".hold_first_person", - "animation." + safeId + ".hold_third_person", - "animation." + safeId + ".head" - ); - } + for (AttachableSlot slot : AttachableSlot.values()) { + Transform pose = Transform + .compose(HandAnchors.forSlot(slot), DisplayPoses.forSlot(slot, display, parent)) + .toBedrock(); - static float[] convertFirstPersonRotation(float[] javaRot) { - return new float[]{ - -90.0F + javaRot[1], - -javaRot[2], - javaRot[0] - }; - } - - static float[] convertFirstPersonPosition(float[] javaTrans) { - return new float[]{ - -javaTrans[1] / 0.0625F, - 12.5F + javaTrans[2] / 0.0625F, - javaTrans[0] / 0.0625F - }; - } - - static float[] convertThirdPersonRotation(float[] javaRot) { - return new float[]{ - 90.0F, - -javaRot[2], - -javaRot[1] - }; - } - - static float[] convertThirdPersonPosition(float[] javaTrans) { - return new float[]{ - -javaTrans[0] / 0.0625F, - 12.5F + javaTrans[2] / 0.0625F, - -javaTrans[1] / 0.0625F - }; - } - - static float[] convertHeadRotation(float[] javaRot) { - return new float[]{ - -javaRot[0], - -javaRot[1], - javaRot[2] - }; - } + String name = "animation." + safeId + "." + slot.animationSuffix(); + animation.withAnimation(name, BedrockAnimation.boneAnimation( + pose.translation(), pose.rotation(), pose.scale())); + names.put(slot, name); + } - static float[] convertHeadPosition(float[] javaTrans) { - return new float[]{ - -javaTrans[0] / 0.0625F * 0.655F, - 20.0F + javaTrans[1] / 0.0625F * 0.655F, - javaTrans[2] / 0.0625F * 0.655F - }; + return new BedrockAnimationContext(animation, names); } } diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/animation/BedrockAnimation.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/animation/BedrockAnimation.java index 8dd5cae6..c8d31991 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/animation/BedrockAnimation.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/animation/BedrockAnimation.java @@ -33,17 +33,21 @@ public static JsonObject boneAnimation(float[] pos, float[] rot, float[] scale) JsonObject anim = new JsonObject(); anim.addProperty("loop", true); + float[] position = round(pos); + float[] rotation = round(rot); + float[] scaling = round(scale); + JsonObject bone = new JsonObject(); JsonObject boneAnim = new JsonObject(); - if (pos[0] != 0 || pos[1] != 0 || pos[2] != 0) { - boneAnim.add("position", toJsonArray(pos[0], pos[1], pos[2])); + if (position[0] != 0 || position[1] != 0 || position[2] != 0) { + boneAnim.add("position", toJsonArray(position[0], position[1], position[2])); } - if (rot[0] != 0 || rot[1] != 0 || rot[2] != 0) { - boneAnim.add("rotation", toJsonArray(rot[0], rot[1], rot[2])); + if (rotation[0] != 0 || rotation[1] != 0 || rotation[2] != 0) { + boneAnim.add("rotation", toJsonArray(rotation[0], rotation[1], rotation[2])); } - if (scale[0] != 1 || scale[1] != 1 || scale[2] != 1) { - boneAnim.add("scale", toJsonArray(scale[0], scale[1], scale[2])); + if (scaling[0] != 1 || scaling[1] != 1 || scaling[2] != 1) { + boneAnim.add("scale", toJsonArray(scaling[0], scaling[1], scaling[2])); } bone.add("bone", boneAnim); @@ -51,6 +55,15 @@ public static JsonObject boneAnimation(float[] pos, float[] rot, float[] scale) return anim; } + private static float[] round(float[] values) { + float[] rounded = new float[values.length]; + for (int axis = 0; axis < values.length; axis++) { + float value = Math.round(values[axis] * 10000.0F) / 10000.0F; + rounded[axis] = value == 0.0F ? 0.0F : value; + } + return rounded; + } + private static JsonArray toJsonArray(float... values) { JsonArray arr = new JsonArray(); for (float v : values) arr.add(v); diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/animation/BedrockAnimationContext.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/animation/BedrockAnimationContext.java index e7b4b5d7..1a37c2dd 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/animation/BedrockAnimationContext.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/animation/BedrockAnimationContext.java @@ -1,47 +1,44 @@ package fr.robie.craftengineconverter.converter.bedrock.animation; +import fr.robie.craftengineconverter.converter.bedrock.display.AttachableSlot; + +import java.util.Collections; +import java.util.EnumMap; +import java.util.Map; import java.util.Optional; -public class BedrockAnimationContext { - private final Optional animation; - private final String firstPersonAnimation; - private final String thirdPersonAnimation; - private final String headAnimation; - - public BedrockAnimationContext(BedrockAnimation animation, String firstPerson, String thirdPerson, String head) { - this.animation = Optional.of(animation); - this.firstPersonAnimation = firstPerson; - this.thirdPersonAnimation = thirdPerson; - this.headAnimation = head; - } +/** + * The pose animations built for one item, and which slot each belongs to. + *

+ * Keyed by {@link AttachableSlot} rather than exposing a fixed first/third/head triple, because the off-hand slots + * would otherwise have nowhere to go — the triple was the reason four of Java's display contexts had to be + * collapsed into two. + */ +public final class BedrockAnimationContext { - public static final BedrockAnimationContext EMPTY = new BedrockAnimationContext(); + public static final BedrockAnimationContext EMPTY = new BedrockAnimationContext(null, Map.of()); - private BedrockAnimationContext() { - this.animation = Optional.empty(); - this.firstPersonAnimation = null; - this.thirdPersonAnimation = null; - this.headAnimation = null; - } + private final BedrockAnimation animation; + private final Map animationNames; - public Optional animation() { - return this.animation; + public BedrockAnimationContext(BedrockAnimation animation, Map animationNames) { + this.animation = animation; + this.animationNames = animationNames.isEmpty() + ? Map.of() + : Collections.unmodifiableMap(new EnumMap<>(animationNames)); } - public String firstPersonAnimation() { - return this.firstPersonAnimation; - } - - public String thirdPersonAnimation() { - return this.thirdPersonAnimation; + public Optional animation() { + return Optional.ofNullable(this.animation); } - public String headAnimation() { - return this.headAnimation; + /** The animation names by slot, in slot declaration order. */ + public Map animationNames() { + return this.animationNames; } public boolean isEmpty() { - return this.animation.isEmpty(); + return this.animation == null || this.animationNames.isEmpty(); } public static BedrockAnimationContext empty() { diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/animation/BedrockAnimationController.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/animation/BedrockAnimationController.java index edc4d558..d6a59942 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/animation/BedrockAnimationController.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/animation/BedrockAnimationController.java @@ -1,10 +1,8 @@ package fr.robie.craftengineconverter.converter.bedrock.animation; -import com.google.gson.JsonArray; import com.google.gson.JsonObject; import java.util.LinkedHashMap; -import java.util.List; import java.util.Map; public class BedrockAnimationController { @@ -30,34 +28,4 @@ public boolean isEmpty() { return this.controllers.isEmpty(); } - public static BedrockAnimationController animatedFrameCycle( - String identifier, int frameCount, List frameTimes, int defaultTickTime) { - String safeName = identifier.replace(":", ".").replace("/", "_"); - String controllerName = "controller.animation." + safeName + "_frame_cycle"; - - JsonObject controller = new JsonObject(); - controller.addProperty("initial_state", "frame_0"); - - JsonObject states = new JsonObject(); - for (int i = 0; i < frameCount; i++) { - float seconds = (i < frameTimes.size() ? frameTimes.get(i) : defaultTickTime) * 0.05f; - - JsonObject state = new JsonObject(); - JsonArray rcs = new JsonArray(); - rcs.add("controller.render." + safeName + "_frame_" + i); - state.add("render_controllers", rcs); - - int nextState = (i + 1) % frameCount; - JsonArray transitions = new JsonArray(); - JsonObject transition = new JsonObject(); - transition.addProperty("frame_" + nextState, "query.anim_time >= " + seconds); - transitions.add(transition); - state.add("transitions", transitions); - - states.add("frame_" + i, state); - } - - controller.add("states", states); - return new BedrockAnimationController().withController(controllerName, controller); - } } \ No newline at end of file diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/animation/BedrockRenderControllers.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/animation/BedrockRenderControllers.java index aeb7bb77..46f0f1ab 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/animation/BedrockRenderControllers.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/animation/BedrockRenderControllers.java @@ -44,25 +44,62 @@ public static JsonObject itemDefaultController() { return c; } - public static JsonObject animatedController(int frameCount, String texturePrefix, int entriesPerFrame) { - JsonObject c = new JsonObject(); - - int totalEntries = frameCount * entriesPerFrame; + /** + * Above this the frame array stops being worth its size, so the timeline is compressed to fit. A + * {@code frametime} of 100 over 16 frames would otherwise want 1600 entries to say what 16 can. + */ + private static final int MAX_FRAME_ENTRIES = 512; + + /** + * Cycles a texture through its animation frames by indexing an array with the entity's age. + *

+ * Bedrock has no flipbook for item textures — Mojang have said so directly + * ({@code bedrock-wiki/meta/blocks-items-qna.md}: "the flipbook stuff is more deeply intertwined with blocks + * such that it's probably not super easy to adapt to items") — so the frames become separate textures and a + * Molang expression picks one. + *

+ * The array holds one entry per tick, so a frame that Java shows for three ticks occupies three + * entries and {@code q.life_time * 20} indexes it directly. That is what makes {@code .mcmeta}'s + * {@code frametime} and its per-frame {@code time} overrides actually take effect: they were parsed and then + * dropped in favour of a flat ten ticks per frame. + *

+ * {@code frameIndices} is honoured rather than assumed to be {@code 0..n}, because {@code .mcmeta} may list a + * custom order — a back-and-forth animation names the same frame twice. + * + * @param frameIndices which frame image each step shows + * @param frameTicks how long each step lasts, in ticks, parallel to {@code frameIndices} + * @return the controller, or {@code null} when there is nothing to animate + */ + public static JsonObject animatedController(int[] frameIndices, int[] frameTicks, String texturePrefix) { + if (frameIndices == null || frameIndices.length == 0) return null; + + int totalTicks = 0; + for (int ticks : frameTicks) totalTicks += Math.max(1, ticks); + + // Compressing the timeline keeps the relative durations and slows the clock to match, so the animation + // still runs at the right speed - just quantised more coarsely. + int divisor = Math.max(1, (int) Math.ceil(totalTicks / (double) MAX_FRAME_ENTRIES)); - JsonObject arrays = new JsonObject(); - JsonObject textureArrays = new JsonObject(); JsonArray framesArray = new JsonArray(); - for (int i = 0; i < frameCount; i++) { - for (int j = 0; j < entriesPerFrame; j++) { - framesArray.add("Texture." + texturePrefix + "_" + i); + for (int step = 0; step < frameIndices.length; step++) { + int ticks = step < frameTicks.length ? Math.max(1, frameTicks[step]) : 1; + int entries = Math.max(1, Math.round(ticks / (float) divisor)); + for (int entry = 0; entry < entries; entry++) { + framesArray.add("Texture." + texturePrefix + "_" + frameIndices[step]); } } + + JsonObject textureArrays = new JsonObject(); textureArrays.add("Array.frames", framesArray); + JsonObject arrays = new JsonObject(); arrays.add("textures", textureArrays); + + JsonObject c = new JsonObject(); c.add("arrays", arrays); JsonArray tex = new JsonArray(); - tex.add("Array.frames[math.mod(math.floor(q.life_time * 20.0), " + totalEntries + ")]"); + tex.add("Array.frames[math.mod(math.floor(q.life_time * " + (20.0F / divisor) + "), " + + framesArray.size() + ")]"); tex.add("Texture.enchanted"); c.add("textures", tex); @@ -98,15 +135,14 @@ public static BedrockRenderControllers itemDefault() { return new BedrockRenderControllers().withController("controller.render.item_default", itemDefaultController()); } - public static BedrockRenderControllers animated(String identifier, int frameCount) { - return animated(identifier, frameCount, 10); - } + /** + * @return the controllers, or an empty set when the frames describe nothing to animate + */ + public static BedrockRenderControllers animated(String identifier, int[] frameIndices, int[] frameTicks) { + JsonObject controller = animatedController(frameIndices, frameTicks, "frame"); + if (controller == null) return new BedrockRenderControllers(); - public static BedrockRenderControllers animated(String identifier, int frameCount, int entriesPerFrame) { String safeName = identifier.replace(":", ".").replace("/", "_"); - return new BedrockRenderControllers().withController( - "controller.render." + safeName, - animatedController(frameCount, "frame", entriesPerFrame) - ); + return new BedrockRenderControllers().withController("controller.render." + safeName, controller); } } diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/attachable/BedrockAttachable.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/attachable/BedrockAttachable.java index 6aa5b508..504d9da6 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/attachable/BedrockAttachable.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/attachable/BedrockAttachable.java @@ -115,15 +115,50 @@ public JsonObject serialize() { return root; } - public static BedrockAttachable equipment(String identifier) { + /** + * An attachable for worn armour, shaped like vanilla's {@code chainmail_*} attachables. + *

+ * Deliberately unlike {@link #geometry}: worn armour uses Bedrock's built-in humanoid armour model and + * the {@code armor} material, and carries no animations. A held-item attachable animates itself + * into the hand via {@code scripts.animate} keyed on {@code context.item_slot}, and those conditions + * never match an armour slot — the model then renders unposed at the body origin, which looks like the + * item's icon stuck inside the player. + *

+ * {@code parent_setup} hides the vanilla armour layer for this slot so the custom model is not drawn on + * top of the default one. + * + * @param slot one of {@code head}, {@code chest}, {@code legs}, {@code feet} + */ + public static BedrockAttachable equipment(String identifier, String slot) { BedrockAttachable a = new BedrockAttachable(identifier); a.withMaterial("default", "armor"); a.withMaterial("enchanted", "armor_enchanted"); a.withTexture("enchanted", "textures/misc/enchanted_actor_glint"); - a.withRenderController("controller.armor"); + a.withGeometry("default", armorGeometry(slot)); + a.withScript("parent_setup", "variable." + layerVariable(slot) + "_layer_visible = 0.0;"); + a.withRenderController("controller.render.armor"); return a; } + private static String armorGeometry(String slot) { + return "geometry.humanoid.armor." + switch (slot) { + case "head" -> "helmet"; + case "chest" -> "chestplate"; + case "legs" -> "leggings"; + default -> "boots"; + }; + } + + // The variable names are vanilla's and do not follow the slot names: chest/leg/boot, not chest/legs/feet. + private static String layerVariable(String slot) { + return switch (slot) { + case "head" -> "helmet"; + case "chest" -> "chest"; + case "legs" -> "leg"; + default -> "boot"; + }; + } + public static BedrockAttachable geometry(String identifier, String geometryId) { return geometry(identifier, geometryId, null); } diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/attachable/BedrockAttachableContext.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/attachable/BedrockAttachableContext.java index c69ca5ab..e1b0258c 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/attachable/BedrockAttachableContext.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/attachable/BedrockAttachableContext.java @@ -1,7 +1,9 @@ package fr.robie.craftengineconverter.converter.bedrock.attachable; import fr.robie.craftengineconverter.converter.bedrock.animation.BedrockAnimationContext; +import fr.robie.craftengineconverter.converter.bedrock.display.AttachableSlot; +import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.Optional; @@ -45,21 +47,28 @@ public static BedrockAttachableContext createWithAnimations(String identifier, b public static BedrockAttachableContext createWithAnimations(String identifier, boolean hasGeometry, boolean hasAnimatedTexture, BedrockAnimationContext animCtx, String defaultTexture) { BedrockAttachableContext ctx = create(identifier, hasGeometry, hasAnimatedTexture, defaultTexture); - if (!animCtx.isEmpty()) { - ctx.attachable().ifPresent(att -> { - att.withAnimation("third_person", animCtx.thirdPersonAnimation()); - att.withAnimation("first_person", animCtx.firstPersonAnimation()); - att.withAnimation("head", animCtx.headAnimation()); - att.withScript("animate", List.of( - Map.of("first_person", "context.is_first_person == 1.0 && (context.item_slot == 'main_hand' || context.item_slot == 'off_hand')"), - Map.of("third_person", "context.is_first_person == 0.0 && (context.item_slot == 'main_hand' || context.item_slot == 'off_hand')"), - Map.of("head", "context.is_first_person == 0.0 && context.item_slot == 'head'") - )); - }); - } + ctx.attachable().ifPresent(att -> applyPoseAnimations(att, animCtx)); return ctx; } + /** + * Points an attachable at its pose animations and writes the {@code scripts.animate} block that switches + * between them. + *

+ * The one place this is done, so the animated-texture path cannot drift from the static one — it previously + * carried its own verbatim copy of the same block. + */ + public static void applyPoseAnimations(BedrockAttachable attachable, BedrockAnimationContext animCtx) { + if (attachable == null || animCtx == null || animCtx.isEmpty()) return; + + List> animate = new ArrayList<>(); + for (Map.Entry entry : animCtx.animationNames().entrySet()) { + attachable.withAnimation(entry.getKey().key(), entry.getValue()); + animate.add(Map.of(entry.getKey().key(), entry.getKey().condition())); + } + attachable.withScript("animate", animate); + } + public static BedrockAttachableContext createWithAnimatedTexture(String identifier, String renderControllerName) { return createWithAnimatedTexture(identifier, renderControllerName, null); } @@ -111,9 +120,13 @@ public static BedrockAttachableContext createAnimatedWithCustomRC(String identif return new BedrockAttachableContext(att); } - public static BedrockAttachableContext createArmor(String identifier, String equipmentTexturePath) { - BedrockAttachable att = BedrockAttachable.equipment(identifier); - att.withTexture("default", equipmentTexturePath); - return new BedrockAttachableContext(Optional.of(att), Optional.of(equipmentTexturePath)); + /** + * @param slot the wearable slot, which decides the armour geometry and which vanilla layer is hidden + * @param armorTexturePath the worn-model texture — not the item icon + */ + public static BedrockAttachableContext createArmor(String identifier, String slot, String armorTexturePath) { + BedrockAttachable att = BedrockAttachable.equipment(identifier, slot); + att.withTexture("default", armorTexturePath); + return new BedrockAttachableContext(Optional.of(att), Optional.of(armorTexturePath)); } } diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/display/AttachableSlot.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/display/AttachableSlot.java new file mode 100644 index 00000000..8d06d06d --- /dev/null +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/display/AttachableSlot.java @@ -0,0 +1,75 @@ +package fr.robie.craftengineconverter.converter.bedrock.display; + +import fr.robie.craftengineconverter.converter.bedrock.geometry.DisplayContext; + +/** + * The render contexts a Bedrock attachable can pose separately, and the Java {@code display} context each one + * draws its pose from. + *

+ * Bedrock has no {@code display} block for held items. An attachable names one animation per slot and a + * {@code scripts.animate} block of Molang conditions that decide which is playing, so this enum is the whole + * mapping from Java's eight display contexts onto what Bedrock can actually distinguish: + * {@code context.is_first_person} and {@code context.item_slot}. + *

+ * The conditions are mutually exclusive. The previous third-person condition was + * {@code context.item_slot != 'head'}, which also matched {@code off_hand} — harmless while there was one + * third-person animation, wrong as soon as the off hand has its own. + *

+ * {@link DisplayContext#GUI} is absent because no attachable slot renders the inventory icon; that is a sprite, + * drawn by {@code ItemIconRenderer}. {@link DisplayContext#GROUND} and {@link DisplayContext#FIXED} are absent + * because Bedrock poses dropped items and item frames itself and gives a resource pack no say. + */ +public enum AttachableSlot { + + FIRST_PERSON_MAIN("first_person", "hold_first_person", DisplayContext.FIRST_PERSON_RIGHT, + "context.is_first_person == 1.0 && context.item_slot == 'main_hand'"), + + FIRST_PERSON_OFF("first_person_off", "hold_first_person_off", DisplayContext.FIRST_PERSON_LEFT, + "context.is_first_person == 1.0 && context.item_slot == 'off_hand'"), + + THIRD_PERSON_MAIN("third_person", "hold_third_person", DisplayContext.THIRD_PERSON_RIGHT, + "context.is_first_person == 0.0 && context.item_slot == 'main_hand'"), + + THIRD_PERSON_OFF("third_person_off", "hold_third_person_off", DisplayContext.THIRD_PERSON_LEFT, + "context.is_first_person == 0.0 && context.item_slot == 'off_hand'"), + + HEAD("head", "head", DisplayContext.HEAD, + "context.is_first_person == 0.0 && context.item_slot == 'head'"); + + private final String key; + private final String animationSuffix; + private final String javaContext; + private final String condition; + + AttachableSlot(String key, String animationSuffix, String javaContext, String condition) { + this.key = key; + this.animationSuffix = animationSuffix; + this.javaContext = javaContext; + this.condition = condition; + } + + /** The name the attachable's {@code animations} map and {@code scripts.animate} entry use. */ + public String key() { + return this.key; + } + + /** Appended to {@code animation..} to name the animation itself. */ + public String animationSuffix() { + return this.animationSuffix; + } + + /** The Java {@code display} context this slot's pose comes from. */ + public String javaContext() { + return this.javaContext; + } + + /** The Molang that selects this slot. */ + public String condition() { + return this.condition; + } + + /** Whether this slot renders in the off hand, whose Java context may be absent and mirrored from the main. */ + public boolean isOffHand() { + return this == FIRST_PERSON_OFF || this == THIRD_PERSON_OFF; + } +} diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/display/DisplayPoses.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/display/DisplayPoses.java new file mode 100644 index 00000000..31675eb4 --- /dev/null +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/display/DisplayPoses.java @@ -0,0 +1,94 @@ +package fr.robie.craftengineconverter.converter.bedrock.display; + +import fr.robie.craftengineconverter.converter.bedrock.geometry.DisplayContext; +import fr.robie.craftengineconverter.converter.bedrock.geometry.JavaBlockModel; + +import java.util.Map; + +/** + * Turns a model's {@code display} block into the {@link Transform} a slot needs, resolving the two ways a context + * can be missing. + *

+ * Kept separate from the composition itself so that the "which values apply here" question and the "how do two + * transforms combine" question stay apart — they were fused in the code this replaces, which is why neither could + * be checked on its own. + */ +public final class DisplayPoses { + + private DisplayPoses() { + throw new UnsupportedOperationException("DisplayPoses is a utility class and cannot be instantiated."); + } + + /** + * The pose a Bedrock attachable slot should apply, before the anchor is composed in. + *

+ * The off hand is always mirrored, whether the model declared a left-hand entry or not, because that is + * what the Java client does. {@code ItemTransform.apply(leftHand, …)} negates the Y and Z rotation and the X + * translation for any left-hand context, on top of whichever entry {@code getTransform} selected — and + * a left-hand entry that is absent falls back to the right-hand one first. + *

+ * That is easy to get backwards, because vanilla's declared left-hand values are pre-negated to survive + * it: {@code item/handheld} writes {@code thirdperson_lefthand: [0,90,-55]} precisely so that the engine's + * negation turns it back into the right hand's {@code [0,-90,55]}. Emitting the declared value as-is, as this + * did, inverts the pose of every tool held in the off hand. + */ + public static Transform forSlot(AttachableSlot slot, Map display) { + return forSlot(slot, display, null); + } + + /** + * @param parent the model's {@code parent}, so a pose it declares nothing for falls back the way the client + * would. Without it a block-shaped item gets {@code item/generated}'s flat-sprite hand pose while + * its icon gets {@code block/block}'s three-quarter view — the two paths disagreeing by + * construction, which reads as "the inventory looks right and the hand does not". + */ + public static Transform forSlot(AttachableSlot slot, Map display, + String parent) { + String context = slot.javaContext(); + JavaBlockModel.DisplayTransform declared = display.get(context); + + // A left-hand context the model does not declare falls back to the right-hand one, before mirroring. + if (declared == null && slot.isOffHand()) { + declared = display.get(DisplayContext.mirrorOf(context)); + } + if (declared == null) declared = fromPresets(DisplayPresets.forParent(parent), slot, context); + if (declared == null) declared = fromPresets(DisplayPresets.generatedItem(), slot, context); + if (declared == null) return Transform.IDENTITY; + + Transform pose = toTransform(declared); + return slot.isOffHand() ? mirrored(pose) : pose; + } + + private static JavaBlockModel.DisplayTransform fromPresets( + Map presets, AttachableSlot slot, String context) { + JavaBlockModel.DisplayTransform preset = presets.get(context); + if (preset == null && slot.isOffHand()) { + preset = presets.get(DisplayContext.mirrorOf(context)); + } + return preset; + } + + /** + * The pose the inventory icon is drawn in. Falls back to {@code block/block}'s three-quarter view, which is + * what the client shows for a model with cubes and no GUI pose of its own. + */ + public static Transform guiPose(JavaBlockModel model) { + return model.display(DisplayContext.GUI) + .map(DisplayPoses::toTransform) + .orElseGet(() -> toTransform(DisplayPresets.block().get(DisplayContext.GUI))); + } + + /** Both pivots folded into the translation, so callers only ever handle a plain TRS. */ + public static Transform toTransform(JavaBlockModel.DisplayTransform display) { + return Transform.of(display.translation(), display.rotation(), display.scale()) + .withPivots(display.rotationPivot(), display.scalePivot()); + } + + /** The left-hand reading of a right-hand pose: rotation Y and Z negated, translation X negated. */ + private static Transform mirrored(Transform right) { + return new Transform( + new float[]{-right.translation()[0], right.translation()[1], right.translation()[2]}, + new float[]{right.rotation()[0], -right.rotation()[1], -right.rotation()[2]}, + right.scale().clone()); + } +} diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/display/HandAnchors.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/display/HandAnchors.java new file mode 100644 index 00000000..85a1211a --- /dev/null +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/display/HandAnchors.java @@ -0,0 +1,135 @@ +package fr.robie.craftengineconverter.converter.bedrock.display; + +import fr.robie.craftengineconverter.api.configuration.Configuration; +import fr.robie.craftengineconverter.api.configuration.ConfigurationKey; +import fr.robie.yamllibrary.ConfigurationSection; + +import java.util.List; + +/** + * Where the engine holds a custom item, before the model's own {@code display} transform is composed on top. + *

+ * This is the file — or now the {@code held-item-anchors} config block — to change when a pose is off in game. + * A pose is the composition of an anchor and the model's {@code display} entry (see {@link Transform}); everything + * else is derived, so an offset affecting every item is a wrong anchor and nothing else. + *

+ * The values are derived from vanilla's own attachables in the Bedrock resource pack, which is the only authoritative + * source: Bedrock has no {@code display} block for held items, so a pose is an animation whose position is an + * offset in the holder's {@code rightItem}/{@code leftItem} bone space. That is a different space from anything + * Blockbench's display mode shows, and getting the two confused is what put an earlier version of this file at + * {@code z = 20.8} — Blockbench's first-person screen position — which pushed every item out of view. + *

+ * The rule vanilla follows is that the Y lift and the bone pivot trade off against each other: + * {@code geometry.spear} has no bone pivot and lifts {@code 24} in its animation, while {@code geometry.trident} + * puts {@code 24} in the bone pivot and lifts {@code -2.5} — the same result. Reference points, all third-person: + *

    + *
  • {@code spyglass} — bone pivot {@code [0,0,0]}, cubes at Y {@code 0..2}, position {@code [1, 22, 0]}
  • + *
  • {@code spear} — no bone pivot, position {@code [0, 24, -27]}
  • + *
  • {@code trident} — bone pivot {@code [0,24,0]}, position {@code [1.5, -2.5, -10.5]}
  • + *
  • {@code shield} — rotation {@code [-90, 0, 90]}; {@code trident} is {@code [97, -1.5, -49]}
  • + *
+ * So an origin-authored model wants roughly {@code +22} in Y for the third person and {@code +24} for the first. + * Item geometry here spans Java's {@code 0..16} band, centred 8 units up, which is where the {@code 14} and + * {@code 16} below come from — and reassuringly the hand-tuned constant this codebase used to ship was {@code 13}. + *

+ * X and Z are zero because the bone binding already places the item at the hand; re-supplying the hand's own offset + * in player space double-counts it. Left-hand slots mirror X, which is nothing to configure. + */ +public final class HandAnchors { + + /** Third person, both hands. The {@code -90} pitch lays an upright-authored model into the hand. */ + private static final Transform DEFAULT_THIRD_PERSON = new Transform( + new float[]{0, 14, 0}, new float[]{-90, 0, 0}, new float[]{1, 1, 1}); + + /** First person, both hands. Vanilla lifts a little higher here than in the third person. */ + private static final Transform DEFAULT_FIRST_PERSON = new Transform( + new float[]{0, 16, 0}, new float[]{-90, 0, 0}, new float[]{1, 1, 1}); + + /** + * Worn on the head. Composes with {@code item/generated}'s own {@code translation [0,13,7]} and this + * {@code 0.625} to about {@code 28}, which is the constant that used to work. + */ + private static final Transform DEFAULT_HEAD = new Transform( + new float[]{0, 20, 0}, new float[]{0, 0, 0}, new float[]{0.625F, 0.625F, 0.625F}); + + /** + * The inventory slot, which needs no anchor of its own: Java renders an item into a fixed 16-unit box, so the + * model's own {@code display.gui} entry is the whole transform. + *

+ * This carried Blockbench's preview-frame scale of {@code 0.4}, which was invisible only because the icon + * renderer used to rescale each model to fill its sprite. Now that it maps one model unit to one sixteenth of + * the slot — see {@code ItemIconRenderer.rasterise} — anything but {@code 1} here shrinks every icon. + */ + public static final Transform GUI = new Transform( + new float[]{0, 0, 0}, new float[]{0, 0, 0}, new float[]{1, 1, 1}); + + private HandAnchors() { + throw new UnsupportedOperationException("HandAnchors is a utility class and cannot be instantiated."); + } + + /** The anchor for a slot, as configured. */ + public static Transform forSlot(AttachableSlot slot) { + return forSlot(slot, section(ConfigurationKey.HELD_ITEM_ANCHORS)); + } + + /** + * The anchor for a slot, reading overrides from the given {@code held-item-anchors} section — {@code null} for + * none. Left-hand slots mirror only the anchor's X, as vanilla's own off-hand poses do, so there is nothing + * separate to configure for the off hand. + */ + public static Transform forSlot(AttachableSlot slot, ConfigurationSection anchors) { + return switch (slot) { + case THIRD_PERSON_MAIN -> configured(anchors, "third-person", DEFAULT_THIRD_PERSON); + case THIRD_PERSON_OFF -> mirrorX(configured(anchors, "third-person", DEFAULT_THIRD_PERSON)); + case FIRST_PERSON_MAIN -> configured(anchors, "first-person", DEFAULT_FIRST_PERSON); + case FIRST_PERSON_OFF -> mirrorX(configured(anchors, "first-person", DEFAULT_FIRST_PERSON)); + case HEAD -> configured(anchors, "head", DEFAULT_HEAD); + }; + } + + /** + * The anchor as configured under {@code held-item-anchors.}, falling back per channel so a config + * naming only {@code translation} keeps the default rotation and scale rather than snapping them to zero. + */ + private static Transform configured(ConfigurationSection anchors, String key, Transform fallback) { + ConfigurationSection slot = anchors == null ? null : anchors.getConfigurationSection(key); + if (slot == null) return fallback; + + return new Transform( + triple(slot, "translation", fallback.translation()), + triple(slot, "rotation", fallback.rotation()), + triple(slot, "scale", fallback.scale())); + } + + /** + * Reading the config must never be able to break a conversion, so a value that is missing, the wrong shape or + * unreadable falls back rather than throwing — and Configuration is absent entirely in unit tests. + */ + private static ConfigurationSection section(ConfigurationKey key) { + try { + Object value = Configuration.get(key); + return value instanceof ConfigurationSection s ? s : null; + } catch (Exception | NoClassDefFoundError ignored) { + return null; + } + } + + private static float[] triple(ConfigurationSection slot, String key, float[] fallback) { + List values = slot.getFloatList(key); + if (values == null || values.size() < 3) return fallback.clone(); + + float[] triple = new float[3]; + for (int axis = 0; axis < 3; axis++) { + Float value = values.get(axis); + triple[axis] = value == null ? fallback[axis] : value; + } + return triple; + } + + private static Transform mirrorX(Transform anchor) { + return new Transform( + new float[]{-anchor.translation()[0], anchor.translation()[1], anchor.translation()[2]}, + anchor.rotation().clone(), + anchor.scale().clone()); + } +} diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/display/Transform.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/display/Transform.java new file mode 100644 index 00000000..ded280b1 --- /dev/null +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/display/Transform.java @@ -0,0 +1,294 @@ +package fr.robie.craftengineconverter.converter.bedrock.display; + +/** + * A translation, an XYZ Euler rotation in degrees, and a scale — the shape both Java's {@code display} block and + * Bedrock's bone animations are written in, and the shape Blockbench keeps a display slot in. + *

+ * The point of this class is composition. A pose is two transforms: where the engine puts the item (the + * hand, the head, the GUI camera) and what the model's {@code display} entry does to it. Those cannot be combined + * per-axis — rotating by A and then by B is not "add the angles", so any code that tries produces a pose that is + * right only while one of the two rotations is trivial. So the two are composed as 4×4 matrices and decomposed + * back, which is exactly what Blockbench's scene graph does when it parents the model under {@code display_base} + * under {@code display_area}. + *

+ * Conventions are ported from Blockbench rather than re-derived, because matching it is the whole point: + *

    + *
  • {@code M = T · R · S}, and {@code R = Rx · Ry · Rz} — three.js Euler order {@code XYZ} + * ({@code Matrix4.makeRotationFromEuler}). Applied to a point that runs Z first, which is also the order + * vanilla's {@code rotationXYZ} quaternion produces.
  • + *
  • Pivots are folded into the translation rather than modelled as a node — see {@link #withPivots}.
  • + *
  • The Java→Bedrock axis flip happens once, at the very end — see {@link #toBedrock()}.
  • + *
+ * Matrices are row-major {@code float[16]}, indexed {@code row * 4 + column}. + */ +public record Transform(float[] translation, float[] rotation, float[] scale) { + + public static final Transform IDENTITY = new Transform( + new float[]{0, 0, 0}, new float[]{0, 0, 0}, new float[]{1, 1, 1}); + + /** Pivots are written in blocks while everything else is in model units, so they scale by 16. */ + private static final float PIVOT_UNITS = 16.0F; + + public static Transform of(float[] translation, float[] rotation, float[] scale) { + return new Transform(translation.clone(), rotation.clone(), scale.clone()); + } + + /** A pure translation, in model units. */ + public static Transform translating(float x, float y, float z) { + return new Transform(new float[]{x, y, z}, new float[]{0, 0, 0}, new float[]{1, 1, 1}); + } + + /** {@code T · R · S}, row-major. */ + public float[] toMatrix() { + float[] m = rotationMatrix(this.rotation); + + // Scale post-multiplies, so it scales columns rather than rows. + for (int row = 0; row < 3; row++) { + for (int col = 0; col < 3; col++) { + m[row * 4 + col] *= this.scale[col]; + } + } + + m[3] = this.translation[0]; + m[7] = this.translation[1]; + m[11] = this.translation[2]; + m[15] = 1.0F; + return m; + } + + /** + * The inverse of {@link #toMatrix()}: translation from the last column, scale from the column lengths, and the + * Euler angles from what is left once the columns are normalised. + *

+ * A negative determinant means the matrix mirrors, which no rotation can express. Blockbench and three.js both + * put that sign on X, so a mirrored slot round-trips as a negative X scale — the same representation Blockbench + * writes out for a mirrored display slot. + */ + public static Transform fromMatrix(float[] m) { + float[] translation = {m[3], m[7], m[11]}; + + float sx = length(m[0], m[4], m[8]); + float sy = length(m[1], m[5], m[9]); + float sz = length(m[2], m[6], m[10]); + if (determinant(m) < 0) sx = -sx; + + float[] basis = new float[9]; + divideColumn(basis, m, 0, sx); + divideColumn(basis, m, 1, sy); + divideColumn(basis, m, 2, sz); + + return new Transform(translation, eulerXyz(basis), new float[]{sx, sy, sz}); + } + + /** {@code a · b} — {@code b} applied first. */ + public static Transform compose(Transform a, Transform b) { + return fromMatrix(multiply(a.toMatrix(), b.toMatrix())); + } + + /** + * Blockbench's two pivot corrections, from {@code DisplayMode.updateDisplayBase}. + *

+ * Neither pivot is a real node in Blockbench's scene graph; both are solved into the position instead. A + * rotation pivot is the offset the rotation moved that point by, subtracted back out + * ({@code position -= R·p - p}); a scale pivot is the rotated pivot weighted by how much the scale shrank each + * axis ({@code position += (R·q) ⊙ (1 - scale)}). + *

+ * The scale correction deliberately uses the scale as written, ignoring any mirror sign, and the two + * corrections are simply added — both are Blockbench's behaviour, and its source carries a + * {@code todo: Fix positions when both rotation pivot and scale pivot are used} against the combination. + */ + public Transform withPivots(float[] rotationPivot, float[] scalePivot) { + if (isZero(rotationPivot) && isZero(scalePivot)) return this; + + float[] basis = rotationMatrix(this.rotation); + float[] translated = this.translation.clone(); + + if (!isZero(rotationPivot)) { + float[] pivot = scaled(rotationPivot, PIVOT_UNITS); + float[] turned = rotate(basis, pivot); + for (int axis = 0; axis < 3; axis++) { + translated[axis] -= turned[axis] - pivot[axis]; + } + } + + if (!isZero(scalePivot)) { + float[] turned = rotate(basis, scaled(scalePivot, PIVOT_UNITS)); + for (int axis = 0; axis < 3; axis++) { + translated[axis] += turned[axis] * (1.0F - this.scale[axis]); + } + } + + return new Transform(translated, this.rotation.clone(), this.scale.clone()); + } + + /** + * The Java→Bedrock axis flip: position negates X, and the rotation is reflected. + *

+ * Blockbench states the rotation half of this as "negate the X and Y Euler angles" + * ({@code Keyframe.compileBedrockKeyframe}), and for a single hand-authored triple that is exactly right. It + * cannot be applied that way here, though, because negating Euler parameters is not a well-defined operation + * on a rotation — the answer depends on which of several equivalent triples you happen to hold. A composed + * pose has been through {@link #fromMatrix}, which returns whichever triple the decomposition produced. + *

+ * That is not hypothetical: Java's {@code item/handheld} third-person rotation is {@code [0,-90,55]}, and + * {@code Y = ±90} is the gimbal case, where X and Z collapse into one channel. The composed matrix decomposes + * to {@code (-145,-90,0)} where the authored form would be {@code (-90,-90,55)}; negating each triple's X and Y + * gives {@code (145,90,0)} and {@code (90,90,-55)}, which are different rotations. Every handheld tool + * came out mis-posed. + *

+ * So the reflection is applied to the matrix instead, as the conjugation {@code M · R · M} with + * {@code M = diag(1,1,-1)}. A conjugation is a change of basis: independent of parameterisation, and + * compositional ({@code M(AB)M = (MAM)(MBM)}). It also agrees with Blockbench term for term, because + * conjugating by that mirror maps {@code Rx(a) → Rx(-a)}, {@code Ry(b) → Ry(-b)} and leaves {@code Rz} alone. + * The mirror is the Z axis rather than the X one because Bedrock also views the model from the opposite side, + * and an X mirror composed with that half-turn is a Z mirror: {@code Ry(180) · diag(-1,1,1) = diag(1,1,-1)}. + *

+ * Translation keeps its own separate X negation, which is Blockbench's rule and is not a conjugation — the two + * channels genuinely flip differently. + */ + public Transform toBedrock() { + float[] reflected = reflectZ(rotationMatrix(this.rotation)); + return new Transform( + new float[]{-this.translation[0], this.translation[1], this.translation[2]}, + eulerXyz(basisOf(reflected)), + this.scale.clone()); + } + + /** + * {@code M · R · M} for {@code M = diag(1,1,-1)} — which negates exactly those entries of the 3x3 where the Z + * row and the Z column do not both apply, i.e. row 2 and column 2 each flip sign and the {@code [2][2]} entry + * flips twice and so stays. + */ + private static float[] reflectZ(float[] m) { + float[] out = m.clone(); + for (int row = 0; row < 3; row++) { + for (int col = 0; col < 3; col++) { + boolean flips = (row == 2) ^ (col == 2); + if (flips) out[row * 4 + col] = -out[row * 4 + col]; + } + } + return out; + } + + /** The 3x3 rotation part of a row-major 4x4, as the row-major 3x3 {@link #eulerXyz} expects. */ + private static float[] basisOf(float[] m) { + return new float[]{ + m[0], m[1], m[2], + m[4], m[5], m[6], + m[8], m[9], m[10] + }; + } + + /** Transforms a point in place by {@code T · R · S}. */ + public void applyTo(float[] point) { + float[] m = this.toMatrix(); + float x = point[0], y = point[1], z = point[2]; + point[0] = m[0] * x + m[1] * y + m[2] * z + m[3]; + point[1] = m[4] * x + m[5] * y + m[6] * z + m[7]; + point[2] = m[8] * x + m[9] * y + m[10] * z + m[11]; + } + + public boolean isIdentity() { + return isZero(this.translation) && isZero(this.rotation) + && this.scale[0] == 1.0F && this.scale[1] == 1.0F && this.scale[2] == 1.0F; + } + + // ---------------------------------------------------------------- matrix internals + + /** + * {@code Rx · Ry · Rz} as a row-major 4×4, expanded rather than built from three multiplies so it matches + * three.js's {@code makeRotationFromEuler} term for term. + */ + private static float[] rotationMatrix(float[] degrees) { + double x = Math.toRadians(degrees[0]); + double y = Math.toRadians(degrees[1]); + double z = Math.toRadians(degrees[2]); + + double a = Math.cos(x), b = Math.sin(x); + double c = Math.cos(y), d = Math.sin(y); + double e = Math.cos(z), f = Math.sin(z); + + float[] m = new float[16]; + m[0] = (float) (c * e); + m[1] = (float) (-c * f); + m[2] = (float) d; + m[4] = (float) (a * f + b * d * e); + m[5] = (float) (a * e - b * d * f); + m[6] = (float) (-b * c); + m[8] = (float) (b * f - a * d * e); + m[9] = (float) (b * e + a * d * f); + m[10] = (float) (a * c); + m[15] = 1.0F; + return m; + } + + /** + * Euler angles from a normalised basis, as three.js {@code Euler.setFromRotationMatrix} order {@code XYZ} + * does it. The {@code 0.9999999} branch is the gimbal case: when Y is a quarter turn, X and Z describe the + * same rotation and only their sum is determined, so Z is pinned to zero. + */ + private static float[] eulerXyz(float[] basis) { + float m02 = basis[2]; + double y = Math.asin(Math.max(-1.0, Math.min(1.0, m02))); + double x; + double z; + if (Math.abs(m02) < 0.9999999) { + x = Math.atan2(-basis[5], basis[8]); + z = Math.atan2(-basis[1], basis[0]); + } else { + x = Math.atan2(basis[7], basis[4]); + z = 0; + } + return new float[]{(float) Math.toDegrees(x), (float) Math.toDegrees(y), (float) Math.toDegrees(z)}; + } + + private static float[] multiply(float[] a, float[] b) { + float[] out = new float[16]; + for (int row = 0; row < 4; row++) { + for (int col = 0; col < 4; col++) { + float sum = 0; + for (int k = 0; k < 4; k++) { + sum += a[row * 4 + k] * b[k * 4 + col]; + } + out[row * 4 + col] = sum; + } + } + return out; + } + + /** Rotates a vector by the 3×3 part of a row-major matrix. */ + private static float[] rotate(float[] m, float[] v) { + return new float[]{ + m[0] * v[0] + m[1] * v[1] + m[2] * v[2], + m[4] * v[0] + m[5] * v[1] + m[6] * v[2], + m[8] * v[0] + m[9] * v[1] + m[10] * v[2] + }; + } + + /** The 3×3 determinant, which only its sign is wanted for. */ + private static float determinant(float[] m) { + return m[0] * (m[5] * m[10] - m[6] * m[9]) + - m[1] * (m[4] * m[10] - m[6] * m[8]) + + m[2] * (m[4] * m[9] - m[5] * m[8]); + } + + /** Writes column {@code col} of the 4×4 {@code m}, divided by {@code by}, into the 3×3 {@code basis}. */ + private static void divideColumn(float[] basis, float[] m, int col, float by) { + float divisor = by == 0 ? 1.0F : by; + basis[col] = m[col] / divisor; + basis[3 + col] = m[4 + col] / divisor; + basis[6 + col] = m[8 + col] / divisor; + } + + private static float length(float x, float y, float z) { + return (float) Math.sqrt(x * x + y * y + z * z); + } + + private static float[] scaled(float[] v, float by) { + return new float[]{v[0] * by, v[1] * by, v[2] * by}; + } + + private static boolean isZero(float[] v) { + return v[0] == 0 && v[1] == 0 && v[2] == 0; + } +} diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/item/ConfigFactoryExpander.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/item/ConfigFactoryExpander.java new file mode 100644 index 00000000..120b7282 --- /dev/null +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/item/ConfigFactoryExpander.java @@ -0,0 +1,180 @@ +package fr.robie.craftengineconverter.converter.bedrock.item; + +import fr.robie.craftengineconverter.api.configuration.template.TemplateArgument; +import fr.robie.craftengineconverter.api.configuration.template.TemplateEngine; +import fr.robie.craftengineconverter.api.configuration.template.TemplateException; +import fr.robie.messageflow.logger.Logger; +import org.jetbrains.annotations.NotNull; + +import java.util.*; + +/** + * Expands CraftEngine {@code config_factory} sections into the config they stand for. + *

+ * A factory declares a blueprint once and a list of instances, and CraftEngine runs the blueprint per + * instance with that instance's values bound as template arguments. It is how a whole family of content is + * declared in one place: + *

+ * config_factory#basic:
+ *   instances:
+ *     - namespace: default
+ *       tree_type: palm
+ *   blueprint:
+ *     items:
+ *       ${namespace}:${tree_type}_log: { ... }
+ * 
+ * One such factory generates roughly twenty ids — {@code default:palm_log}, {@code default:palm_planks}, + * {@code default:palm_door} and so on. Nothing declares them literally, so a converter that reads only + * literal {@code items:} sections sees none of them: the resource pack ships their models and textures, and + * the items simply never appear. + *

+ * Mirrors {@code AbstractPackManager.ConfigFactoryParser}, including its alias spellings, and runs after + * templates are loaded — CraftEngine states that dependency explicitly + * ({@code dependencies() == [LoadingStages.TEMPLATE]}), because a blueprint routinely uses templates. + */ +public final class ConfigFactoryExpander { + + // Every spelling CraftEngine accepts, so a pack written against any of them converts. + private static final Set FACTORY_SECTIONS = + Set.of("config-factory", "config_factory", "config-factories", "config_factories"); + private static final List BLUEPRINT_KEYS = List.of("blueprint", "prototype", "schema"); + private static final List INSTANCE_KEYS = List.of("instances", "instance", "inputs", "input"); + + // A blueprint may itself contain a factory — tree.yml nests config_factory#extra inside one — so + // expansion recurses. Bounded in case a pack ever references itself. + private static final int MAX_DEPTH = 8; + + private final TemplateEngine templates; + + public ConfigFactoryExpander(@NotNull TemplateEngine templates) { + this.templates = templates; + } + + /** True if this top-level key declares a factory. The part after {@code #} is only a label. */ + public static boolean isFactoryKey(@NotNull String key) { + return FACTORY_SECTIONS.contains(sectionType(key)); + } + + /** + * The section type a top-level key denotes. + *

+ * CraftEngine takes everything before a {@code #} as the type, which lets one file hold several + * sections of the same kind — {@code config_factory#basic} beside {@code config_factory#extra}. + */ + @NotNull + public static String sectionType(@NotNull String key) { + int hash = key.indexOf('#'); + return hash < 0 ? key : key.substring(0, hash); + } + + /** + * Expands every factory in a file's top-level map. + * + * @return section type (for example {@code items}) to the expanded section bodies, one per instance + */ + @NotNull + public Map>> expand(@NotNull Map topLevel) { + Map>> out = new LinkedHashMap<>(); + this.expandInto(topLevel, out, 0); + return out; + } + + private void expandInto(Map topLevel, Map>> out, int depth) { + if (depth > MAX_DEPTH) { + Logger.warn("config_factory nesting deeper than " + MAX_DEPTH + " levels - giving up"); + return; + } + + for (Map.Entry entry : topLevel.entrySet()) { + if (!isFactoryKey(entry.getKey())) { + // A factory is routinely written inside a version gate — tree.yml puts its slab/stairs + // factory under "$$>=1.20.3". The YAML layer does not resolve that gate away, and because + // '.' is the config path separator the key arrives split into nested sections + // ($$>=1 -> 20 -> 3 -> config_factory#extra). Descending through those fragments is what + // finds it; nothing else is followed, so a factory inside a blueprint is left to the + // blueprint handling below. + if (looksLikeVersionGateFragment(entry.getKey()) && entry.getValue() instanceof Map nested) { + this.expandInto(castToStringMap(nested), out, depth + 1); + } + continue; + } + if (!(entry.getValue() instanceof Map factory)) continue; + + Map body = castToStringMap(factory); + Object blueprint = firstPresent(body, BLUEPRINT_KEYS); + Object instances = firstPresent(body, INSTANCE_KEYS); + if (!(blueprint instanceof Map blueprintMap) || instances == null) { + Logger.warn("Factory '" + entry.getKey() + "' has no usable blueprint/instances - skipping"); + continue; + } + + for (Object rawInstance : asList(instances)) { + if (!(rawInstance instanceof Map instanceMap)) continue; + + // The instance's own entries become the arguments the blueprint is resolved against. + Map arguments = new LinkedHashMap<>(); + for (Map.Entry argument : instanceMap.entrySet()) { + arguments.put(String.valueOf(argument.getKey()), + TemplateArgument.fromValue(argument.getValue())); + } + + for (Map.Entry section : blueprintMap.entrySet()) { + String sectionKey = String.valueOf(section.getKey()); + if (section.getValue() == null) continue; + + Object resolved; + try { + resolved = this.templates.resolve(section.getValue(), arguments); + } catch (TemplateException e) { + Logger.warn("Factory '" + entry.getKey() + "' could not expand its '" + sectionKey + + "' section: " + e.getMessage()); + continue; + } + if (!(resolved instanceof Map resolvedMap)) continue; + Map resolvedSection = castToStringMap(resolvedMap); + + // A blueprint entry can be another factory; expand it with the outer values applied. + if (isFactoryKey(sectionKey)) { + this.expandInto(Map.of(sectionKey, resolvedSection), out, depth + 1); + continue; + } + out.computeIfAbsent(sectionType(sectionKey), k -> new ArrayList<>()).add(resolvedSection); + } + } + } + } + + /** + * Whether a key is part of an unresolved {@code $$}-prefixed version gate. + *

+ * Either the gate itself ({@code $$>=1}) or one of the numeric fragments it was split into ({@code 20}, + * {@code 3}). Deliberately narrow: only these are followed, so ordinary config is never mistaken for a + * container of factories. + */ + private static boolean looksLikeVersionGateFragment(String key) { + if (key.startsWith("$$")) return true; + if (key.isEmpty()) return false; + for (int i = 0; i < key.length(); i++) { + if (!Character.isDigit(key.charAt(i))) return false; + } + return true; + } + + private static Object firstPresent(Map body, List aliases) { + for (String alias : aliases) { + Object value = body.get(alias); + if (value != null) return value; + } + return null; + } + + /** Accepts a single instance written without a list, as CraftEngine's {@code instance} alias allows. */ + private static List asList(Object value) { + return value instanceof List list ? list : List.of(value); + } + + @SuppressWarnings("unchecked") + private static Map castToStringMap(Map map) { + return (Map) map; + } +} diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/item/EquipmentAssetRegistry.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/item/EquipmentAssetRegistry.java new file mode 100644 index 00000000..14f6e9ea --- /dev/null +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/item/EquipmentAssetRegistry.java @@ -0,0 +1,118 @@ +package fr.robie.craftengineconverter.converter.bedrock.item; + +import fr.robie.messageflow.logger.Logger; +import fr.robie.yamllibrary.ConfigurationSection; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.nio.file.Path; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Optional; + +/** + * Maps a CraftEngine equipment asset id to the armour textures that go on the worn model. + *

+ * An armour item names its asset through {@code settings.equipment.asset_id} rather than carrying the + * textures itself, and the top-level {@code equipments:} block resolves that id: + *

+ * equipments:
+ *   default:topaz:
+ *     humanoid: minecraft:entity/equipment/humanoid/topaz
+ *     humanoid_leggings: minecraft:entity/equipment/humanoid_leggings/topaz
+ * 
+ * These are the textures Bedrock needs for the armour attachable — the item icon is a different image and + * looks wrong stretched over a humanoid model. Nothing else on the CraftEngine-to-Bedrock path reads this + * section; only the reverse converters do. + *

+ * The block is normally split into {@code $$>=1.21.2} ({@code type: component}) and {@code $$<1.21.2} + * ({@code type: trim}) variants. Both carry the same texture references, so whichever the version directive + * selects gives the same answer and {@code type} can be ignored. + *

+ * Java splits armour across two textures, matching Bedrock exactly: {@code humanoid} covers the helmet, + * chestplate and boots (Bedrock's layer 1), {@code humanoid_leggings} covers the leggings (layer 2). + */ +public final class EquipmentAssetRegistry { + + /** + * One equipment asset. + * + * @param humanoid layer-1 texture reference — helmet, chestplate, boots + * @param leggings layer-2 texture reference — leggings only + * @param javaAssetsDir the assets root this was found under, captured because the context's assets dir + * is reassigned for every pack layer + */ + public record EquipmentAsset(String id, @Nullable String humanoid, @Nullable String leggings, + @Nullable Path javaAssetsDir) { + + /** The texture for a wearable slot, or {@code null} when this asset does not cover it. */ + @Nullable + public String textureFor(String slot) { + return "legs".equals(slot) ? this.leggings : this.humanoid; + } + + /** Bedrock's armour textures are numbered by layer; leggings are the odd one out. */ + public int layerFor(String slot) { + return "legs".equals(slot) ? 2 : 1; + } + } + + private final Map assets = new LinkedHashMap<>(); + + /** + * Reads an {@code equipments:} section. Called once per config file during the same pass that collects + * templates, since an item and the asset it names need not share a file. + */ + public void addFromEquipmentsSection(@NotNull ConfigurationSection equipments, @Nullable Path javaAssetsDir) { + this.collect(equipments, javaAssetsDir, 0); + } + + /** + * Walks the section looking for anything shaped like an equipment asset, rather than assuming assets sit + * exactly one level down. + *

+ * The block is normally wrapped in {@code $$>=1.21.2} / {@code $$<1.21.2} variants that the YAML layer is + * expected to resolve away. It currently does not: the key survives literally, and because {@code .} is + * the config path separator {@code $$>=1.21.2} is then split into nested sections + * ({@code $$>=1} → {@code 21} → {@code 2} → the asset). Recognising an asset by its own shape works + * either way, so armour converts whether or not the gate is applied. + *

+ * Both variants carry identical {@code humanoid} references — they differ only in {@code type} + * ({@code component} vs {@code trim}), which Bedrock does not care about — so collapsing them is safe. + * Later wins, giving a deterministic result. + */ + private void collect(ConfigurationSection section, @Nullable Path javaAssetsDir, int depth) { + if (depth > 6) return; // Guards against a pathological config; real nesting is 1-4 deep. + + for (String key : section.getKeys(false)) { + ConfigurationSection child = section.getConfigurationSection(key); + if (child == null) continue; + + String humanoid = child.getString("humanoid"); + String leggings = child.getString("humanoid_leggings"); + if (humanoid != null || leggings != null) { + this.assets.put(key, new EquipmentAsset(key, humanoid, leggings, javaAssetsDir)); + continue; + } + this.collect(child, javaAssetsDir, depth + 1); + } + } + + public Optional get(@Nullable String assetId) { + return assetId == null ? Optional.empty() : Optional.ofNullable(this.assets.get(assetId)); + } + + public boolean isEmpty() { + return this.assets.isEmpty(); + } + + public int size() { + return this.assets.size(); + } + + /** Logs what was collected, so a missing asset is diagnosable from the conversion output. */ + public void logSummary() { + if (this.assets.isEmpty()) return; + Logger.info("Found " + this.assets.size() + " equipment asset(s): " + String.join(", ", this.assets.keySet())); + } +} diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/item/ItemModelDefinitionMapper.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/item/ItemModelDefinitionMapper.java new file mode 100644 index 00000000..19ae07eb --- /dev/null +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/item/ItemModelDefinitionMapper.java @@ -0,0 +1,102 @@ +package fr.robie.craftengineconverter.converter.bedrock.item; + +import fr.robie.craftengineconverter.api.configuration.item.models.ModelConfiguration; +import fr.robie.craftengineconverter.api.configuration.loader.JsonConfigurationAdapter; +import fr.robie.craftengineconverter.api.configuration.loader.models.ModelConfigurationRegistry; +import fr.robie.craftengineconverter.api.manager.FileCacheManager; +import fr.robie.messageflow.logger.Logger; + +import java.io.File; +import java.nio.file.Path; +import java.util.*; + +/** + * Accumulates Java item model definitions from {@code assets//items/}. + *

+ * Since Java 1.21.4 an item's appearance is described by one of these files rather than by a model + * override list, and Geyser's v2 mapping format is built around the same concept: a definition maps a + * Java item plus an item model to one Bedrock item. The identifier is the file's path relative to + * {@code items/} without its extension, so {@code items/topaz_bow.json} is {@code :topaz_bow} and + * {@code items/tools/drill.json} is {@code :tools/drill} — the same value a server puts in an item + * stack's {@code minecraft:item_model} component. + *

+ * The {@code model} object is handed to the existing {@link ModelConfigurationRegistry} through + * {@link JsonConfigurationAdapter}, so the whole condition / select / range_dispatch loader tree is + * reused rather than reimplemented for JSON. + *

+ * These files carry appearance only — notably not the base Java item, which exists solely in + * CraftEngine's YAML {@code material:} key. A definition here is therefore useless on its own; it has + * to be joined against an item config to know which Java item to file it under. + */ +public final class ItemModelDefinitionMapper { + + /** + * One parsed item model definition. + * + * @param identifier {@code :}, matching a {@code minecraft:item_model} value + * @param model the parsed model tree, or {@code null} when the type has no loader + * @param oversizedInGui Java's {@code oversized_in_gui} flag; no Bedrock equivalent, kept for logging + * @param javaAssetsDir the assets root this was found under — captured per entry because the + * context's assets dir is reassigned for every pack layer + */ + public record ItemDefinition(String identifier, ModelConfiguration model, + boolean oversizedInGui, Path javaAssetsDir) {} + + // Insertion-ordered so output stays deterministic; a later pack layer claiming the same + // identifier replaces the earlier one, matching the last-write-wins rule the other mappers use. + private final Map definitions = new LinkedHashMap<>(); + + public void addFromItemsDirectory(File itemsDir, String namespace, Path javaAssetsDir) { + this.scan(itemsDir, namespace, "", javaAssetsDir); + } + + // Recursive: items/ may nest, and a nested path is part of the identifier. + private void scan(File dir, String namespace, String prefix, Path javaAssetsDir) { + File[] files = dir.listFiles(); + if (files == null) return; + + // listFiles() order is unspecified; sort so the output is reproducible. + Arrays.sort(files, Comparator.comparing(File::getName)); + + for (File file : files) { + if (file.isDirectory()) { + this.scan(file, namespace, prefix + file.getName() + "/", javaAssetsDir); + continue; + } + if (!file.isFile() || !file.getName().endsWith(".json")) continue; + + String name = file.getName().substring(0, file.getName().length() - ".json".length()); + String identifier = namespace + ":" + prefix + name; + + FileCacheManager.getJsonCache().getData(file.toPath()).ifPresent(root -> { + if (!root.has("model") || !root.get("model").isJsonObject()) return; + + ModelConfiguration model = ModelConfigurationRegistry.load( + JsonConfigurationAdapter.toSection(root.getAsJsonObject("model"))); + if (model == null) { + // An unregistered type — "special" (player_head, banner, ...) has no loader at all. + Logger.warn("Item model definition " + identifier + + " uses an unsupported model type and will fall back to a plain definition"); + } + + boolean oversized = root.has("oversized_in_gui") + && root.get("oversized_in_gui").getAsBoolean(); + this.definitions.put(identifier, + new ItemDefinition(identifier, model, oversized, javaAssetsDir)); + }); + } + } + + /** The definition for a {@code minecraft:item_model} value, if this pack declares one. */ + public Optional get(String identifier) { + return Optional.ofNullable(this.definitions.get(identifier)); + } + + public boolean isEmpty() { + return this.definitions.isEmpty(); + } + + public int size() { + return this.definitions.size(); + } +} From acd200211ae4f7c8d54c844cacd47ba3bb502010 Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Wed, 5 Aug 2026 16:00:58 +0200 Subject: [PATCH 053/116] feat: implement item icon rendering and texture tinting for Bedrock conversion --- .../bedrock/icon/ItemIconRenderer.java | 428 ++++++++++++++++++ .../bedrock/icon/ModelTextureTinter.java | 134 ++++++ 2 files changed, 562 insertions(+) create mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/icon/ItemIconRenderer.java create mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/icon/ModelTextureTinter.java diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/icon/ItemIconRenderer.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/icon/ItemIconRenderer.java new file mode 100644 index 00000000..6e1f4dba --- /dev/null +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/icon/ItemIconRenderer.java @@ -0,0 +1,428 @@ +package fr.robie.craftengineconverter.converter.bedrock.icon; + +import fr.robie.craftengineconverter.converter.bedrock.display.DisplayPoses; +import fr.robie.craftengineconverter.converter.bedrock.display.HandAnchors; +import fr.robie.craftengineconverter.converter.bedrock.display.Transform; +import fr.robie.craftengineconverter.converter.bedrock.geometry.JavaBlockModel; + +import java.awt.image.BufferedImage; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.function.Function; + +/** + * Draws a Java item model into a flat inventory-icon sprite. + *

+ * Bedrock has no way to render geometry into an inventory slot: a custom item's icon is a sprite named by + * {@code bedrock_options.icon}, and attachables only cover the held and equipped render. Java has the opposite + * arrangement — an item whose model has {@code elements} ships no icon file at all, because the client + * renders one live from the cubes using the model's {@code display.gui} pose. Copying the model's texture in + * its place shows the raw UV atlas, which is a sheet of unwrapped faces rather than a picture of the item. + *

+ * So the icon has to be rendered here, once, at conversion time. This is a deliberately small rasteriser: + * every face of every cube is a flat quad with a known texture rectangle, so it needs a transform, an + * orthographic projection, a depth buffer and nearest-neighbour sampling — no shading model, no perspective, + * no dependency beyond {@code java.awt}. + *

+ * Nearest-neighbour is not a shortcut but a requirement: interpolating between texels turns pixel art into + * mush at these sizes. + */ +public final class ItemIconRenderer { + + /** + * How Java shades a face by which way it points. Flat colour per direction rather than a real light — + * enough to read as three-dimensional, which a single unshaded silhouette does not. + */ + private static float shadeOf(String direction) { + return switch (direction) { + case "up" -> 1.0F; + case "down" -> 0.5F; + case "north", "south" -> 0.8F; + default -> 0.6F; + }; + } + + /** + * The point a {@code display} transform turns the model about. + *

+ * Java applies the transform and then shifts the model by half a block, so the pivot is model coordinate + * {@code (8, 8, 8)} — the centre. The same reasoning fixes the held item's bone pivot in + * {@code GeometryMapper}, which is what keeps the icon and the held model agreeing. + */ + private static final float MODEL_CENTRE = 8.0F; + + private final Function textureLoader; + + /** + * @param textureLoader resolves a Java texture reference ({@code item/custom/sofa}) to its image, or + * {@code null} when it cannot be found — a face with no texture is simply not drawn + */ + public ItemIconRenderer(Function textureLoader) { + this.textureLoader = textureLoader; + } + + /** + * @param model a model with {@code elements}; one without has nothing to render and should keep using its + * own texture as the sprite + * @param tints tint colours by {@code tintindex}, as 24-bit RGB; a face whose index is absent is untinted + * @param size output width and height in pixels + * @return the sprite, or {@code null} when nothing was drawn (no elements, or no texture resolved) + */ + public BufferedImage render(JavaBlockModel model, Map tints, int size) { + if (model == null || model.elements().isEmpty() || size <= 0) return null; + + boolean frontLit = model.guiLightFront(); + + List quads = new ArrayList<>(); + for (JavaBlockModel.Element element : model.elements()) { + this.collectQuads(element, model, frontLit, quads); + } + if (quads.isEmpty()) return null; + + // The same composition the held item's pose animation uses — the inventory camera's reference frame + // combined with the model's own gui entry — so an icon and a held model can never disagree about what + // the model's display block meant. + Transform gui = Transform.compose(HandAnchors.GUI, DisplayPoses.guiPose(model)); + for (Quad quad : quads) { + for (float[] corner : quad.corners) { + corner[0] -= MODEL_CENTRE; + corner[1] -= MODEL_CENTRE; + corner[2] -= MODEL_CENTRE; + gui.applyTo(corner); + } + } + + return rasterise(quads, tints, size); + } + + // ---------------------------------------------------------------- geometry + + /** + * One quad per declared face. Faces are built from the cube's corners in Java model space, so a face that + * the model does not declare leaves a hole exactly as it does in game. + */ + private void collectQuads(JavaBlockModel.Element element, JavaBlockModel model, boolean frontLit, + List out) { + // An element written with from > to is inside-out and the client does not draw it, which packs rely on: + // the globe hides its Earth cube inside two inverted shells, and treating them as solid boxes replaces + // the Earth with a plain blue ball. + // + // The winding cull in rasterise does not catch this, and it is worth saying why. Inverting all three axes + // mirrors each face along both of its own axes, which is a 180-degree turn in the face's plane — winding + // preserved. So the faces still look front-facing; what actually changes is that each one sits where its + // opposite should be. Cheaper and clearer to reject the element outright. + if (element.fromX() > element.toX() + || element.fromY() > element.toY() + || element.fromZ() > element.toZ()) { + return; + } + + float x0 = element.fromX(); + float y0 = element.fromY(); + float z0 = element.fromZ(); + float x1 = element.toX(); + float y1 = element.toY(); + float z1 = element.toZ(); + + for (JavaBlockModel.Face face : element.faces()) { + String reference = resolveTextureReference(face.texture(), model); + if (reference == null) continue; + BufferedImage texture = this.textureLoader.apply(reference); + if (texture == null) continue; + + // Corners in the order (u0,v0) (u1,v0) (u1,v1) (u0,v1), so UV interpolation is a plain bilinear + // walk over the quad regardless of which way the face points. + float[][] corners = switch (face.direction()) { + case "north" -> new float[][]{{x1, y1, z0}, {x0, y1, z0}, {x0, y0, z0}, {x1, y0, z0}}; + case "south" -> new float[][]{{x0, y1, z1}, {x1, y1, z1}, {x1, y0, z1}, {x0, y0, z1}}; + case "west" -> new float[][]{{x0, y1, z0}, {x0, y1, z1}, {x0, y0, z1}, {x0, y0, z0}}; + case "east" -> new float[][]{{x1, y1, z1}, {x1, y1, z0}, {x1, y0, z0}, {x1, y0, z1}}; + case "up" -> new float[][]{{x0, y1, z0}, {x1, y1, z0}, {x1, y1, z1}, {x0, y1, z1}}; + case "down" -> new float[][]{{x0, y0, z1}, {x1, y0, z1}, {x1, y0, z0}, {x0, y0, z0}}; + default -> null; + }; + if (corners == null) continue; + + element.rotation().ifPresent(rotation -> { + for (float[] corner : corners) rotateAbout(corner, rotation); + }); + + float shade = (frontLit || !element.shade()) ? 1.0F : shadeOf(face.direction()); + out.add(new Quad(corners, face, texture, shade)); + } + } + + /** + * A face names its texture as a variable — {@code "#0"} — which the model's {@code textures} map binds to a + * real reference. The binding may itself be another variable, so follow the chain, bounded in case a pack + * declares a cycle. + * + * @return the resolved reference, or {@code null} when the variable was never bound + */ + private static String resolveTextureReference(String texture, JavaBlockModel model) { + String reference = texture; + for (int hop = 0; hop < 8 && reference != null && reference.startsWith("#"); hop++) { + reference = model.textures().get(reference.substring(1)); + } + return reference == null || reference.startsWith("#") ? null : reference; + } + + /** A Java element rotation: one angle about one axis, through an origin in model units. */ + private static void rotateAbout(float[] point, JavaBlockModel.Element.ElementRotation rotation) { + double radians = Math.toRadians(rotation.angle()); + double cos = Math.cos(radians); + double sin = Math.sin(radians); + + float px = point[0] - rotation.ox(); + float py = point[1] - rotation.oy(); + float pz = point[2] - rotation.oz(); + + // "rescale" stretches the cube so a 22.5/45 degree rotation still meets the block grid. + double scale = rotation.rescale() + ? 1.0 / Math.cos(Math.abs(radians) > Math.PI / 4 ? Math.PI / 4 : radians) + : 1.0; + + switch (rotation.axis()) { + case "x" -> { + double y = py * cos - pz * sin; + double z = py * sin + pz * cos; + py = (float) (y * scale); + pz = (float) (z * scale); + } + case "y" -> { + double x = px * cos + pz * sin; + double z = -px * sin + pz * cos; + px = (float) (x * scale); + pz = (float) (z * scale); + } + case "z" -> { + double x = px * cos - py * sin; + double y = px * sin + py * cos; + px = (float) (x * scale); + py = (float) (y * scale); + } + default -> { + return; + } + } + + point[0] = px + rotation.ox(); + point[1] = py + rotation.oy(); + point[2] = pz + rotation.oz(); + } + + // ---------------------------------------------------------------- raster + + /** + * Scan-converts every quad into the sprite, keeping the nearest fragment per pixel. + *

+ * The sprite is Java's inventory slot, at whatever resolution was asked for: the client renders an item + * with {@code scale(16, -16, 16)} into a 16×16 slot, so one model unit is one sixteenth of the slot however big + * the model is. Reproducing that exactly is what makes a seed look like a seed next to a block — this used to + * scale each model to fill its own sprite, which is why every item came out the same apparent size whatever + * {@code display.gui} said. + *

+ * A model wider than 16 units therefore clips, and that is faithful rather than a shortcut: Java crops + * the slot too, with real clip planes at a ±3.2-unit box since 1.21.6. {@link #fillTriangle} already clamps its + * span to the sprite, so nothing here has to guard against it. + */ + private static BufferedImage rasterise(List quads, Map tints, int size) { + if (quads.isEmpty()) return null; + + // One model unit to one sixteenth of the slot. The corners arrive centred on the origin — render() + // subtracts the model centre and never adds it back — so the sprite centre is the origin. + float pixelsPerUnit = size / JavaBlockModel.UV_SPACE; + float centre = size / 2.0F; + + // Every fragment is kept rather than just the nearest, because a face may be semi-transparent — the + // globe's glass, stained glass, anything with an alpha ramp — and Java blends those. Discarding what is + // behind them, as a plain depth buffer does, would turn a translucent surface opaque. + List[] buffer = newFragmentBuffer(size * size); + + for (Quad quad : quads) { + // Screen coordinates: x right, y down (model y is up, so it flips). + float[][] screen = new float[4][3]; + for (int i = 0; i < 4; i++) { + screen[i][0] = centre + quad.corners[i][0] * pixelsPerUnit; + screen[i][1] = centre - quad.corners[i][1] * pixelsPerUnit; + screen[i][2] = quad.corners[i][2]; + } + if (isBackFacing(screen)) continue; + fillQuad(buffer, size, screen, quad, tints); + } + + BufferedImage image = new BufferedImage(size, size, BufferedImage.TYPE_INT_ARGB); + for (int pixel = 0; pixel < buffer.length; pixel++) { + List fragments = buffer[pixel]; + if (fragments == null) continue; + + // Far to near, so nearer fragments composite over what they cover. + fragments.sort(java.util.Comparator.comparingDouble(fragment -> fragment.z)); + int argb = 0; + for (Fragment fragment : fragments) argb = over(fragment.argb, argb); + image.setRGB(pixel % size, pixel / size, argb); + } + + return image; + } + + @SuppressWarnings("unchecked") + private static List[] newFragmentBuffer(int pixels) { + return new List[pixels]; + } + + /** + * Whether a projected quad is turned away from the viewer, from the sign of its screen-space area. + *

+ * Every face is built corner-ordered top-left, top-right, bottom-right, bottom-left as seen from + * outside, so a face pointing away winds the other way and this one test covers all six directions. + *

+ * What it buys: a zero-thickness element — the flat brim of a cap — stops drawing its dark underside on top + * of its lit upper face, which looked like grime, and no face is ever drawn twice. + */ + private static boolean isBackFacing(float[][] screen) { + float area = 0; + for (int i = 0; i < 4; i++) { + float[] a = screen[i]; + float[] b = screen[(i + 1) % 4]; + area += a[0] * b[1] - b[0] * a[1]; + } + return area <= 0; + } + + /** Source-over: {@code src} drawn on top of {@code dst}, both non-premultiplied ARGB. */ + private static int over(int src, int dst) { + int srcAlpha = src >>> 24; + if (srcAlpha == 255 || (dst >>> 24) == 0) return src; + if (srcAlpha == 0) return dst; + + float a = srcAlpha / 255.0F; + int dstAlpha = dst >>> 24; + float outAlpha = a + (dstAlpha / 255.0F) * (1 - a); + if (outAlpha <= 0) return 0; + + return (Math.round(outAlpha * 255) << 24) + | (blend((src >> 16) & 0xFF, (dst >> 16) & 0xFF, a, dstAlpha / 255.0F, outAlpha) << 16) + | (blend((src >> 8) & 0xFF, (dst >> 8) & 0xFF, a, dstAlpha / 255.0F, outAlpha) << 8) + | blend(src & 0xFF, dst & 0xFF, a, dstAlpha / 255.0F, outAlpha); + } + + private static int blend(int src, int dst, float srcAlpha, float dstAlpha, float outAlpha) { + float value = (src * srcAlpha + dst * dstAlpha * (1 - srcAlpha)) / outAlpha; + return Math.max(0, Math.min(255, Math.round(value))); + } + + /** One sampled pixel of one face, awaiting compositing. */ + private record Fragment(float z, int argb) {} + + /** + * Fills one quad as two triangles, interpolating UV and depth barycentrically. Two triangles rather than an + * inverse-bilinear solve because a rotated element's face is no longer a parallelogram, and triangles stay + * exact whatever shape it takes. + */ + private static void fillQuad(List[] buffer, int size, float[][] screen, + Quad quad, Map tints) { + float[][] uv = quad.uvCorners(); + fillTriangle(buffer, size, screen[0], screen[1], screen[2], uv[0], uv[1], uv[2], quad, tints); + fillTriangle(buffer, size, screen[0], screen[2], screen[3], uv[0], uv[2], uv[3], quad, tints); + } + + private static void fillTriangle(List[] buffer, int size, + float[] a, float[] b, float[] c, + float[] uvA, float[] uvB, float[] uvC, + Quad quad, Map tints) { + float area = (b[0] - a[0]) * (c[1] - a[1]) - (c[0] - a[0]) * (b[1] - a[1]); + if (Math.abs(area) < 1e-6F) return; + + int minPx = Math.max(0, (int) Math.floor(Math.min(a[0], Math.min(b[0], c[0])))); + int maxPx = Math.min(size - 1, (int) Math.ceil(Math.max(a[0], Math.max(b[0], c[0])))); + int minPy = Math.max(0, (int) Math.floor(Math.min(a[1], Math.min(b[1], c[1])))); + int maxPy = Math.min(size - 1, (int) Math.ceil(Math.max(a[1], Math.max(b[1], c[1])))); + + for (int py = minPy; py <= maxPy; py++) { + for (int px = minPx; px <= maxPx; px++) { + float cx = px + 0.5F; + float cy = py + 0.5F; + + float w0 = ((b[0] - cx) * (c[1] - cy) - (c[0] - cx) * (b[1] - cy)) / area; + float w1 = ((c[0] - cx) * (a[1] - cy) - (a[0] - cx) * (c[1] - cy)) / area; + float w2 = 1.0F - w0 - w1; + if (w0 < -1e-4F || w1 < -1e-4F || w2 < -1e-4F) continue; + + float u = w0 * uvA[0] + w1 * uvB[0] + w2 * uvC[0]; + float v = w0 * uvA[1] + w1 * uvB[1] + w2 * uvC[1]; + + int argb = quad.sample(u, v, tints); + if ((argb >>> 24) == 0) continue; + + float z = w0 * a[2] + w1 * b[2] + w2 * c[2]; + int index = py * size + px; + if (buffer[index] == null) buffer[index] = new ArrayList<>(4); + buffer[index].add(new Fragment(z, argb)); + } + } + } + + /** + * One textured face ready to draw. + * + * @param corners four positions, mutated in place as the model is posed + * @param shade the directional brightness multiplier + */ + private record Quad(float[][] corners, JavaBlockModel.Face face, BufferedImage texture, float shade) { + + /** + * The face's UV rectangle in pixels of its own texture, matched corner-for-corner with + * {@link #corners}. UVs span 0-16 whatever the texture's resolution — see + * {@link JavaBlockModel#UV_SPACE} — so they scale by the texture size; {@code rotation} turns the + * rectangle in 90-degree steps. + */ + float[][] uvCorners() { + float scaleU = this.texture.getWidth() / JavaBlockModel.UV_SPACE; + float scaleV = this.texture.getHeight() / JavaBlockModel.UV_SPACE; + float u0 = this.face.u0() * scaleU; + float v0 = this.face.v0() * scaleV; + float u1 = this.face.u1() * scaleU; + float v1 = this.face.v1() * scaleV; + + float[][] uv = {{u0, v0}, {u1, v0}, {u1, v1}, {u0, v1}}; + + int steps = ((this.face.rotation() % 360) + 360) % 360 / 90; + for (int step = 0; step < steps; step++) { + float[] first = uv[0]; + uv = new float[][]{uv[1], uv[2], uv[3], first}; + } + return uv; + } + + int sample(float u, float v, Map tints) { + int x = clamp((int) Math.floor(u), this.texture.getWidth()); + int y = clamp((int) Math.floor(v), this.texture.getHeight()); + int argb = this.texture.getRGB(x, y); + + int alpha = argb >>> 24; + if (alpha == 0) return 0; + + float r = ((argb >> 16) & 0xFF) * this.shade; + float g = ((argb >> 8) & 0xFF) * this.shade; + float b = (argb & 0xFF) * this.shade; + + Integer tint = this.face.tintIndex() < 0 ? null : tints.get(this.face.tintIndex()); + if (tint != null) { + r *= ((tint >> 16) & 0xFF) / 255.0F; + g *= ((tint >> 8) & 0xFF) / 255.0F; + b *= (tint & 0xFF) / 255.0F; + } + + return (alpha << 24) + | (Math.min(255, Math.round(r)) << 16) + | (Math.min(255, Math.round(g)) << 8) + | Math.min(255, Math.round(b)); + } + + private static int clamp(int value, int bound) { + return Math.max(0, Math.min(bound - 1, value)); + } + } +} diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/icon/ModelTextureTinter.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/icon/ModelTextureTinter.java new file mode 100644 index 00000000..5967792e --- /dev/null +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/icon/ModelTextureTinter.java @@ -0,0 +1,134 @@ +package fr.robie.craftengineconverter.converter.bedrock.icon; + +import fr.robie.craftengineconverter.converter.bedrock.geometry.JavaBlockModel; + +import java.awt.image.BufferedImage; +import java.util.*; +import java.util.function.Function; + +/** + * Bakes a model's dye tints into copies of its textures. + *

+ * Java multiplies a tint into a face at render time; Bedrock has no equivalent, because Geyser cannot send a + * {@code dyed_color} component and an attachable simply samples its texture as-is. So a tint can only reach a + * Bedrock item by being painted into the texture before the pack is written. The colour baked in is the item's + * default tint, which is what an undyed item shows in Java — the closest thing to correct that a client + * unable to dye anything can display. + *

+ * The tint is applied per face region, never to the whole image: a tint belongs to the faces that ask + * for it by {@code tintindex}, and a texture usually serves both kinds. The sofa is the plain example — its + * cushions are tinted olive and its wooden legs are not, and multiplying the whole sheet would stain the legs. + */ +public final class ModelTextureTinter { + + private ModelTextureTinter() { + throw new UnsupportedOperationException("ModelTextureTinter is a utility class and cannot be instantiated."); + } + + /** + * The texture areas this model wants tinted, and with what. + *

+ * Regions rather than finished images, because one texture is often shared by several items that each tint a + * different part of it — {@code sofa}, {@code sofa_inner} and {@code sleeper_sofa} all live on one sheet. Any + * scheme that produced a whole tinted image per item would have to pick one and discard the others' work. + * + * @param model the model whose faces name the tints + * @param loader resolves a Java texture reference to its image; used only for its dimensions, never modified + * @param tints tint colours by {@code tintindex}, as 24-bit RGB + * @return regions keyed by texture reference; empty when the model asks for no tint that could be resolved + */ + public static Map> regions(JavaBlockModel model, + Function loader, + Map tints) { + if (model == null || tints.isEmpty()) return Map.of(); + + Map> found = new LinkedHashMap<>(); + Map sources = new HashMap<>(); + + for (JavaBlockModel.Element element : model.elements()) { + for (JavaBlockModel.Face face : element.faces()) { + Integer tint = face.tintIndex() < 0 ? null : tints.get(face.tintIndex()); + if (tint == null) continue; + + String reference = resolveTextureReference(face.texture(), model); + if (reference == null) continue; + + BufferedImage source = sources.computeIfAbsent(reference, loader::apply); + if (source == null) continue; + + int[] region = faceRegion(face, model, source); + found.computeIfAbsent(reference, key -> new ArrayList<>()) + .add(new TintRegion(region[0], region[1], region[2], region[3], tint)); + } + } + + return found; + } + + /** + * Multiplies {@code rgb} into every opaque pixel of a rectangle. Applied to the pack's own copy of the + * texture, so the held and worn model shows the colour. + * + * @param x1 exclusive + * @param y1 exclusive + */ + public record TintRegion(int x0, int y0, int x1, int y1, int rgb) { + + public void applyTo(BufferedImage image) { + float r = ((this.rgb >> 16) & 0xFF) / 255.0F; + float g = ((this.rgb >> 8) & 0xFF) / 255.0F; + float b = (this.rgb & 0xFF) / 255.0F; + + for (int y = Math.max(0, this.y0); y < Math.min(this.y1, image.getHeight()); y++) { + for (int x = Math.max(0, this.x0); x < Math.min(this.x1, image.getWidth()); x++) { + int argb = image.getRGB(x, y); + int alpha = argb >>> 24; + if (alpha == 0) continue; + + image.setRGB(x, y, (alpha << 24) + | (Math.round(((argb >> 16) & 0xFF) * r) << 16) + | (Math.round(((argb >> 8) & 0xFF) * g) << 8) + | Math.round((argb & 0xFF) * b)); + } + } + } + + public boolean covers(int x, int y) { + return x >= this.x0 && x < this.x1 && y >= this.y0 && y < this.y1; + } + } + + /** The pixel rectangle of {@code source} a face covers, as {@code {x0, y0, x1, y1}} with x1/y1 exclusive. */ + private static int[] faceRegion(JavaBlockModel.Face face, JavaBlockModel model, BufferedImage source) { + float scaleU = source.getWidth() / JavaBlockModel.UV_SPACE; + float scaleV = source.getHeight() / JavaBlockModel.UV_SPACE; + + // UVs run either way round — a mirrored or flipped face swaps them — and the region is the same either + // way, so normalise rather than trusting the order. + float u0 = Math.min(face.u0(), face.u1()) * scaleU; + float u1 = Math.max(face.u0(), face.u1()) * scaleU; + float v0 = Math.min(face.v0(), face.v1()) * scaleV; + float v1 = Math.max(face.v0(), face.v1()) * scaleV; + + int x0 = clamp((int) Math.floor(u0), source.getWidth()); + int y0 = clamp((int) Math.floor(v0), source.getHeight()); + // Ceil the far edge, and keep at least one pixel: a zero-height face — the flat brim of a cap — still + // names a real texel. + int x1 = Math.max(x0 + 1, clamp((int) Math.ceil(u1), source.getWidth() + 1)); + int y1 = Math.max(y0 + 1, clamp((int) Math.ceil(v1), source.getHeight() + 1)); + + return new int[]{x0, y0, Math.min(x1, source.getWidth()), Math.min(y1, source.getHeight())}; + } + + private static String resolveTextureReference(String texture, JavaBlockModel model) { + String reference = texture; + for (int hop = 0; hop < 8 && reference != null && reference.startsWith("#"); hop++) { + reference = model.textures().get(reference.substring(1)); + } + return reference == null || reference.startsWith("#") ? null : reference; + } + + private static int clamp(int value, int bound) { + return Math.max(0, Math.min(bound, value)); + } +} From e845a939d627be34e46c6789c80519f78e51dd98 Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Wed, 5 Aug 2026 16:02:08 +0200 Subject: [PATCH 054/116] refactor: simplify language JSON export by utilizing FileCacheManager --- .../converter/bedrock/lang/LanguageMapper.java | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/lang/LanguageMapper.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/lang/LanguageMapper.java index d3c49e4d..06f2de6b 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/lang/LanguageMapper.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/lang/LanguageMapper.java @@ -1,7 +1,5 @@ package fr.robie.craftengineconverter.converter.bedrock.lang; -import com.google.gson.Gson; -import com.google.gson.GsonBuilder; import com.google.gson.JsonArray; import com.google.gson.JsonElement; import fr.robie.craftengineconverter.api.manager.FileCacheManager; @@ -17,9 +15,6 @@ import java.util.Map; public final class LanguageMapper { - - private static final Gson GSON = new GsonBuilder().setPrettyPrinting().disableHtmlEscaping().create(); - private final Map> entries = new LinkedHashMap<>(); /** @@ -91,12 +86,7 @@ public void save(Path textsDir) { languagesJson.add(locale); } - Path languagesFile = textsDir.resolve("languages.json"); - try (var writer = Files.newBufferedWriter(languagesFile, StandardCharsets.UTF_8)) { - GSON.toJson(languagesJson, writer); - } catch (IOException e) { - Logger.error("Failed to write languages.json", e); - } + FileCacheManager.saveJsonToFile(textsDir.resolve("languages.json"), languagesJson); Logger.info("Exported " + this.entries.size() + " language(s) with " + totalKeys + " total keys"); } From 364ac2be299979955ec589a7d63d91a96d32692f Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Wed, 5 Aug 2026 16:09:04 +0200 Subject: [PATCH 055/116] feat: implement pack path shortening to prevent long file paths in Bedrock conversion --- .../converter/bedrock/ConversionContext.java | 13 +- .../bedrock/pack/PackPathShortener.java | 214 ++++++++++++++++++ .../converter/bedrock/sound/SoundMapper.java | 76 +++++-- 3 files changed, 273 insertions(+), 30 deletions(-) create mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/pack/PackPathShortener.java diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/ConversionContext.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/ConversionContext.java index 402dff1b..12fd8235 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/ConversionContext.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/ConversionContext.java @@ -1,6 +1,8 @@ package fr.robie.craftengineconverter.converter.bedrock; import com.google.gson.JsonObject; +import fr.robie.craftengineconverter.api.configuration.Configuration; +import fr.robie.craftengineconverter.api.configuration.ConfigurationKey; import fr.robie.craftengineconverter.api.configuration.bedrock.ItemTextureConfiguration; import fr.robie.craftengineconverter.api.configuration.bedrock.ManifestConfiguration; import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.MappingsConfiguration; @@ -30,6 +32,7 @@ import fr.robie.craftengineconverter.converter.bedrock.item.EquipmentAssetRegistry; import fr.robie.craftengineconverter.converter.bedrock.item.ItemModelDefinitionMapper; import fr.robie.craftengineconverter.converter.bedrock.lang.LanguageMapper; +import fr.robie.craftengineconverter.converter.bedrock.pack.PackPathShortener; import fr.robie.craftengineconverter.converter.bedrock.sound.SoundMapper; import fr.robie.craftengineconverter.converter.bedrock.texture.CachedTextureInfo; import fr.robie.craftengineconverter.converter.bedrock.texture.TexturePipeline; @@ -764,7 +767,7 @@ public void saveAll() { fr.robie.messageflow.logger.Logger.info("Saved " + this.waypointStyleMapper.size() + " waypoint style(s)"); } -// this.soundMapper.reportMissingSounds(); + this.soundMapper.reportMissingSounds(); this.texturePipeline.reportTrimFallbacks(); if (!this.soundMapper.isEmpty()) { try { @@ -873,10 +876,10 @@ public void saveAll() { } } -// if ((boolean) Configuration.get(ConfigurationKey.SHORTEN_PACK_PATHS)) { -// PackPathShortener.shorten(this.packDir); -// } -// PackPathShortener.reportLongPaths(this.packDir); + if ((boolean) Configuration.get(ConfigurationKey.SHORTEN_PACK_PATHS)) { + PackPathShortener.shorten(this.packDir); + } + PackPathShortener.reportLongPaths(this.packDir); } private static void writeDefaultPackIcon(java.nio.file.Path dest) throws java.io.IOException { diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/pack/PackPathShortener.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/pack/PackPathShortener.java new file mode 100644 index 00000000..5b652020 --- /dev/null +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/pack/PackPathShortener.java @@ -0,0 +1,214 @@ +package fr.robie.craftengineconverter.converter.bedrock.pack; + +import fr.robie.messageflow.logger.Logger; +import org.jetbrains.annotations.NotNull; + +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.util.*; +import java.util.stream.Stream; + +/** + * Shortens the names of generated pack files, so no path in the pack reaches the length some Bedrock platforms + * choke on. Geyser reports the same threshold: + *

+ * has a file in it that meets or exceeds 80 characters in its path
+ * (render_controllers/controller.render.internal.previous_page_1.render_controllers.json, 85 characters long)
+ * 
+ * A render controller's file name restates the controller name inside it, wrapped in 58 characters of fixed + * boilerplate, so the item identifier only has 22 characters to spend before the pack is over the line. + *

+ * This runs over the finished pack rather than changing how each mapper names its files, because the constraint + * belongs to the pack as a whole and not to any one mapper. + * + *

Why renaming these files needs no reference rewriting

+ * Bedrock directory-scans {@code models/}, {@code attachables/}, {@code animations/}, + * {@code animation_controllers/} and {@code render_controllers/}, and indexes each entry by the identifier written + * inside the file. Nothing reads those file names - not the attachables, not the Geyser mappings, not the + * block definitions, which all address geometry, animations and controllers by identifier. The file name is a pure + * restatement of that identifier, so it is free to change. + * + *

What must keep its name, and why

+ * Everything else in the pack is found by exact path, and is therefore left alone: + *
    + *
  • {@code textures/**.png} and {@code sounds/**.ogg} - referenced by path from the shortname maps and + * directly. Note that {@code attachables/*.json} name their textures by raw path, not by an + * {@code item_texture.json} shortname: a rename that rewrote only the shortname maps would leave a pack whose + * inventory icons were right and whose every held and worn model was untextured.
  • + *
  • {@code font/glyph_XX.png} - the hex suffix is the Unicode page the client computes from the code + * point.
  • + *
  • {@code texts/.lang} - the name is the locale.
  • + *
  • {@code ui/chest_screen.json} - works by overriding a vanilla path, and names its images by path.
  • + *
  • {@code manifest.json}, {@code pack_icon.png}, {@code sound_definitions.json}, {@code item_texture.json}, + * {@code terrain_texture.json}, {@code flipbook_textures.json}, {@code texts/languages.json}.
  • + *
+ */ +public final class PackPathShortener { + + /** Geyser's own threshold, and the one some Bedrock platforms actually fail at. */ + public static final int PATH_LIMIT = 80; + + /** + * How many base-36 characters of the digest a generated name gets. Short enough that the compound extension is + * the longest part of the path again, and wide enough that a collision would need some two billion files. + */ + private static final int WIDTH = 6; + + /** + * The directories Bedrock scans, each paired with the compound extension its scanner matches on. The extension + * has to survive the rename: it is how the client decides what kind of file it is looking at. + */ + private static final Map SCANNED = Map.of( + "models/entity", ".geo.json", + "models/blocks", ".geo.json", + "animations", ".animation.json", + "animation_controllers", ".animation_controllers.json", + "render_controllers", ".render_controllers.json", + "attachables", ".json"); + + /** Stable order, so a run's log and its renames read the same way every time. */ + private static final List ORDER = List.of( + "models/entity", "models/blocks", "animations", "animation_controllers", + "render_controllers", "attachables"); + + private PackPathShortener() { + } + + /** + * Renames every generated file in the scanned directories to a short, deterministic name. + * + * @return how many files were renamed + */ + public static int shorten(@NotNull Path packDir) { + int renamed = 0; + for (String directory : ORDER) { + Path dir = packDir.resolve(directory); + if (!Files.isDirectory(dir)) continue; + renamed += shortenDirectory(dir, SCANNED.get(directory)); + } + if (renamed > 0) { + Logger.debug("Shortened " + renamed + " generated file name(s) to keep pack paths under " + + PATH_LIMIT + " characters"); + } + return renamed; + } + + private static int shortenDirectory(Path dir, String extension) { + // Collected and sorted first: renaming while walking a directory is undefined, and a stable order is what + // makes the collision suffixes below reproducible. + List files = new ArrayList<>(); + try (Stream entries = Files.list(dir)) { + entries.filter(Files::isRegularFile) + .filter(path -> path.getFileName().toString().endsWith(extension)) + .sorted() + .forEach(files::add); + } catch (IOException e) { + Logger.error("Failed to list " + dir + " while shortening pack paths", e); + return 0; + } + + // Planned in full before anything moves, because a short name can collide with a file that has not been + // renamed yet - so the rename itself can never overwrite something it still needs. + // + // The names already short enough are claimed first, which is also what makes the pass idempotent: run over + // an already-shortened pack it finds nothing left to do, rather than churning every name a second time. + Set taken = new HashSet<>(); + List pending = new ArrayList<>(); + for (Path file : files) { + String original = file.getFileName().toString(); + if (original.length() - extension.length() <= WIDTH) { + taken.add(original); + } else { + pending.add(file); + } + } + + Map plan = new LinkedHashMap<>(); + for (Path file : pending) { + String original = file.getFileName().toString(); + String basename = original.substring(0, original.length() - extension.length()); + String target = shortName(basename, extension, taken); + taken.add(target); + plan.put(file, target); + } + + int renamed = 0; + for (Map.Entry entry : plan.entrySet()) { + try { + Files.move(entry.getKey(), entry.getKey().resolveSibling(entry.getValue())); + renamed++; + } catch (IOException e) { + Logger.error("Failed to shorten " + entry.getKey() + " to " + entry.getValue(), e); + } + } + return renamed; + } + + /** + * A short name derived from the original, so two conversions of the same pack produce the same file names - the + * pack stays diffable, and a re-download only happens when something really changed. + *

+ * {@link #WIDTH} base-36 characters of a digest of the original name, widened a character at a time if that + * name is somehow already claimed - so a collision costs a longer name, never a lost file. + */ + private static String shortName(String basename, String extension, Set taken) { + String hash = digest(basename); + for (int width = WIDTH; width <= hash.length(); width++) { + String candidate = hash.substring(0, width) + extension; + if (!taken.contains(candidate)) return candidate; + } + return hash + extension; + } + + private static String digest(String text) { + try { + byte[] bytes = MessageDigest.getInstance("SHA-1").digest(text.getBytes(StandardCharsets.UTF_8)); + StringBuilder out = new StringBuilder(); + // Base 36 rather than hex, so the same uniqueness costs fewer characters - which is the whole point. + for (int i = 0; i + 1 < bytes.length; i += 2) { + int chunk = ((bytes[i] & 0xFF) << 8) | (bytes[i + 1] & 0xFF); + out.append(Integer.toString(chunk, 36)); + } + return out.toString(); + } catch (NoSuchAlgorithmException e) { + // SHA-1 is required of every JVM, so this cannot happen; a stable fallback beats failing the conversion. + return Integer.toString(Math.abs(text.hashCode()), 36); + } + } + + /** + * Reports any path still at or over the limit after the pass, naming the file and its length. + *

+ * A future addition that reintroduces a long path should say so during conversion, rather than in a player's + * client log. + * + * @return the longest relative path length found, or 0 for an empty pack + */ + public static int reportLongPaths(@NotNull Path packDir) { + List offenders = new ArrayList<>(); + int longest = 0; + try (Stream walk = Files.walk(packDir)) { + List files = walk.filter(Files::isRegularFile).sorted().toList(); + for (Path file : files) { + String relative = packDir.relativize(file).toString().replace('\\', '/'); + longest = Math.max(longest, relative.length()); + if (relative.length() >= PATH_LIMIT) { + offenders.add(relative + " (" + relative.length() + ")"); + } + } + } catch (IOException e) { + Logger.error("Failed to walk the pack while checking path lengths", e); + return longest; + } + + if (!offenders.isEmpty()) { + Logger.warn(offenders.size() + " pack path(s) reach " + PATH_LIMIT + + " characters, which fails on some Bedrock platforms:\n " + String.join("\n ", offenders)); + } + return longest; + } +} diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/sound/SoundMapper.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/sound/SoundMapper.java index 7ce67711..94da62be 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/sound/SoundMapper.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/sound/SoundMapper.java @@ -6,14 +6,9 @@ import fr.robie.craftengineconverter.api.utils.FileUtils; import fr.robie.messageflow.logger.Logger; -import java.io.File; import java.nio.file.Files; import java.nio.file.Path; -import java.util.HashSet; -import java.util.LinkedHashMap; -import java.util.Locale; -import java.util.Map; -import java.util.Set; +import java.util.*; public final class SoundMapper { @@ -48,13 +43,14 @@ String bedrockId() { private final Map soundDefinitions = new LinkedHashMap<>(); private final Set copiedPaths = new HashSet<>(); + private final Set missingSounds = new java.util.LinkedHashSet<>(); /** * Parses one Java namespace's sounds.json root object and accumulates entries. * Entries from multiple namespaces / pack layers are merged rather than clobbered. */ public void addFromJavaSounds(JsonObject javaSoundsRoot, String namespace, - Path javaAssetsDir, Path outputSoundsDir) { + Path javaAssetsDir, Path outputSoundsDir) { for (String javaKey : javaSoundsRoot.keySet()) { JsonElement entry = javaSoundsRoot.get(javaKey); if (!entry.isJsonObject()) continue; @@ -66,21 +62,23 @@ public void addFromJavaSounds(JsonObject javaSoundsRoot, String namespace, SoundCategory category = SoundCategory.fromString(rawCategory); JsonArray bedrockSounds = new JsonArray(); + int declared = 0; if (event.has("sounds")) { JsonElement soundsElem = event.get("sounds"); - if (soundsElem.isJsonArray()) { - for (JsonElement soundElem : soundsElem.getAsJsonArray()) { - JsonObject bedrockSound = this.toBedrockSound(soundElem); + Iterable entries = soundsElem.isJsonArray() + ? soundsElem.getAsJsonArray() + : java.util.List.of(soundsElem); + for (JsonElement soundElem : entries) { + declared++; + JsonObject bedrockSound = this.toBedrockSound(soundElem); + if (this.copyAudioFile(bedrockSound, namespace, javaAssetsDir, outputSoundsDir)) { bedrockSounds.add(bedrockSound); - this.copyAudioFile(bedrockSound, namespace, javaAssetsDir, outputSoundsDir); } - } else { - JsonObject bedrockSound = this.toBedrockSound(soundsElem); - bedrockSounds.add(bedrockSound); - this.copyAudioFile(bedrockSound, namespace, javaAssetsDir, outputSoundsDir); } } + if (declared > 0 && bedrockSounds.isEmpty()) continue; + if (this.soundDefinitions.containsKey(bedrockKey)) { JsonObject existing = this.soundDefinitions.get(bedrockKey); JsonArray existingSounds = existing.getAsJsonArray("sounds"); @@ -119,20 +117,23 @@ private static String normalizeSoundPath(String name) { return name; } - private void copyAudioFile(JsonObject bedrockSound, String namespace, - Path javaAssetsDir, Path outputSoundsDir) { - if (!bedrockSound.has("name")) return; + /** + * Copies one sound file into the pack, if the pack has it. + * + * @return whether the file is in the output pack, so the caller knows to reference it + */ + private boolean copyAudioFile(JsonObject bedrockSound, String namespace, + Path javaAssetsDir, Path outputSoundsDir) { + if (!bedrockSound.has("name")) return false; String bedrockPath = bedrockSound.get("name").getAsString(); - // bedrockPath is like "sounds/foo/bar" — strip the leading "sounds/" to get the relative path String relativePath = bedrockPath.startsWith("sounds/") ? bedrockPath.substring("sounds/".length()) : bedrockPath; - if (this.copiedPaths.contains(relativePath)) return; + if (this.copiedPaths.contains(relativePath)) return true; for (String ext : AUDIO_EXTENSIONS) { - // Try in the namespace-specific folder first, then directly under assets dir Path[] candidates = { - javaAssetsDir.resolve(namespace).resolve("sounds").resolve(relativePath + ext), - javaAssetsDir.resolve("sounds").resolve(relativePath + ext) + javaAssetsDir.resolve(namespace).resolve("sounds").resolve(relativePath + ext), + javaAssetsDir.resolve("sounds").resolve(relativePath + ext) }; for (Path source : candidates) { if (Files.exists(source)) { @@ -143,12 +144,37 @@ private void copyAudioFile(JsonObject bedrockSound, String namespace, this.copiedPaths.add(relativePath); } catch (Exception e) { Logger.warn("Failed to copy sound file " + source + ": " + e.getMessage()); + return false; } - return; + return true; } } } - Logger.warn("Sound file not found for: " + relativePath + " (namespace=" + namespace + ")"); + + this.missingSounds.add(namespace + ":" + relativePath); + return false; + } + + /** + * One line about the sounds that could not be supplied, rather than one per sound. + *

+ * Split by namespace because the two cases are not equally interesting: a missing vanilla sound is expected, + * while a missing sound from the pack's own namespace means the pack forgot to ship a file it names. + */ + public void reportMissingSounds() { + if (this.missingSounds.isEmpty()) return; + + long vanilla = this.missingSounds.stream().filter(s -> s.startsWith("minecraft:")).count(); + long own = this.missingSounds.size() - vanilla; + + if (vanilla > 0) { + Logger.debug(vanilla + " vanilla sound(s) are referenced but not shippable" + + " (Minecraft keeps its audio outside the client jar) - Bedrock will use its own"); + } + if (own > 0) { + Logger.warn(own + " sound(s) named by the pack have no audio file, so those events will be silent:" + + " " + this.missingSounds.stream().filter(s -> !s.startsWith("minecraft:")).limit(10).toList()); + } } public boolean isEmpty() { From f9e16f91b0eb42fde2ed379f4b0ee19034f75b4e Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Wed, 5 Aug 2026 19:43:30 +0200 Subject: [PATCH 056/116] feat: enhance Bedrock item conversion with template collection and config factory expansion --- .../converter/bedrock/BedrockConverter.java | 149 +++++++++++++++--- 1 file changed, 131 insertions(+), 18 deletions(-) diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockConverter.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockConverter.java index 6280f686..c1579f08 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockConverter.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockConverter.java @@ -1,8 +1,10 @@ package fr.robie.craftengineconverter.converter.bedrock; import fr.robie.craftengineconverter.api.configuration.bedrock.ManifestConfiguration; +import fr.robie.craftengineconverter.api.configuration.loader.ConfigurationTrees; import fr.robie.craftengineconverter.api.manager.FileCacheManager; import fr.robie.craftengineconverter.api.utils.FileUtils; +import fr.robie.craftengineconverter.converter.bedrock.item.ConfigFactoryExpander; import fr.robie.messageflow.logger.Logger; import fr.robie.yamllibrary.ConfigurationSection; import fr.robie.yamllibrary.file.YamlConfiguration; @@ -12,6 +14,7 @@ import java.nio.file.Files; import java.nio.file.Path; import java.util.Locale; +import java.util.Map; public class BedrockConverter { @@ -71,7 +74,8 @@ public void convert() { return; } - ConversionContext ctx = new ConversionContext(customMappings.toPath(), textures.toPath(), packOut.toPath()); + ConversionContext ctx = new ConversionContext(customMappings.toPath(), textures.toPath(), packOut.toPath()) + .withPluginFolder(this.pluginFolder); boolean isPrimaryPack = true; for (File packFolder : this.settings.allPackFolders()) { @@ -118,10 +122,111 @@ private void convertItems(@NotNull File inputFolder, @NotNull ConversionContext return; } + // Templates must all be known before any item is resolved: a template is routinely declared in a + // different file from the items that use it, so a single interleaved pass would fail on whichever + // file happened to be walked first. + this.collectTemplates(inputFolder, ctx); this.convertItemsRecursive(inputFolder, ctx); } + /** + * Pass one: reads every {@code templates:} / {@code template:} block into the engine, and every + * {@code equipments:} block into the equipment registry. + *

+ * Both are cross-file references — an item can use a template or name an equipment asset declared + * anywhere in the tree — so both have to be complete before any item is converted. + */ + private void collectTemplates(@NotNull File folder, @NotNull ConversionContext ctx) { + this.walkItemConfigs(folder, ctx, false, (file, yaml) -> { + for (ConfigurationSection templates : sectionsOfType(yaml, "templates", "template")) { + for (String templateId : templates.getKeys(false)) { + Object body = templates.get(templateId); + ctx.templates().register(templateId, body instanceof ConfigurationSection nested + ? ConfigurationTrees.toMap(nested) + : body); + } + } + + for (ConfigurationSection equipments : sectionsOfType(yaml, "equipments", "equipment")) { + ctx.equipmentAssets().addFromEquipmentsSection(equipments, ctx.javaAssetsDir()); + } + }); + } + + /** + * Every top-level section of one of {@code types}, matching on the part before a {@code #}. + *

+ * CraftEngine treats that prefix as the section type, so one file may hold several sections of the same + * kind — {@code config_factory#basic} beside {@code config_factory#extra}. Matching the key exactly + * would skip all of them. + */ + @NotNull + private static java.util.List sectionsOfType(@NotNull YamlConfiguration yaml, + @NotNull String... types) { + java.util.List found = new java.util.ArrayList<>(); + java.util.Set wanted = java.util.Set.of(types); + for (String key : yaml.getKeys(false)) { + if (!wanted.contains(ConfigFactoryExpander.sectionType(key))) continue; + ConfigurationSection section = yaml.getConfigurationSection(key); + if (section != null) found.add(section); + } + return found; + } + + /** + * Pass two: expands any {@code config_factory}, then resolves each item against the templates and + * converts it. + *

+ * Factory expansion happens here rather than in pass one because a blueprint routinely uses templates, + * which are only complete once pass one has finished — the same ordering CraftEngine declares. + */ private void convertItemsRecursive(@NotNull File folder, @NotNull ConversionContext ctx) { + ConfigFactoryExpander expander = new ConfigFactoryExpander(ctx.templates()); + + this.walkItemConfigs(folder, ctx, true, (file, yaml) -> { + // Literal sections first, then anything a factory generated. + for (ConfigurationSection items : sectionsOfType(yaml, "items", "item")) { + this.convertItemSection(items, file, ctx); + } + + Map>> expanded = + expander.expand(ConfigurationTrees.toMap(yaml)); + java.util.List> generatedItems = expanded.get("items"); + if (generatedItems == null) generatedItems = expanded.get("item"); + if (generatedItems == null) return; + + int count = 0; + for (Map section : generatedItems) { + this.convertItemSection(ConfigurationTrees.toSection(section), file, ctx); + count += section.size(); + } + if (count > 0) { + Logger.info("Expanded " + count + " item(s) from config factories in " + file.getName()); + } + }); + } + + private void convertItemSection(@NotNull ConfigurationSection items, @NotNull File file, + @NotNull ConversionContext ctx) { + for (String itemId : items.getKeys(false)) { + ConfigurationSection itemSection = items.getConfigurationSection(itemId); + if (itemSection == null) continue; + ConfigurationSection resolved = ctx.resolveTemplates(itemId, itemSection, file); + if (resolved == null) continue; + ctx.acceptMapping(new BedrockItemLoader(itemId, resolved, ctx).load()); + } + } + + /** + * Walks the item config tree, handing each YAML file to {@code handler}. + *

+ * Both passes need the same traversal, and it has one quirk worth preserving: a {@code resourcepack/} + * directory is not item config at all but a nested resource pack, converted in place. Only the item + * pass should do that, hence {@code convertNestedPacks} — doing it in both would convert every nested + * pack twice. + */ + private void walkItemConfigs(@NotNull File folder, @NotNull ConversionContext ctx, + boolean convertNestedPacks, @NotNull ItemConfigHandler handler) { File[] listed = folder.listFiles(); if (listed == null) return; @@ -129,28 +234,24 @@ private void convertItemsRecursive(@NotNull File folder, @NotNull ConversionCont if (file.isDirectory()) { String name = file.getName().toLowerCase(); if (name.equals("resourcepack") || name.equals("resource_pack") || name.equals("resoucepack")) { - this.convertPackDirectory(file, ctx.packDir().toFile(), ctx, false); + if (convertNestedPacks) { + this.convertPackDirectory(file, ctx.packDir().toFile(), ctx, false); + } } else { - this.convertItemsRecursive(file, ctx); + this.walkItemConfigs(file, ctx, convertNestedPacks, handler); } } else if (file.isFile() && FileUtils.isYmlFile(file)) { - FileCacheManager.getYamlCache().getEntryFile(file.toPath()).ifPresent(yamlFileCacheEntry -> { - YamlConfiguration yamlConfiguration = yamlFileCacheEntry.getData(); - ConfigurationSection items = yamlConfiguration.getConfigurationSection("items"); - if (items != null) { - for (String itemId : items.getKeys(false)) { - ConfigurationSection itemSection = items.getConfigurationSection(itemId); - if (itemSection != null) { - BedrockItemLoader itemLoader = new BedrockItemLoader(itemId, itemSection, ctx); - ctx.acceptMapping(itemLoader.load()); - } - } - } - }); + FileCacheManager.getYamlCache().getEntryFile(file.toPath()) + .ifPresent(entry -> handler.accept(file, entry.getData())); } } } + @FunctionalInterface + private interface ItemConfigHandler { + void accept(File file, YamlConfiguration yaml); + } + private void convertPack(@NotNull File inputFile, @NotNull File outputPackFolder, @NotNull ConversionContext ctx, boolean isPrimary) { if (!inputFile.exists()) { Logger.info("Pack input does not exist: " + inputFile.getAbsolutePath()); @@ -246,7 +347,7 @@ private void convertPackDirectory(@NotNull File inputFolder, @NotNull File outpu } else { String fileNameWithoutExtension = FileUtils.getFileNameWithoutExtension(file); String extension = FileUtils.getFileExtension(file); - if (fileNameWithoutExtension.equalsIgnoreCase("pack")) { + if (fileNameWithoutExtension.equalsIgnoreCase("pack") && isImageExtension(extension)) { File dest = new File(outputPackFolder, "pack_icon." + extension); FileUtils.copyFile(file, dest); } else if (fileName.equalsIgnoreCase("pack.mcmeta")) { @@ -259,11 +360,20 @@ private void convertPackDirectory(@NotNull File inputFolder, @NotNull File outpu } } - if (!hasManifest.get()) { + if (!hasManifest.get() && isPrimary) { Logger.info("No pack.mcmeta found in input pack, using default manifest"); } } + /** Extensions Bedrock will accept as {@code pack_icon}. */ + private static boolean isImageExtension(String extension) { + if (extension == null) return false; + return switch (extension.toLowerCase(java.util.Locale.ROOT)) { + case "png", "jpg", "jpeg", "tga" -> true; + default -> false; + }; + } + private void convertNamespaceAssets(File namespaceDir, String namespace, ConversionContext ctx) { File[] listed = namespaceDir.listFiles(); if (listed == null) return; @@ -276,6 +386,9 @@ private void convertNamespaceAssets(File namespaceDir, String namespace, Convers case "font" -> ctx.addFontDirectory(file, namespace); case "blockstates" -> ctx.addBlockstatesDirectory(file, namespace); case "waypoint_style" -> ctx.addWaypointStyleDirectory(file, namespace); + // Java 1.21.4+ item model definitions. Every pack layer is scanned before + // convertItems() runs below, so these are populated before any item is converted. + case "items" -> ctx.addItemsDirectory(file, namespace); default -> { // Other directories can be handled here if needed } From a31a1b616c8c68d6b297da6dca9dd07c5d961025 Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Wed, 5 Aug 2026 19:49:40 +0200 Subject: [PATCH 057/116] fix(bedrock): load the loader registries in DevConvert DevConvert never called RegistryHelper.loadRegistries(), so ModelConfigurationRegistry.load(...) returned null for every model. An item whose appearance is described only by a model tree then fell through BedrockItemLoader.load() to its bare `return null` and was dropped without a word - no warning, no count. That hit every armour piece, because armour's shape comes from a trim `select` in assets//items/.json rather than from a `texture:` key the loader could fall back on. A conversion of a pack with trimmable armour emitted no chainmail mappings, no armour attachables and no worn textures, which read as "the converter does not support armour" rather than "this entry point forgot to load its registries". Measured on the sample pack: 0 -> 4 armour groups, 12 trim definitions each, 4 attachables, 2 worn textures, 23 -> 50 attachables overall. ArmorTrimReproTest pins the underlying fact - that the trim select parses to a TrimMaterialSelectConfiguration once the registries are loaded - since nothing else would catch the registry silently going empty again. Co-Authored-By: Claude Opus 5 --- .../ArmorTrimReproTest.java | 65 +++++++++++++ .../converter/bedrock/DevConvert.java | 95 +++++++++++++++++++ 2 files changed, 160 insertions(+) create mode 100644 Plugin/src/test/java/fr/robie/craftengineconverter/ArmorTrimReproTest.java create mode 100644 Plugin/src/test/java/fr/robie/craftengineconverter/converter/bedrock/DevConvert.java diff --git a/Plugin/src/test/java/fr/robie/craftengineconverter/ArmorTrimReproTest.java b/Plugin/src/test/java/fr/robie/craftengineconverter/ArmorTrimReproTest.java new file mode 100644 index 00000000..9146d15e --- /dev/null +++ b/Plugin/src/test/java/fr/robie/craftengineconverter/ArmorTrimReproTest.java @@ -0,0 +1,65 @@ +package fr.robie.craftengineconverter; + +import fr.robie.craftengineconverter.api.configuration.item.models.ModelConfiguration; +import fr.robie.craftengineconverter.converter.bedrock.item.ItemModelDefinitionMapper; +import fr.robie.craftengineconverter.common.CraftEngineConverterPlugin; +import org.junit.jupiter.api.Test; + +import java.io.File; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Optional; + +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +/** + * Temporary reproduction probe: why does {@code topaz_armor.yml} contribute nothing to a conversion? + *

+ * {@code BedrockItemLoader.load()} returns {@code null} — silently, no logging — when it can find no model for an + * item. For an armour piece the model has to come from {@code assets/default/items/topaz_helmet.json}, which is a + * {@code select} on {@code trim_material}. If that file does not parse, the item vanishes with no diagnostic and + * its armour attachable, worn texture and 12 trim variants are never emitted. + */ +class ArmorTrimReproTest { + + /** The real dev-pack assets, so this probes the actual file rather than a hand-written approximation. */ + private static Path itemsDir() { + return Path.of("src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items"); + } + + @Test + void theTrimSelectItemDefinitionParses() throws Exception { + // Without this the loader registry is empty and every model parses to null — the exact state DevConvert + // runs in, and the reason a conversion outside the plugin drops armour silently. + new RegistryHelper(CraftEngineConverterPlugin.class.getClassLoader()).loadRegistries(); + + Path items = itemsDir(); + assertTrue(Files.isDirectory(items), "dev pack items dir must exist at " + items.toAbsolutePath()); + + Path helmet = items.resolve("topaz_helmet.json"); + assertTrue(Files.isRegularFile(helmet), "topaz_helmet.json must exist"); + System.out.println("[repro] topaz_helmet.json first 200 chars: " + + Files.readString(helmet).substring(0, 200)); + + ItemModelDefinitionMapper mapper = new ItemModelDefinitionMapper(); + mapper.addFromItemsDirectory(new File(items.toString()), "default", items.getParent()); + + // The control: a plain "type": "model" item that we know converts fine. + Optional sword = mapper.get("default:topaz_sword"); + System.out.println("[repro] default:topaz_sword present=" + sword.isPresent() + + " model=" + sword.map(d -> String.valueOf(d.model())).orElse("-")); + + // The subject: the trim select. + Optional helmetDef = mapper.get("default:topaz_helmet"); + System.out.println("[repro] default:topaz_helmet present=" + helmetDef.isPresent() + + " model=" + helmetDef.map(d -> String.valueOf(d.model())).orElse("-")); + + assertTrue(helmetDef.isPresent(), + "the helmet definition must be registered, else BedrockItemLoader.load() returns null and the " + + "whole armour item is dropped"); + ModelConfiguration model = helmetDef.get().model(); + assertNotNull(model, + "the trim select must parse to a model; a null model is what makes the armour item vanish"); + } +} diff --git a/Plugin/src/test/java/fr/robie/craftengineconverter/converter/bedrock/DevConvert.java b/Plugin/src/test/java/fr/robie/craftengineconverter/converter/bedrock/DevConvert.java new file mode 100644 index 00000000..852c7694 --- /dev/null +++ b/Plugin/src/test/java/fr/robie/craftengineconverter/converter/bedrock/DevConvert.java @@ -0,0 +1,95 @@ +package fr.robie.craftengineconverter.converter.bedrock; + +import java.io.File; + +/** + * Runs one conversion against a plugin data folder, with no server. + *

+ * Reached through {@code ./gradlew devConvert}. This is the job the end-to-end tests used to do — drive the whole + * pipeline over a real pack so the output can be inspected — but as a task rather than a test, so {@code build} + * stays a fast pure-unit suite and the conversion is still one command away. + *

+ * It lives in the test source set on purpose: it needs the same classpath the tests get, since {@code + * paper-api} is a {@code compileOnly} dependency of the main source set and only the test runtime puts it back. + *

+ * Partial for items, and deliberately so. There is no running server here, so no Bukkit material registry + * and no CraftEngine, and the item pipeline leans on both. Measured on the sample pack this emits 23 item + * geometries where a real server emits far more, and no rendered icons at all. Blocks, blockstates, textures, + * fonts, sounds and the geometry conversion itself are unaffected, which is what makes this useful for the work it + * is aimed at — a mapper or geometry change, checked in a second without booting Paper. + *

+ * For anything item-shaped, {@code /cec bedrock} on the dev server is the authoritative run. The old end-to-end + * tests were not a substitute either: they shared one JVM with the rest of the suite and only saw a full conversion + * because another test had already initialised {@link fr.robie.craftengineconverter.api.configuration.Configuration}, + * so their output depended on test ordering. + *

+ * Nothing here is shipped in the plugin jar. + */ +public final class DevConvert { + + private DevConvert() { + throw new UnsupportedOperationException("DevConvert is an entry point and cannot be instantiated."); + } + + public static void main(String[] args) { + if (args.length < 1) { + System.err.println("usage: DevConvert "); + System.exit(2); + return; + } + + File pluginFolder = new File(args[0]); + if (!pluginFolder.isDirectory()) { + System.err.println("Not a directory: " + pluginFolder.getAbsolutePath() + + " - run ./gradlew installDevPack first"); + System.exit(1); + return; + } + + System.out.println("Converting " + pluginFolder.getAbsolutePath()); + long started = System.currentTimeMillis(); + + // The model / tint / select / range_dispatch loader registries, exactly as the plugin's onEnable does it. + // Without this every ModelConfigurationRegistry.load(...) returns null, so an item whose appearance is + // described only by a model tree — every armour piece, because its shape comes from a trim `select` in + // assets//items/.json — falls through BedrockItemLoader.load() to its `return null` and is + // dropped without a word. Armour, its worn texture, its attachable and its trim variants then simply do + // not exist in the output, which reads as "the converter does not support armour" rather than + // "this entry point forgot to load its registries". + new fr.robie.craftengineconverter.RegistryHelper(DevConvert.class.getClassLoader()).loadRegistries(); + + BedrockConverter converter = new BedrockConverter(pluginFolder); + File config = new File(pluginFolder, "config.yml"); + if (config.isFile()) { + fr.robie.yamllibrary.file.YamlConfiguration yaml = + fr.robie.yamllibrary.file.YamlConfiguration.loadConfiguration(config); + + // The global Configuration singleton, exactly as the plugin's onEnable does it. Without this every + // Configuration.get(...) falls back to its enum default, which is not the same thing — and it is + // load-bearing: with the singleton uninitialised this conversion emitted 23 items instead of 134. + // The deleted end-to-end tests only ever saw the full output because another test in the same JVM had + // initialised it first, which is a test-ordering dependency worth being rid of. + fr.robie.craftengineconverter.api.configuration.Configuration.getInstance().load(yaml, config); + + // Folder overrides (bedrock.items-folder and friends), which are separate from the global config. + converter.loadSettingsFromConfig(yaml); + } + + // Said out loud because it silently changes the whole output: without a vanilla assets tree a missing + // parent can only be rebuilt from its name, so anything that is not a cube or a cross — a fence gate, an + // anvil, a button — falls back to a solid block. That looks exactly like "the texture did not convert". + fr.robie.craftengineconverter.converter.bedrock.asset.VanillaAssets assets = + fr.robie.craftengineconverter.converter.bedrock.asset.VanillaAssetStore.existing(pluginFolder); + Object configuredPath = fr.robie.craftengineconverter.api.configuration.Configuration + .get(fr.robie.craftengineconverter.api.configuration.ConfigurationKey.VANILLA_ASSETS_PATH); + System.out.println(assets.isAvailable() + ? "Vanilla assets: " + assets.source() + : "Vanilla assets: NONE - non-cube vanilla parents will fall back to a full block." + + " vanilla-assets.path resolved to [" + configuredPath + "]"); + + converter.convert(); + + System.out.println("Done in " + (System.currentTimeMillis() - started) + " ms"); + System.out.println("Output: " + new File(pluginFolder, "bedrock-converted/Geyser-Spigot").getAbsolutePath()); + } +} From 90601c694859ddc8a60016f43e81b3694a3e6633 Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Wed, 5 Aug 2026 19:50:12 +0200 Subject: [PATCH 058/116] feat(bedrock): colour armour trim icons, and keep greyscale PNGs out of the pack Two findings from bisecting a pack that would not load, confirmed in game. A greyscale+alpha PNG stops the whole pack loading. Java's armour trim sheets are stored that way - greyscale, because Java tints them from a palette at render time - so a pack with trimmable armour shipped four of them and the client refused it. Bisected to exactly that: the same pack without the trim overlays loads, with them present it does not. Plain greyscale (colour type 0) survives today, but is the same latent hazard. So copyTexture now does two things. A trim overlay is never copied at all: it is a compositing ingredient, nothing in a Bedrock pack can reference one, and those four files were unreferenced dead weight even before they broke loading. Any other greyscale or greyscale+alpha texture is re-encoded as RGBA on the way in, which fixes the whole class rather than this one pack. RGB, indexed and RGBA still copy byte-for-byte, so the pack does not grow. Bedrock will not trim a custom item at runtime - its armour render controller reads variable.has_trim, which the engine only sets for vanilla armour - but it does not have to, because Geyser gives every trim material its own Bedrock item via the trim_material predicate. ArmorTrimBaker colours the overlay and composites it, so each variant is handed a finished sprite while untrimmed armour keeps its plain icon. Verified against the real vanilla palettes: lapis -> #091E45 #21497B #1C4D9C #416E97, exactly palette indices 6, 2, 1, 0. Java's trim colouring is palette indexing, not tinting: the overlay's grey levels index trims/color_palettes/.png through the key palette trim_palette.png, both 8x1. Two traps are pinned by tests because both are silent. An overlay's grey must not be read with getRGB - greyscale PNGs decode to TYPE_BYTE_GRAY, a linear colour space, and getRGB converts to sRGB, so the value returned is not the value stored; measured, that collapsed lapis onto two wrong palette entries and the armour rendered in the wrong colour with no error. And armour sprites are often animated strips, so the trim is baked onto the frame the icon actually uses rather than the size mismatch being refused. Worn armour is deliberately left untrimmed. Java keys a trim on a material and a pattern, and only the inventory overlay is pattern-independent; the worn one is trims/entity/humanoid/, and Geyser's match predicate has no trim_pattern property. Picking a pattern arbitrarily would draw the wrong shape, so the conversion summary says what it did not do instead. Co-Authored-By: Claude Opus 5 --- .../converter/bedrock/BedrockItemLoader.java | 40 ++- .../converter/bedrock/ConversionContext.java | 130 +++++++- .../bedrock/texture/ArmorTrimBaker.java | 281 ++++++++++++++++++ .../bedrock/texture/TexturePipeline.java | 106 ++++++- .../ArmorTrimBakerTest.java | 206 +++++++++++++ .../GreyscaleTextureTest.java | 113 +++++++ 6 files changed, 856 insertions(+), 20 deletions(-) create mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/texture/ArmorTrimBaker.java create mode 100644 Plugin/src/test/java/fr/robie/craftengineconverter/ArmorTrimBakerTest.java create mode 100644 Plugin/src/test/java/fr/robie/craftengineconverter/GreyscaleTextureTest.java diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockItemLoader.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockItemLoader.java index aee3cb02..aa2d4fcf 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockItemLoader.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockItemLoader.java @@ -1,5 +1,8 @@ package fr.robie.craftengineconverter.converter.bedrock; +import com.google.gson.Gson; +import com.google.gson.JsonArray; +import com.google.gson.JsonObject; import fr.robie.craftengineconverter.api.configuration.Configuration; import fr.robie.craftengineconverter.api.configuration.ConfigurationKey; import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.GroupDefinitionMapping; @@ -24,8 +27,12 @@ import fr.robie.craftengineconverter.api.configuration.item.models.model.GenerationConfiguration; import fr.robie.craftengineconverter.api.configuration.item.models.model.SimpleModelConfiguration; import fr.robie.craftengineconverter.api.configuration.item.models.range_dispatch.RangeDispatchModelConfiguration; -import fr.robie.craftengineconverter.api.configuration.item.models.select.*; -import fr.robie.craftengineconverter.api.configuration.item.models.tints.TintConfiguration; +import fr.robie.craftengineconverter.api.configuration.item.models.select.ChargeTypeSelectConfiguration; +import fr.robie.craftengineconverter.api.configuration.item.models.select.ComponentSelectConfiguration; +import fr.robie.craftengineconverter.api.configuration.item.models.select.CustomModelDataSelectConfiguration; +import fr.robie.craftengineconverter.api.configuration.item.models.select.SelectModelConfiguration; +import fr.robie.craftengineconverter.api.configuration.item.models.select.TrimMaterialSelectConfiguration; +import fr.robie.craftengineconverter.converter.bedrock.item.ItemModelDefinitionMapper; import fr.robie.craftengineconverter.api.configuration.loader.models.ModelConfigurationRegistry; import fr.robie.craftengineconverter.converter.bedrock.animation.AnimationMapper; import fr.robie.craftengineconverter.converter.bedrock.animation.BedrockAnimationContext; @@ -35,10 +42,10 @@ import fr.robie.craftengineconverter.converter.bedrock.geometry.BedrockGeometry; import fr.robie.craftengineconverter.converter.bedrock.geometry.DisplayContext; import fr.robie.craftengineconverter.converter.bedrock.geometry.GeometryMapper; +import fr.robie.craftengineconverter.api.configuration.item.models.tints.TintConfiguration; import fr.robie.craftengineconverter.converter.bedrock.geometry.JavaBlockModel; import fr.robie.craftengineconverter.converter.bedrock.icon.ItemIconRenderer; import fr.robie.craftengineconverter.converter.bedrock.icon.ModelTextureTinter; -import fr.robie.craftengineconverter.converter.bedrock.item.ItemModelDefinitionMapper; import fr.robie.craftengineconverter.converter.bedrock.texture.CachedTextureInfo; import fr.robie.messageflow.logger.Logger; import fr.robie.yamllibrary.ConfigurationSection; @@ -47,6 +54,8 @@ import org.jetbrains.annotations.Nullable; import java.awt.image.BufferedImage; +import java.nio.file.Files; +import java.nio.file.Path; import java.util.*; public class BedrockItemLoader { @@ -108,8 +117,8 @@ public ItemMapping load() { ItemMapping iconSource = this.baseDefinition != null ? this.baseDefinition : rootGroup.getDefinitions().stream() - .filter(definition -> !definition.getTexturesData().isEmpty()) - .findFirst().orElse(null); + .filter(definition -> !definition.getTexturesData().isEmpty()) + .findFirst().orElse(null); if (rootGroup.getTexturesData().isEmpty() && iconSource != null && !iconSource.getTexturesData().isEmpty()) { rootGroup.addTextureData(iconSource.getTexturesData().getFirst()); @@ -789,12 +798,21 @@ private void addTextureDataIfSimpleModel(ModelConfiguration modelConfiguration, this.renderIconFromModel(modelPath, textureId, simpleModelConfiguration); for (int layer = 1; layer < textureRefs.size(); layer++) { - // Only layer0 becomes an item. Bedrock renders a custom item's icon from a single - // flat texture and cannot composite layers the way Java does for armour trims, so - // the remaining layers get copied but generate no attachable, geometry, animation or - // render-controller artifacts — those would be unreferenced files, and their long - // generated names push paths past the Windows limit. - this.context.copyTexture(textureRefs.get(layer), textureId + "_layer" + layer); + String layerRef = textureRefs.get(layer); + + // An armour trim is the one layer worth combining rather than copying. Bedrock draws a custom + // item's icon from a single flat texture, so a trim layer left as its own file would never be + // drawn — but Geyser gives each trim material its own Bedrock item, so the two layers can be + // merged now and that item handed the finished sprite. + if (this.context.bakeTrimmedIcon(textureId, textureRefs.getFirst(), layerRef, + mat == null ? null : mat.name())) { + continue; + } + + // Any other extra layer still only gets copied. Bedrock cannot composite it, and generating an + // attachable, geometry, animation or render controller per layer would leave unreferenced files + // whose long generated names push paths past the Windows limit. + this.context.copyTexture(layerRef, textureId + "_layer" + layer); } if (!hasGenerationTexture) { diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/ConversionContext.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/ConversionContext.java index 12fd8235..c43b602e 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/ConversionContext.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/ConversionContext.java @@ -20,23 +20,24 @@ import fr.robie.craftengineconverter.converter.bedrock.animation.BedrockAnimation; import fr.robie.craftengineconverter.converter.bedrock.animation.BedrockAnimationController; import fr.robie.craftengineconverter.converter.bedrock.animation.BedrockRenderControllers; -import fr.robie.craftengineconverter.converter.bedrock.asset.VanillaAssetStore; import fr.robie.craftengineconverter.converter.bedrock.asset.VanillaAssets; +import fr.robie.craftengineconverter.converter.bedrock.asset.VanillaAssetStore; import fr.robie.craftengineconverter.converter.bedrock.attachable.BedrockAttachableContext; import fr.robie.craftengineconverter.converter.bedrock.block.BlockStateMapper; -import fr.robie.craftengineconverter.converter.bedrock.font.FontMapper; import fr.robie.craftengineconverter.converter.bedrock.geometry.BedrockGeometry; -import fr.robie.craftengineconverter.converter.bedrock.geometry.GeometryMapper; -import fr.robie.craftengineconverter.converter.bedrock.geometry.JavaBlockModel; +import fr.robie.craftengineconverter.converter.bedrock.font.FontMapper; import fr.robie.craftengineconverter.converter.bedrock.icon.ModelTextureTinter; import fr.robie.craftengineconverter.converter.bedrock.item.EquipmentAssetRegistry; import fr.robie.craftengineconverter.converter.bedrock.item.ItemModelDefinitionMapper; +import fr.robie.craftengineconverter.converter.bedrock.waypoint.WaypointStyleMapper; import fr.robie.craftengineconverter.converter.bedrock.lang.LanguageMapper; import fr.robie.craftengineconverter.converter.bedrock.pack.PackPathShortener; +import fr.robie.craftengineconverter.converter.bedrock.geometry.GeometryMapper; +import fr.robie.craftengineconverter.converter.bedrock.geometry.JavaBlockModel; import fr.robie.craftengineconverter.converter.bedrock.sound.SoundMapper; +import fr.robie.craftengineconverter.converter.bedrock.texture.ArmorTrimBaker; import fr.robie.craftengineconverter.converter.bedrock.texture.CachedTextureInfo; import fr.robie.craftengineconverter.converter.bedrock.texture.TexturePipeline; -import fr.robie.craftengineconverter.converter.bedrock.waypoint.WaypointStyleMapper; import fr.robie.yamllibrary.ConfigurationSection; import org.bukkit.Material; import org.jetbrains.annotations.Nullable; @@ -47,6 +48,7 @@ import java.util.List; import java.util.Map; import java.util.Optional; +import java.util.Set; public class ConversionContext { private final MappingsConfiguration mappings = new MappingsConfiguration(); @@ -88,6 +90,10 @@ public class ConversionContext { private File pluginFolder; private Material defaultMaterial; private VanillaAssets vanillaAssets; + // Resolved on first use, then kept: building it reads the trim key palette off disk. + private Optional armorTrimBaker; + /** Definitions whose icon got a coloured trim, for one summary line instead of one per variant. */ + private final Set trimmedIcons = new java.util.LinkedHashSet<>(); public ConversionContext(Path customMappingsDir, Path texturesDir, Path packDir) { this.customMappingsDir = customMappingsDir; @@ -96,7 +102,8 @@ public ConversionContext(Path customMappingsDir, Path texturesDir, Path packDir) // Blocks read models through the same resolver as items, so they inherit the vanilla-asset fallback and // there is only one copy of the parent-chain logic to keep correct. this.blockStateMapper.withModelResolver(this.javaModelResolver).withTexturePipeline(this.texturePipeline); - this.manifest = ManifestConfiguration.resourcePack("CraftEngineConverter Pack").build(); + this.manifest = new ManifestConfiguration("CraftEngineConverter Pack") + .setPackUUID(java.util.UUID.randomUUID()); this.texturesConfig.setResourcePackName("CraftEngineConverter") .setTextureName("atlas.items"); this.terrainTexturesConfig.setResourcePackName("CraftEngineConverter") @@ -280,8 +287,8 @@ private void assignIcon(ItemMapping mapping) { String iconTex = rendered != null ? "textures/item/icons/" + mapping.getBedrockIdentifier().replace(":", ".").replace("/", "_") : firstTex.matches(".*_\\d+$") - ? firstTex.replaceAll("_\\d+$", "_icon") - : firstTex + "_icon"; + ? firstTex.replaceAll("_\\d+$", "_icon") + : firstTex + "_icon"; String iconId = mapping.getBedrockIdentifier() + "_icon"; TextureData iconTd = new TextureData(iconId); @@ -308,6 +315,109 @@ private void assignIcon(ItemMapping mapping) { mapping.setBedrockOptions(opts); } + /** + * Draws an armour piece's icon with its trim already coloured on, and uses it as that variant's inventory sprite. + *

+ * Bedrock cannot combine an armour texture with a trim overlay itself — its armour render controller reads + * {@code variable.has_trim}, which the engine only sets for vanilla armour — but it does not have to, because + * Geyser gives every trim material its own Bedrock item. So the combination is made here, once per material, and + * handed over as a finished sprite. + * + * @param textureId the definition's texture id, which is what {@link #assignIcon} looks a rendered icon up by + * @param baseRef the model's {@code layer0}: the untrimmed armour sprite + * @param overlayRef the model's trim layer, e.g. {@code minecraft:trims/items/helmet_trim_lapis} + * @param armourMaterial the Java material the piece is built on, so a same-material trim can be darkened + * @return whether an icon was produced; {@code false} leaves the caller's existing untrimmed icon in place + */ + public boolean bakeTrimmedIcon(String textureId, String baseRef, String overlayRef, + @Nullable String armourMaterial) { + if (this.javaAssetsDir == null) return false; + + Optional overlay = this.texturePipeline.asTrimOverlay(overlayRef); + if (overlay.isEmpty()) return false; + + Optional baker = this.armorTrimBaker(); + if (baker.isEmpty()) return false; + + Optional base = this.texturePipeline.resolveTexture(baseRef, textureId, this.javaAssetsDir); + if (base.isEmpty()) return false; + + java.awt.image.BufferedImage sprite; + try { + sprite = javax.imageio.ImageIO.read(base.get().sourcePath().toFile()); + } catch (Exception e) { + fr.robie.messageflow.logger.Logger.debug( + "Could not read " + base.get().sourcePath() + " to trim it: " + e.getMessage()); + return false; + } + if (sprite == null) return false; + + // An animated armour texture is a vertical strip of frames, and the trim overlay is one frame in size. The + // inventory icon is a still of the first frame — flipbook_textures.json only animates terrain tiles — so trim + // that frame rather than refusing the whole sheet for a size mismatch that is not one. + sprite = firstFrameOf(sprite, base.get()); + + Optional trimmed = baker.get().bake( + sprite, overlay.get().sheetAssetsPath(), overlay.get().material(), armourMaterial); + if (trimmed.isEmpty()) return false; + + this.registerRenderedIcon(textureId, trimmed.get()); + this.trimmedIcons.add(textureId); + return true; + } + + /** + * The frame an animated texture's inventory icon is taken from, or the image unchanged when it is a still. + *

+ * Located the same way {@code extractAnimationFrames} does, by the frame's index within the strip, so a + * {@code .mcmeta} that lists frames out of order still picks the one written as {@code _0}. + */ + private static java.awt.image.BufferedImage firstFrameOf(java.awt.image.BufferedImage sheet, + CachedTextureInfo info) { + if (info.animation().isEmpty()) return sheet; + var animation = info.animation().get(); + if (animation.frames().isEmpty()) return sheet; + + int frameWidth = animation.frameWidth(); + int frameHeight = animation.frameHeight(); + if (frameWidth <= 0 || frameHeight <= 0) return sheet; + + int columns = Math.max(1, sheet.getWidth() / frameWidth); + int index = animation.frames().getFirst().index(); + int x = (index % columns) * frameWidth; + int y = (index / columns) * frameHeight; + if (x + frameWidth > sheet.getWidth() || y + frameHeight > sheet.getHeight()) return sheet; + + return sheet.getSubimage(x, y, frameWidth, frameHeight); + } + + /** Built once: it loads the key palette, and its absence is the whole feature's answer. */ + private Optional armorTrimBaker() { + if (this.armorTrimBaker == null) { + this.armorTrimBaker = ArmorTrimBaker.create(this.vanillaAssets, this.javaAssetsDir); + } + return this.armorTrimBaker; + } + + /** + * One line for the whole pack, rather than one per armour piece and material. + *

+ * It also says what was not done, because the difference is visible in game and would otherwise read as a + * bug: a trimmed piece shows its trim in the inventory but is worn plain. Java keys a trim on two things, a + * material and a pattern, and only the inventory overlay ({@code trims/items/_trim}) is + * pattern-independent. The worn overlay is per pattern ({@code trims/entity/humanoid/}), and Geyser's + * {@code match} predicate has no {@code trim_pattern} property — only {@code trim_material} — so nothing in the + * mapping can tell two patterns apart. Picking one arbitrarily would draw the wrong trim shape, which is worse + * than drawing none. + */ + public void reportTrimmedIcons() { + if (this.trimmedIcons.isEmpty()) return; + fr.robie.messageflow.logger.Logger.info("Coloured " + this.trimmedIcons.size() + + " armour trim variant icon(s) from vanilla's trim palettes." + + " Worn armour stays untrimmed: Geyser can match a trim's material but not its pattern, and the" + + " worn overlay is per pattern"); + } + public void registerRenderedIcon(String textureId, java.awt.image.BufferedImage icon) { if (textureId == null || icon == null) return; this.renderedIcons.put(iconKey(textureId), icon); @@ -769,6 +879,8 @@ public void saveAll() { this.soundMapper.reportMissingSounds(); this.texturePipeline.reportTrimFallbacks(); + this.texturePipeline.reportSkippedTrimOverlays(); + this.reportTrimmedIcons(); if (!this.soundMapper.isEmpty()) { try { Path soundDefPath = this.packDir.resolve("sounds/sound_definitions.json"); @@ -876,6 +988,8 @@ public void saveAll() { } } + // Last, once every file exists: the pass renames files Bedrock finds by the identifier inside them, so it + // has to see the finished pack, and nothing after it may write into those directories again. if ((boolean) Configuration.get(ConfigurationKey.SHORTEN_PACK_PATHS)) { PackPathShortener.shorten(this.packDir); } diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/texture/ArmorTrimBaker.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/texture/ArmorTrimBaker.java new file mode 100644 index 00000000..5a6d8c18 --- /dev/null +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/texture/ArmorTrimBaker.java @@ -0,0 +1,281 @@ +package fr.robie.craftengineconverter.converter.bedrock.texture; + +import fr.robie.craftengineconverter.converter.bedrock.asset.VanillaAssets; +import fr.robie.messageflow.logger.Logger; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import javax.imageio.ImageIO; +import java.awt.image.BufferedImage; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Optional; + +/** + * Colours an armour trim overlay for one trim material, so a trimmed armour piece can be drawn as a finished texture. + * + *

Why this has to happen at conversion time

+ * Bedrock renders trims itself and will not do it for a custom item. Its armour render controller picks the trim + * texture from engine-set variables: + *
+ * "textures": [ "variable.has_trim ? variable.trim_path : Texture.default", "Texture.enchanted" ]
+ * 
+ * {@code variable.has_trim} is only ever true for vanilla armour carrying trim data, and a {@code geyser_custom:} + * item has none — so no resource pack can switch it on. What Geyser does give us is a separate Bedrock item per trim + * material (the {@code trim_material} predicate), and a separate item can have its own texture. So instead of asking + * the client to combine armour and trim, we hand it the combination already made. + * + *

How Java colours a trim, and therefore how this does

+ * The overlay ships greyscale and its grey levels are palette indices, not brightness. Two files decide the + * colour, both 8x1 pixels: + *
    + *
  • {@code trims/color_palettes/trim_palette.png} — the key, greys {@code 224,192,160,128,96,64,32,0}
  • + *
  • {@code trims/color_palettes/.png} — the material's eight colours, in the same order
  • + *
+ * A pixel whose grey equals the key's nth entry takes the material's nth colour. Nothing is + * interpolated or multiplied, which is why a hand-rolled "tint by multiplying" gets trims visibly wrong. + *

+ * Both files are read from the same source, so the mapping stays self-consistent even if a future version reorders + * the palette: the key is never assumed, only read. + */ +public final class ArmorTrimBaker { + + /** Where the palettes live inside an assets tree or client jar. */ + private static final String PALETTE_DIR = "minecraft/textures/trims/color_palettes/"; + + /** + * Java darkens a trim whose material matches the armour it sits on, or it would vanish into it — gold on gold. + * Only these five ship a darker variant. + */ + private static final java.util.Set HAS_DARKER = + java.util.Set.of("copper", "diamond", "gold", "iron", "netherite"); + + /** The key palette's greys, in index order. */ + private final int[] keyGreys; + private final VanillaAssets vanillaAssets; + private final Path javaAssetsDir; + /** Material name to its eight colours; {@code null} for a material whose palette is missing. */ + private final Map palettes = new LinkedHashMap<>(); + private final Map overlayCache = new HashMap<>(); + + private ArmorTrimBaker(int[] keyGreys, VanillaAssets vanillaAssets, @Nullable Path javaAssetsDir) { + this.keyGreys = keyGreys; + this.vanillaAssets = vanillaAssets; + this.javaAssetsDir = javaAssetsDir; + } + + /** + * A baker, or empty when the key palette cannot be found — which is the whole feature's prerequisite, so it is + * checked once here rather than per texture. + * + * @param javaAssetsDir the pack's own assets, consulted first so a pack may override the palettes + */ + public static Optional create(@Nullable VanillaAssets vanillaAssets, + @Nullable Path javaAssetsDir) { + Path key = locate(vanillaAssets, javaAssetsDir, PALETTE_DIR + "trim_palette.png"); + if (key == null) { + Logger.debug("No trims/color_palettes/trim_palette.png available, so armour trims cannot be coloured"); + return Optional.empty(); + } + int[] greys = readPaletteGreys(key); + if (greys == null) return Optional.empty(); + return Optional.of(new ArmorTrimBaker(greys, vanillaAssets, javaAssetsDir)); + } + + /** + * Composites a coloured trim overlay onto an armour texture. + * + * @param base the untrimmed armour texture; not modified + * @param overlayPath assets-relative path of the greyscale overlay, e.g. + * {@code minecraft/textures/trims/items/helmet_trim.png} + * @param trimMaterial the trim material, namespaced or not — {@code minecraft:lapis} and {@code lapis} both work + * @param armourMaterial the armour's own material, so a same-material trim can be darkened; may be {@code null} + * @return the combined image, or empty when the overlay or the material's palette is missing + */ + public Optional bake(@NotNull BufferedImage base, @NotNull String overlayPath, + @NotNull String trimMaterial, @Nullable String armourMaterial) { + Overlay overlay = this.overlay(overlayPath); + if (overlay == null) return Optional.empty(); + + int[] palette = this.palette(paletteNameFor(trimMaterial, armourMaterial)); + if (palette == null) return Optional.empty(); + + // The overlay is authored at the armour texture's own size; anything else is a pack error we cannot guess at. + if (overlay.width() != base.getWidth() || overlay.height() != base.getHeight()) { + Logger.debug("Trim overlay " + overlayPath + " is " + overlay.width() + "x" + overlay.height() + + " but the armour texture is " + base.getWidth() + "x" + base.getHeight() + "; not trimming it"); + return Optional.empty(); + } + + BufferedImage out = new BufferedImage(base.getWidth(), base.getHeight(), BufferedImage.TYPE_INT_ARGB); + var graphics = out.createGraphics(); + graphics.drawImage(base, 0, 0, null); + graphics.dispose(); + + for (int y = 0; y < overlay.height(); y++) { + for (int x = 0; x < overlay.width(); x++) { + int at = y * overlay.width() + x; + int alpha = overlay.alpha()[at]; + if (alpha == 0) continue; + out.setRGB(x, y, (alpha << 24) | palette[this.indexOfGrey(overlay.grey()[at])]); + } + } + return Optional.of(out); + } + + /** {@code minecraft:lapis} and {@code lapis} both name the {@code lapis} palette; a matching pair goes darker. */ + private static String paletteNameFor(String trimMaterial, @Nullable String armourMaterial) { + int colon = trimMaterial.indexOf(':'); + String name = (colon < 0 ? trimMaterial : trimMaterial.substring(colon + 1)).toLowerCase(java.util.Locale.ROOT); + boolean sameAsArmour = armourMaterial != null + && armourMaterial.toLowerCase(java.util.Locale.ROOT).contains(name); + return sameAsArmour && HAS_DARKER.contains(name) ? name + "_darker" : name; + } + + /** The key index whose grey is closest to this one — exact in practice, nearest so an odd pixel still maps. */ + private int indexOfGrey(int grey) { + int best = 0; + int bestDistance = Integer.MAX_VALUE; + for (int index = 0; index < this.keyGreys.length; index++) { + int distance = Math.abs(this.keyGreys[index] - grey); + if (distance < bestDistance) { + bestDistance = distance; + best = index; + } + } + return best; + } + + @Nullable + private int[] palette(String name) { + if (this.palettes.containsKey(name)) return this.palettes.get(name); + + Path file = locate(this.vanillaAssets, this.javaAssetsDir, PALETTE_DIR + name + ".png"); + int[] colours = null; + if (file == null) { + Logger.debug("No trim colour palette for '" + name + "', so that trim is left off"); + } else { + colours = readPaletteColours(file); + } + this.palettes.put(name, colours); + return colours; + } + + /** + * An overlay's stored grey level and alpha per pixel. + *

+ * Kept as raw samples rather than as a {@link BufferedImage} because the grey must not be read through + * {@link BufferedImage#getRGB}: a greyscale PNG decodes to {@code TYPE_BYTE_GRAY}, whose colour space is linear, + * and {@code getRGB} converts it to sRGB on the way out. The number that comes back is therefore not the number + * in the file — measured, grey 160 and grey 224 both came back as something else and collapsed onto the wrong + * palette entries, which is a trim of the wrong colour rather than a crash. Reading the raster gives the stored + * sample, which is the palette index the format actually means. + */ + private record Overlay(int width, int height, int[] grey, int[] alpha) {} + + @Nullable + private Overlay overlay(String overlayPath) { + if (this.overlayCache.containsKey(overlayPath)) return this.overlayCache.get(overlayPath); + + Path file = locate(this.vanillaAssets, this.javaAssetsDir, overlayPath); + Overlay overlay = null; + if (file != null) { + try { + overlay = readOverlay(ImageIO.read(file.toFile())); + } catch (Exception e) { + Logger.debug("Could not read trim overlay " + file + ": " + e.getMessage()); + } + } + this.overlayCache.put(overlayPath, overlay); + return overlay; + } + + @Nullable + private static Overlay readOverlay(@Nullable BufferedImage image) { + if (image == null) return null; + int width = image.getWidth(); + int height = image.getHeight(); + int[] grey = new int[width * height]; + int[] alpha = new int[width * height]; + + var raster = image.getRaster(); + // One colour component means greyscale, with or without an alpha band alongside it. + boolean greyscale = image.getColorModel().getColorSpace().getNumComponents() == 1; + int bands = raster.getNumBands(); + // Sub-byte depths exist (4-bit greyscale is common in packs), so samples are scaled to 0..255 by their range. + int maxSample = (1 << raster.getSampleModel().getSampleSize(0)) - 1; + + for (int y = 0; y < height; y++) { + for (int x = 0; x < width; x++) { + int at = y * width + x; + if (greyscale) { + grey[at] = maxSample == 255 + ? raster.getSample(x, y, 0) + : raster.getSample(x, y, 0) * 255 / maxSample; + alpha[at] = bands > 1 ? raster.getSample(x, y, 1) : 255; + } else { + // Indexed and true-colour images have no linear-grey problem, so getRGB is right for them. + int argb = image.getRGB(x, y); + alpha[at] = argb >>> 24; + grey[at] = (argb >> 16) & 0xFF; + } + } + } + return new Overlay(width, height, grey, alpha); + } + + /** The pack's own copy wins, so a pack may ship its own palettes or overlays; else vanilla's. */ + @Nullable + private static Path locate(@Nullable VanillaAssets vanillaAssets, @Nullable Path javaAssetsDir, + String assetsRelativePath) { + if (javaAssetsDir != null) { + Path own = javaAssetsDir.resolve(assetsRelativePath); + if (Files.isRegularFile(own)) return own; + } + return vanillaAssets == null ? null : vanillaAssets.resolve(assetsRelativePath); + } + + /** + * The key palette's greys. Read through the same raster path as an overlay, since vanilla stores the key as RGB + * but a pack overriding it may not, and a linear-grey key would be misread exactly as an overlay would. + */ + @Nullable + private static int[] readPaletteGreys(Path file) { + try { + Overlay row = readOverlay(ImageIO.read(file.toFile())); + if (row == null || row.width() == 0) { + Logger.debug("Trim key palette " + file + " could not be read as an image"); + return null; + } + int[] greys = new int[row.width()]; + System.arraycopy(row.grey(), 0, greys, 0, row.width()); + return greys; + } catch (Exception e) { + Logger.debug("Could not read trim key palette " + file + ": " + e.getMessage()); + return null; + } + } + + /** A palette is a single row of colours; read left to right, alpha dropped. */ + @Nullable + private static int[] readPaletteColours(Path file) { + try { + BufferedImage image = ImageIO.read(file.toFile()); + if (image == null || image.getWidth() == 0) { + Logger.debug("Trim palette " + file + " could not be read as an image"); + return null; + } + int[] colours = new int[image.getWidth()]; + for (int x = 0; x < image.getWidth(); x++) { + colours[x] = image.getRGB(x, 0) & 0xFFFFFF; + } + return colours; + } catch (Exception e) { + Logger.debug("Could not read trim palette " + file + ": " + e.getMessage()); + return null; + } + } +} diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/texture/TexturePipeline.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/texture/TexturePipeline.java index d3210b00..6bea0688 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/texture/TexturePipeline.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/texture/TexturePipeline.java @@ -19,6 +19,8 @@ public class TexturePipeline { /** Reported once each, because one texture is asked about once per state or variant that uses it. */ private final Set missingTextures = new java.util.LinkedHashSet<>(); private final Set trimFallbacks = new java.util.LinkedHashSet<>(); + /** Trim overlays deliberately left out of the pack; deduplicated, since every material asks for the same sheet. */ + private final Set skippedTrimOverlays = new java.util.LinkedHashSet<>(); private fr.robie.craftengineconverter.converter.bedrock.asset.VanillaAssets vanillaAssets; /** @@ -148,9 +150,24 @@ public boolean hasTransparency(String textureRef, Path javaAssetsDir) { } public boolean copyTexture(CachedTextureInfo info, Path outputTexturesDir) { + String relative = info.bedrockTexturePath().replace("textures/", ""); + + // A trim overlay is an ingredient, not pack content: Java composites it over the armour sprite and tints it + // from a palette, and nothing in a Bedrock pack can reference it — the emitted item_texture entries, the + // attachables and the Geyser mappings all name the armour texture itself. Copying it shipped four files + // nothing pointed at, and it crashed the client outright (see isGreyscalePng). + if (isTrimOverlay(relative)) { + this.skippedTrimOverlays.add(relative); + return false; + } + try { - Path targetPath = outputTexturesDir.resolve(info.bedrockTexturePath().replace("textures/", "") + ".png"); + Path targetPath = outputTexturesDir.resolve(relative + ".png"); Files.createDirectories(targetPath.getParent()); + + if (isGreyscalePng(info.sourcePath())) { + return writeAsRgba(info.sourcePath(), targetPath); + } Files.copy(info.sourcePath(), targetPath, StandardCopyOption.REPLACE_EXISTING); return true; } catch (IOException e) { @@ -159,6 +176,93 @@ public boolean copyTexture(CachedTextureInfo info, Path outputTexturesDir) { } } + /** Whether this is an armour trim overlay, which exists only to be composited and must not reach the pack. */ + private static boolean isTrimOverlay(String relativePath) { + return relativePath.startsWith("trims/items/"); + } + + /** + * An armour trim overlay named by a model layer, split into the greyscale sheet to draw and the material to + * colour it with. + * + * @param sheetAssetsPath assets-relative path of the greyscale sheet, e.g. + * {@code minecraft/textures/trims/items/helmet_trim.png} + * @param material the trim material, e.g. {@code lapis} + */ + public record TrimOverlay(String sheetAssetsPath, String material) {} + + /** + * Reads a trim overlay out of a model's texture layer, if that is what it is. + *

+ * A pack's generated trim models name the material in the path — {@code trims/items/helmet_trim_lapis} — which is + * the only place the material is written down by the time a layer is being copied, so it is also where the colour + * to bake comes from. Vanilla stopped shipping those per-material files, hence the split: the sheet that does + * exist is the material-less prefix, and the suffix is the material. + *

+ * Returns empty for the modern material-less form ({@code trims/items/helmet_trim}), because that names no + * material and nothing here can tell which trim was meant. + */ + public Optional asTrimOverlay(String textureRef) { + String path = this.modelPathToTexturePath(textureRef); + if (!isTrimOverlay(path)) return Optional.empty(); + + int marker = path.lastIndexOf("_trim_"); + if (marker < 0) return Optional.empty(); + + String sheet = path.substring(0, marker + "_trim".length()); + String material = path.substring(marker + "_trim_".length()); + if (material.isBlank()) return Optional.empty(); + + return Optional.of(new TrimOverlay( + this.extractNamespace(textureRef) + "/textures/" + sheet + ".png", material)); + } + + /** + * Whether a PNG is stored as greyscale, with or without an alpha channel. + *

+ * Bedrock cannot read these. Greyscale+alpha (colour type 4) is the worse of the two: a pack carrying one + * makes the client fail to load the pack at all, which is how four vanilla armour trim sheets — the only such + * files in an otherwise all-RGBA pack — took the whole conversion down. Plain greyscale (type 0) is survivable + * today but is the same latent hazard, so both are re-encoded. + *

+ * Read straight out of the IHDR rather than by decoding the image, since this is asked of every texture copied. + * Byte 25 is the colour type: 0 greyscale, 2 RGB, 3 indexed, 4 greyscale+alpha, 6 RGBA. + */ + private static boolean isGreyscalePng(Path file) { + try (var stream = Files.newInputStream(file)) { + byte[] header = stream.readNBytes(26); + if (header.length < 26) return false; + return header[25] == 0 || header[25] == 4; + } catch (IOException e) { + // Not worth failing a conversion over; the plain copy below is the existing behaviour. + Logger.debug("Could not read the PNG header of " + file + ": " + e.getMessage()); + return false; + } + } + + /** Re-encodes a texture as RGBA, preserving its pixels — only the storage format changes. */ + private static boolean writeAsRgba(Path source, Path target) throws IOException { + BufferedImage original = ImageIO.read(source.toFile()); + if (original == null) { + Files.copy(source, target, StandardCopyOption.REPLACE_EXISTING); + return true; + } + BufferedImage rgba = new BufferedImage( + original.getWidth(), original.getHeight(), BufferedImage.TYPE_INT_ARGB); + var graphics = rgba.createGraphics(); + graphics.drawImage(original, 0, 0, null); + graphics.dispose(); + ImageIO.write(rgba, "PNG", target.toFile()); + return true; + } + + /** One line naming the trim overlays left out of the pack, rather than one per armour piece and material. */ + public void reportSkippedTrimOverlays() { + if (this.skippedTrimOverlays.isEmpty()) return; + Logger.debug(this.skippedTrimOverlays.size() + " armour trim overlay(s) were not copied into the pack:" + + " Bedrock has no palette-tinted trim layer, and a greyscale sheet stops the pack loading"); + } + public boolean extractAnimationFrames(CachedTextureInfo info, Path outputTexturesDir) { try { BufferedImage sheet = ImageIO.read(info.sourcePath().toFile()); diff --git a/Plugin/src/test/java/fr/robie/craftengineconverter/ArmorTrimBakerTest.java b/Plugin/src/test/java/fr/robie/craftengineconverter/ArmorTrimBakerTest.java new file mode 100644 index 00000000..3c09ce4c --- /dev/null +++ b/Plugin/src/test/java/fr/robie/craftengineconverter/ArmorTrimBakerTest.java @@ -0,0 +1,206 @@ +package fr.robie.craftengineconverter; + +import fr.robie.craftengineconverter.converter.bedrock.texture.ArmorTrimBaker; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +import javax.imageio.ImageIO; +import java.awt.image.BufferedImage; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Optional; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + +/** + * Colouring an armour trim overlay. + *

+ * The overlay's greys are palette indices, not brightness: vanilla's key is + * {@code 224,192,160,128,96,64,32,0} and a pixel matching the key's nth grey takes the material palette's + * nth colour. Getting that wrong is not subtle — multiplying the grey by a tint instead produces trims in + * roughly the right place and visibly the wrong colour — so the mapping is pinned exactly. + */ +class ArmorTrimBakerTest { + + /** Vanilla's real key palette, so the fixture cannot drift from what packs actually contain. */ + private static final int[] KEY_GREYS = {224, 192, 160, 128, 96, 64, 32, 0}; + /** Vanilla's real lapis palette, index 0 to 7. */ + private static final int[] LAPIS = { + 0x416E97, 0x1C4D9C, 0x21497B, 0x123365, 0x112E63, 0x0C285A, 0x091E45, 0x051636}; + + private Path assets; + + @BeforeEach + void setUp() throws Exception { + this.assets = Files.createTempDirectory("trim-baker"); + writeRow(this.palette("trim_palette"), KEY_GREYS, true); + writeRow(this.palette("lapis"), LAPIS, false); + writeRow(this.palette("gold_darker"), LAPIS, false); // colours are irrelevant, only selection is + } + + private Path palette(String name) { + return this.assets.resolve("minecraft/textures/trims/color_palettes/" + name + ".png"); + } + + /** An 8x1 palette row. Greys are written as RGB so a channel read picks up the level. */ + private static void writeRow(Path file, int[] values, boolean greyscale) throws Exception { + Files.createDirectories(file.getParent()); + BufferedImage image = new BufferedImage(values.length, 1, BufferedImage.TYPE_INT_RGB); + for (int x = 0; x < values.length; x++) { + int value = greyscale ? (values[x] << 16) | (values[x] << 8) | values[x] : values[x]; + image.setRGB(x, 0, value); + } + ImageIO.write(image, "PNG", file.toFile()); + } + + /** A 2x1 overlay: one pixel at the key's index-2 grey, one fully transparent. */ + private Path writeOverlay(String name) throws Exception { + Path file = this.assets.resolve("minecraft/textures/trims/items/" + name + ".png"); + Files.createDirectories(file.getParent()); + BufferedImage image = new BufferedImage(2, 1, BufferedImage.TYPE_INT_ARGB); + image.setRGB(0, 0, 0xFF000000 | (160 << 16) | (160 << 8) | 160); + image.setRGB(1, 0, 0x00000000); + ImageIO.write(image, "PNG", file.toFile()); + return file; + } + + private static BufferedImage base(int argb) { + BufferedImage image = new BufferedImage(2, 1, BufferedImage.TYPE_INT_ARGB); + image.setRGB(0, 0, argb); + image.setRGB(1, 0, argb); + return image; + } + + private ArmorTrimBaker baker() { + Optional baker = ArmorTrimBaker.create(null, this.assets); + assertTrue(baker.isPresent(), "the key palette is present, so a baker must be built"); + return baker.get(); + } + + @Test + void aGreyIsReplacedByThePaletteColourAtItsOwnIndex() throws Exception { + this.writeOverlay("helmet_trim"); + BufferedImage out = this.baker() + .bake(base(0xFF102030), "minecraft/textures/trims/items/helmet_trim.png", "minecraft:lapis", null) + .orElseThrow(); + + assertEquals(0xFF000000 | LAPIS[2], out.getRGB(0, 0), + "grey 160 is the key's index 2, so it must take lapis index 2 — not a multiply of the grey"); + } + + /** + * The regression that matters most, because it is silent. + *

+ * Vanilla ships these overlays as true greyscale PNGs, which {@code ImageIO} decodes to {@code TYPE_BYTE_GRAY} — + * a linear colour space. Reading a pixel with {@code getRGB} converts it to sRGB, so the value handed back + * is not the value in the file: baking the real vanilla helmet sheet this way turned its four greys into two + * colours at palette indices 0 and 4, instead of 6, 2, 1 and 0. The armour still rendered, just in the wrong + * colour, which no crash or warning would ever have surfaced. + */ + @Test + void aTrueGreyscaleOverlayIsReadByItsStoredSampleNotThroughSrgb() throws Exception { + Path file = this.assets.resolve("minecraft/textures/trims/items/grey_trim.png"); + Files.createDirectories(file.getParent()); + // Written through the raster so the byte stored really is 160 — setRGB would convert it on the way in. + BufferedImage grey = new BufferedImage(2, 1, BufferedImage.TYPE_BYTE_GRAY); + grey.getRaster().setSample(0, 0, 0, 160); + grey.getRaster().setSample(1, 0, 0, 224); + ImageIO.write(grey, "PNG", file.toFile()); + + BufferedImage out = this.baker() + .bake(base(0xFF102030), "minecraft/textures/trims/items/grey_trim.png", "lapis", null) + .orElseThrow(); + + assertEquals(0xFF000000 | LAPIS[2], out.getRGB(0, 0), "stored grey 160 is key index 2"); + assertEquals(0xFF000000 | LAPIS[0], out.getRGB(1, 0), "stored grey 224 is key index 0"); + } + + @Test + void aTransparentOverlayPixelLeavesTheArmourShowing() throws Exception { + this.writeOverlay("helmet_trim"); + BufferedImage out = this.baker() + .bake(base(0xFF102030), "minecraft/textures/trims/items/helmet_trim.png", "lapis", null) + .orElseThrow(); + + assertEquals(0xFF102030, out.getRGB(1, 0), "where the trim is absent the armour must be untouched"); + } + + /** The un-namespaced form has to work too: the pack writes {@code minecraft:lapis}, config may write {@code lapis}. */ + @Test + void theMaterialMayBeNamespacedOrNot() throws Exception { + this.writeOverlay("helmet_trim"); + ArmorTrimBaker baker = this.baker(); + BufferedImage withNamespace = baker + .bake(base(0xFF102030), "minecraft/textures/trims/items/helmet_trim.png", "minecraft:lapis", null) + .orElseThrow(); + BufferedImage without = baker + .bake(base(0xFF102030), "minecraft/textures/trims/items/helmet_trim.png", "lapis", null) + .orElseThrow(); + + assertEquals(withNamespace.getRGB(0, 0), without.getRGB(0, 0)); + } + + /** + * Java darkens a trim sitting on armour of its own material, or it disappears into it. Proven by selection: the + * darker fixture holds different colours, so picking it changes the output. + */ + @Test + void aTrimOnArmourOfItsOwnMaterialUsesTheDarkerPalette() throws Exception { + this.writeOverlay("helmet_trim"); + // gold.png is deliberately absent, so a run that ignored _darker would find no palette and bake nothing. + Optional onGold = this.baker() + .bake(base(0xFF102030), "minecraft/textures/trims/items/helmet_trim.png", "gold", "golden_helmet"); + + assertTrue(onGold.isPresent(), "gold on golden armour must resolve, via gold_darker"); + assertEquals(0xFF000000 | LAPIS[2], onGold.get().getRGB(0, 0), + "and it must come from the darker palette, which is the only gold palette written here"); + } + + @Test + void aMaterialWithNoPaletteBakesNothingRatherThanGuessing() throws Exception { + this.writeOverlay("helmet_trim"); + assertTrue(this.baker() + .bake(base(0xFF102030), "minecraft/textures/trims/items/helmet_trim.png", "unobtainium", null) + .isEmpty(), + "an unknown material must leave the armour untrimmed, not invent a colour"); + } + + @Test + void aMissingOverlayBakesNothing() { + assertTrue(this.baker() + .bake(base(0xFF102030), "minecraft/textures/trims/items/not_shipped.png", "lapis", null) + .isEmpty()); + } + + /** A mismatched overlay would tile or stretch unpredictably, so it is refused rather than guessed at. */ + @Test + void anOverlayOfADifferentSizeIsRefused() throws Exception { + Path file = this.assets.resolve("minecraft/textures/trims/items/big_trim.png"); + Files.createDirectories(file.getParent()); + ImageIO.write(new BufferedImage(64, 32, BufferedImage.TYPE_INT_ARGB), "PNG", file.toFile()); + + assertTrue(this.baker() + .bake(base(0xFF102030), "minecraft/textures/trims/items/big_trim.png", "lapis", null) + .isEmpty()); + } + + @Test + void withoutAKeyPaletteThereIsNoBaker() throws Exception { + Path bare = Files.createTempDirectory("no-palettes"); + assertTrue(ArmorTrimBaker.create(null, bare).isEmpty(), + "the key palette is the feature's prerequisite and its absence must be detected once, up front"); + } + + /** The baked result is always RGBA, so it can never reintroduce the greyscale PNG that stops packs loading. */ + @Test + void theBakedImageIsRgba() throws Exception { + this.writeOverlay("helmet_trim"); + BufferedImage out = this.baker() + .bake(base(0xFF102030), "minecraft/textures/trims/items/helmet_trim.png", "lapis", null) + .orElseThrow(); + assertEquals(BufferedImage.TYPE_INT_ARGB, out.getType()); + assertNotEquals(0, out.getRGB(0, 0) >>> 24, "the trimmed pixel must be opaque"); + } +} diff --git a/Plugin/src/test/java/fr/robie/craftengineconverter/GreyscaleTextureTest.java b/Plugin/src/test/java/fr/robie/craftengineconverter/GreyscaleTextureTest.java new file mode 100644 index 00000000..927d813b --- /dev/null +++ b/Plugin/src/test/java/fr/robie/craftengineconverter/GreyscaleTextureTest.java @@ -0,0 +1,113 @@ +package fr.robie.craftengineconverter; + +import fr.robie.craftengineconverter.converter.bedrock.texture.CachedTextureInfo; +import fr.robie.craftengineconverter.converter.bedrock.texture.TexturePipeline; +import org.junit.jupiter.api.Test; + +import javax.imageio.ImageIO; +import java.awt.image.BufferedImage; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Optional; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + +/** + * What may reach the pack as a PNG. + *

+ * Bedrock cannot read a greyscale+alpha PNG, and one is enough to stop the whole pack loading. Java's armour + * trim sheets are stored exactly that way — greyscale, because Java tints them from a palette at render time — so a + * pack with trimmable armour shipped four of them and the client refused it. Bisected down to this: the same pack + * with the trim overlays removed loads, with them present it does not. + *

+ * Two separate guarantees, because either alone would have prevented it and both are worth keeping: a trim overlay + * is never copied at all, and any other greyscale texture is re-encoded as RGBA. + */ +class GreyscaleTextureTest { + + /** PNG colour type lives at byte 25 of the IHDR: 0 greyscale, 2 RGB, 3 indexed, 4 greyscale+alpha, 6 RGBA. */ + private static int colourTypeOf(Path png) throws Exception { + byte[] header = new byte[26]; + try (var stream = Files.newInputStream(png)) { + assertEquals(26, stream.readNBytes(header, 0, 26), "a PNG must have a readable IHDR"); + } + return header[25]; + } + + private static Path writePng(Path file, int imageType) throws Exception { + Files.createDirectories(file.getParent()); + BufferedImage image = new BufferedImage(16, 16, imageType); + // A half-transparent pixel, so an alpha channel is meaningful and survives the round trip. + image.setRGB(0, 0, 0x80FFFFFF); + image.setRGB(1, 1, 0xFF808080); + ImageIO.write(image, "PNG", file.toFile()); + return file; + } + + private static CachedTextureInfo info(Path source, String bedrockTexturePath) { + return new CachedTextureInfo(source, "key", bedrockTexturePath, Optional.empty()); + } + + @Test + void aTrimOverlayIsNeverCopiedIntoThePack() throws Exception { + Path root = Files.createTempDirectory("trim-overlay"); + Path source = writePng(root.resolve("src/helmet_trim.png"), BufferedImage.TYPE_BYTE_GRAY); + Path out = root.resolve("textures"); + + boolean copied = new TexturePipeline() + .copyTexture(info(source, "textures/trims/items/helmet_trim"), out); + + assertFalse(copied, "a trim overlay is a compositing ingredient, not pack content"); + assertFalse(Files.exists(out.resolve("trims/items/helmet_trim.png")), + "nothing in a Bedrock pack can reference a trim overlay, so it must not be written"); + } + + @Test + void aGreyscaleAlphaTextureIsReEncodedAsRgba() throws Exception { + Path root = Files.createTempDirectory("grey-alpha"); + // TYPE_BYTE_GRAY has no alpha, so build the 4-channel case ImageIO actually writes as colour type 4. + Path source = root.resolve("src/thing.png"); + Files.createDirectories(source.getParent()); + BufferedImage grey = new BufferedImage(16, 16, BufferedImage.TYPE_BYTE_GRAY); + BufferedImage greyAlpha = new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB); + greyAlpha.createGraphics().drawImage(grey, 0, 0, null); + ImageIO.write(greyAlpha, "PNG", source.toFile()); + + Path out = root.resolve("textures"); + assertTrue(new TexturePipeline().copyTexture(info(source, "textures/item/custom/thing"), out)); + + Path written = out.resolve("item/custom/thing.png"); + assertTrue(Files.exists(written), "a normal texture is still copied"); + int colourType = colourTypeOf(written); + assertFalse(colourType == 0 || colourType == 4, + "a greyscale texture must not reach the pack; Bedrock cannot read one, got colour type " + colourType); + } + + @Test + void aPlainGreyscaleTextureIsAlsoReEncoded() throws Exception { + Path root = Files.createTempDirectory("grey"); + Path source = writePng(root.resolve("src/gunpowder_block.png"), BufferedImage.TYPE_BYTE_GRAY); + assertEquals(0, colourTypeOf(source), "the fixture itself has to be greyscale for this to mean anything"); + + Path out = root.resolve("textures"); + assertTrue(new TexturePipeline().copyTexture(info(source, "textures/block/custom/gunpowder_block"), out)); + + assertEquals(6, colourTypeOf(out.resolve("block/custom/gunpowder_block.png")), + "type 0 survives today but is the same hazard, so it is normalised to RGBA too"); + } + + /** The common case must stay a plain byte-for-byte copy — re-encoding every texture would bloat the pack. */ + @Test + void anRgbaTextureIsCopiedUnchanged() throws Exception { + Path root = Files.createTempDirectory("rgba"); + Path source = writePng(root.resolve("src/sword.png"), BufferedImage.TYPE_INT_ARGB); + Path out = root.resolve("textures"); + + assertTrue(new TexturePipeline().copyTexture(info(source, "textures/item/custom/sword"), out)); + + Path written = out.resolve("item/custom/sword.png"); + assertEquals(-1, Files.mismatch(source, written), "an already-RGBA texture should be copied verbatim"); + } +} From bdfe323569803dc291dae6a04937e4d32a49c929 Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Wed, 5 Aug 2026 22:46:32 +0200 Subject: [PATCH 059/116] fix: update .gitignore to exclude Minecraft default assets --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index c0cd3ca4..92b842a3 100644 --- a/.gitignore +++ b/.gitignore @@ -133,4 +133,5 @@ gha-creds-*.json agent.yaml reflection/ concepts/ -MCBE-Vanilla-RP/ \ No newline at end of file +MCBE-Vanilla-RP/ +Minecraft-default-assets-latest/ \ No newline at end of file From b562ca8b007490f60e61c4527aab5b1466e8f228 Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Wed, 5 Aug 2026 22:50:19 +0200 Subject: [PATCH 060/116] refactor: improve argument resolution and logging in Bedrock conversion --- .../mapping/block/BlockDefinition.java | 6 ++- .../template/ArgumentString.java | 18 +++++++++ .../converter/bedrock/BedrockConverter.java | 7 ++++ .../bedrock/animation/BedrockAnimation.java | 5 +++ .../BedrockConverterTest.java | 37 ------------------- 5 files changed, 34 insertions(+), 39 deletions(-) delete mode 100644 Plugin/src/test/java/fr/robie/craftengineconverter/BedrockConverterTest.java diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/block/BlockDefinition.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/block/BlockDefinition.java index 1d9b9002..52f213bb 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/block/BlockDefinition.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/block/BlockDefinition.java @@ -4,7 +4,6 @@ import com.google.gson.JsonObject; import org.jetbrains.annotations.Nullable; -import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Optional; @@ -237,6 +236,7 @@ public JsonObject serialize() { } public static class Builder { + // Insertion-ordered, and copied as such in build(): Map.copyOf would salt the order per JVM run. private final Map instances = new java.util.LinkedHashMap<>(); public Builder withInstance(String key, String texture, String renderMethod, boolean faceDimming, boolean ambientOcclusion) { this.instances.put(key, new Instance(texture, renderMethod, faceDimming, ambientOcclusion)); @@ -252,6 +252,8 @@ public JsonObject serialize() { JsonObject obj = new JsonObject(); if (this.texture != null) obj.addProperty("texture", this.texture); obj.addProperty("render_method", this.renderMethod); + // Both are always written. Geyser defaults them to false, so omitting a true meant the opposite + // of what the caller asked for and left every full block unshaded. obj.addProperty("face_dimming", this.faceDimming); obj.addProperty("ambient_occlusion", this.ambientOcclusion); return obj; @@ -260,7 +262,7 @@ public JsonObject serialize() { } public record Transformation(float sx, float sy, float sz, float tx, float ty, float tz, - int rx, int ry, int rz) { + int rx, int ry, int rz) { public static final Transformation IDENTITY = new Transformation(1, 1, 1, 0, 0, 0, 0, 0, 0); public boolean isIdentity() { return this.equals(IDENTITY); } public JsonObject serialize() { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/template/ArgumentString.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/template/ArgumentString.java index 1c4827c7..0d060a6f 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/template/ArgumentString.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/template/ArgumentString.java @@ -158,8 +158,23 @@ public Object resolve(@NotNull String node, @NotNull Map Date: Wed, 5 Aug 2026 22:50:28 +0200 Subject: [PATCH 061/116] feat(config): add support for vanilla assets and custom item anchoring in Bedrock conversion --- Plugin/src/main/resources/config.yml | 116 +++++++++++++++++++++++++++ 1 file changed, 116 insertions(+) diff --git a/Plugin/src/main/resources/config.yml b/Plugin/src/main/resources/config.yml index 3891fb2a..9ab80ac6 100644 --- a/Plugin/src/main/resources/config.yml +++ b/Plugin/src/main/resources/config.yml @@ -91,6 +91,122 @@ auto-convert-on-startup: false # Default material for items default-material: "PAPER" +# Vanilla models and textures that packs inherit but do not ship. +# +# A pack's models rarely describe their own shape - they say `"parent": "block/cactus"` and inherit it. Those +# parents live in the Minecraft client jar, so without them the shape is unknown: a custom block's inventory icon +# falls back to a flat square instead of the familiar cube, and a few icons (item/light, armour trim overlays) +# cannot be resolved at all. +# +# The jar is fetched from Mojang's own servers, the same ones the launcher uses, and cached under +# plugins/CraftEngineConverter/vanilla-assets/. Only the files a pack actually references are unpacked from it. +# Nothing is redistributed with this plugin. +# +# Run "/cec bedrock vanilla-assets" to fetch or refresh it up front instead of during a conversion. +vanilla-assets: + # Download the client jar when the cache is empty. Turn off for an offline server; the converter then falls back + # to a built-in cube shape for the handful of parents it can recognise by name. + download: true + # "auto" follows the server's own Minecraft version, which is what the pack targets. Or pin one, e.g. "1.21.4". + version: auto + # Use assets you already have instead of downloading: an extracted assets folder, a client jar, or a vanilla + # resource pack zip. Takes precedence over the download. + # + # For a folder, point at either the "assets" directory itself or the directory containing it - so a checkout of + # the default resource pack works as-is, e.g. "C:/servers/Minecraft-default-assets-latest". + # + # Worth setting. Without it the converter can only rebuild a missing vanilla parent from its *name*, which + # recovers a cube shape and the common poses but not much else; with it, every parent resolves properly and + # models keep their real shape, UVs, face rotations and display transforms. + path: "" + +# Renders an inventory icon from the item's 3D model instead of using the model's texture as the sprite. +# +# Java has no icon file for such an item - the client draws one live from the cubes - while Bedrock can only +# show a flat sprite and cannot render geometry into a slot. Without this, the icon falls back to the model's +# texture, which for a 3D model is a sheet of unwrapped faces rather than a picture of the item. +# +# Items whose model is already a flat sprite (most tools and materials) are unaffected either way. +render-item-icons: true + +# Pixel size of those rendered icons. 64 is plenty for an inventory slot; raise it only if you zoom in on +# icons elsewhere in the UI. +item-icon-size: 64 + +# Shortens generated file names so no path in the pack reaches 80 characters, which some Bedrock platforms fail on +# and which Geyser warns about. A render controller's file name, for instance, restates the identifier inside it +# after 58 characters of fixed boilerplate. +# +# Only affects files Bedrock finds by the identifier written inside them - geometry, animations, animation and render +# controllers, attachables. Textures, sounds, fonts, language files and the manifests are found by path and are never +# renamed. Turn it off only if you want the generated names to stay readable while debugging a pack. +shorten-pack-paths: true + +# Where the game holds a custom item, before the model's own Java "display" transform is applied on top. +# +# Bedrock has no "display" block for held items: a pose is an animation on the attachable, and its position is an +# offset in the holder's item-bone space. That offset cannot be derived from the Java model - it depends on how +# Bedrock positions the hand - so these are starting values taken from vanilla's own attachables (spyglass, spear, +# trident, shield), and the final nudge is something you do by looking at an item in game. +# +# Change a number here and re-run the conversion; no rebuild is needed. Each slot takes translation in model units +# (16 = one block), rotation in degrees, and scale as a multiplier. The off hand mirrors X automatically, so there +# is nothing separate to set for it. +# +# If an item sits too low or too high in the hand, that is "translation" Y. If it is turned the wrong way, that is +# "rotation" X - vanilla uses about -90 to lay an upright model into the hand. If it is invisible in first person, +# suspect a large "translation" Z, which pushes it past the camera. +held-item-anchors: + third-person: + translation: [0, 14, 0] + rotation: [-90, 0, 0] + scale: [1, 1, 1] + first-person: + translation: [0, 16, 0] + rotation: [-90, 0, 0] + scale: [1, 1, 1] + head: + translation: [0, 20, 0] + rotation: [0, 0, 0] + scale: [0.625, 0.625, 0.625] + +# Slots converted items into a vanilla Bedrock creative-menu group by matching their CraftEngine item id +# (for example "default:topaz_ore"). Without a rule here the group is guessed from the item's base material, +# which is often nothing useful - an ore built on nether_brick inherits no group at all. +# +# Each entry is a rule name of your choosing: +# group: the vanilla group to use, e.g. "itemGroup.name.ore". Only vanilla group names work, because a +# custom group has to live in a behavior pack and Geyser cannot send one. An unrecognised name is +# warned about on startup. +# category: optional. Overrides the creative tab (construction, nature, equipment, items) that would +# otherwise be derived from the material. A group is only shown when the item has a category. +# wildcards: "*" matches any run of characters and "?" matches one. A wildcard describes the whole id, and +# the namespace is optional, so "*_ore" and "topaz_*" both match "default:topaz_ore". +# patterns: Java regex, matched anywhere in the id, so "_ore$" and ".*_ore" both work. +# +# A rule may use wildcards, patterns, or both; matching is case-insensitive either way. They are separate +# keys on purpose - a bare "topaz" means "contains topaz" as a regex but "is exactly topaz" as a wildcard. +# +# Rules apply in the order written and the first match wins, so put narrow rules above broad ones. +# +# Example: +# creative-groups: +# ores: +# group: "itemGroup.name.ore" +# category: construction +# wildcards: +# - "*_ore" +# logs: +# group: "itemGroup.name.log" +# wildcards: +# - "*_log" +# - "*_wood" +# leftover-tools: +# group: "itemGroup.name.pickaxe" +# patterns: +# - "(pick|drill)" +creative-groups: {} + # Disable italic formatting in item lore by adding tag disable-default-italic: true From 81c82744020f5e99bda47dd1f85fb047d965c340 Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Wed, 5 Aug 2026 22:57:32 +0200 Subject: [PATCH 062/116] refactor: reorganize imports and streamline manifest configuration in ConversionContext --- .../converter/bedrock/ConversionContext.java | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/ConversionContext.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/ConversionContext.java index c43b602e..5bc5a4ae 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/ConversionContext.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/ConversionContext.java @@ -20,35 +20,31 @@ import fr.robie.craftengineconverter.converter.bedrock.animation.BedrockAnimation; import fr.robie.craftengineconverter.converter.bedrock.animation.BedrockAnimationController; import fr.robie.craftengineconverter.converter.bedrock.animation.BedrockRenderControllers; -import fr.robie.craftengineconverter.converter.bedrock.asset.VanillaAssets; import fr.robie.craftengineconverter.converter.bedrock.asset.VanillaAssetStore; +import fr.robie.craftengineconverter.converter.bedrock.asset.VanillaAssets; import fr.robie.craftengineconverter.converter.bedrock.attachable.BedrockAttachableContext; import fr.robie.craftengineconverter.converter.bedrock.block.BlockStateMapper; -import fr.robie.craftengineconverter.converter.bedrock.geometry.BedrockGeometry; import fr.robie.craftengineconverter.converter.bedrock.font.FontMapper; +import fr.robie.craftengineconverter.converter.bedrock.geometry.BedrockGeometry; +import fr.robie.craftengineconverter.converter.bedrock.geometry.GeometryMapper; +import fr.robie.craftengineconverter.converter.bedrock.geometry.JavaBlockModel; import fr.robie.craftengineconverter.converter.bedrock.icon.ModelTextureTinter; import fr.robie.craftengineconverter.converter.bedrock.item.EquipmentAssetRegistry; import fr.robie.craftengineconverter.converter.bedrock.item.ItemModelDefinitionMapper; -import fr.robie.craftengineconverter.converter.bedrock.waypoint.WaypointStyleMapper; import fr.robie.craftengineconverter.converter.bedrock.lang.LanguageMapper; import fr.robie.craftengineconverter.converter.bedrock.pack.PackPathShortener; -import fr.robie.craftengineconverter.converter.bedrock.geometry.GeometryMapper; -import fr.robie.craftengineconverter.converter.bedrock.geometry.JavaBlockModel; import fr.robie.craftengineconverter.converter.bedrock.sound.SoundMapper; import fr.robie.craftengineconverter.converter.bedrock.texture.ArmorTrimBaker; import fr.robie.craftengineconverter.converter.bedrock.texture.CachedTextureInfo; import fr.robie.craftengineconverter.converter.bedrock.texture.TexturePipeline; +import fr.robie.craftengineconverter.converter.bedrock.waypoint.WaypointStyleMapper; import fr.robie.yamllibrary.ConfigurationSection; import org.bukkit.Material; import org.jetbrains.annotations.Nullable; import java.io.File; import java.nio.file.Path; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import java.util.Set; +import java.util.*; public class ConversionContext { private final MappingsConfiguration mappings = new MappingsConfiguration(); @@ -102,8 +98,7 @@ public ConversionContext(Path customMappingsDir, Path texturesDir, Path packDir) // Blocks read models through the same resolver as items, so they inherit the vanilla-asset fallback and // there is only one copy of the parent-chain logic to keep correct. this.blockStateMapper.withModelResolver(this.javaModelResolver).withTexturePipeline(this.texturePipeline); - this.manifest = new ManifestConfiguration("CraftEngineConverter Pack") - .setPackUUID(java.util.UUID.randomUUID()); + this.manifest = ManifestConfiguration.resourcePack("CraftEngineConverter pack").build(); this.texturesConfig.setResourcePackName("CraftEngineConverter") .setTextureName("atlas.items"); this.terrainTexturesConfig.setResourcePackName("CraftEngineConverter") From 280e5114594151bd57263e3d1cc0077c186270e0 Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Thu, 6 Aug 2026 20:36:11 +0200 Subject: [PATCH 063/116] fix(bedrock): finish the X mirror, and apply it to blocks and their hitboxes Bedrock reads geometry mirrored along X relative to Java. mapElement knew that and flipped a cube's position, but called mapFace with no mirror awareness, so two thirds of the job never happened: the east and west faces did not trade places, and no face's U was reversed. A half mirror moves a shape to the other side of its block and reverses its texture, which is verbatim what the comment removing block mirroring described. The conclusion drawn then was "blocks must not mirror"; the truth was "our mirror is incomplete". One bug wearing two faces - doors and flowers broke because the mirror was partial, and fence gates, stairs and trapdoors broke later because it was removed outright. It hid for so long because a closed fence gate is X-symmetric on all four facings, as is a plain cube, so nothing in the suite could see a mirror at all. Confirmed by measurement against the real 1.21.11 client jar: the converted gate matches Java's coordinates exactly (closed X[-8..8] Z[-1..1], open Z[-1..7], all four facings rotating the right way) and still rendered mirrored in game. So mapFace now takes the flag, swaps east and west, and reverses U by moving the origin to the far edge and negating the width. Both block call sites mirror, verified in game across gates, stairs and trapdoors. Two things fall out of turning it on. An element's rotation is now the mirror's conjugate, which is per axis rather than uniform: the X mirror commutes with a turn about X and reverses one about Y or Z, so only those two change sign. Negating X as well - which is what compensating for Blockbench's export rather than for our own transform did - tilts a rotated part the wrong way about the one axis the mirror leaves alone. And the collision and selection boxes were still measured from Java's raw coordinates, so they sat on the opposite side of the block from the shape they wrap: a stair you could walk through on one half and bump into thin air on the other. They mirror with the geometry now. Four tests move to the mirrored convention with the reasoning recorded, and the block-item held form gains its own test. BedrockItemLoader also drops minecraft:block_placer, which named a block no converted pack registers and left 33 items invisible, and gives a held 3D model to the 24 block items whose model uses a single texture - the only ones an attachable's single render pass can carry correctly. Co-Authored-By: Claude Opus 5 --- .../converter/bedrock/BedrockItemLoader.java | 48 ++-- .../bedrock/block/BlockGeometryBuilder.java | 9 +- .../bedrock/geometry/GeometryMapper.java | 55 +++- .../BlockItemHeldFormTest.java | 119 ++++++++ .../BlockStateMapperShapeTest.java | 255 ++++++++++++++++++ .../BlockTextureTest.java | 237 ++++++++++++++++ .../BlockbenchAlignmentTest.java | 226 ++++++++++++++++ .../UpDownUvConventionTest.java | 77 ++++++ 8 files changed, 1000 insertions(+), 26 deletions(-) create mode 100644 Plugin/src/test/java/fr/robie/craftengineconverter/BlockItemHeldFormTest.java create mode 100644 Plugin/src/test/java/fr/robie/craftengineconverter/BlockStateMapperShapeTest.java create mode 100644 Plugin/src/test/java/fr/robie/craftengineconverter/BlockTextureTest.java create mode 100644 Plugin/src/test/java/fr/robie/craftengineconverter/BlockbenchAlignmentTest.java create mode 100644 Plugin/src/test/java/fr/robie/craftengineconverter/UpDownUvConventionTest.java diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockItemLoader.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockItemLoader.java index aa2d4fcf..5418e00b 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockItemLoader.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockItemLoader.java @@ -561,16 +561,27 @@ private void detectBlockItem(ItemMapping mapping) { String type = behaviorSection.getString("type"); if ("block_item".equals(type)) { - // This component is what makes Bedrock draw the item as its block, in hand and in an item frame: - // "The block placer component will also give the item the 3D appearance of the block by default" - // (bedrock-wiki/blocks/blocks-as-items.md). Without it the item fell back to an attachable, and an - // attachable geometry has one texture per render pass — so a six-textured block like the drawer showed - // the same texture on every face, and the held form never matched the placed block. Block geometry has - // per-face material instances and gets it right, which is why the fix is to defer to it rather than to - // reproduce it. See emitHeldModel in addTextureDataIfSimpleModel for the other half. - mapping.addBedrockComponent(new GenericBedrockComponent("minecraft:block_placer", - java.util.Map.of("block", mapping.getBedrockIdentifier()))); - // Also register textures as terrain textures for block items + // No minecraft:block_placer here, deliberately. + // + // It was added to get the block's 3D appearance in hand — "the block placer component will also give the + // item the 3D appearance of the block by default" (bedrock-wiki/blocks/blocks-as-items.md) — but it + // cannot work for a converted block, and it made the item render as *nothing at all*. The component names + // a block by identifier, and the same page states the constraint it depends on: a replacement block item + // "will need to create a new item JSON file that has the same identifier as the block". A CraftEngine + // block is not a Bedrock block of its own; it is a state override on the vanilla block it replaces, so + // geyser_block_mappings.json registers `minecraft_oak_leaves` and friends and never anything named after + // the item. Pointing block_placer at the item's own identifier named a block that does not exist, and + // Bedrock drew nothing — measured: 33 of this pack's items, every one invisible in the inventory. + // + // Naming the base block instead would not help: `block` takes a plain identifier (only `use_on` accepts + // states), so it could only ever place and draw the unmodified vanilla state — plain oak leaves for palm + // leaves. So the item keeps its 2D icon, which is the documented alternative on that same page. + // + // Getting a correct 3D held form needs all faces packed into one texture with UVs into it, because + // per-face `material_instances` are resolved from the *block* definition against terrain_texture.json + // and mean nothing to an attachable. That is the outstanding UV-atlas work, not something this can fake. + // + // The terrain registration stays: the placed block still reads its textures from that atlas. this.registerExistingTexturesAsTerrain(mapping); } else if ("furniture_item".equals(type)) { String blockedBy = behaviorSection.getString("settings.item"); @@ -780,14 +791,21 @@ private void addTextureDataIfSimpleModel(ModelConfiguration modelConfiguration, // attachables differ only in key separator but sanitise to the same filename, so one silently // overwrote the other. // - // A block item is drawn by Bedrock as its own block, via the minecraft:block_placer component - // added in detectBlockItem. That matters because block geometry carries per-face material - // instances and attachable geometry cannot: a six-textured block converted as an attachable came - // out with one texture on every face, and never matched the block once placed. + // A block item gets a held 3D model only when its model uses a single texture, and its 2D icon + // otherwise. An attachable binds one texture per render pass and its geometry's UVs index into that + // one image, so faces can differ by region but never by texture — per-face material instances are a + // block concept, resolved from the block definition against terrain_texture.json, and mean nothing + // here. With one texture that limit costs nothing and the held form matches the placed block. With + // several it produced a cube wearing one texture on every face, which is worse than a recognisable + // sprite, so those keep the icon until every face can be packed into a single image. + // Measured on the sample pack: 24 of 33 block items use one texture and get real geometry; the 8 + // that do not are the anvil, drawer, safe, melon, lantern, coil and the two logs. + // See detectBlockItem for why minecraft:block_placer is not an alternative. // // The texture work still runs in both cases, because the inventory icon and its flipbook come // from it. - boolean emitHeldModel = !this.isArmorMaterial(mat) && !this.isBlockItem(); + boolean emitHeldModel = !this.isArmorMaterial(mat) + && (!this.isBlockItem() || textureRefs.size() == 1); // Artifacts first: resolving a texture is what populates the animation cache that // isAnimated / getFrameBaseTexturePath below depend on. diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/block/BlockGeometryBuilder.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/block/BlockGeometryBuilder.java index 9eeb9478..4cf2f6fc 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/block/BlockGeometryBuilder.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/block/BlockGeometryBuilder.java @@ -181,10 +181,15 @@ public static Boxes boxesFor(@NotNull JavaBlockModel model) { float maxX = -Float.MAX_VALUE, maxY = -Float.MAX_VALUE, maxZ = -Float.MAX_VALUE; for (JavaBlockModel.Element element : model.elements()) { - float ex0 = Math.min(element.fromX(), element.toX()); + // Mirrored along X to follow the geometry. Block geometry is emitted mirrored, because Bedrock reads it + // that way round, and a box left in Java's coordinates then sits on the opposite side of the block from + // the shape it is meant to wrap — a stair you could walk through on one half and bump into thin air on + // the other. Java's model space is 0..16, so mirroring is 16 minus the coordinate, and the min/max swap + // because negating reverses their order. + float ex0 = JavaBlockModel.UV_SPACE - Math.max(element.fromX(), element.toX()); + float ex1 = JavaBlockModel.UV_SPACE - Math.min(element.fromX(), element.toX()); float ey0 = Math.min(element.fromY(), element.toY()); float ez0 = Math.min(element.fromZ(), element.toZ()); - float ex1 = Math.max(element.fromX(), element.toX()); float ey1 = Math.max(element.fromY(), element.toY()); float ez1 = Math.max(element.fromZ(), element.toZ()); diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/geometry/GeometryMapper.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/geometry/GeometryMapper.java index 5c1940c6..3275af5b 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/geometry/GeometryMapper.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/geometry/GeometryMapper.java @@ -60,7 +60,7 @@ public BedrockGeometry mapBlockGeometry(String identifier, JavaBlockModel model, for (JavaBlockModel.Element element : model.elements()) { this.mapElement(element, bone, (int) JavaBlockModel.UV_SPACE, (int) JavaBlockModel.UV_SPACE, - model, instanceNames, false); + model, instanceNames, true); } return geo; @@ -87,7 +87,7 @@ public BedrockGeometry mapRotatedBlockGeometry(String identifier, JavaBlockModel BedrockGeometry.Bone bone = geo.addBone("bone"); for (JavaBlockModel.Element element : rotateModel(model, rotX, rotY).elements()) { this.mapElement(element, bone, - (int) JavaBlockModel.UV_SPACE, (int) JavaBlockModel.UV_SPACE, model, instanceNames, false); + (int) JavaBlockModel.UV_SPACE, (int) JavaBlockModel.UV_SPACE, model, instanceNames, true); } return geo; } @@ -279,7 +279,7 @@ private void mapElement(JavaBlockModel.Element element, BedrockGeometry.Bone bon for (JavaBlockModel.Face face : element.faces()) { String instance = model == null ? null : materialInstanceFor(face, model); if (instance != null && instanceNames != null) instanceNames.add(instance); - this.mapFace(face, cube, texW, texH, from, to, instance); + this.mapFace(face, cube, texW, texH, from, to, instance, mirrorX); } element.rotation().ifPresent(rot -> { @@ -294,12 +294,14 @@ private void mapElement(JavaBlockModel.Element element, BedrockGeometry.Bone bon if (mirrorX) rotOrigin[0] = -rotOrigin[0]; cube.withPivot(rotOrigin[0], rotOrigin[1], rotOrigin[2]); - // Blockbench's Java→Bedrock export negates X and Y rotation to compensate for its X-axis - // coordinate mirror. Items mirror X, so they need that compensation. Blocks do not mirror X - // (task #72), so their rotation passes through unchanged. Z is never negated. + // A rotation carried through a mirror is the mirror's conjugate of it, and for the X mirror used here + // (x -> -x) that has one answer per axis: turning about X is unchanged, because the mirror plane + // contains the X axis and the two commute, while turning about Y or Z reverses, because the mirror + // flips the sense of the plane each sweeps. Negating X instead — as this did while compensating for + // Blockbench's export rather than for our own transform — tilts a rotated part the wrong way about the + // one axis that should have been left alone. float bedrockAngle = switch (rot.axis()) { - case "x", "y" -> mirrorX ? -rot.angle() : rot.angle(); - case "z" -> rot.angle(); + case "y", "z" -> mirrorX ? -rot.angle() : rot.angle(); default -> rot.angle(); }; float[] rotVec = switch (rot.axis()) { @@ -345,7 +347,22 @@ private void mapFace(JavaBlockModel.Face face, BedrockGeometry.Cube cube, int te private void mapFace(JavaBlockModel.Face face, BedrockGeometry.Cube cube, int texW, int texH, float[] from, float[] to, String materialInstance) { - String dir = face.direction(); + this.mapFace(face, cube, texW, texH, from, to, materialInstance, false); + } + + /** + * @param mirrorX whether the cube this face belongs to was mirrored along X, in which case the face has to be + * mirrored with it. Mirroring is not just a position change: the sides that faced east and west + * have swapped places, and every face keeps its own left and right, so its U must run the other + * way. Moving the cube and leaving its faces alone is a half mirror, and its symptoms are + * on record — the comment that removed block mirroring in the first place described a shape that + * "moves to the opposite side of its own block and reverses its texture", which is exactly what a + * half mirror does. That is why this takes the flag rather than the caller mirroring positions + * alone. + */ + private void mapFace(JavaBlockModel.Face face, BedrockGeometry.Cube cube, int texW, int texH, + float[] from, float[] to, String materialInstance, boolean mirrorX) { + String dir = mirrorX ? mirroredDirection(face.direction()) : face.direction(); float u0 = face.u0(); float v0 = face.v0(); float u1 = face.u1(); @@ -369,6 +386,14 @@ private void mapFace(JavaBlockModel.Face face, BedrockGeometry.Cube cube, int te int uvRotation = ((face.rotation() % 360) + 360) % 360; + // A mirrored cube's faces are seen from the other side, so each one's U has to run the other way or the + // texture reads back to front. Expressed by moving the origin to the far edge and negating the width, which + // is how Bedrock spells a flipped UV rect. + if (mirrorX) { + uvOriginU += uvSizeU; + uvSizeU = -uvSizeU; + } + // Java UVs span 0-16 whatever the texture's resolution (see JavaBlockModel.UV_SPACE), so they are // rescaled into whatever space this geometry declares. float widthMul = texW / JavaBlockModel.UV_SPACE; @@ -381,6 +406,18 @@ private void mapFace(JavaBlockModel.Face face, BedrockGeometry.Cube cube, int te cube.withFace(dir, uvOriginU, uvOriginV, uvSizeU, uvSizeV, materialInstance, uvRotation); } + /** + * Where a face ends up when its cube is mirrored along X: east and west trade places, and the other four are + * unmoved because they straddle the mirror plane rather than sitting either side of it. + */ + private static String mirroredDirection(String direction) { + return switch (direction) { + case "east" -> "west"; + case "west" -> "east"; + default -> direction; + }; + } + public static String getMeaningfulMaterialInstanceName(String face, String texture, int elementIndex) { return texture + "_" + face + "_" + elementIndex; } diff --git a/Plugin/src/test/java/fr/robie/craftengineconverter/BlockItemHeldFormTest.java b/Plugin/src/test/java/fr/robie/craftengineconverter/BlockItemHeldFormTest.java new file mode 100644 index 00000000..a7a16ae0 --- /dev/null +++ b/Plugin/src/test/java/fr/robie/craftengineconverter/BlockItemHeldFormTest.java @@ -0,0 +1,119 @@ +package fr.robie.craftengineconverter; + +import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.ItemMapping; +import fr.robie.craftengineconverter.api.configuration.loader.ConfigurationTrees; +import fr.robie.craftengineconverter.converter.bedrock.BedrockItemLoader; +import fr.robie.craftengineconverter.converter.bedrock.ConversionContext; +import fr.robie.craftengineconverter.common.CraftEngineConverterPlugin; +import fr.robie.yamllibrary.ConfigurationSection; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.LinkedHashMap; +import java.util.Map; + +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +/** + * How a block item is drawn. + * + *

Never with {@code minecraft:block_placer}

+ * That component was used to get the block's 3D look in hand, but it names a block by identifier and a converted + * CraftEngine block is not a Bedrock block of its own — it is a state override on the vanilla block it replaces, so + * {@code geyser_block_mappings.json} registers {@code minecraft_oak_leaves} and never anything named after the item. + * Pointing it at the item's own identifier named a block that does not exist and Bedrock drew nothing at all: + * measured, 33 of the sample pack's items were invisible in the inventory because of it. + * + *

With real geometry only when one texture is involved

+ * An attachable binds one texture per render pass and its geometry's UVs index into that single image, so faces can + * differ by region but never by texture — per-face {@code material_instances} are a block concept resolved against + * {@code terrain_texture.json}. One texture costs nothing and the held form matches the placed block; several would + * put one texture on every face, which is worse than a recognisable sprite, so those keep the 2D icon. + */ +class BlockItemHeldFormTest { + + @BeforeAll + static void loadRegistries() { + new RegistryHelper(CraftEngineConverterPlugin.class.getClassLoader()).loadRegistries(); + } + + private static void write(Path file, String json) throws Exception { + Files.createDirectories(file.getParent()); + Files.writeString(file, json); + } + + /** + * Converts one {@code block_item} whose model names {@code textureCount} textures. + * + * @return the mapping, so the caller can inspect its components + */ + private static Result convert(int textureCount) throws Exception { + Path root = Files.createTempDirectory("block-item"); + Path assets = root.resolve("assets"); + + StringBuilder textures = new StringBuilder(); + for (int layer = 0; layer < textureCount; layer++) { + if (layer > 0) textures.append(','); + // Distinct texture per face key, which is what a multi-textured block model looks like. + textures.append("\"face").append(layer).append("\":\"block/custom/face").append(layer).append('"'); + } + write(assets.resolve("default/models/block/custom/thing.json"), + "{\"textures\":{" + textures + "},\"elements\":[{\"from\":[0,0,0],\"to\":[16,16,16],\"faces\":{" + + "\"north\":{\"uv\":[0,0,16,16],\"texture\":\"#face0\"}}}]}"); + write(assets.resolve("default/items/thing.json"), + "{\"model\":{\"type\":\"model\",\"model\":\"default:block/custom/thing\"}}"); + + Path out = root.resolve("out"); + Files.createDirectories(out); + ConversionContext context = new ConversionContext(out, out, out).withJavaAssetsDir(assets); + context.addItemsDirectory(assets.resolve("default/items").toFile(), "default"); + + Map item = new LinkedHashMap<>(); + item.put("material", "stone"); + item.put("behavior", Map.of("type", "block_item")); + ConfigurationSection section = ConfigurationTrees.toSection(item); + + ItemMapping mapping = new BedrockItemLoader("default:thing", section, context).load(); + assertNotNull(mapping, "the item must convert at all"); + return new Result(mapping, context); + } + + private record Result(ItemMapping mapping, ConversionContext context) { + boolean hasHeldGeometry() { + // registerPipelineArtifacts only records geometry when a held model is being emitted. + return !this.context.collectedGeometry().isEmpty(); + } + + String serialised() { + return this.mapping.serialize().toString(); + } + } + + @Test + void aBlockItemNeverGetsBlockPlacer() throws Exception { + for (int textureCount : new int[]{1, 6}) { + String json = convert(textureCount).serialised(); + assertFalse(json.contains("block_placer"), + "block_placer names a block that a converted pack never registers, and Bedrock then draws" + + " nothing; got " + json); + } + } + + @Test + void aSingleTextureBlockItemGetsRealHeldGeometry() throws Exception { + assertTrue(convert(1).hasHeldGeometry(), + "one texture means the attachable's single render pass is enough, so the held form can match the" + + " placed block"); + } + + @Test + void aMultiTextureBlockItemFallsBackToItsIcon() throws Exception { + assertFalse(convert(6).hasHeldGeometry(), + "six textures cannot survive one render pass; a cube with the wrong texture on five faces is worse" + + " than a sprite, so no held geometry is emitted"); + } +} diff --git a/Plugin/src/test/java/fr/robie/craftengineconverter/BlockStateMapperShapeTest.java b/Plugin/src/test/java/fr/robie/craftengineconverter/BlockStateMapperShapeTest.java new file mode 100644 index 00000000..f2d2b7fd --- /dev/null +++ b/Plugin/src/test/java/fr/robie/craftengineconverter/BlockStateMapperShapeTest.java @@ -0,0 +1,255 @@ +package fr.robie.craftengineconverter; + +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; +import fr.robie.craftengineconverter.converter.bedrock.asset.VanillaAssets; +import fr.robie.craftengineconverter.converter.bedrock.block.BlockStateMapper; +import fr.robie.craftengineconverter.converter.bedrock.geometry.JavaModelResolver; +import org.junit.jupiter.api.Test; + +import java.nio.file.Files; +import java.nio.file.Path; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +/** + * Bedrock has only two usable built-in block models — a full cube and a crossed plane — so what a block looks like + * comes down to measuring its Java shape and either matching a built-in or shipping geometry of its own. These pin + * that decision, using stubbed vanilla models rather than a download. + */ +class BlockStateMapperShapeTest { + + private static void write(Path file, String json) throws Exception { + Files.createDirectories(file.getParent()); + Files.writeString(file, json); + } + + /** + * A pack with one blockstate pointing at one model, plus a stub of the vanilla parent it inherits. + * + * @return the emitted definition for the single state + */ + private static JsonObject convert(String modelJson, String vanillaParentPath, String vanillaParentJson) + throws Exception { + Path root = Files.createTempDirectory("blockshape"); + Path assets = root.resolve("assets"); + + write(assets.resolve("minecraft/blockstates/test_block.json"), + "{\"variants\":{\"\":{\"model\":\"block/custom/thing\"}}}"); + write(assets.resolve("minecraft/models/block/custom/thing.json"), modelJson); + + JavaModelResolver resolver = new JavaModelResolver(); + if (vanillaParentPath != null) { + write(root.resolve("vanilla/assets/minecraft/models/" + vanillaParentPath + ".json"), vanillaParentJson); + resolver.withVanillaAssets(new VanillaAssets(root.resolve("cache"), root.resolve("vanilla"))); + } + + BlockStateMapper mapper = new BlockStateMapper().withModelResolver(resolver); + mapper.addFromBlockstatesDirectory( + assets.resolve("minecraft/blockstates").toFile(), "minecraft", assets); + + Path out = root.resolve("out"); + Files.createDirectories(out); + mapper.save(out); + + JsonObject blocks = JsonParser.parseString(Files.readString(out.resolve("geyser_block_mappings.json"))) + .getAsJsonObject().getAsJsonObject("blocks"); + assertEquals(1, blocks.size()); + return blocks.getAsJsonObject(blocks.keySet().iterator().next()); + } + + private static String geometryOf(JsonObject definition) { + return definition.getAsJsonObject("geometry").get("identifier").getAsString(); + } + + private static JsonObject defaultInstance(JsonObject definition) { + return definition.getAsJsonObject("material_instances").getAsJsonObject("*"); + } + + /** + * The mapping key is the Java block being overridden; {@code name} is the Bedrock custom block, which + * Geyser prefixes with {@code geyser_custom:}. Putting a namespaced identifier in {@code name} produced + * {@code geyser_custom:minecraft:anvil} - two colons, not a valid Bedrock identifier - and the client refused to + * register the block, reported every geometry component on it as a missing asset, and crashed while writing the + * 416th such error. + */ + @Test + void theBedrockNameCarriesNoNamespace() throws Exception { + Path root = Files.createTempDirectory("blockname"); + Path assets = root.resolve("assets"); + write(assets.resolve("minecraft/blockstates/anvil.json"), + "{\"variants\":{\"\":{\"model\":\"block/custom/thing\"}}}"); + write(assets.resolve("minecraft/models/block/custom/thing.json"), + "{\"elements\":[{\"from\":[0,0,0],\"to\":[16,16,16],\"faces\":{" + + "\"up\":{\"uv\":[0,0,16,16],\"texture\":\"#all\"}}}]," + + "\"textures\":{\"all\":\"block/custom/thing\"}}"); + + BlockStateMapper mapper = new BlockStateMapper().withModelResolver(new JavaModelResolver()); + mapper.addFromBlockstatesDirectory( + assets.resolve("minecraft/blockstates").toFile(), "minecraft", assets); + Path out = Files.createDirectories(root.resolve("out")); + mapper.save(out); + + JsonObject blocks = JsonParser.parseString(Files.readString(out.resolve("geyser_block_mappings.json"))) + .getAsJsonObject().getAsJsonObject("blocks"); + + assertTrue(blocks.has("minecraft:anvil"), + "the key is the Java block Geyser looks the override up by, got " + blocks.keySet()); + + String name = blocks.getAsJsonObject("minecraft:anvil").get("name").getAsString(); + assertFalse(name.contains(":"), + "Geyser prepends geyser_custom:, so a colon here yields an invalid two-colon identifier, got " + name); + assertEquals("minecraft_anvil", name, + "the namespace is folded in rather than dropped, so two namespaces stay distinct"); + } + + @Test + void aCubeParentedBlockUsesTheBuiltInFullBlock() throws Exception { + JsonObject definition = convert( + "{\"parent\":\"block/cube_all\",\"textures\":{\"all\":\"block/custom/thing\"}}", + "block/cube_all", + "{\"elements\":[{\"from\":[0,0,0],\"to\":[16,16,16],\"faces\":{" + + "\"up\":{\"uv\":[0,0,16,16],\"texture\":\"#all\"}}}]}"); + + assertEquals("minecraft:geometry.full_block", geometryOf(definition)); + + JsonObject instance = defaultInstance(definition); + assertEquals("opaque", instance.get("render_method").getAsString()); + // Both must be present and true. Geyser defaults them to false, so a full block that omits them renders + // unshaded and flat beside its vanilla neighbours. + assertTrue(instance.get("face_dimming").getAsBoolean()); + assertTrue(instance.get("ambient_occlusion").getAsBoolean()); + } + + @Test + void aPlantUsesTheBuiltInCrossWithShadingOff() throws Exception { + JsonObject definition = convert( + "{\"parent\":\"block/cross\",\"textures\":{\"cross\":\"block/custom/thing\"}}", + "block/cross", + "{\"elements\":[" + + "{\"from\":[0.8,0,8],\"to\":[15.2,16,8],\"faces\":{" + + "\"north\":{\"uv\":[0,0,16,16],\"texture\":\"#cross\"}}}," + + "{\"from\":[8,0,0.8],\"to\":[8,16,15.2],\"faces\":{" + + "\"east\":{\"uv\":[0,0,16,16],\"texture\":\"#cross\"}}}]}"); + + assertEquals("minecraft:geometry.cross", geometryOf(definition)); + + JsonObject instance = defaultInstance(definition); + // geometry.cross flickers without back-face culling, and shading a flat sheet by its facing darkens one + // half of the cross. This is the setup vanilla crops use. + assertEquals("alpha_test_single_sided", instance.get("render_method").getAsString()); + assertFalse(instance.get("face_dimming").getAsBoolean()); + assertFalse(instance.get("ambient_occlusion").getAsBoolean()); + } + + /** + * Two solid elements is a stairway, not a cross — the distinction the old element-count rule could not + * make. It has no built-in model, so it must ship geometry. + */ + @Test + void aPartialShapeGetsGeneratedGeometry() throws Exception { + JsonObject definition = convert( + "{\"parent\":\"block/slab\",\"textures\":{\"side\":\"block/custom/thing\"}}", + "block/slab", + "{\"elements\":[{\"from\":[0,0,0],\"to\":[16,8,16],\"faces\":{" + + "\"up\":{\"uv\":[0,0,16,16],\"texture\":\"#side\"}}}]}"); + + String geometry = geometryOf(definition); + assertTrue(geometry.startsWith("geometry.blocks."), "expected generated geometry, got " + geometry); + // Colons are invalid in a geometry identifier. + assertFalse(geometry.contains(":"), geometry); + } + + @Test + void generatedGeometryKeepsTheJavaBounds() throws Exception { + Path root = Files.createTempDirectory("blockshape"); + Path assets = root.resolve("assets"); + write(assets.resolve("minecraft/blockstates/test_block.json"), + "{\"variants\":{\"\":{\"model\":\"block/custom/thing\"}}}"); + write(assets.resolve("minecraft/models/block/custom/thing.json"), + "{\"textures\":{\"0\":\"block/custom/thing\"},\"elements\":[" + + "{\"from\":[4,0,5],\"to\":[7,2,8],\"faces\":{" + + "\"up\":{\"uv\":[0,0,16,16],\"texture\":\"#0\"}}}]}"); + + BlockStateMapper mapper = new BlockStateMapper().withModelResolver(new JavaModelResolver()); + mapper.addFromBlockstatesDirectory(assets.resolve("minecraft/blockstates").toFile(), "minecraft", assets); + + var generated = mapper.getGeneratedGeometry(); + assertEquals(1, generated.size()); + + JsonObject geo = generated.values().iterator().next().serialize() + .getAsJsonArray("minecraft:geometry").get(0).getAsJsonObject(); + JsonObject bone = geo.getAsJsonArray("bones").get(0).getAsJsonObject(); + // A block bone must not carry the attachable's item-slot binding. + assertFalse(bone.has("binding"), "block geometry should have no item-slot binding"); + + JsonObject cube = bone.getAsJsonArray("cubes").get(0).getAsJsonObject(); + // x and z are centred on the block, y is untouched, and x is mirrored, because Bedrock reads geometry + // mirrored relative to Java. So from [4,0,5] centres to [-4, 0, -3] and the x then reflects to +1. + // + // This used to assert -4, on the reasoning that mirroring "moved a door to the opposite half of its frame + // and reversed its texture". Those were real symptoms of a mirror that moved cubes but never swapped the + // east and west faces or flipped their U — a half mirror. Completing it fixed the doors and left the + // mirror correct; keeping the mirror off instead was what put fence gates, stairs and trapdoors the wrong + // way round, invisibly, because a closed gate is X-symmetric on all four facings. + assertEquals(1.0, cube.getAsJsonArray("origin").get(0).getAsDouble(), 0.001); + assertEquals(0.0, cube.getAsJsonArray("origin").get(1).getAsDouble(), 0.001); + assertEquals(-3.0, cube.getAsJsonArray("origin").get(2).getAsDouble(), 0.001); + assertEquals(3.0, cube.getAsJsonArray("size").get(0).getAsDouble(), 0.001); + assertEquals(2.0, cube.getAsJsonArray("size").get(1).getAsDouble(), 0.001); + + // The face points at a material instance named after the Java texture variable. + assertEquals("0", cube.getAsJsonObject("uv").getAsJsonObject("up").get("material_instance").getAsString()); + } + + /** + * Several states of one host block routinely use different models — three pebble models on + * {@code minecraft:tripwire} — so geometry has to be named after the model. Naming it after the block gave them + * all one file and left every state wearing the last model's shape. + */ + @Test + void eachModelGetsItsOwnGeometryEvenOnOneBlock() throws Exception { + Path root = Files.createTempDirectory("blockshape"); + Path assets = root.resolve("assets"); + write(assets.resolve("minecraft/blockstates/test_block.json"), + "{\"variants\":{\"age=0\":{\"model\":\"block/custom/one\"}," + + "\"age=1\":{\"model\":\"block/custom/two\"}}}"); + for (String name : new String[]{"one", "two"}) { + write(assets.resolve("minecraft/models/block/custom/" + name + ".json"), + "{\"textures\":{\"0\":\"block/custom/" + name + "\"},\"elements\":[" + + "{\"from\":[4,0,5],\"to\":[7,2,8],\"faces\":{" + + "\"up\":{\"uv\":[0,0,16,16],\"texture\":\"#0\"}}}]}"); + } + + BlockStateMapper mapper = new BlockStateMapper().withModelResolver(new JavaModelResolver()); + mapper.addFromBlockstatesDirectory(assets.resolve("minecraft/blockstates").toFile(), "minecraft", assets); + + assertEquals(2, mapper.getGeneratedGeometry().size(), "two models must not share one geometry file"); + } + + /** A model Bedrock would refuse has to degrade to a full block rather than produce a pack the client drops. */ + @Test + void aModelBeyondBedrocksLimitsFallsBackToAFullBlock() throws Exception { + JsonObject definition = convert( + "{\"textures\":{\"0\":\"block/custom/thing\"},\"elements\":[" + + "{\"from\":[0,0,0],\"to\":[16,40,16],\"faces\":{" + + "\"up\":{\"uv\":[0,0,16,16],\"texture\":\"#0\"}}}]}", + null, null); + + // 40 units tall is past the 30-unit block model limit. + assertEquals("minecraft:geometry.full_block", geometryOf(definition)); + } + + @Test + void aModelThatResolvesToNothingStillMapsToAFullBlock() throws Exception { + JsonObject definition = convert( + "{\"parent\":\"block/not_shipped_anywhere\",\"textures\":{\"all\":\"block/custom/thing\"}}", + null, null); + + assertNotNull(definition); + assertEquals("minecraft:geometry.full_block", geometryOf(definition)); + } +} diff --git a/Plugin/src/test/java/fr/robie/craftengineconverter/BlockTextureTest.java b/Plugin/src/test/java/fr/robie/craftengineconverter/BlockTextureTest.java new file mode 100644 index 00000000..79d1db4d --- /dev/null +++ b/Plugin/src/test/java/fr/robie/craftengineconverter/BlockTextureTest.java @@ -0,0 +1,237 @@ +package fr.robie.craftengineconverter; + +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; +import fr.robie.craftengineconverter.converter.bedrock.asset.VanillaAssets; +import fr.robie.craftengineconverter.converter.bedrock.block.BlockStateMapper; +import fr.robie.craftengineconverter.converter.bedrock.geometry.BedrockGeometry; +import fr.robie.craftengineconverter.converter.bedrock.geometry.GeometryMapper; +import fr.robie.craftengineconverter.converter.bedrock.geometry.JavaBlockModel; +import fr.robie.craftengineconverter.converter.bedrock.geometry.JavaModelResolver; +import fr.robie.craftengineconverter.converter.bedrock.geometry.VanillaBlockShapes; +import org.junit.jupiter.api.Test; + +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Map; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +/** + * What a full-cube block's faces actually say. + *

+ * Bedrock's built-in unit cube maps every face to its whole texture at rotation zero, and + * {@code material_instances} only chooses which texture a face uses. So a block whose appearance depends on + * per-face rotation — the glazed-terracotta family, and any chessboard-like pattern built on it — cannot be + * expressed that way and must get real geometry instead. These pin that, and the shape rebuild that feeds it. + */ +class BlockTextureTest { + + private record Converted(JsonObject definition, Map geometry) {} + + private static void write(Path file, String json) throws Exception { + Files.createDirectories(file.getParent()); + Files.writeString(file, json); + } + + /** A pack with one blockstate pointing at one model, plus a stub of the vanilla parent it inherits. */ + private static Converted convert(String modelJson, String vanillaParentPath, String vanillaParentJson) + throws Exception { + Path root = Files.createTempDirectory("blocktexture"); + Path assets = root.resolve("assets"); + + write(assets.resolve("minecraft/blockstates/test_block.json"), + "{\"variants\":{\"\":{\"model\":\"block/custom/thing\"}}}"); + write(assets.resolve("minecraft/models/block/custom/thing.json"), modelJson); + + JavaModelResolver resolver = new JavaModelResolver(); + if (vanillaParentPath != null) { + write(root.resolve("vanilla/assets/minecraft/models/" + vanillaParentPath + ".json"), vanillaParentJson); + resolver.withVanillaAssets(new VanillaAssets(root.resolve("cache"), root.resolve("vanilla"))); + } + + BlockStateMapper mapper = new BlockStateMapper().withModelResolver(resolver); + mapper.addFromBlockstatesDirectory( + assets.resolve("minecraft/blockstates").toFile(), "minecraft", assets); + + Path out = root.resolve("out"); + Files.createDirectories(out); + mapper.save(out); + + JsonObject blocks = JsonParser.parseString(Files.readString(out.resolve("geyser_block_mappings.json"))) + .getAsJsonObject().getAsJsonObject("blocks"); + assertEquals(1, blocks.size()); + return new Converted(blocks.getAsJsonObject(blocks.keySet().iterator().next()), + mapper.getGeneratedGeometry()); + } + + private static String geometryOf(JsonObject definition) { + return definition.getAsJsonObject("geometry").get("identifier").getAsString(); + } + + private static JsonObject facesOf(BedrockGeometry geometry) { + return geometry.serialize() + .getAsJsonArray("minecraft:geometry").get(0).getAsJsonObject() + .getAsJsonArray("bones").get(0).getAsJsonObject() + .getAsJsonArray("cubes").get(0).getAsJsonObject() + .getAsJsonObject("uv"); + } + + private static int uvRotationOf(JsonObject faces, String direction) { + JsonObject face = faces.getAsJsonObject(direction); + assertNotNull(face, "no " + direction + " face"); + return face.has("uv_rotation") ? face.get("uv_rotation").getAsInt() : 0; + } + + // ---------------------------------------------------------------- routing + + /** A plain cube keeps the cheap built-in shape and ships no geometry file. */ + @Test + void aPlainFullCubeStillUsesTheBuiltInUnitCube() throws Exception { + Converted converted = convert( + "{\"parent\":\"block/cube_all\",\"textures\":{\"all\":\"block/custom/thing\"}}", + "block/cube_all", + "{\"elements\":[{\"from\":[0,0,0],\"to\":[16,16,16],\"faces\":{" + + "\"up\":{\"uv\":[0,0,16,16],\"texture\":\"#all\"}," + + "\"north\":{\"uv\":[0,0,16,16],\"texture\":\"#all\"}}}]}"); + + assertEquals("minecraft:geometry.full_block", geometryOf(converted.definition())); + assertTrue(converted.geometry().isEmpty(), "a plain cube needs no geometry file"); + } + + /** + * The chessboard case. A full cube whose faces carry rotations must get real geometry, because the unit cube + * cannot turn a face's texture at all. + */ + @Test + void aFullCubeWithFaceRotationsGetsRealGeometryCarryingThem() throws Exception { + Converted converted = convert( + "{\"parent\":\"block/template_glazed_terracotta\",\"textures\":{\"pattern\":\"block/custom/thing\"}}", + "block/template_glazed_terracotta", + "{\"elements\":[{\"from\":[0,0,0],\"to\":[16,16,16],\"faces\":{" + + "\"down\":{\"uv\":[0,0,16,16],\"texture\":\"#pattern\"}," + + "\"up\":{\"uv\":[0,0,16,16],\"texture\":\"#pattern\"}," + + "\"north\":{\"uv\":[0,0,16,16],\"texture\":\"#pattern\",\"rotation\":90}," + + "\"south\":{\"uv\":[0,0,16,16],\"texture\":\"#pattern\",\"rotation\":270}," + + "\"west\":{\"uv\":[0,0,16,16],\"texture\":\"#pattern\",\"rotation\":0}," + + "\"east\":{\"uv\":[0,0,16,16],\"texture\":\"#pattern\",\"rotation\":180}}}]}"); + + assertFalse("minecraft:geometry.full_block".equals(geometryOf(converted.definition())), + "a rotated-face cube must not be flattened onto the unit cube"); + assertEquals(1, converted.geometry().size(), "it needs a geometry file of its own"); + + // Block geometry is mirrored along X, so the two side faces trade places: what Java authored on the east + // arrives on the west and vice versa, each keeping its own rotation. North and south straddle the mirror + // plane and stay put. Distinct rotations per face are what make the swap visible here at all. + JsonObject faces = facesOf(converted.geometry().values().iterator().next()); + assertEquals(90, uvRotationOf(faces, "north")); + assertEquals(270, uvRotationOf(faces, "south")); + assertEquals(180, uvRotationOf(faces, "west"), "Java's east face, rotated 180, lands on the west"); + assertEquals(0, uvRotationOf(faces, "east"), "Java's west face, rotated 0, lands on the east"); + } + + /** Partial UVs are the other thing a unit cube cannot sample. */ + @Test + void aFullCubeWithPartialUvsGetsRealGeometry() throws Exception { + Converted converted = convert( + "{\"parent\":\"block/cube_all\",\"textures\":{\"all\":\"block/custom/thing\"}}", + "block/cube_all", + "{\"elements\":[{\"from\":[0,0,0],\"to\":[16,16,16],\"faces\":{" + + "\"up\":{\"uv\":[0,0,8,8],\"texture\":\"#all\"}}}]}"); + + assertFalse("minecraft:geometry.full_block".equals(geometryOf(converted.definition())), + "a cube sampling part of its texture must not use the unit cube"); + } + + /** + * Bedrock renders a custom block in hand and in the inventory from the block's own geometry, posed by + * {@code item_display_transforms} — so a block with a Java {@code display} block needs a geometry file for the + * pose to live in, even when its shape is a plain cube. + */ + @Test + void aFullCubeWithADisplayBlockGetsGeometryCarryingItemDisplayTransforms() throws Exception { + Converted converted = convert( + "{\"parent\":\"block/cube_all\",\"textures\":{\"all\":\"block/custom/thing\"}}", + "block/cube_all", + "{\"display\":{\"thirdperson_righthand\":{\"rotation\":[75,45,0]," + + "\"translation\":[0,2.5,0],\"scale\":[0.375,0.375,0.375]}}," + + "\"elements\":[{\"from\":[0,0,0],\"to\":[16,16,16],\"faces\":{" + + "\"up\":{\"uv\":[0,0,16,16],\"texture\":\"#all\"}}}]}"); + + assertFalse("minecraft:geometry.full_block".equals(geometryOf(converted.definition())), + "a posed block needs geometry the pose can live in"); + assertEquals(1, converted.geometry().size()); + + JsonObject root = converted.geometry().values().iterator().next().serialize() + .getAsJsonArray("minecraft:geometry").get(0).getAsJsonObject(); + assertTrue(root.has("item_display_transforms"), + "the block's Java display block must reach the geometry"); + assertNotNull(root.getAsJsonObject("item_display_transforms").get("thirdperson_righthand")); + } + + // ---------------------------------------------------------------- the shape rebuild + + /** + * When the vanilla parent is not cached the cube is rebuilt from the parent's name. That rebuild used to + * hardcode rotation zero on all six faces, which is exactly what silently dropped the glazed-terracotta + * rotations — right in Blockbench, which has the real parent, wrong in game. + */ + @Test + void theNameBasedRebuildCarriesTheGlazedTerracottaRotations() { + JavaBlockModel model = new JavaBlockModel("block/template_glazed_terracotta", true); + model.addTexture("pattern", "block/custom/chessboard"); + + assertTrue(VanillaBlockShapes.addCube(model, "block/template_glazed_terracotta")); + + Map rotations = new java.util.HashMap<>(); + for (JavaBlockModel.Face face : model.elements().getFirst().faces()) { + rotations.put(face.direction(), face.rotation()); + } + assertEquals(90, rotations.get("north"), "north"); + assertEquals(270, rotations.get("south"), "south"); + assertEquals(0, rotations.get("west"), "west"); + assertEquals(180, rotations.get("east"), "east"); + assertEquals(0, rotations.get("up"), "up"); + assertEquals(0, rotations.get("down"), "down"); + } + + @Test + void otherRebuiltShapesStayUnrotated() { + JavaBlockModel model = new JavaBlockModel("block/cube_all", true); + model.addTexture("all", "block/custom/thing"); + + assertTrue(VanillaBlockShapes.addCube(model, "block/cube_all")); + for (JavaBlockModel.Face face : model.elements().getFirst().faces()) { + assertEquals(0, face.rotation(), face.direction() + " should be unrotated"); + } + } + + // ---------------------------------------------------------------- baked variant rotation + + /** + * Turning a block about Y carries the four sides onto one another, each keeping its texture upright — but the + * axis runs through the top and bottom, so there the turn happens within the face's own plane and shows as a + * quarter turn of the texture. Without this, all four facings of a patterned block show the same top. + */ + @Test + void bakingAVariantRotationTurnsOnlyTheTopAndBottomTextures() { + assertEquals(90, GeometryMapper.rotatedFaceRotation("up", 0, 90), "up follows the block round"); + assertEquals(270, GeometryMapper.rotatedFaceRotation("down", 0, 90), "down turns the other way"); + + for (String side : new String[]{"north", "south", "east", "west"}) { + assertEquals(0, GeometryMapper.rotatedFaceRotation(side, 0, 90), + side + " keeps its texture upright as it moves"); + } + } + + @Test + void bakedFaceRotationAddsToTheFacesOwnAndStaysInRange() { + assertEquals(0, GeometryMapper.rotatedFaceRotation("up", 270, 90), "270 + 90 wraps to 0"); + assertEquals(180, GeometryMapper.rotatedFaceRotation("up", 90, 90)); + assertEquals(0, GeometryMapper.rotatedFaceRotation("down", 90, 90), "90 - 90"); + assertEquals(270, GeometryMapper.rotatedFaceRotation("down", 0, 90), "0 - 90 wraps positive"); + } +} diff --git a/Plugin/src/test/java/fr/robie/craftengineconverter/BlockbenchAlignmentTest.java b/Plugin/src/test/java/fr/robie/craftengineconverter/BlockbenchAlignmentTest.java new file mode 100644 index 00000000..b7988da2 --- /dev/null +++ b/Plugin/src/test/java/fr/robie/craftengineconverter/BlockbenchAlignmentTest.java @@ -0,0 +1,226 @@ +package fr.robie.craftengineconverter; + +import com.google.gson.JsonObject; +import fr.robie.craftengineconverter.converter.bedrock.block.BlockGeometryBuilder; +import fr.robie.craftengineconverter.converter.bedrock.geometry.BedrockGeometry; +import fr.robie.craftengineconverter.converter.bedrock.geometry.GeometryMapper; +import fr.robie.craftengineconverter.converter.bedrock.geometry.JavaBlockModel; +import org.junit.jupiter.api.Test; + +import java.util.LinkedHashSet; +import java.util.Set; + +import static org.junit.jupiter.api.Assertions.*; + +class BlockbenchAlignmentTest { + + @Test + void faceRotation90EmitsUvRotation() { + JavaBlockModel model = new JavaBlockModel(null, true); + model.addTexture("top", "block/test"); + JavaBlockModel.Element cube = new JavaBlockModel.Element(0, 0, 0, 16, 16, 16); + cube.addFace("up", "#top", 0, 0, 16, 16, 90); + model.addElement(cube); + + JsonObject cubeJson = firstCube(buildBlock(model)); + JsonObject up = cubeJson.getAsJsonObject("uv").getAsJsonObject("up"); + assertEquals(90, up.get("uv_rotation").getAsInt()); + } + + @Test + void faceRotation180EmitsUvRotation() { + JavaBlockModel model = new JavaBlockModel(null, true); + model.addTexture("side", "block/test"); + JavaBlockModel.Element cube = new JavaBlockModel.Element(0, 0, 0, 16, 16, 16); + cube.addFace("north", "#side", 0, 0, 16, 16, 180); + model.addElement(cube); + + JsonObject cubeJson = firstCube(buildBlock(model)); + JsonObject north = cubeJson.getAsJsonObject("uv").getAsJsonObject("north"); + assertEquals(180, north.get("uv_rotation").getAsInt()); + } + + @Test + void faceRotation270EmitsUvRotation() { + JavaBlockModel model = new JavaBlockModel(null, true); + model.addTexture("side", "block/test"); + JavaBlockModel.Element cube = new JavaBlockModel.Element(0, 0, 0, 16, 16, 16); + cube.addFace("east", "#side", 0, 0, 16, 16, 270); + model.addElement(cube); + + // Read back under "west": block geometry is mirrored along X, and the two side faces trade places with it, + // so the face Java authored as east is the one Bedrock sees on the west. Its uv_rotation rides along + // unchanged — the mirror moves the face and reverses its U, it does not re-rotate the texture. + JsonObject cubeJson = firstCube(buildBlock(model)); + JsonObject mirroredEast = cubeJson.getAsJsonObject("uv").getAsJsonObject("west"); + assertNotNull(mirroredEast, "the east face must be emitted as west once the cube is mirrored"); + assertEquals(270, mirroredEast.get("uv_rotation").getAsInt()); + } + + @Test + void noFaceRotationOmitsUvRotation() { + JavaBlockModel model = new JavaBlockModel(null, true); + model.addTexture("side", "block/test"); + JavaBlockModel.Element cube = new JavaBlockModel.Element(0, 0, 0, 16, 16, 16); + cube.addFace("north", "#side", 0, 0, 16, 16, 0); + model.addElement(cube); + + JsonObject cubeJson = firstCube(buildBlock(model)); + JsonObject north = cubeJson.getAsJsonObject("uv").getAsJsonObject("north"); + assertNull(north.get("uv_rotation"), "uv_rotation should be absent when 0"); + } + + @Test + void rescaleEmitsInflate() { + JavaBlockModel model = new JavaBlockModel(null, true); + model.addTexture("all", "block/test"); + JavaBlockModel.Element cube = new JavaBlockModel.Element(0, 0, 0, 8, 8, 8); + cube.addFace("north", "#all", 0, 0, 8, 8, 0); + cube.setRotation(4, 4, 4, 22.5F, "y", true); + model.addElement(cube); + + JsonObject cubeJson = firstCube(buildBlock(model)); + assertTrue(cubeJson.has("inflate"), "inflate should be emitted when rescale is true"); + float inflate = cubeJson.get("inflate").getAsFloat(); + assertTrue(inflate > 0.1F && inflate < 1.0F, "inflate " + inflate + " should be reasonable for 22.5 degrees"); + } + + @Test + void noRescaleOmitsInflate() { + JavaBlockModel model = new JavaBlockModel(null, true); + model.addTexture("all", "block/test"); + JavaBlockModel.Element cube = new JavaBlockModel.Element(0, 0, 0, 8, 8, 8); + cube.addFace("north", "#all", 0, 0, 8, 8, 0); + cube.setRotation(4, 4, 4, 22.5F, "y", false); + model.addElement(cube); + + JsonObject cubeJson = firstCube(buildBlock(model)); + assertFalse(cubeJson.has("inflate"), "inflate should be absent when rescale is false"); + } + + @Test + void displayTransformsProduceItemDisplayTransforms() { + JavaBlockModel model = new JavaBlockModel(null, true); + model.addTexture("all", "block/test"); + JavaBlockModel.Element cube = new JavaBlockModel.Element(0, 0, 0, 8, 8, 8); + cube.addFace("north", "#all", 0, 0, 8, 8, 0); + model.addElement(cube); + model.addDisplay("gui", new JavaBlockModel.DisplayTransform( + new float[]{30, 225, 0}, new float[]{0, 0, 0}, new float[]{0.625F, 0.625F, 0.625F})); + + BlockGeometryBuilder.Result result = BlockGeometryBuilder.build( + "test_display", model, k -> "test_shortname", "opaque", "test", 0, 0); + assertNotNull(result); + JsonObject geo = result.geometry().serialize(); + JsonObject root = geo.getAsJsonArray("minecraft:geometry").get(0).getAsJsonObject(); + assertTrue(root.has("item_display_transforms"), "block geometry should carry item_display_transforms"); + JsonObject gui = root.getAsJsonObject("item_display_transforms").getAsJsonObject("gui"); + assertNotNull(gui); + assertEquals(30.0F, gui.getAsJsonArray("rotation").get(0).getAsFloat(), 0.001F); + assertTrue(gui.has("fit_to_frame"), "gui slot should have fit_to_frame"); + assertEquals("1.21.110", geo.get("format_version").getAsString()); + + // Bedrock's inventory camera looks at a block from the opposite side, so Java's 225 becomes 45 — + // Blockbench's applyPreset does exactly this substitution for a Bedrock block project. + assertEquals(45.0F, gui.getAsJsonArray("rotation").get(1).getAsFloat(), 0.001F, + "the gui slot's Y rotation must be turned half a circle for Bedrock"); + assertEquals(0.0F, gui.getAsJsonArray("rotation").get(2).getAsFloat(), 0.001F, "Z is untouched"); + } + + /** + * Blockbench's {@code DisplaySlot.exportBedrock} writes nothing for a slot at its defaults, and the mere + * presence of any slot drags the whole file up to {@code format_version 1.21.110}. + */ + @Test + void anAllDefaultDisplaySlotIsNotEmitted() { + JavaBlockModel model = new JavaBlockModel(null, true); + model.addTexture("all", "block/test"); + JavaBlockModel.Element cube = new JavaBlockModel.Element(0, 0, 0, 8, 8, 8); + cube.addFace("north", "#all", 0, 0, 8, 8, 0); + model.addElement(cube); + model.addDisplay("ground", new JavaBlockModel.DisplayTransform( + new float[]{0, 0, 0}, new float[]{0, 0, 0}, new float[]{1, 1, 1})); + + BlockGeometryBuilder.Result result = BlockGeometryBuilder.build( + "test_default_display", model, k -> "test_shortname", "opaque", "test", 0, 0); + assertNotNull(result); + JsonObject geo = result.geometry().serialize(); + JsonObject root = geo.getAsJsonArray("minecraft:geometry").get(0).getAsJsonObject(); + + assertFalse(root.has("item_display_transforms"), "a default-only slot says nothing and should be dropped"); + assertEquals("1.21.0", geo.get("format_version").getAsString(), + "and must not bump the format version"); + } + + /** Pivots reach the output rather than being zeroed, now that the Java side parses them. */ + @Test + void displayPivotsAreCarriedThrough() { + JavaBlockModel model = new JavaBlockModel(null, true); + model.addTexture("all", "block/test"); + JavaBlockModel.Element cube = new JavaBlockModel.Element(0, 0, 0, 8, 8, 8); + cube.addFace("north", "#all", 0, 0, 8, 8, 0); + model.addElement(cube); + model.addDisplay("head", new JavaBlockModel.DisplayTransform( + new float[]{0, 0, 0}, new float[]{0, 0, 0}, new float[]{1, 1, 1}, + new float[]{0.5F, 0, 0}, new float[]{0, -0.5F, 0})); + + BlockGeometryBuilder.Result result = BlockGeometryBuilder.build( + "test_pivots", model, k -> "test_shortname", "opaque", "test", 0, 0); + assertNotNull(result); + JsonObject head = result.geometry().serialize() + .getAsJsonArray("minecraft:geometry").get(0).getAsJsonObject() + .getAsJsonObject("item_display_transforms").getAsJsonObject("head"); + + assertEquals(0.5F, head.getAsJsonArray("rotation_pivot").get(0).getAsFloat(), 0.001F); + assertEquals(-0.5F, head.getAsJsonArray("scale_pivot").get(1).getAsFloat(), 0.001F); + } + + @Test + void noDisplayKeepsFormatVersion121() { + JavaBlockModel model = new JavaBlockModel(null, true); + model.addTexture("all", "block/test"); + JavaBlockModel.Element cube = new JavaBlockModel.Element(0, 0, 0, 16, 16, 16); + cube.addFace("north", "#all", 0, 0, 16, 16, 0); + model.addElement(cube); + + JsonObject geo = buildBlock(model); + assertEquals("1.21.0", geo.get("format_version").getAsString()); + } + + @Test + void blockElementRotationPreservesSignOnAllAxes() { + for (String axis : new String[]{"x", "y", "z"}) { + JavaBlockModel model = new JavaBlockModel(null, true); + model.addTexture("all", "block/test"); + JavaBlockModel.Element cube = new JavaBlockModel.Element(0, 0, 0, 8, 8, 8); + cube.addFace("north", "#all", 0, 0, 8, 8, 0); + cube.setRotation(4, 4, 4, 22.5F, axis, false); + model.addElement(cube); + + JsonObject cubeJson = firstCube(buildBlock(model)); + float emittedAngle = cubeJson.get("rotation").getAsJsonArray().get( + axis.equals("x") ? 0 : axis.equals("y") ? 1 : 2).getAsFloat(); + + // Block geometry is emitted mirrored along X, so an element's rotation comes through as the mirror's + // conjugate of itself. The X mirror commutes with a turn about X and reverses one about Y or Z, so only + // those two change sign. Getting this per-axis rather than uniformly is the point: negating X as well + // tilts the part the wrong way about the one axis the mirror does not touch. + float expected = axis.equals("x") ? 22.5F : -22.5F; + assertEquals(expected, emittedAngle, 0.01F, + "a mirrored block's element rotation on " + axis + " must be the X mirror's conjugate"); + } + } + + private static JsonObject buildBlock(JavaBlockModel model) { + Set instances = new LinkedHashSet<>(); + BedrockGeometry geometry = new GeometryMapper() + .mapBlockGeometry("test_block", model, instances); + return geometry.serialize(); + } + + private static JsonObject firstCube(JsonObject geoRoot) { + return geoRoot.getAsJsonArray("minecraft:geometry").get(0).getAsJsonObject() + .getAsJsonArray("bones").get(0).getAsJsonObject() + .getAsJsonArray("cubes").get(0).getAsJsonObject(); + } +} diff --git a/Plugin/src/test/java/fr/robie/craftengineconverter/UpDownUvConventionTest.java b/Plugin/src/test/java/fr/robie/craftengineconverter/UpDownUvConventionTest.java new file mode 100644 index 00000000..5b431c2a --- /dev/null +++ b/Plugin/src/test/java/fr/robie/craftengineconverter/UpDownUvConventionTest.java @@ -0,0 +1,77 @@ +package fr.robie.craftengineconverter; + +import com.google.gson.JsonObject; +import fr.robie.craftengineconverter.converter.bedrock.geometry.BedrockGeometry; +import fr.robie.craftengineconverter.converter.bedrock.geometry.GeometryMapper; +import fr.robie.craftengineconverter.converter.bedrock.geometry.JavaBlockModel; +import org.junit.jupiter.api.Test; + +import java.util.LinkedHashSet; +import java.util.Set; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +/** + * Verifies our up/down face UV output matches Blockbench's convention. + *

+ * Blockbench flips both UV axes on up/down when compiling to Bedrock: + * {@code uv[0] += uv_size[0]; uv_size[0] *= -1;} (and same for v). + *

+ * For a face with Java UVs [2,3] to [14,13], normal (non up/down) output is: + * uv = [2,3], uv_size = [12,10] + *

+ * Blockbench's up/down flip starts from the normal output and applies: + * uv = [2+12, 3+10] = [14,13], uv_size = [-12,-10] + *

+ * Our code computes for up/down: uvOrigin = (u1,v1) = (14,13), uvSize = (u0-u1, v0-v1) = (-12,-10). + * These are mathematically identical. + */ +class UpDownUvConventionTest { + + @Test + void upFaceUvMatchesBlockbenchConvention() { + JavaBlockModel model = new JavaBlockModel(null, true); + model.addTexture("top", "block/test"); + + JavaBlockModel.Element cube = new JavaBlockModel.Element(0, 0, 0, 16, 16, 16); + cube.addFace("up", "#top", 2, 3, 14, 13, 0); + cube.addFace("down", "#top", 4, 5, 12, 11, 0); + cube.addFace("north", "#top", 0, 0, 16, 16, 0); + model.addElement(cube); + + Set instances = new LinkedHashSet<>(); + BedrockGeometry geometry = new GeometryMapper() + .mapBlockGeometry("test_updown", model, instances); + + JsonObject json = geometry.serialize(); + JsonObject bone = json.getAsJsonArray("minecraft:geometry").get(0).getAsJsonObject() + .getAsJsonArray("bones").get(0).getAsJsonObject(); + JsonObject cubeJson = bone.getAsJsonArray("cubes").get(0).getAsJsonObject(); + JsonObject uv = cubeJson.getAsJsonObject("uv"); + + // Block geometry is emitted mirrored along X, so every face's U additionally runs the other way: the origin + // moves to the far edge and the width negates. V is untouched, since the mirror is on X alone. Each + // expectation below is therefore Blockbench's own convention with that one flip applied — up would be + // uv=[14,13] size=[-12,-10] unmirrored, and 14 + -12 = 2 with the width back to +12. + JsonObject up = uv.getAsJsonObject("up"); + assertEquals(2.0F, up.getAsJsonArray("uv").get(0).getAsFloat(), 0.001F, "up uv[0]"); + assertEquals(13.0F, up.getAsJsonArray("uv").get(1).getAsFloat(), 0.001F, "up uv[1]"); + assertEquals(12.0F, up.getAsJsonArray("uv_size").get(0).getAsFloat(), 0.001F, "up uv_size[0]"); + assertEquals(-10.0F, up.getAsJsonArray("uv_size").get(1).getAsFloat(), 0.001F, "up uv_size[1]"); + + // Down: [12,11] size [-8,-6] unmirrored, so 12 + -8 = 4 with the width back to +8. + JsonObject down = uv.getAsJsonObject("down"); + assertEquals(4.0F, down.getAsJsonArray("uv").get(0).getAsFloat(), 0.001F, "down uv[0]"); + assertEquals(11.0F, down.getAsJsonArray("uv").get(1).getAsFloat(), 0.001F, "down uv[1]"); + assertEquals(8.0F, down.getAsJsonArray("uv_size").get(0).getAsFloat(), 0.001F, "down uv_size[0]"); + assertEquals(-6.0F, down.getAsJsonArray("uv_size").get(1).getAsFloat(), 0.001F, "down uv_size[1]"); + + // North is a side face, so it has no up/down flip of its own — only the mirror's: [0,0] size [16,16] + // becomes origin 0 + 16 with the width negated. V stays as authored. + JsonObject north = uv.getAsJsonObject("north"); + assertEquals(16.0F, north.getAsJsonArray("uv").get(0).getAsFloat(), 0.001F, "north uv[0]"); + assertEquals(0.0F, north.getAsJsonArray("uv").get(1).getAsFloat(), 0.001F, "north uv[1]"); + assertEquals(-16.0F, north.getAsJsonArray("uv_size").get(0).getAsFloat(), 0.001F, "north uv_size[0]"); + assertEquals(16.0F, north.getAsJsonArray("uv_size").get(1).getAsFloat(), 0.001F, "north uv_size[1]"); + } +} From 2469a47d0c70ae7afbb44fbb450be02d6099b5be Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Thu, 6 Aug 2026 20:46:37 +0200 Subject: [PATCH 064/116] fix(bedrock): stop the X mirror reversing UVs, which changed every door's hinge Mirroring a cube along X does not mirror its texture. Bedrock mirrors a geometry's positions and then samples each face's UV rect exactly as authored, so reversing U as part of the mirror applies it a second time and the texture comes out back to front. Vanilla's doors are the proof, because they encode the hinge side in nothing but UV direction. The geometry of both is identical, from [0,0,0] to [3,16,16]: door_bottom_left west [0,0,16,16] east [16,0,0,16] door_bottom_right west [16,0,0,16] east [0,0,16,16] Reversing U therefore turned every left-hinged door into a right-hinged one, open and closed alike - reported as the handle sitting on the wrong side. The face swap stays: east and west really do trade places under the mirror, and that part was right. Only the UV reversal goes. This hid behind the shapes already under test because they are textured symmetrically - a fence gate and a stair are planks, where reversing U is invisible, which is also why they looked correct while the mirror was doing both. DoorHingeUvTest uses the one thing that can see it, and asserts both hinges keep their authored direction plus that the two never converge, so a fix that merely reversed the bug fails too. Co-Authored-By: Claude Opus 5 --- .../bedrock/geometry/GeometryMapper.java | 15 +-- .../craftengineconverter/DoorHingeUvTest.java | 97 +++++++++++++++++++ .../UpDownUvConventionTest.java | 26 ++--- 3 files changed, 118 insertions(+), 20 deletions(-) create mode 100644 Plugin/src/test/java/fr/robie/craftengineconverter/DoorHingeUvTest.java diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/geometry/GeometryMapper.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/geometry/GeometryMapper.java index 3275af5b..5190942e 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/geometry/GeometryMapper.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/geometry/GeometryMapper.java @@ -386,13 +386,14 @@ private void mapFace(JavaBlockModel.Face face, BedrockGeometry.Cube cube, int te int uvRotation = ((face.rotation() % 360) + 360) % 360; - // A mirrored cube's faces are seen from the other side, so each one's U has to run the other way or the - // texture reads back to front. Expressed by moving the origin to the far edge and negating the width, which - // is how Bedrock spells a flipped UV rect. - if (mirrorX) { - uvOriginU += uvSizeU; - uvSizeU = -uvSizeU; - } + // The UV is deliberately left alone, even though the cube is mirrored. Bedrock mirrors a geometry's + // positions and then samples each face's UV rect as authored, so reversing U here mirrors the texture a + // second time and it comes out back to front. + // + // Vanilla's doors are the proof, because they encode a hinge side in nothing but UV direction: geometry + // identical, and door_bottom_left's west face reads [0,0,16,16] where door_bottom_right's reads + // [16,0,0,16]. Flipping U turned every left-hinged door into a right-hinged one. Symmetric textures such + // as planks hide this completely, which is why fence gates and stairs looked correct either way. // Java UVs span 0-16 whatever the texture's resolution (see JavaBlockModel.UV_SPACE), so they are // rescaled into whatever space this geometry declares. diff --git a/Plugin/src/test/java/fr/robie/craftengineconverter/DoorHingeUvTest.java b/Plugin/src/test/java/fr/robie/craftengineconverter/DoorHingeUvTest.java new file mode 100644 index 00000000..bd8810c4 --- /dev/null +++ b/Plugin/src/test/java/fr/robie/craftengineconverter/DoorHingeUvTest.java @@ -0,0 +1,97 @@ +package fr.robie.craftengineconverter; + +import com.google.gson.JsonObject; +import fr.robie.craftengineconverter.converter.bedrock.geometry.BedrockGeometry; +import fr.robie.craftengineconverter.converter.bedrock.geometry.GeometryMapper; +import fr.robie.craftengineconverter.converter.bedrock.geometry.JavaBlockModel; +import org.junit.jupiter.api.Test; + +import java.util.LinkedHashSet; +import java.util.Set; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; + +/** + * A door's hinge side lives in its UVs, and mirroring must not touch them. + *

+ * Vanilla tells a left-hinged door from a right-hinged one by UV direction alone — the geometry is identical, + * {@code from [0,0,0] to [3,16,16]} in both, and only the west and east rects are reversed: + *

+ * door_bottom_left   west [0,0,16,16]   east [16,0,0,16]
+ * door_bottom_right  west [16,0,0,16]   east [0,0,16,16]
+ * 
+ * Block geometry is emitted mirrored along X, and reversing U as part of that mirror turned every left-hinged door + * into a right-hinged one — the handle came out on the wrong side, open and closed alike. Bedrock mirrors positions + * and then samples each face's rect as authored, so the UV has to survive untouched. + *

+ * Nothing caught it because the shapes already under test are textured symmetrically: a fence gate and a stair are + * planks, where reversing U is invisible. This uses the one thing that can see it. + */ +class DoorHingeUvTest { + + /** The two vanilla door models, reduced to the faces that carry the hinge. */ + private static JavaBlockModel door(boolean leftHinge) { + JavaBlockModel model = new JavaBlockModel(null, false); + model.addTexture("bottom", "block/custom/door"); + JavaBlockModel.Element panel = new JavaBlockModel.Element(0, 0, 0, 3, 16, 16); + if (leftHinge) { + panel.addFace("west", "#bottom", 0, 0, 16, 16, 0); + panel.addFace("east", "#bottom", 16, 0, 0, 16, 0); + } else { + panel.addFace("west", "#bottom", 16, 0, 0, 16, 0); + panel.addFace("east", "#bottom", 0, 0, 16, 16, 0); + } + model.addElement(panel); + return model; + } + + private static JsonObject facesOf(BedrockGeometry geometry) { + return geometry.serialize() + .getAsJsonArray("minecraft:geometry").get(0).getAsJsonObject() + .getAsJsonArray("bones").get(0).getAsJsonObject() + .getAsJsonArray("cubes").get(0).getAsJsonObject() + .getAsJsonObject("uv"); + } + + private static JsonObject convert(boolean leftHinge) { + Set instances = new LinkedHashSet<>(); + return facesOf(new GeometryMapper().mapBlockGeometry("door", door(leftHinge), instances)); + } + + /** + * The U rect has to arrive exactly as authored. Mirroring the cube must not mirror the texture with it, or the + * handle moves to the other edge of the door. + */ + @Test + void aLeftHingedDoorKeepsItsAuthoredUvDirection() { + JsonObject faces = convert(true); + // Java's west face is emitted under east, because the mirror swaps the two side faces. + JsonObject fromWest = faces.getAsJsonObject("east"); + assertEquals(0.0F, fromWest.getAsJsonArray("uv").get(0).getAsFloat(), 0.001F, + "a left hinge authors west as [0,0,16,16]; its U origin must survive the mirror"); + assertEquals(16.0F, fromWest.getAsJsonArray("uv_size").get(0).getAsFloat(), 0.001F, + "and its U must still run forwards, or the door changes hinge"); + } + + /** The other half of the pair, so a fix that simply reversed the bug would fail here. */ + @Test + void aRightHingedDoorKeepsItsAuthoredUvDirection() { + JsonObject faces = convert(false); + JsonObject fromWest = faces.getAsJsonObject("east"); + assertEquals(16.0F, fromWest.getAsJsonArray("uv").get(0).getAsFloat(), 0.001F, + "a right hinge authors west as [16,0,0,16]"); + assertEquals(-16.0F, fromWest.getAsJsonArray("uv_size").get(0).getAsFloat(), 0.001F, + "and its U runs backwards, which is the whole difference between the two doors"); + } + + /** The point of the pair: whatever the convention, the two hinges must not converge on the same UVs. */ + @Test + void theTwoHingesStayDistinguishable() { + assertNotEquals( + convert(true).getAsJsonObject("east").getAsJsonArray("uv_size").get(0).getAsFloat(), + convert(false).getAsJsonObject("east").getAsJsonArray("uv_size").get(0).getAsFloat(), + "a left and a right hinge differ only by UV direction; if the conversion flattens that, every door" + + " in the pack hangs the same way round"); + } +} diff --git a/Plugin/src/test/java/fr/robie/craftengineconverter/UpDownUvConventionTest.java b/Plugin/src/test/java/fr/robie/craftengineconverter/UpDownUvConventionTest.java index 5b431c2a..0d7f8619 100644 --- a/Plugin/src/test/java/fr/robie/craftengineconverter/UpDownUvConventionTest.java +++ b/Plugin/src/test/java/fr/robie/craftengineconverter/UpDownUvConventionTest.java @@ -49,29 +49,29 @@ void upFaceUvMatchesBlockbenchConvention() { JsonObject cubeJson = bone.getAsJsonArray("cubes").get(0).getAsJsonObject(); JsonObject uv = cubeJson.getAsJsonObject("uv"); - // Block geometry is emitted mirrored along X, so every face's U additionally runs the other way: the origin - // moves to the far edge and the width negates. V is untouched, since the mirror is on X alone. Each - // expectation below is therefore Blockbench's own convention with that one flip applied — up would be - // uv=[14,13] size=[-12,-10] unmirrored, and 14 + -12 = 2 with the width back to +12. + // A mirrored cube keeps its UVs exactly as Java authored them: Bedrock mirrors positions and samples each + // face's rect as written, so touching U here would mirror the texture twice. Vanilla's doors depend on it — + // they tell a left hinge from a right one by UV direction alone. + + // Up face: Blockbench expects uv=[14,13], uv_size=[-12,-10] JsonObject up = uv.getAsJsonObject("up"); - assertEquals(2.0F, up.getAsJsonArray("uv").get(0).getAsFloat(), 0.001F, "up uv[0]"); + assertEquals(14.0F, up.getAsJsonArray("uv").get(0).getAsFloat(), 0.001F, "up uv[0]"); assertEquals(13.0F, up.getAsJsonArray("uv").get(1).getAsFloat(), 0.001F, "up uv[1]"); - assertEquals(12.0F, up.getAsJsonArray("uv_size").get(0).getAsFloat(), 0.001F, "up uv_size[0]"); + assertEquals(-12.0F, up.getAsJsonArray("uv_size").get(0).getAsFloat(), 0.001F, "up uv_size[0]"); assertEquals(-10.0F, up.getAsJsonArray("uv_size").get(1).getAsFloat(), 0.001F, "up uv_size[1]"); - // Down: [12,11] size [-8,-6] unmirrored, so 12 + -8 = 4 with the width back to +8. + // Down face: Blockbench expects uv=[12,11], uv_size=[-8,-6] JsonObject down = uv.getAsJsonObject("down"); - assertEquals(4.0F, down.getAsJsonArray("uv").get(0).getAsFloat(), 0.001F, "down uv[0]"); + assertEquals(12.0F, down.getAsJsonArray("uv").get(0).getAsFloat(), 0.001F, "down uv[0]"); assertEquals(11.0F, down.getAsJsonArray("uv").get(1).getAsFloat(), 0.001F, "down uv[1]"); - assertEquals(8.0F, down.getAsJsonArray("uv_size").get(0).getAsFloat(), 0.001F, "down uv_size[0]"); + assertEquals(-8.0F, down.getAsJsonArray("uv_size").get(0).getAsFloat(), 0.001F, "down uv_size[0]"); assertEquals(-6.0F, down.getAsJsonArray("uv_size").get(1).getAsFloat(), 0.001F, "down uv_size[1]"); - // North is a side face, so it has no up/down flip of its own — only the mirror's: [0,0] size [16,16] - // becomes origin 0 + 16 with the width negated. V stays as authored. + // North face (non up/down): standard, no flip JsonObject north = uv.getAsJsonObject("north"); - assertEquals(16.0F, north.getAsJsonArray("uv").get(0).getAsFloat(), 0.001F, "north uv[0]"); + assertEquals(0.0F, north.getAsJsonArray("uv").get(0).getAsFloat(), 0.001F, "north uv[0]"); assertEquals(0.0F, north.getAsJsonArray("uv").get(1).getAsFloat(), 0.001F, "north uv[1]"); - assertEquals(-16.0F, north.getAsJsonArray("uv_size").get(0).getAsFloat(), 0.001F, "north uv_size[0]"); + assertEquals(16.0F, north.getAsJsonArray("uv_size").get(0).getAsFloat(), 0.001F, "north uv_size[0]"); assertEquals(16.0F, north.getAsJsonArray("uv_size").get(1).getAsFloat(), 0.001F, "north uv_size[1]"); } } From bc704a47dd8f96df0588417f8c440de0a9728b1e Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Thu, 6 Aug 2026 20:58:00 +0200 Subject: [PATCH 065/116] fix(bedrock): stop the X mirror renaming faces, which inverted doors on two facings Mirroring a block moves its coordinates and nothing else. Bedrock's face names are absolute - they say which way a face points in the world - so renaming east to west as part of the mirror mirrors the block a second time. The doors gave it away by facing. A door panel is thin in X, so its large faces are west and east, and a swap exchanges exactly the two whose UVs carry the hinge: facing=east y=0 large faces stay west/east hinge inverted facing=south y=90 rotated onto north/south correct facing=west y=180 large faces stay west/east hinge inverted facing=north y=270 rotated onto north/south correct Wrong precisely where the swap did something, right precisely where it did not, which is what identified it rather than another argument about handedness. That is the second half of the same mistake as the UV reversal in the previous commit: both tried to carry the mirror into the faces, and Bedrock only wants it in the coordinates. With both gone, a mirrored cube is its Java original with X negated, and its faces are untouched. DoorHingeUvTest now records both dead ends so neither is reinvented. Co-Authored-By: Claude Opus 5 --- .../bedrock/geometry/GeometryMapper.java | 22 +++++++-------- .../BlockTextureTest.java | 9 +++--- .../BlockbenchAlignmentTest.java | 11 ++++---- .../craftengineconverter/DoorHingeUvTest.java | 28 ++++++++++++------- 4 files changed, 37 insertions(+), 33 deletions(-) diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/geometry/GeometryMapper.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/geometry/GeometryMapper.java index 5190942e..8a8f0f77 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/geometry/GeometryMapper.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/geometry/GeometryMapper.java @@ -362,7 +362,7 @@ private void mapFace(JavaBlockModel.Face face, BedrockGeometry.Cube cube, int te */ private void mapFace(JavaBlockModel.Face face, BedrockGeometry.Cube cube, int texW, int texH, float[] from, float[] to, String materialInstance, boolean mirrorX) { - String dir = mirrorX ? mirroredDirection(face.direction()) : face.direction(); + String dir = face.direction(); float u0 = face.u0(); float v0 = face.v0(); float u1 = face.u1(); @@ -407,17 +407,15 @@ private void mapFace(JavaBlockModel.Face face, BedrockGeometry.Cube cube, int te cube.withFace(dir, uvOriginU, uvOriginV, uvSizeU, uvSizeV, materialInstance, uvRotation); } - /** - * Where a face ends up when its cube is mirrored along X: east and west trade places, and the other four are - * unmoved because they straddle the mirror plane rather than sitting either side of it. - */ - private static String mirroredDirection(String direction) { - return switch (direction) { - case "east" -> "west"; - case "west" -> "east"; - default -> direction; - }; - } + // No mirroredDirection here on purpose: a face keeps its authored name through the mirror. + // + // Swapping east and west looked right — the sides do change places geometrically — but Bedrock's face names are + // absolute, naming the world direction the face ends up pointing, so renaming them mirrors the block a second + // time. Doors proved it by facing: their panel is thin in X, so its large faces are west and east, and a swap + // exchanges exactly the two faces whose UVs carry the hinge. At y=0 and y=180 (facing east and west) those + // faces stay on the X axis and the hinge came out inverted; at y=90 and y=270 the rotation carries them onto + // north and south, the swap touches only the thin edges, and the same door was correct. Wrong precisely where + // the swap did something, right precisely where it did not. public static String getMeaningfulMaterialInstanceName(String face, String texture, int elementIndex) { return texture + "_" + face + "_" + elementIndex; diff --git a/Plugin/src/test/java/fr/robie/craftengineconverter/BlockTextureTest.java b/Plugin/src/test/java/fr/robie/craftengineconverter/BlockTextureTest.java index 79d1db4d..ebe76cca 100644 --- a/Plugin/src/test/java/fr/robie/craftengineconverter/BlockTextureTest.java +++ b/Plugin/src/test/java/fr/robie/craftengineconverter/BlockTextureTest.java @@ -123,14 +123,13 @@ void aFullCubeWithFaceRotationsGetsRealGeometryCarryingThem() throws Exception { "a rotated-face cube must not be flattened onto the unit cube"); assertEquals(1, converted.geometry().size(), "it needs a geometry file of its own"); - // Block geometry is mirrored along X, so the two side faces trade places: what Java authored on the east - // arrives on the west and vice versa, each keeping its own rotation. North and south straddle the mirror - // plane and stay put. Distinct rotations per face are what make the swap visible here at all. + // Every face keeps the name Java gave it. Bedrock's names are absolute — they say which way the face points + // in the world — so mirroring the cube's coordinates must not rename its faces as well. JsonObject faces = facesOf(converted.geometry().values().iterator().next()); assertEquals(90, uvRotationOf(faces, "north")); assertEquals(270, uvRotationOf(faces, "south")); - assertEquals(180, uvRotationOf(faces, "west"), "Java's east face, rotated 180, lands on the west"); - assertEquals(0, uvRotationOf(faces, "east"), "Java's west face, rotated 0, lands on the east"); + assertEquals(0, uvRotationOf(faces, "west")); + assertEquals(180, uvRotationOf(faces, "east")); } /** Partial UVs are the other thing a unit cube cannot sample. */ diff --git a/Plugin/src/test/java/fr/robie/craftengineconverter/BlockbenchAlignmentTest.java b/Plugin/src/test/java/fr/robie/craftengineconverter/BlockbenchAlignmentTest.java index b7988da2..28f62e37 100644 --- a/Plugin/src/test/java/fr/robie/craftengineconverter/BlockbenchAlignmentTest.java +++ b/Plugin/src/test/java/fr/robie/craftengineconverter/BlockbenchAlignmentTest.java @@ -48,13 +48,12 @@ void faceRotation270EmitsUvRotation() { cube.addFace("east", "#side", 0, 0, 16, 16, 270); model.addElement(cube); - // Read back under "west": block geometry is mirrored along X, and the two side faces trade places with it, - // so the face Java authored as east is the one Bedrock sees on the west. Its uv_rotation rides along - // unchanged — the mirror moves the face and reverses its U, it does not re-rotate the texture. + // Still read back as "east": mirroring a block moves its coordinates and nothing else. Bedrock's face names + // are absolute, so renaming them would mirror the block a second time — which is what inverted door hinges. JsonObject cubeJson = firstCube(buildBlock(model)); - JsonObject mirroredEast = cubeJson.getAsJsonObject("uv").getAsJsonObject("west"); - assertNotNull(mirroredEast, "the east face must be emitted as west once the cube is mirrored"); - assertEquals(270, mirroredEast.get("uv_rotation").getAsInt()); + JsonObject east = cubeJson.getAsJsonObject("uv").getAsJsonObject("east"); + assertNotNull(east, "a mirrored cube keeps the face name Java authored"); + assertEquals(270, east.get("uv_rotation").getAsInt()); } @Test diff --git a/Plugin/src/test/java/fr/robie/craftengineconverter/DoorHingeUvTest.java b/Plugin/src/test/java/fr/robie/craftengineconverter/DoorHingeUvTest.java index bd8810c4..c80bfac2 100644 --- a/Plugin/src/test/java/fr/robie/craftengineconverter/DoorHingeUvTest.java +++ b/Plugin/src/test/java/fr/robie/craftengineconverter/DoorHingeUvTest.java @@ -21,12 +21,20 @@ * door_bottom_left west [0,0,16,16] east [16,0,0,16] * door_bottom_right west [16,0,0,16] east [0,0,16,16] * - * Block geometry is emitted mirrored along X, and reversing U as part of that mirror turned every left-hinged door - * into a right-hinged one — the handle came out on the wrong side, open and closed alike. Bedrock mirrors positions - * and then samples each face's rect as authored, so the UV has to survive untouched. + * Block geometry is emitted mirrored along X, and only its coordinates may move. Two attempts to carry the + * mirror into the faces each inverted the hinge: + *

    + *
  • reversing U — which mirrors the texture a second time, since Bedrock samples each rect as authored;
  • + *
  • renaming east to west — which mirrors the block a second time, since Bedrock's face names are absolute and + * say which way a face points in the world.
  • + *
+ * The rename gave itself away by facing. A door panel is thin in X, so its large faces are west and east, and a + * swap exchanges exactly the two whose UVs carry the hinge. At {@code y=0} and {@code y=180} — facing east and + * west — those faces stay on the X axis and the hinge inverted; at {@code y=90} and {@code y=270} the rotation + * carries them onto north and south, the swap reached only the thin edges, and the same door was correct. *

- * Nothing caught it because the shapes already under test are textured symmetrically: a fence gate and a stair are - * planks, where reversing U is invisible. This uses the one thing that can see it. + * Nothing caught either because the shapes already under test are textured symmetrically: a fence gate and a stair + * are planks, where none of this is visible. This uses the one thing that can see it. */ class DoorHingeUvTest { @@ -66,8 +74,8 @@ private static JsonObject convert(boolean leftHinge) { @Test void aLeftHingedDoorKeepsItsAuthoredUvDirection() { JsonObject faces = convert(true); - // Java's west face is emitted under east, because the mirror swaps the two side faces. - JsonObject fromWest = faces.getAsJsonObject("east"); + // Read back under the name Java gave it: the mirror moves coordinates, never face names. + JsonObject fromWest = faces.getAsJsonObject("west"); assertEquals(0.0F, fromWest.getAsJsonArray("uv").get(0).getAsFloat(), 0.001F, "a left hinge authors west as [0,0,16,16]; its U origin must survive the mirror"); assertEquals(16.0F, fromWest.getAsJsonArray("uv_size").get(0).getAsFloat(), 0.001F, @@ -78,7 +86,7 @@ void aLeftHingedDoorKeepsItsAuthoredUvDirection() { @Test void aRightHingedDoorKeepsItsAuthoredUvDirection() { JsonObject faces = convert(false); - JsonObject fromWest = faces.getAsJsonObject("east"); + JsonObject fromWest = faces.getAsJsonObject("west"); assertEquals(16.0F, fromWest.getAsJsonArray("uv").get(0).getAsFloat(), 0.001F, "a right hinge authors west as [16,0,0,16]"); assertEquals(-16.0F, fromWest.getAsJsonArray("uv_size").get(0).getAsFloat(), 0.001F, @@ -89,8 +97,8 @@ void aRightHingedDoorKeepsItsAuthoredUvDirection() { @Test void theTwoHingesStayDistinguishable() { assertNotEquals( - convert(true).getAsJsonObject("east").getAsJsonArray("uv_size").get(0).getAsFloat(), - convert(false).getAsJsonObject("east").getAsJsonArray("uv_size").get(0).getAsFloat(), + convert(true).getAsJsonObject("west").getAsJsonArray("uv_size").get(0).getAsFloat(), + convert(false).getAsJsonObject("west").getAsJsonArray("uv_size").get(0).getAsFloat(), "a left and a right hinge differ only by UV direction; if the conversion flattens that, every door" + " in the pack hangs the same way round"); } From f29aa0eb5c5cf8f170c705551560d00adacea1c6 Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Thu, 6 Aug 2026 21:25:42 +0200 Subject: [PATCH 066/116] fix(bedrock): stop mirroring collision boxes, which put them on the wrong face Geometry and a collision box are not the same kind of thing, and only one of them mirrors. Block geometry is emitted mirrored along X because Bedrock mirrors it back when it draws, so the shape lands where Java put it. A collision box is never drawn - it is a world-space volume the engine takes literally - so mirroring one moves it while the visible block stays where it was. Mirroring the boxes alongside the geometry, which is what the earlier commit did, therefore made them agree in the file and disagree in the world. Measured on a door: the panel renders at x -8..-5 and its box sat at +5..+8, the opposite face of the block. The door could be walked through, and the empty half could not. Verified against the real pack after the change - facing=east, hinge=left, closed now boxes x -8..-5, matching where it draws. HitboxMirrorTest pins it with a panel pressed against one face, because every X-symmetric shape hides this and most blocks are symmetric: a full cube, a fence post, a closed gate all look identical either way. Co-Authored-By: Claude Opus 5 --- .../bedrock/block/BlockGeometryBuilder.java | 16 ++--- .../HitboxMirrorTest.java | 63 +++++++++++++++++++ 2 files changed, 72 insertions(+), 7 deletions(-) create mode 100644 Plugin/src/test/java/fr/robie/craftengineconverter/HitboxMirrorTest.java diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/block/BlockGeometryBuilder.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/block/BlockGeometryBuilder.java index 4cf2f6fc..5ee2662d 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/block/BlockGeometryBuilder.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/block/BlockGeometryBuilder.java @@ -181,15 +181,17 @@ public static Boxes boxesFor(@NotNull JavaBlockModel model) { float maxX = -Float.MAX_VALUE, maxY = -Float.MAX_VALUE, maxZ = -Float.MAX_VALUE; for (JavaBlockModel.Element element : model.elements()) { - // Mirrored along X to follow the geometry. Block geometry is emitted mirrored, because Bedrock reads it - // that way round, and a box left in Java's coordinates then sits on the opposite side of the block from - // the shape it is meant to wrap — a stair you could walk through on one half and bump into thin air on - // the other. Java's model space is 0..16, so mirroring is 16 minus the coordinate, and the min/max swap - // because negating reverses their order. - float ex0 = JavaBlockModel.UV_SPACE - Math.max(element.fromX(), element.toX()); - float ex1 = JavaBlockModel.UV_SPACE - Math.min(element.fromX(), element.toX()); + // Java's coordinates, deliberately NOT mirrored, even though the geometry is. + // + // The two are not the same kind of thing. Geometry is emitted mirrored because Bedrock mirrors it back + // when it draws, so the shape lands where Java put it. A collision box is not drawn — it is a + // world-space volume the engine takes literally — so mirroring one moves it while the visible block + // stays put. Measured on a door: the panel renders at x -8..-5 and its box sat at +5..+8, the far side + // of the block, so the door could be walked through and the empty half could not. + float ex0 = Math.min(element.fromX(), element.toX()); float ey0 = Math.min(element.fromY(), element.toY()); float ez0 = Math.min(element.fromZ(), element.toZ()); + float ex1 = Math.max(element.fromX(), element.toX()); float ey1 = Math.max(element.fromY(), element.toY()); float ez1 = Math.max(element.fromZ(), element.toZ()); diff --git a/Plugin/src/test/java/fr/robie/craftengineconverter/HitboxMirrorTest.java b/Plugin/src/test/java/fr/robie/craftengineconverter/HitboxMirrorTest.java new file mode 100644 index 00000000..67065d41 --- /dev/null +++ b/Plugin/src/test/java/fr/robie/craftengineconverter/HitboxMirrorTest.java @@ -0,0 +1,63 @@ +package fr.robie.craftengineconverter; + +import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.block.BlockDefinition; +import fr.robie.craftengineconverter.converter.bedrock.block.BlockGeometryBuilder; +import fr.robie.craftengineconverter.converter.bedrock.geometry.JavaBlockModel; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +/** + * A collision box must sit where the block is drawn, which is not where its geometry is written. + *

+ * Block geometry is emitted mirrored along X, because Bedrock mirrors it back when it draws — the shape therefore + * lands where Java put it. A collision box is not drawn: it is a world-space volume the engine takes literally. So + * the geometry mirrors and the box must not, even though they describe the same block. + *

+ * Mirroring the box too was measured on a door panel: it renders at x -8..-5 and its box sat at +5..+8, the far side + * of the block. The door could be walked through and the empty half could not. Every shape whose X extent is + * symmetric hides this completely, which is most of them — a full cube, a fence post, a closed gate — so this uses + * a panel pushed hard against one face. + */ +class HitboxMirrorTest { + + /** A door-shaped panel: three units thick against the west face, full height and depth. */ + private static JavaBlockModel panelAgainstWest() { + JavaBlockModel model = new JavaBlockModel(null, false); + model.addTexture("all", "block/custom/door"); + JavaBlockModel.Element panel = new JavaBlockModel.Element(0, 0, 0, 3, 16, 16); + panel.addFace("north", "#all", 0, 0, 3, 16, 0); + model.addElement(panel); + return model; + } + + @Test + void aCollisionBoxStaysOnTheSideJavaDrewIt() { + BlockGeometryBuilder.Boxes boxes = BlockGeometryBuilder.boxesFor(panelAgainstWest()); + + assertEquals(1, boxes.collision().size(), "one solid element, one box"); + BlockDefinition.Box box = boxes.collision().getFirst(); + + // Bedrock's block space centres x and z on the block, so Java's 0..3 is -8..-5. + assertEquals(-8.0F, box.originX(), 0.001F, + "the box must wrap the panel where it is drawn; +5 here would be the opposite face"); + assertEquals(3.0F, box.sizeX(), 0.001F, "and keep its thickness"); + } + + @Test + void theSelectionOutlineFollowsTheSameSide() { + BlockDefinition.Box selection = BlockGeometryBuilder.boxesFor(panelAgainstWest()).selection(); + assertEquals(-8.0F, selection.originX(), 0.001F); + assertEquals(3.0F, selection.sizeX(), 0.001F); + } + + /** Y and Z are untouched by an X mirror either way, so they pin that nothing else drifted. */ + @Test + void theOtherAxesAreUnchanged() { + BlockDefinition.Box box = BlockGeometryBuilder.boxesFor(panelAgainstWest()).collision().getFirst(); + assertEquals(0.0F, box.originY(), 0.001F, "y starts at the block floor"); + assertEquals(-8.0F, box.originZ(), 0.001F, "z is centred like x"); + assertEquals(16.0F, box.sizeY(), 0.001F); + assertEquals(16.0F, box.sizeZ(), 0.001F); + } +} From ce005c603bb41df9fddf429c424576ad11fbd29a Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Thu, 6 Aug 2026 21:34:05 +0200 Subject: [PATCH 067/116] fix(bedrock): mirror collision boxes with the geometry after all Reverses the previous commit, which had this backwards. A box is written in the same space as the shape it wraps, so whatever the client does with one it does with the other, and they only line up if both are mirrored. The previous commit reasoned that a box is a world-space volume and so must stay in Java's coordinates. That was an argument, not a measurement, and the door disproved it by presenting the question four ways at once. Unmirrored, the box was wrong for every state whose panel is thin along X - facing east and west closed, facing north and south open - and right for every state whose panel is thin along Z, where an X mirror changes nothing. Wrong precisely where the mirror mattered, which is the signature of a box that has not been mirrored. The earlier hitbox report was against a build that already had unmirrored boxes, so mirroring them had never actually been tried; reverting on that report threw away the fix rather than the bug. Verified per facing against the real pack: geometry and collision X now agree on all four - east 5..8, south -8..8, west -8..-5, north -8..8. Co-Authored-By: Claude Opus 5 --- .../bedrock/block/BlockGeometryBuilder.java | 21 ++++++++----- .../HitboxMirrorTest.java | 30 ++++++++++--------- 2 files changed, 29 insertions(+), 22 deletions(-) diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/block/BlockGeometryBuilder.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/block/BlockGeometryBuilder.java index 5ee2662d..9cd129f2 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/block/BlockGeometryBuilder.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/block/BlockGeometryBuilder.java @@ -181,17 +181,22 @@ public static Boxes boxesFor(@NotNull JavaBlockModel model) { float maxX = -Float.MAX_VALUE, maxY = -Float.MAX_VALUE, maxZ = -Float.MAX_VALUE; for (JavaBlockModel.Element element : model.elements()) { - // Java's coordinates, deliberately NOT mirrored, even though the geometry is. + // Mirrored along X, exactly as the geometry is. A box is expressed in the same space as the shape it + // wraps, so whatever the client does with one it does with the other, and the two only line up if they + // are mirrored alike. // - // The two are not the same kind of thing. Geometry is emitted mirrored because Bedrock mirrors it back - // when it draws, so the shape lands where Java put it. A collision box is not drawn — it is a - // world-space volume the engine takes literally — so mirroring one moves it while the visible block - // stays put. Measured on a door: the panel renders at x -8..-5 and its box sat at +5..+8, the far side - // of the block, so the door could be walked through and the empty half could not. - float ex0 = Math.min(element.fromX(), element.toX()); + // Established by facing rather than by argument, because a door shows it four different ways. Leaving + // the box in Java's coordinates put it on the far side of the block for every state whose panel is + // thin along X — facing east and west closed, facing north and south open — and left it correct for + // every state whose panel is thin along Z, where an X mirror changes nothing. Wrong precisely where + // the mirror mattered. + // + // Java's model space is 0..16, so mirroring is 16 minus the coordinate, and min and max trade places + // because negating reverses their order. + float ex0 = JavaBlockModel.UV_SPACE - Math.max(element.fromX(), element.toX()); + float ex1 = JavaBlockModel.UV_SPACE - Math.min(element.fromX(), element.toX()); float ey0 = Math.min(element.fromY(), element.toY()); float ez0 = Math.min(element.fromZ(), element.toZ()); - float ex1 = Math.max(element.fromX(), element.toX()); float ey1 = Math.max(element.fromY(), element.toY()); float ez1 = Math.max(element.fromZ(), element.toZ()); diff --git a/Plugin/src/test/java/fr/robie/craftengineconverter/HitboxMirrorTest.java b/Plugin/src/test/java/fr/robie/craftengineconverter/HitboxMirrorTest.java index 67065d41..049ecc03 100644 --- a/Plugin/src/test/java/fr/robie/craftengineconverter/HitboxMirrorTest.java +++ b/Plugin/src/test/java/fr/robie/craftengineconverter/HitboxMirrorTest.java @@ -8,16 +8,18 @@ import static org.junit.jupiter.api.Assertions.assertEquals; /** - * A collision box must sit where the block is drawn, which is not where its geometry is written. + * A collision box is written in the same mirrored space as the geometry it wraps. *

- * Block geometry is emitted mirrored along X, because Bedrock mirrors it back when it draws — the shape therefore - * lands where Java put it. A collision box is not drawn: it is a world-space volume the engine takes literally. So - * the geometry mirrors and the box must not, even though they describe the same block. + * Block geometry is emitted mirrored along X, and a box is written in that same space, so the two only line up if + * they are mirrored alike. *

- * Mirroring the box too was measured on a door panel: it renders at x -8..-5 and its box sat at +5..+8, the far side - * of the block. The door could be walked through and the empty half could not. Every shape whose X extent is - * symmetric hides this completely, which is most of them — a full cube, a fence post, a closed gate — so this uses - * a panel pushed hard against one face. + * A door settles it, because it presents the question four different ways. Leaving the box in Java's coordinates + * put it on the far side of the block for every state whose panel is thin along X — facing east and west closed, + * facing north and south open — and left it correct for every state whose panel is thin along Z, where an X mirror + * changes nothing. Wrong precisely where the mirror mattered, right precisely where it did not. + *

+ * Every shape whose X extent is symmetric hides this completely, and most are: a full cube, a fence post, a closed + * gate. So this uses a panel pushed hard against one face. */ class HitboxMirrorTest { @@ -32,22 +34,22 @@ private static JavaBlockModel panelAgainstWest() { } @Test - void aCollisionBoxStaysOnTheSideJavaDrewIt() { + void aCollisionBoxIsMirroredWithTheGeometry() { BlockGeometryBuilder.Boxes boxes = BlockGeometryBuilder.boxesFor(panelAgainstWest()); assertEquals(1, boxes.collision().size(), "one solid element, one box"); BlockDefinition.Box box = boxes.collision().getFirst(); - // Bedrock's block space centres x and z on the block, so Java's 0..3 is -8..-5. - assertEquals(-8.0F, box.originX(), 0.001F, - "the box must wrap the panel where it is drawn; +5 here would be the opposite face"); - assertEquals(3.0F, box.sizeX(), 0.001F, "and keep its thickness"); + // Java's 0..3 mirrors to 13..16, which is +5..+8 once Bedrock's block space centres x on the block. + assertEquals(5.0F, box.originX(), 0.001F, + "the box mirrors with the shape it wraps; -8 here would be Java's own coordinates, unmirrored"); + assertEquals(3.0F, box.sizeX(), 0.001F, "and keeps its thickness"); } @Test void theSelectionOutlineFollowsTheSameSide() { BlockDefinition.Box selection = BlockGeometryBuilder.boxesFor(panelAgainstWest()).selection(); - assertEquals(-8.0F, selection.originX(), 0.001F); + assertEquals(5.0F, selection.originX(), 0.001F); assertEquals(3.0F, selection.sizeX(), 0.001F); } From 5ee7fe83159ce0ece59f10f911cd47d5e1cb0619 Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Fri, 7 Aug 2026 23:23:55 +0200 Subject: [PATCH 068/116] fix(bedrock): read greyscale textures by raster so rendered icons keep their brightness A greyscale PNG decodes to TYPE_BYTE_GRAY, whose colour space is linear, and every read through getRGB converts it to sRGB on the way out. The icon renderer samples its texture that way, so a greyscale texture came out visibly brighter than the file: the gunpowder block's stored greys top out at 112 and its rendered icon reached 193. It showed as an item that glowed in the inventory while the placed block looked right - the block uses the copied terrain texture and never goes through getRGB, so only the rendered icon was affected. Reading the raster and rebuilding the image sidesteps the conversion. Measured after: the icon spans 43..136, which is the render's own face shading around the source's 84..112 rather than a wholesale lift. Third place this same trap has appeared, after the armour trim palettes and the trim overlays. Anything that samples a pack texture with getRGB is suspect. Co-Authored-By: Claude Opus 5 --- .../converter/bedrock/BedrockItemLoader.java | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockItemLoader.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockItemLoader.java index 5418e00b..debe5f6d 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockItemLoader.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockItemLoader.java @@ -913,6 +913,37 @@ private void bakeTintsIntoTextures(JavaBlockModel model, java.util.Map + * A greyscale PNG decodes to {@code TYPE_BYTE_GRAY}, whose colour space is linear, and every read through + * {@code getRGB} — which is how the icon renderer samples a texture — converts it to sRGB on the way out. The + * number that comes back is not the number in the file, and the picture is visibly brighter for it: the + * gunpowder block's stored greys top out at 112 and its rendered icon reached 193, so it glowed in the + * inventory while the placed block, which uses the copied texture and never goes through {@code getRGB}, was + * right. Reading the raster and rebuilding the image sidesteps the conversion. + *

+ * Indexed and true-colour images have no such problem and are returned untouched. + */ + private static BufferedImage toTrueColour(BufferedImage image) { + if (image.getColorModel().getColorSpace().getNumComponents() != 1) return image; + + var raster = image.getRaster(); + int bands = raster.getNumBands(); + int maxSample = (1 << raster.getSampleModel().getSampleSize(0)) - 1; + + BufferedImage out = new BufferedImage(image.getWidth(), image.getHeight(), BufferedImage.TYPE_INT_ARGB); + for (int y = 0; y < image.getHeight(); y++) { + for (int x = 0; x < image.getWidth(); x++) { + int grey = raster.getSample(x, y, 0); + if (maxSample != 255) grey = grey * 255 / maxSample; + int alpha = bands > 1 ? raster.getSample(x, y, 1) : 255; + out.setRGB(x, y, (alpha << 24) | (grey << 16) | (grey << 8) | grey); + } + } + return out; + } + private BufferedImage loadModelTexture(String reference) { Optional resolved = this.context.texturePipeline() .resolveTexture(reference, this.itemId, this.context.javaAssetsDir()); @@ -922,6 +953,8 @@ private BufferedImage loadModelTexture(String reference) { BufferedImage image = javax.imageio.ImageIO.read(resolved.get().sourcePath().toFile()); if (image == null) return null; + image = toTrueColour(image); + CachedTextureInfo info = resolved.get(); if (info.animation().isPresent()) { int frameHeight = info.animation().get().frameHeight(); From ede0386cdefa27150eb0852e52c60a7249f44ed5 Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Fri, 7 Aug 2026 23:24:15 +0200 Subject: [PATCH 069/116] fix(bedrock): take backface visibility and shading from the model, not from a default Three settings were forced on regardless of what the pack said, and each one showed. Backface visibility. Bedrock has two transparent render methods that differ only in whether a face is visible from behind, and vanilla splits its blocks between them (bedrock-wiki/blocks/block-visuals-intro, "Render Methods"): alpha_test backfaces visible Ladder, Monster Spawner, Vines alpha_test_single_sided backfaces hidden Doors, Saplings, Trapdoors Everything transparent used alpha_test, so looking through a door's window showed the inside of its far side - which Java never does, because it culls them. Now decided by shape: a form with thickness hides its backfaces, a zero-thickness sheet keeps them, because a ladder or a cross is its own backface and would vanish from one side without them. light_dampening. Every block was shipped fully light-blocking, so a door, a gate, a sapling and a trapdoor each shaded whatever they stood against: two doors facing each other darkened their inner faces, and a gate cast a shadow onto the side of the block beside it through a gap you could walk through. Only a full opaque cube stops light now, which is how Java decides it too. ambient_occlusion. Java's `ambientocclusion` says whether a shape should be shaded by its neighbours, and vanilla turns it off for the models that would look wrong with it - door_bottom_left.json opens with it. The flag was parsed and then ignored. It also has to be inherited: a pack's door is a bare parent plus textures, so the false lives one level up, and inherit() carried textures, elements, display and gui light but not this. Tracked separately from the value because the default is true and so is indistinguishable from an explicit true, yet the two behave differently under inheritance. The point of all three is that the answer now comes from the pack. A trapdoor still gets ambient occlusion because its vanilla model does not turn it off; set it in the model and the conversion will follow. Co-Authored-By: Claude Opus 5 --- .../bedrock/block/BlockGeometryBuilder.java | 13 ++- .../bedrock/block/BlockStateMapper.java | 47 +++++++- .../bedrock/geometry/JavaBlockModel.java | 22 +++- .../bedrock/geometry/JavaModelResolver.java | 7 ++ .../BlockShadingTest.java | 106 ++++++++++++++++++ .../RenderMethodBackfaceTest.java | 100 +++++++++++++++++ 6 files changed, 289 insertions(+), 6 deletions(-) create mode 100644 Plugin/src/test/java/fr/robie/craftengineconverter/BlockShadingTest.java create mode 100644 Plugin/src/test/java/fr/robie/craftengineconverter/RenderMethodBackfaceTest.java diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/block/BlockGeometryBuilder.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/block/BlockGeometryBuilder.java index 9cd129f2..321bdb5c 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/block/BlockGeometryBuilder.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/block/BlockGeometryBuilder.java @@ -69,20 +69,27 @@ public static Result build(@NotNull String identifier, @NotNull JavaBlockModel m geometry.withDisplay(entry.getKey(), entry.getValue()); } + // Smooth lighting comes from the model, not from a guess. Java's `ambientocclusion` says whether a shape + // should be shaded by its neighbours, and every vanilla model that would look wrong with it turns it off — + // door_bottom_left.json opens with `"ambientocclusion": false` precisely so a door is not shaded by + // whatever it is hung against. Forcing it on gave two facing doors shadows across their inner faces. The + // flag was already parsed and carried through merges; it was only ever ignored here. + boolean ambientOcclusion = model.ambientOcclusion(); + BlockDefinition.MaterialInstances.Builder instances = new BlockDefinition.MaterialInstances.Builder(); boolean any = false; for (String name : instanceNames) { String shortname = shortnameOf.apply(name); if (shortname == null) continue; - // Face dimming and ambient occlusion on, matching a vanilla non-light-emitting block. - instances.withInstance(name, shortname, renderMethod, true, true); + // Face dimming stays on: that is direction-based shading, which vanilla applies to every solid block. + instances.withInstance(name, shortname, renderMethod, true, ambientOcclusion); any = true; } if (!any) return null; // "*" catches any face the model left without an instance, so a missing one cannot render untextured. String fallback = firstResolvable(instanceNames, shortnameOf); - if (fallback != null) instances.withInstance("*", fallback, renderMethod, true, true); + if (fallback != null) instances.withInstance("*", fallback, renderMethod, true, ambientOcclusion); return new Result(geometry, instances.build()); } diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/block/BlockStateMapper.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/block/BlockStateMapper.java index 3022cbf7..63efcda0 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/block/BlockStateMapper.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/block/BlockStateMapper.java @@ -385,7 +385,16 @@ private BlockDefinition resolveModelToDefinition(String modelPath, String blockN // A texture with see-through pixels rendered as "opaque" shows them solid, so leaves and the like need // alpha testing. One method has to serve every instance of the block, which is why it is decided here. - String renderMethod = this.hasTransparency(model) ? "alpha_test" : "opaque"; + String renderMethod = renderMethodFor(model, this.hasTransparency(model)); + + // Only a block that genuinely fills its cube should stop light, and the default assumed every block + // did. A door, a gate, a sapling and a trapdoor were all shipped as fully light-blocking, so each + // darkened whatever it stood against: two doors facing each other shaded one another's inner faces, + // and a gate cast a shadow onto the side of the solid block beside it, through gaps you could walk + // through. Java derives this from the shape, and so does this — 15 for a full opaque cube, 0 for + // anything you can see past. + builder.withLightDampening( + isFullCube(model) && !this.hasTransparency(model) ? 15 : 0); // Shape decides the geometry, measured rather than counted. Counting elements only ever worked // because models used to arrive unresolved: a stairway has two elements just as a cross does. @@ -432,7 +441,7 @@ private BlockDefinition resolveLoadedModelToDefinition(JavaBlockModel model, Str } if (resolvedTexture == null) resolvedTexture = blockName; - String renderMethod = this.hasTransparency(model) ? "alpha_test" : "opaque"; + String renderMethod = renderMethodFor(model, this.hasTransparency(model)); if (isInvisible(model)) { this.applyInvisibleGeometry(builder, resolvedTexture); @@ -583,6 +592,40 @@ private static boolean isInvisible(JavaBlockModel model) { return true; } + /** + * Which alpha-testing method a see-through block should draw with, which comes down to whether its own far side + * ought to be visible through it. + *

+ * Bedrock's two transparent methods differ only in backface visibility + * ({@code bedrock-wiki/blocks/block-visuals-intro} "Render Methods"): + *

+     * alpha_test              backfaces visible    Ladder, Monster Spawner, Vines
+     * alpha_test_single_sided backfaces hidden     Doors, Saplings, Trapdoors
+     * 
+ * A shape with thickness has a second surface behind the first, so showing backfaces means looking through a + * door's window and seeing the inside of its far side — which Java never does, because it culls them. Vanilla + * puts doors and trapdoors on the single-sided method for exactly this reason. + *

+ * A sheet with no thickness is the opposite case and keeps {@code alpha_test}: a ladder or a cross is its + * own backface, and hiding those would leave it invisible from one side. + */ + private static String renderMethodFor(JavaBlockModel model, boolean transparent) { + if (!transparent) return "opaque"; + return isFlatSheet(model) ? "alpha_test" : "alpha_test_single_sided"; + } + + /** Whether every element is a zero-thickness plane, as a cross, ladder or vine is. */ + private static boolean isFlatSheet(JavaBlockModel model) { + if (model.elements().isEmpty()) return false; + for (JavaBlockModel.Element element : model.elements()) { + boolean flat = element.fromX() == element.toX() + || element.fromY() == element.toY() + || element.fromZ() == element.toZ(); + if (!flat) return false; + } + return true; + } + /** One element filling the whole block: the shape {@code minecraft:geometry.full_block} already is. */ private static boolean isFullCube(JavaBlockModel model) { if (model.elements().size() != 1) return false; diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/geometry/JavaBlockModel.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/geometry/JavaBlockModel.java index 34ca45fe..abd43117 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/geometry/JavaBlockModel.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/geometry/JavaBlockModel.java @@ -13,7 +13,16 @@ public class JavaBlockModel { private final String parent; - private final boolean ambientOcclusion; + private boolean ambientOcclusion; + /** + * Whether this model wrote {@code ambientocclusion} itself, as opposed to taking the default. + *

+ * Needed because the default is {@code true} and so is indistinguishable from an explicit {@code true} — yet + * the two behave differently under inheritance. Java lets a child take its parent's value, and a pack's door + * is a bare {@code parent} plus {@code textures}: the {@code false} that stops a door being shaded by its own + * frame lives in {@code block/door_bottom_left}, one level up. + */ + private boolean ambientOcclusionDeclared; private boolean guiLightFront = false; // Insertion-ordered, not hashed: both maps decide the order things are written to the Bedrock pack — texture // variables become material instances, display contexts become item_display_transforms — and a hashed order @@ -29,6 +38,15 @@ public JavaBlockModel(String parent, boolean ambientOcclusion) { public Optional parent() { return Optional.ofNullable(this.parent); } public boolean ambientOcclusion() { return this.ambientOcclusion; } + + /** Whether the model stated {@code ambientocclusion} rather than falling back to the default. */ + public boolean ambientOcclusionDeclared() { return this.ambientOcclusionDeclared; } + + /** Takes a parent's smooth-lighting setting, for a child that declared none of its own. */ + public void inheritAmbientOcclusion(boolean value) { + this.ambientOcclusion = value; + this.ambientOcclusionDeclared = true; + } public boolean guiLightFront() { return this.guiLightFront; } public void setGuiLightFront(boolean front) { this.guiLightFront = front; } public Map textures() { return this.textures; } @@ -76,6 +94,8 @@ public static JavaBlockModel parse(JsonObject json) { boolean ao = !json.has("ambientocclusion") || json.get("ambientocclusion").getAsBoolean(); JavaBlockModel model = new JavaBlockModel(parent, ao); + // Recorded separately from the value, so inheritance can tell "said true" from "said nothing". + if (json.has("ambientocclusion")) model.inheritAmbientOcclusion(ao); // "texture_size" is deliberately ignored. It is a Blockbench field, not part of the vanilla model // format, and vanilla always reads UVs as 0-16 spanning the whole texture whatever its resolution. diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/geometry/JavaModelResolver.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/geometry/JavaModelResolver.java index 82c27c5c..deff9c54 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/geometry/JavaModelResolver.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/geometry/JavaModelResolver.java @@ -189,6 +189,13 @@ private static void inherit(JavaBlockModel child, JavaBlockModel parent) { if (!child.guiLightFront() && parent.guiLightFront()) { child.setGuiLightFront(true); } + // Smooth lighting is inherited like everything else, and it has to be: a pack's door is a bare parent plus + // textures, and the `ambientocclusion: false` that stops a door being shaded by its own frame is written one + // level up in block/door_bottom_left. Only for a child that declared nothing — an explicit true must not be + // overwritten by a parent's false. + if (!child.ambientOcclusionDeclared() && parent.ambientOcclusionDeclared()) { + child.inheritAmbientOcclusion(parent.ambientOcclusion()); + } } private static Path resolveFile(String modelPath, Path javaAssetsDir) { diff --git a/Plugin/src/test/java/fr/robie/craftengineconverter/BlockShadingTest.java b/Plugin/src/test/java/fr/robie/craftengineconverter/BlockShadingTest.java new file mode 100644 index 00000000..8f131ff7 --- /dev/null +++ b/Plugin/src/test/java/fr/robie/craftengineconverter/BlockShadingTest.java @@ -0,0 +1,106 @@ +package fr.robie.craftengineconverter; + +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; +import fr.robie.craftengineconverter.converter.bedrock.block.BlockStateMapper; +import fr.robie.craftengineconverter.converter.bedrock.geometry.JavaModelResolver; +import fr.robie.craftengineconverter.converter.bedrock.texture.TexturePipeline; +import org.junit.jupiter.api.Test; + +import java.nio.file.Files; +import java.nio.file.Path; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; + +/** + * The two things that darken a converted block, both of which were previously forced on. + * + *

light_dampening

+ * Every block was shipped fully light-blocking, so a door, a gate and a sapling each shaded whatever they stood + * against — two doors facing one another darkened each other's inner faces, and a gate cast a shadow onto the side + * of the solid block beside it, across a gap you could walk through. Only a shape that fills its cube should stop + * light. + * + *

ambient_occlusion

+ * Java's {@code ambientocclusion} says whether a shape should be shaded by its neighbours, and vanilla turns it off + * for the models that would look wrong with it. It is inherited: a pack's door is a bare {@code parent} plus + * {@code textures}, and the {@code false} lives one level up in {@code block/door_bottom_left}. The flag was parsed + * but never read, and never inherited either. + */ +class BlockShadingTest { + + private static void write(Path file, String json) throws Exception { + Files.createDirectories(file.getParent()); + Files.writeString(file, json); + } + + /** Converts one block and returns its definition, given a model and an optional parent to inherit from. */ + private static JsonObject convert(String model, String parentName, String parentJson) throws Exception { + Path root = Files.createTempDirectory("shading"); + Path assets = root.resolve("assets"); + + write(assets.resolve("minecraft/blockstates/test_block.json"), + "{\"variants\":{\"\":{\"model\":\"block/custom/thing\"}}}"); + write(assets.resolve("minecraft/models/block/custom/thing.json"), model); + if (parentJson != null) { + write(assets.resolve("minecraft/models/" + parentName + ".json"), parentJson); + } + + BlockStateMapper mapper = new BlockStateMapper() + .withModelResolver(new JavaModelResolver()) + .withTexturePipeline(new TexturePipeline()); + mapper.addFromBlockstatesDirectory( + assets.resolve("minecraft/blockstates").toFile(), "minecraft", assets); + + Path out = root.resolve("out"); + Files.createDirectories(out); + mapper.save(out); + + JsonObject blocks = JsonParser.parseString(Files.readString(out.resolve("geyser_block_mappings.json"))) + .getAsJsonObject().getAsJsonObject("blocks"); + return blocks.getAsJsonObject(blocks.keySet().iterator().next()); + } + + /** Absent means zero — the field is only written when it is non-zero. */ + private static int lightDampeningOf(JsonObject definition) { + return definition.has("light_dampening") ? definition.get("light_dampening").getAsInt() : 0; + } + + private static final String FULL_CUBE = + "{\"textures\":{\"all\":\"block/custom/thing\"},\"elements\":[{\"from\":[0,0,0],\"to\":[16,16,16]," + + "\"faces\":{\"north\":{\"uv\":[0,0,16,16],\"texture\":\"#all\"}}}]}"; + + /** A door-thin panel: you can see past it, so it must not stop light. */ + private static final String THIN_PANEL = + "{\"textures\":{\"all\":\"block/custom/thing\"},\"elements\":[{\"from\":[0,0,0],\"to\":[3,16,16]," + + "\"faces\":{\"north\":{\"uv\":[0,0,16,16],\"texture\":\"#all\"}}}]}"; + + @Test + void aShapeYouCanSeePastDoesNotBlockLight() throws Exception { + assertEquals(0, lightDampeningOf(convert(THIN_PANEL, null, null)), + "a door or gate that dampened light cast a shadow through the gap beside it"); + } + + @Test + void aFullCubeStillBlocksLight() throws Exception { + assertEquals(15, lightDampeningOf(convert(FULL_CUBE, null, null)), + "a solid block must keep stopping light, or caves and interiors light up through it"); + } + + /** + * The inheritance that was missing. The child says nothing about smooth lighting; its parent says no. + */ + @Test + void ambientOcclusionIsInheritedFromTheParentModel() throws Exception { + JsonObject definition = convert( + "{\"parent\":\"block/door_like\",\"textures\":{\"all\":\"block/custom/thing\"}}", + "block/door_like", + "{\"ambientocclusion\":false,\"elements\":[{\"from\":[0,0,0],\"to\":[3,16,16]," + + "\"faces\":{\"north\":{\"uv\":[0,0,16,16],\"texture\":\"#all\"}}}]}"); + + String json = definition.toString(); + assertFalse(json.contains("\"ambient_occlusion\":true"), + "the parent turned smooth lighting off, so two facing doors must not shade each other; got " + json); + } +} diff --git a/Plugin/src/test/java/fr/robie/craftengineconverter/RenderMethodBackfaceTest.java b/Plugin/src/test/java/fr/robie/craftengineconverter/RenderMethodBackfaceTest.java new file mode 100644 index 00000000..10c16010 --- /dev/null +++ b/Plugin/src/test/java/fr/robie/craftengineconverter/RenderMethodBackfaceTest.java @@ -0,0 +1,100 @@ +package fr.robie.craftengineconverter; + +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; +import fr.robie.craftengineconverter.converter.bedrock.block.BlockStateMapper; +import fr.robie.craftengineconverter.converter.bedrock.geometry.JavaModelResolver; +import org.junit.jupiter.api.Test; + +import java.awt.image.BufferedImage; +import java.io.File; +import java.nio.file.Files; +import java.nio.file.Path; + +import javax.imageio.ImageIO; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +/** + * Which alpha-testing method a see-through block draws with, which decides whether you can see its own far side + * through it. + *

+ * Bedrock's two transparent methods differ only in backface visibility, and vanilla splits its blocks accordingly + * ({@code bedrock-wiki/blocks/block-visuals-intro}, "Render Methods"): + *

+ * alpha_test              backfaces visible    Ladder, Monster Spawner, Vines
+ * alpha_test_single_sided backfaces hidden     Doors, Saplings, Trapdoors
+ * 
+ * Using {@code alpha_test} for everything meant looking through a door's window and seeing the inside of its far + * side, which Java never shows because it culls backfaces. A flat sheet needs the opposite: a ladder or a cross + * is its own backface and would be invisible from one side without them. + */ +class RenderMethodBackfaceTest { + + private static void write(Path file, String contents) throws Exception { + Files.createDirectories(file.getParent()); + Files.writeString(file, contents); + } + + /** A texture with a see-through pixel, so the block is classed as transparent at all. */ + private static void writeTransparentTexture(Path file) throws Exception { + Files.createDirectories(file.getParent()); + BufferedImage image = new BufferedImage(16, 16, BufferedImage.TYPE_INT_ARGB); + for (int y = 0; y < 16; y++) for (int x = 0; x < 16; x++) image.setRGB(x, y, 0xFF808080); + image.setRGB(0, 0, 0x00000000); + ImageIO.write(image, "PNG", file.toFile()); + } + + /** Converts one block whose model is the given elements, and returns the render method it was given. */ + private static String renderMethodOf(String elements) throws Exception { + Path root = Files.createTempDirectory("render-method"); + Path assets = root.resolve("assets"); + + write(assets.resolve("minecraft/blockstates/test_block.json"), + "{\"variants\":{\"\":{\"model\":\"block/custom/thing\"}}}"); + write(assets.resolve("minecraft/models/block/custom/thing.json"), + "{\"textures\":{\"all\":\"block/custom/thing\"},\"elements\":" + elements + "}"); + writeTransparentTexture(assets.resolve("minecraft/textures/block/custom/thing.png")); + + // The texture pipeline is what answers hasTransparency; without it every block reads as opaque and the + // question under test never even arises. + BlockStateMapper mapper = new BlockStateMapper() + .withModelResolver(new JavaModelResolver()) + .withTexturePipeline(new fr.robie.craftengineconverter.converter.bedrock.texture.TexturePipeline()); + mapper.addFromBlockstatesDirectory( + assets.resolve("minecraft/blockstates").toFile(), "minecraft", assets); + + Path out = root.resolve("out"); + Files.createDirectories(out); + mapper.save(out); + + JsonObject blocks = JsonParser.parseString(Files.readString(out.resolve("geyser_block_mappings.json"))) + .getAsJsonObject().getAsJsonObject("blocks"); + JsonObject entry = blocks.getAsJsonObject(blocks.keySet().iterator().next()); + JsonObject instances = entry.has("material_instances") + ? entry.getAsJsonObject("material_instances") + : entry.getAsJsonObject("state_overrides").entrySet().iterator().next() + .getValue().getAsJsonObject().getAsJsonObject("material_instances"); + JsonObject first = instances.entrySet().iterator().next().getValue().getAsJsonObject(); + return first.get("render_method").getAsString(); + } + + /** A door is three units thick, so its far side must not show through the window in its near side. */ + @Test + void aShapeWithThicknessHidesItsBackfaces() throws Exception { + assertEquals("alpha_test_single_sided", renderMethodOf( + "[{\"from\":[0,0,0],\"to\":[3,16,16],\"faces\":{" + + "\"west\":{\"uv\":[0,0,16,16],\"texture\":\"#all\"}," + + "\"east\":{\"uv\":[0,0,16,16],\"texture\":\"#all\"}}}]"), + "a door seen through its own window must not show the inside of its far side"); + } + + /** A cross or ladder is one sheet: hide its backfaces and it disappears from one side. */ + @Test + void aFlatSheetKeepsItsBackfacesVisible() throws Exception { + assertEquals("alpha_test", renderMethodOf( + "[{\"from\":[0,0,8],\"to\":[16,16,8],\"faces\":{" + + "\"north\":{\"uv\":[0,0,16,16],\"texture\":\"#all\"}}}]"), + "a sheet is its own backface, so hiding those would leave it invisible from behind"); + } +} From 3580d941deb9d2408fc6081cde9549e85bddcd6c Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Fri, 7 Aug 2026 23:45:48 +0200 Subject: [PATCH 070/116] fix(bedrock): tint each texel once, so shared texture areas stop going dark A tint is a multiply, and every region was multiplied into the image in turn, so a texel covered by two tinted faces came out squared. With the sofa's olive that is 0.51 on red and 0.2 on blue applied twice, which reads as a black patch rather than as a darker olive. Regions overlap for two ordinary reasons, neither of them a mistake: two faces of one model can name the same texture rectangle, and several items routinely share one sheet - sofa, sofa_inner and sleeper_sofa all tint parts of item/custom/sofa.png with the same dye. The existing overlap check only warned when the colours *differed*, so the same-colour case, which is the common one, went through silently. Measured on the shipped pack: of sofa.png's 1902 opaque texels, 768 were tinted once and 96 twice. Replaying the three sofa models' 36 regions reproduces exactly that split under the old code, and gives zero doubles under the new one. First region wins, matching ItemIconRenderer, which already resolved a pixel to a single covering face - which is why the inventory icon looked right while the held and displayed model did not. Co-Authored-By: Claude Opus 5 --- .../converter/bedrock/ConversionContext.java | 2 +- .../bedrock/icon/ModelTextureTinter.java | 32 ++++ .../ModelTextureTinterTest.java | 180 ++++++++++++++++++ 3 files changed, 213 insertions(+), 1 deletion(-) create mode 100644 Plugin/src/test/java/fr/robie/craftengineconverter/ModelTextureTinterTest.java diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/ConversionContext.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/ConversionContext.java index 5bc5a4ae..f9f9a885 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/ConversionContext.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/ConversionContext.java @@ -473,7 +473,7 @@ private void writeTintedTextures() { image.getWidth(), image.getHeight(), java.awt.image.BufferedImage.TYPE_INT_ARGB); target.createGraphics().drawImage(image, 0, 0, null); - for (ModelTextureTinter.TintRegion region : entry.getValue()) region.applyTo(target); + ModelTextureTinter.applyAll(target, entry.getValue()); javax.imageio.ImageIO.write(target, "png", png.toFile()); } catch (Exception e) { fr.robie.messageflow.logger.Logger.warn("Could not tint texture " + entry.getKey() diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/icon/ModelTextureTinter.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/icon/ModelTextureTinter.java index 5967792e..09ebe4b4 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/icon/ModelTextureTinter.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/icon/ModelTextureTinter.java @@ -65,6 +65,26 @@ public static Map> regions(JavaBlockModel model, return found; } + /** + * Paints every region into one image, tinting each pixel at most once. + *

+ * The once-only part is the whole point. A tint is a multiply, so applying it twice to the same texel squares + * it — the sofa's dye came out at 0.51² on red and 0.2² on blue, which reads as a black patch rather than a + * darker olive. Regions overlap for two ordinary reasons and neither is a mistake worth rejecting: two faces + * of one model can share a texture rectangle, and several items routinely share one sheet — {@code sofa}, + * {@code sofa_inner} and {@code sleeper_sofa} all tint parts of {@code item/custom/sofa.png} with the same + * colour. Both used to compound. + *

+ * First region wins, matching {@code ItemIconRenderer}, which resolves a pixel to a single covering face. The + * two have to agree or an item's icon and its held model come out different colours. + */ + public static void applyAll(BufferedImage image, List regions) { + if (image == null || regions == null || regions.isEmpty()) return; + + boolean[] tinted = new boolean[image.getWidth() * image.getHeight()]; + for (TintRegion region : regions) region.applyTo(image, tinted); + } + /** * Multiplies {@code rgb} into every opaque pixel of a rectangle. Applied to the pack's own copy of the * texture, so the held and worn model shows the colour. @@ -74,15 +94,27 @@ public static Map> regions(JavaBlockModel model, */ public record TintRegion(int x0, int y0, int x1, int y1, int rgb) { + /** One region on its own. Use {@link #applyAll} for a set, which is what stops overlaps compounding. */ public void applyTo(BufferedImage image) { + this.applyTo(image, new boolean[image.getWidth() * image.getHeight()]); + } + + /** @param tinted pixels already coloured by an earlier region, and so left alone; updated as we go */ + private void applyTo(BufferedImage image, boolean[] tinted) { float r = ((this.rgb >> 16) & 0xFF) / 255.0F; float g = ((this.rgb >> 8) & 0xFF) / 255.0F; float b = (this.rgb & 0xFF) / 255.0F; for (int y = Math.max(0, this.y0); y < Math.min(this.y1, image.getHeight()); y++) { for (int x = Math.max(0, this.x0); x < Math.min(this.x1, image.getWidth()); x++) { + int index = y * image.getWidth() + x; + if (tinted[index]) continue; + int argb = image.getRGB(x, y); int alpha = argb >>> 24; + // Marked even when fully transparent: a later region must not treat it as untouched and + // colour it, which would put paint outside every face that asked for any. + tinted[index] = true; if (alpha == 0) continue; image.setRGB(x, y, (alpha << 24) diff --git a/Plugin/src/test/java/fr/robie/craftengineconverter/ModelTextureTinterTest.java b/Plugin/src/test/java/fr/robie/craftengineconverter/ModelTextureTinterTest.java new file mode 100644 index 00000000..d92553af --- /dev/null +++ b/Plugin/src/test/java/fr/robie/craftengineconverter/ModelTextureTinterTest.java @@ -0,0 +1,180 @@ +package fr.robie.craftengineconverter; + +import fr.robie.craftengineconverter.converter.bedrock.geometry.JavaBlockModel; +import fr.robie.craftengineconverter.converter.bedrock.icon.ModelTextureTinter; +import org.junit.jupiter.api.Test; + +import java.awt.image.BufferedImage; +import java.util.List; +import java.util.Map; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + +/** + * Bedrock cannot tint at runtime, so a dye colour has to be painted into the texture for the held and worn model + * to carry it. What has to hold is that only the faces asking for a tint get one — a sheet usually serves tinted + * and untinted faces both, and staining the whole thing would colour the sofa's wooden legs. + */ +class ModelTextureTinterTest { + + private static BufferedImage white(int size) { + BufferedImage image = new BufferedImage(size, size, BufferedImage.TYPE_INT_ARGB); + for (int y = 0; y < size; y++) { + for (int x = 0; x < size; x++) image.setRGB(x, y, 0xFFFFFFFF); + } + return image; + } + + private static BufferedImage applied(JavaBlockModel model, BufferedImage texture, Map tints) { + Map> regions = + ModelTextureTinter.regions(model, reference -> texture, tints); + + BufferedImage target = new BufferedImage( + texture.getWidth(), texture.getHeight(), BufferedImage.TYPE_INT_ARGB); + target.createGraphics().drawImage(texture, 0, 0, null); + for (List list : regions.values()) { + ModelTextureTinter.applyAll(target, list); + } + return target; + } + + /** A model with one tinted face over the left half and one untinted face over the right half. */ + private static JavaBlockModel splitModel() { + JavaBlockModel model = new JavaBlockModel(null, true); + model.addTexture("0", "test/white"); + + JavaBlockModel.Element element = new JavaBlockModel.Element(0, 0, 0, 16, 16, 16); + element.addFace("south", "#0", 0, 0, 8, 16, 0, 0); + element.addFace("north", "#0", 8, 0, 16, 16, 0, -1); + model.addElement(element); + return model; + } + + @Test + void onlyTheRegionsOfTintedFacesAreStained() { + BufferedImage texture = white(16); + BufferedImage result = applied(splitModel(), texture, Map.of(0, 0x00FF00)); + + // Left half: tinted green, so red and blue are gone. + assertEquals(0xFF00FF00, result.getRGB(2, 8), "left half should be green"); + // Right half: the untinted face's area, left white. This is the sofa's wooden legs. + assertEquals(0xFFFFFFFF, result.getRGB(13, 8), "right half must stay untouched"); + } + + @Test + void regionsAreReportedPerTextureReference() { + Map> regions = + ModelTextureTinter.regions(splitModel(), reference -> white(16), Map.of(0, 0x00FF00)); + + // Only the tinted face contributes, and both faces name the same texture. + assertEquals(1, regions.size()); + assertEquals(1, regions.get("test/white").size()); + } + + @Test + void aTextureWithNoTintedFaceIsNotTouchedAtAll() { + JavaBlockModel model = new JavaBlockModel(null, true); + model.addTexture("0", "test/white"); + JavaBlockModel.Element element = new JavaBlockModel.Element(0, 0, 0, 16, 16, 16); + element.addFace("south", "#0", 0, 0, 16, 16, 0, -1); + model.addElement(element); + + assertTrue(ModelTextureTinter.regions(model, reference -> white(16), Map.of(0, 0x00FF00)).isEmpty()); + } + + @Test + void aTintIndexWithNoResolvedColourIsSkipped() { + // A grass or team tint has no single colour, so it never reaches the map and the face stays plain. + assertTrue(ModelTextureTinter.regions(splitModel(), reference -> white(16), Map.of()).isEmpty()); + } + + /** + * A face's pixel rectangle scales from the 0-16 UV space to the texture's real resolution — the same rule the + * renderer follows, so the icon and the baked texture always agree on which pixels a face owns. + */ + @Test + void regionsScaleToTheTextureResolution() { + JavaBlockModel model = new JavaBlockModel(null, true); + model.addTexture("0", "test/white"); + + JavaBlockModel.Element element = new JavaBlockModel.Element(0, 0, 0, 16, 16, 16); + element.addFace("south", "#0", 0, 0, 8, 8, 0, 0); + model.addElement(element); + + BufferedImage result = applied(model, white(32), Map.of(0, 0x00FF00)); + + // UV 0-8 of 16 is the first half, which on a 32px texture is pixels 0-15. + assertEquals(0xFF00FF00, result.getRGB(4, 4), "the named quarter should be tinted"); + assertEquals(0xFFFFFFFF, result.getRGB(28, 28), "the rest must be left alone"); + } + + @Test + void transparentPixelsStayTransparent() { + BufferedImage texture = white(16); + texture.setRGB(2, 2, 0x00000000); + + BufferedImage result = applied(splitModel(), texture, Map.of(0, 0x00FF00)); + assertEquals(0, result.getRGB(2, 2) >>> 24, "a tint must not give a transparent pixel colour"); + } + + /** + * The sofa's dark patches. A tint is a multiply, so a texel covered by two tinted faces used to be multiplied + * twice and come out squared — with the sofa's olive that is 0.51² on red and 0.2² on blue, which reads as + * black rather than as a darker olive. Measured on the shipped pack, 96 of its 1902 opaque texels were doubled. + */ + @Test + void aPixelTwoTintedFacesShareIsTintedOnlyOnce() { + JavaBlockModel model = new JavaBlockModel(null, true); + model.addTexture("0", "test/white"); + + // Two faces of one model naming the same UV rectangle — an ordinary way to reuse a texture. + JavaBlockModel.Element element = new JavaBlockModel.Element(0, 0, 0, 16, 16, 16); + element.addFace("south", "#0", 0, 0, 8, 16, 0, 0); + element.addFace("north", "#0", 0, 0, 8, 16, 0, 0); + model.addElement(element); + + BufferedImage result = applied(model, white(16), Map.of(0, 0x8040C0)); + + assertEquals(2, ModelTextureTinter.regions(model, reference -> white(16), Map.of(0, 0x8040C0)) + .get("test/white").size(), "both faces should still be reported; the fix is in how they are applied"); + assertEquals(0xFF8040C0, result.getRGB(2, 8), + "white tinted once is the tint itself; tinting twice squares it and darkens the model"); + } + + /** + * The same defect across items rather than within one model, which is how the sofa actually hit it: {@code sofa}, + * {@code sofa_inner} and {@code sleeper_sofa} share one sheet and all register the same dye over overlapping + * areas. Their regions accumulate into one list, so the guard has to hold for a list assembled from several + * items, not just for one model's faces. + */ + @Test + void regionsFromDifferentItemsSharingASheetDoNotCompound() { + BufferedImage target = white(16); + int olive = 0x82A833; + + ModelTextureTinter.applyAll(target, List.of( + new ModelTextureTinter.TintRegion(0, 0, 16, 16, olive), + new ModelTextureTinter.TintRegion(4, 4, 12, 12, olive))); + + assertEquals(0xFF000000 | olive, target.getRGB(8, 8), + "the overlap is where the sofa went dark"); + assertEquals(0xFF000000 | olive, target.getRGB(1, 1), "and the rest is unchanged"); + } + + @Test + void aFlippedUvRectangleCoversTheSameArea() { + JavaBlockModel model = new JavaBlockModel(null, true); + model.addTexture("0", "test/white"); + + // Same left half, written right-to-left as a mirrored face would be. + JavaBlockModel.Element element = new JavaBlockModel.Element(0, 0, 0, 16, 16, 16); + element.addFace("south", "#0", 8, 16, 0, 0, 0, 0); + model.addElement(element); + + BufferedImage result = applied(model, white(16), Map.of(0, 0x00FF00)); + assertEquals(0xFF00FF00, result.getRGB(2, 8)); + assertFalse(result.getRGB(13, 8) == 0xFF00FF00, "the region must not have spread"); + } +} From b0f53d29031db042ea63914ae7b4832de241c9d5 Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Sat, 8 Aug 2026 20:27:44 +0200 Subject: [PATCH 071/116] fix(bedrock): negate element rotation on x and y, not on y and z Bedrock negates rotation about X and Y and leaves Z alone. That is not the conjugate of the X mirror the positions get - that would leave X and negate Y and Z - and the mismatch is not an error to reason away: Bedrock's rotation convention differs in handedness from its position convention, so the two halves of the transform genuinely disagree. Deriving the angles from the mirror alone was self-consistent and wrong in game. Blockbench is the reference, since it is what Bedrock models are authored in and its round trip matches the client, and its Bedrock codec applies "negate every axis but Z" in three separate places - cubes, bones and locators. Caught on the sofa: its backrest is authored `axis: x, angle: 22.5` and was reaching the geometry as +22.5, leaning it forward instead of back. The sofa is symmetric about X, so the position mirror is invisible on it and the rotation sign was the only thing that showed - which is why this read as "the backrest is turned the wrong way". Affects any model with a tilted part: in the sample pack that is the mushrooms and pebbles among blocks, and the flower baskets, globe, table lamp and sofas among items. 52 cubes across 12 geometries. Co-Authored-By: Claude Opus 5 --- .../bedrock/geometry/GeometryMapper.java | 25 +++++++++++++----- .../BlockbenchAlignmentTest.java | 26 ++++++++++++++----- 2 files changed, 37 insertions(+), 14 deletions(-) diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/geometry/GeometryMapper.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/geometry/GeometryMapper.java index 8a8f0f77..99db8922 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/geometry/GeometryMapper.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/geometry/GeometryMapper.java @@ -294,14 +294,25 @@ private void mapElement(JavaBlockModel.Element element, BedrockGeometry.Bone bon if (mirrorX) rotOrigin[0] = -rotOrigin[0]; cube.withPivot(rotOrigin[0], rotOrigin[1], rotOrigin[2]); - // A rotation carried through a mirror is the mirror's conjugate of it, and for the X mirror used here - // (x -> -x) that has one answer per axis: turning about X is unchanged, because the mirror plane - // contains the X axis and the two commute, while turning about Y or Z reverses, because the mirror - // flips the sense of the plane each sweeps. Negating X instead — as this did while compensating for - // Blockbench's export rather than for our own transform — tilts a rotated part the wrong way about the - // one axis that should have been left alone. + // Bedrock negates rotation about X and Y and leaves Z alone. That is not the conjugate of the X + // mirror applied to the positions just above — that would leave X and negate Y and Z — and the + // discrepancy is not a mistake to be reasoned away: Bedrock's rotation convention differs in handedness + // from its position convention, so the two halves of the transform genuinely disagree. Deriving the + // angles from the mirror alone, as this did, is self-consistent and wrong in game. + // + // Blockbench is the reference, because it is what Bedrock models are actually authored in and its + // round trip is known to match the client. Its Bedrock codec applies the same rule in three separate + // places — cubes, bones and locators — each as "negate every axis but Z": + // + // base_cube.rotation.forEach((br, axis) => { if (axis != 2) base_cube.rotation[axis] *= -1 }) + // base_cube.origin[0] *= -1; + // + // Reported from a converted pack: the sofa's backrest is authored `axis: x, angle: 22.5` and has to + // reach the geometry as -22.5. Emitting +22.5 leans it forward instead of back, which is the whole of + // the "backrest is turned the wrong way" defect — the sofa is symmetric about X, so the position mirror + // is invisible on it and only the rotation sign shows. float bedrockAngle = switch (rot.axis()) { - case "y", "z" -> mirrorX ? -rot.angle() : rot.angle(); + case "x", "y" -> mirrorX ? -rot.angle() : rot.angle(); default -> rot.angle(); }; float[] rotVec = switch (rot.axis()) { diff --git a/Plugin/src/test/java/fr/robie/craftengineconverter/BlockbenchAlignmentTest.java b/Plugin/src/test/java/fr/robie/craftengineconverter/BlockbenchAlignmentTest.java index 28f62e37..e89ae9d6 100644 --- a/Plugin/src/test/java/fr/robie/craftengineconverter/BlockbenchAlignmentTest.java +++ b/Plugin/src/test/java/fr/robie/craftengineconverter/BlockbenchAlignmentTest.java @@ -186,8 +186,24 @@ void noDisplayKeepsFormatVersion121() { assertEquals("1.21.0", geo.get("format_version").getAsString()); } + /** + * Element rotation signs, per axis, against Blockbench. + *

+ * Bedrock negates rotation about X and Y and leaves Z. That is deliberately not the + * conjugate of the X mirror the positions get — that would leave X and negate Y and Z — because Bedrock's + * rotation convention differs in handedness from its position convention. Deriving these angles from the mirror + * alone is self-consistent and wrong in game, which is how this test came to assert the opposite of the truth + * on two of the three axes. + *

+ * Blockbench is the reference: its Bedrock codec applies "negate every axis but Z" in three separate places + * (cubes, bones, locators), and its round trip is what Bedrock modellers rely on. + *

+ * The defect that caught it: the sofa's backrest is authored {@code axis: x, angle: 22.5} and has to reach the + * geometry as {@code -22.5}. Emitted as {@code +22.5} it leans forward instead of back. The sofa is symmetric + * about X, so the position mirror is invisible on it and the rotation sign is the only thing that shows. + */ @Test - void blockElementRotationPreservesSignOnAllAxes() { + void blockElementRotationMatchesBedrocksPerAxisSignRule() { for (String axis : new String[]{"x", "y", "z"}) { JavaBlockModel model = new JavaBlockModel(null, true); model.addTexture("all", "block/test"); @@ -200,13 +216,9 @@ void blockElementRotationPreservesSignOnAllAxes() { float emittedAngle = cubeJson.get("rotation").getAsJsonArray().get( axis.equals("x") ? 0 : axis.equals("y") ? 1 : 2).getAsFloat(); - // Block geometry is emitted mirrored along X, so an element's rotation comes through as the mirror's - // conjugate of itself. The X mirror commutes with a turn about X and reverses one about Y or Z, so only - // those two change sign. Getting this per-axis rather than uniformly is the point: negating X as well - // tilts the part the wrong way about the one axis the mirror does not touch. - float expected = axis.equals("x") ? 22.5F : -22.5F; + float expected = axis.equals("z") ? 22.5F : -22.5F; assertEquals(expected, emittedAngle, 0.01F, - "a mirrored block's element rotation on " + axis + " must be the X mirror's conjugate"); + "Bedrock negates element rotation on every axis but z; " + axis + " came out wrong"); } } From 97cc528685cb2ac056bd0b5aa8f59021229b1806 Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Sat, 8 Aug 2026 20:42:56 +0200 Subject: [PATCH 072/116] fix(bedrock): name custom items by translation, not by their translation key An item named `` had the tags stripped and the bare key written into display_name as a plain string, so the item was called "item.default.flame_cane" in game. Two things were missing, and both are needed. Geyser documents display_name as "a string, or json text component", and a key belongs in a {"translate": ...} component - as a string it is shown exactly as written. translationKeyOf now tells a key from literal text, which stripFormatting could not, since it returned a plain string either way. Bedrock also does not read the Java key at all. A custom item is named by item..name, identifier spelled in full with its namespace and colon, as the wiki's pottery sherd shows: item.wiki:custom_pottery_sherd.name=Custom Pottery Sherd So LanguageMapper now writes that second spelling for every custom item, per locale, reusing whatever the Java key already translates to. A locale that never translated the key is skipped rather than filled from another: Bedrock falls back to en_US by itself, which beats English text under a French heading. Co-Authored-By: Claude Opus 5 --- .../bedrock/mapping/item/ItemMapping.java | 22 +++- .../converter/bedrock/BedrockItemLoader.java | 32 ++++- .../converter/bedrock/ConversionContext.java | 8 ++ .../bedrock/lang/LanguageMapper.java | 47 +++++++- .../TranslatableItemNameTest.java | 109 ++++++++++++++++++ 5 files changed, 212 insertions(+), 6 deletions(-) create mode 100644 Plugin/src/test/java/fr/robie/craftengineconverter/TranslatableItemNameTest.java diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/ItemMapping.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/ItemMapping.java index df93df8c..b8ae6d70 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/ItemMapping.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/ItemMapping.java @@ -35,6 +35,20 @@ public ItemMapping setDisplayName(String displayName) { return this; } + /** + * Names the item by translation key rather than by literal text. + *

+ * Geyser documents {@code display_name} as "a string, or json text component", so a key belongs in a + * {@code {"translate": ...}} component and never as a bare string — written as a string it is shown + * verbatim, which is how items came to be called {@code item.default.flame_cane} in game. + */ + public ItemMapping setDisplayNameTranslationKey(String translationKey) { + this.displayNameTranslationKey = translationKey; + return this; + } + + private String displayNameTranslationKey; + public ItemMapping setBedrockOptions(BedrockOptions bedrockOptions) { this.bedrockOptions = bedrockOptions; return this; @@ -76,7 +90,13 @@ public JsonObject serialize() { JsonObject jsonObject = new JsonObject(); jsonObject.addProperty("bedrock_identifier", this.bedrockIdentifier); - if (this.displayName != null) { + // A key becomes a text component, never a bare string: Geyser accepts either, and a string is shown + // exactly as written, so a key put there reads as "item.default.flame_cane" in the inventory. + if (this.displayNameTranslationKey != null) { + JsonObject translated = new JsonObject(); + translated.addProperty("translate", this.displayNameTranslationKey); + jsonObject.add("display_name", translated); + } else if (this.displayName != null) { jsonObject.addProperty("display_name", this.displayName); } diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockItemLoader.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockItemLoader.java index debe5f6d..19667b06 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockItemLoader.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockItemLoader.java @@ -496,9 +496,19 @@ private void convertItem(ItemMapping itemMapping) { if (itemName == null) itemName = this.itemSection.getString("data.item_name"); if (itemName == null) itemName = this.itemSection.getString("data.custom-name"); if (itemName != null) { - String stripped = this.stripFormatting(itemName); - if (stripped != null) { - itemMapping.setDisplayName(stripped); + // A name given as is a translation key, not text, and the two cannot be emitted the + // same way. Both halves of the answer are needed: the key goes into display_name as a text component + // so Geyser does not hand Bedrock a literal string, and the same string is registered under Bedrock's + // own item..name so the client can name the item from the pack in its own language. + String translationKey = translationKeyOf(itemName); + if (translationKey != null) { + itemMapping.setDisplayNameTranslationKey(translationKey); + this.context.registerItemNameTranslation(itemMapping.getBedrockIdentifier(), translationKey); + } else { + String stripped = this.stripFormatting(itemName); + if (stripped != null) { + itemMapping.setDisplayName(stripped); + } } } @@ -742,9 +752,23 @@ private String determineCreativeCategory(Material material) { return "items"; } + /** + * The translation key a name refers to, or {@code null} when the name is literal text. + *

+ * Split out from {@link #stripFormatting} because that returns a plain string either way, and its two cases + * have to be told apart: a key needs a text component and a Bedrock lang entry, literal text needs neither. + */ + private static String translationKeyOf(String input) { + if (input == null) return null; + java.util.regex.Matcher matcher = LANG_TAG.matcher(input); + return matcher.find() ? matcher.group(1) : null; + } + + private static final java.util.regex.Pattern LANG_TAG = java.util.regex.Pattern.compile("]+)>"); + private String stripFormatting(String input) { if (input == null) return null; - java.util.regex.Matcher langMatcher = java.util.regex.Pattern.compile("]+)>").matcher(input); + java.util.regex.Matcher langMatcher = LANG_TAG.matcher(input); if (langMatcher.find()) { return langMatcher.group(1); } diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/ConversionContext.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/ConversionContext.java index f9f9a885..708780bd 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/ConversionContext.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/ConversionContext.java @@ -554,6 +554,14 @@ public void addLangDirectory(File langDir, String namespace) { this.languageMapper.addFromLangDirectory(langDir, namespace); } + /** + * Names a custom item under the key Bedrock reads, taking the text from the Java key the pack already + * translates. See {@link LanguageMapper#addItemNameAlias}. + */ + public void registerItemNameTranslation(String bedrockIdentifier, String javaTranslationKey) { + this.languageMapper.addItemNameAlias(bedrockIdentifier, javaTranslationKey); + } + public void addFontDirectory(File fontDir, String namespace) { if (this.javaAssetsDir == null) return; this.fontMapper.addFromFontDirectory(fontDir, namespace, this.javaAssetsDir); diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/lang/LanguageMapper.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/lang/LanguageMapper.java index 06f2de6b..7ce53394 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/lang/LanguageMapper.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/lang/LanguageMapper.java @@ -42,8 +42,51 @@ public void addFromLangDirectory(File langDir, String namespace) { } } + /** + * Names a custom item under the key Bedrock actually looks up, reusing whatever the Java key translates to. + *

+ * Java names an item by any key it likes — CraftEngine writes {@code } and the + * pack's {@code lang/en_us.json} defines {@code item.default.flame_cane}. Bedrock does not read that: a custom + * item's name comes from {@code item..name}, identifier included in full with its namespace + * and colon, exactly as the wiki's pottery-sherd example shows: + *

item.wiki:custom_pottery_sherd.name=Custom Pottery Sherd
+ * So the same string has to appear a second time under the Bedrock spelling, per locale, or the item shows the + * raw key instead of its name. + *

+ * Registered rather than written immediately because locales are still being read when items are converted; + * the aliases resolve in {@link #save}. + * + * @param bedrockIdentifier namespaced, e.g. {@code default:flame_cane} + * @param javaKey the translation key the Java item name referred to + */ + public void addItemNameAlias(String bedrockIdentifier, String javaKey) { + if (bedrockIdentifier == null || javaKey == null || bedrockIdentifier.isBlank() || javaKey.isBlank()) return; + this.itemNameAliases.put(bedrockIdentifier, javaKey); + } + + /** Bedrock item identifier to the Java translation key its name came from. See {@link #addItemNameAlias}. */ + private final Map itemNameAliases = new LinkedHashMap<>(); + + /** + * Writes each alias into every locale that can translate it. + *

+ * Per locale rather than once, so a French client gets the French name. A locale missing the key is skipped + * rather than filled from another one: Bedrock falls back to {@code en_US} by itself, which is a better answer + * than showing English text under a French heading. + */ + private void applyItemNameAliases() { + for (Map.Entry alias : this.itemNameAliases.entrySet()) { + String bedrockKey = "item." + alias.getKey() + ".name"; + for (LinkedHashMap localeMap : this.entries.values()) { + String translated = localeMap.get(alias.getValue()); + // Only when the locale really has it, and never over an entry the pack wrote itself. + if (translated != null) localeMap.putIfAbsent(bedrockKey, translated); + } + } + } + public boolean isEmpty() { - return this.entries.isEmpty(); + return this.entries.isEmpty() && this.itemNameAliases.isEmpty(); } public int size() { @@ -53,6 +96,8 @@ public int size() { public void save(Path textsDir) { if (this.isEmpty()) return; + this.applyItemNameAliases(); + try { Files.createDirectories(textsDir); } catch (IOException e) { diff --git a/Plugin/src/test/java/fr/robie/craftengineconverter/TranslatableItemNameTest.java b/Plugin/src/test/java/fr/robie/craftengineconverter/TranslatableItemNameTest.java new file mode 100644 index 00000000..179d8197 --- /dev/null +++ b/Plugin/src/test/java/fr/robie/craftengineconverter/TranslatableItemNameTest.java @@ -0,0 +1,109 @@ +package fr.robie.craftengineconverter; + +import fr.robie.craftengineconverter.converter.bedrock.lang.LanguageMapper; +import org.junit.jupiter.api.Test; + +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.List; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + +/** + * A custom item's name has to survive into Bedrock as a name, not as the key it was written with. + *

+ * CraftEngine names an item {@code } and the Java pack translates that key. Bedrock + * reads neither: a custom item is named by {@code item..name}, with the identifier spelled in + * full including its namespace and colon — the form the Bedrock wiki uses for custom pottery sherds + * ({@code item.wiki:custom_pottery_sherd.name}). Without that entry the item showed the raw + * {@code item.default.flame_cane} in game. + */ +class TranslatableItemNameTest { + + /** Writes a Java lang file the mapper can read. */ + private static Path langDir(Path root, String locale, String json) throws Exception { + Path dir = root.resolve("lang"); + Files.createDirectories(dir); + Files.writeString(dir.resolve(locale + ".json"), json); + return dir; + } + + private static List writeAndRead(LanguageMapper mapper, Path root, String locale) throws Exception { + Path texts = root.resolve("texts"); + mapper.save(texts); + return Files.readAllLines(texts.resolve(locale + ".lang")); + } + + @Test + void aCustomItemIsNamedUnderBedrocksOwnKey() throws Exception { + Path root = Files.createTempDirectory("lang-alias"); + LanguageMapper mapper = new LanguageMapper(); + mapper.addFromLangDirectory( + langDir(root, "en_us", "{\"item.default.flame_cane\":\"Flame Cane\"}").toFile(), "default"); + mapper.addItemNameAlias("default:flame_cane", "item.default.flame_cane"); + + List lines = writeAndRead(mapper, root, "en_US"); + + assertTrue(lines.contains("item.default:flame_cane.name=Flame Cane"), + "Bedrock names a custom item from item..name; got " + lines); + // The Java key stays too - it is what the pack's own text and the item mapping still refer to. + assertTrue(lines.contains("item.default.flame_cane=Flame Cane"), "the original key must survive"); + } + + /** Per locale, so a French client reads French rather than the English fallback baked in at conversion. */ + @Test + void eachLocaleGetsItsOwnTranslation() throws Exception { + Path root = Files.createTempDirectory("lang-alias-locales"); + LanguageMapper mapper = new LanguageMapper(); + mapper.addFromLangDirectory( + langDir(root, "en_us", "{\"item.default.flame_cane\":\"Flame Cane\"}").toFile(), "default"); + mapper.addFromLangDirectory( + langDir(root, "fr_fr", "{\"item.default.flame_cane\":\"Canne de Flamme\"}").toFile(), "default"); + mapper.addItemNameAlias("default:flame_cane", "item.default.flame_cane"); + + mapper.save(root.resolve("texts")); + + assertTrue(Files.readAllLines(root.resolve("texts/en_US.lang")) + .contains("item.default:flame_cane.name=Flame Cane")); + assertTrue(Files.readAllLines(root.resolve("texts/fr_FR.lang")) + .contains("item.default:flame_cane.name=Canne de Flamme")); + } + + /** + * A locale that never translated the key is left alone. Bedrock falls back to {@code en_US} on its own, which + * beats writing English text under a French heading. + */ + @Test + void aLocaleMissingTheKeyIsNotFilledFromAnother() throws Exception { + Path root = Files.createTempDirectory("lang-alias-missing"); + LanguageMapper mapper = new LanguageMapper(); + mapper.addFromLangDirectory( + langDir(root, "en_us", "{\"item.default.flame_cane\":\"Flame Cane\"}").toFile(), "default"); + mapper.addFromLangDirectory( + langDir(root, "fr_fr", "{\"item.default.other\":\"Autre\"}").toFile(), "default"); + mapper.addItemNameAlias("default:flame_cane", "item.default.flame_cane"); + + mapper.save(root.resolve("texts")); + + assertFalse(Files.readAllLines(root.resolve("texts/fr_FR.lang")).stream() + .anyMatch(line -> line.startsWith("item.default:flame_cane.name=")), + "an untranslated locale must not be given the English string"); + } + + /** An alias for a key nothing translates cannot invent a name, and must not write an empty entry. */ + @Test + void anUnknownKeyAddsNothing() throws Exception { + Path root = Files.createTempDirectory("lang-alias-unknown"); + LanguageMapper mapper = new LanguageMapper(); + mapper.addFromLangDirectory( + langDir(root, "en_us", "{\"item.default.flame_cane\":\"Flame Cane\"}").toFile(), "default"); + mapper.addItemNameAlias("default:ghost", "item.default.ghost"); + + List lines = writeAndRead(mapper, root, "en_US"); + + assertEquals(1, lines.stream().filter(line -> !line.isBlank()).count(), + "only the one real translation should be written; got " + lines); + } +} From bc1aeb46ae633e1baab6da16bee9105ec5056708 Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Sat, 8 Aug 2026 20:53:02 +0200 Subject: [PATCH 073/116] feat(bedrock): model item names as text components, keeping their formatting An item name was a String that was sometimes literal text and sometimes a translation key, with no way to tell the two apart, and every colour in it was deleted by a regex that stripped all tags. So a name written Flame Cane arrived in Bedrock as plain white text, and one written arrived as that literal string. TextComponent models the Java text component tree - text, translate/with, extra, colour, the five style flags, font. Java rather than Bedrock on purpose: Geyser's mapping is read on the Java side and Geyser converts it to Bedrock rawtext itself. Bedrock's own rawtext has nowhere to go here, since texts/*.lang holds plain key=value strings, not JSON. selector, score, keybind and nbt are left out - they resolve per player when a message is sent, and an item name is registered once at startup, so they would render empty. MiniMessageToComponent reads the tags CraftEngine actually emits and returns null on anything else, so an unsupported tag costs the formatting and never the name. is carried through as an explicit italic:false, because Java italicises a custom name by default and Bedrock does not. ItemName ties a component to the translation key recoverable from it. Only a bare translate can also become an item..name lang entry, the one route that localises per client; styling it trades that away, which is the author's call to make. bedrock.display-name overrides all of it, as a string or as a component with colour and style. Inference is a default, not a policy. Co-Authored-By: Claude Opus 5 --- .../bedrock/mapping/item/ItemMapping.java | 35 ++-- .../configuration/bedrock/text/ItemName.java | 72 +++++++ .../bedrock/text/MiniMessageToComponent.java | 188 ++++++++++++++++++ .../bedrock/text/TextComponent.java | 127 ++++++++++++ .../converter/bedrock/BedrockItemLoader.java | 96 +++++++-- .../TextComponentNameTest.java | 123 ++++++++++++ 6 files changed, 603 insertions(+), 38 deletions(-) create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/text/ItemName.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/text/MiniMessageToComponent.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/text/TextComponent.java create mode 100644 Plugin/src/test/java/fr/robie/craftengineconverter/TextComponentNameTest.java diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/ItemMapping.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/ItemMapping.java index b8ae6d70..9f89f8bb 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/ItemMapping.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/ItemMapping.java @@ -17,7 +17,6 @@ public abstract class ItemMapping { private final String bedrockIdentifier; - private String displayName; private BedrockOptions bedrockOptions; private final List bedrockPredicates = new ArrayList<>(); @@ -30,24 +29,30 @@ public ItemMapping(@NotNull Material javaMaterial, @NotNull String bedrockIdenti this.bedrockIdentifier = bedrockIdentifier; } + /** Literal text. Kept for callers that already know the name is not a key. */ public ItemMapping setDisplayName(String displayName) { - this.displayName = displayName; + this.name = displayName == null ? null + : fr.robie.craftengineconverter.api.configuration.bedrock.text.ItemName.literal(displayName); return this; } /** - * Names the item by translation key rather than by literal text. + * The item's name, styling and all. *

- * Geyser documents {@code display_name} as "a string, or json text component", so a key belongs in a - * {@code {"translate": ...}} component and never as a bare string — written as a string it is shown - * verbatim, which is how items came to be called {@code item.default.flame_cane} in game. + * Geyser documents {@code display_name} as "a string, or json text component", and the difference is + * load-bearing: a translation key written as a string is shown verbatim, which is how items came to be called + * {@code item.default.flame_cane} in game. */ - public ItemMapping setDisplayNameTranslationKey(String translationKey) { - this.displayNameTranslationKey = translationKey; + public ItemMapping setName(fr.robie.craftengineconverter.api.configuration.bedrock.text.ItemName name) { + this.name = name; return this; } - private String displayNameTranslationKey; + public fr.robie.craftengineconverter.api.configuration.bedrock.text.ItemName getName() { + return this.name; + } + + private fr.robie.craftengineconverter.api.configuration.bedrock.text.ItemName name; public ItemMapping setBedrockOptions(BedrockOptions bedrockOptions) { this.bedrockOptions = bedrockOptions; @@ -90,14 +95,10 @@ public JsonObject serialize() { JsonObject jsonObject = new JsonObject(); jsonObject.addProperty("bedrock_identifier", this.bedrockIdentifier); - // A key becomes a text component, never a bare string: Geyser accepts either, and a string is shown - // exactly as written, so a key put there reads as "item.default.flame_cane" in the inventory. - if (this.displayNameTranslationKey != null) { - JsonObject translated = new JsonObject(); - translated.addProperty("translate", this.displayNameTranslationKey); - jsonObject.add("display_name", translated); - } else if (this.displayName != null) { - jsonObject.addProperty("display_name", this.displayName); + // A string when the name is bare text, an object when it carries a key or any styling. ItemName owns that + // choice, so there is one place that decides rather than a branch here and another in the loader. + if (this.name != null) { + jsonObject.add("display_name", this.name.toDisplayNameJson()); } if (this.bedrockOptions != null) { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/text/ItemName.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/text/ItemName.java new file mode 100644 index 00000000..20c5d5ad --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/text/ItemName.java @@ -0,0 +1,72 @@ +package fr.robie.craftengineconverter.api.configuration.bedrock.text; + +import com.google.gson.JsonElement; + +/** + * What a custom item is called, and everything that follows from it. + *

+ * A name reaches Bedrock by two routes at once and they answer different questions: + *

    + *
  • {@code display_name} in the Geyser mapping — carries styling, and is what Geyser sends.
  • + *
  • {@code item..name} in the pack's {@code texts/*.lang} — the only route that localises, because + * the client resolves it in whatever language it is running.
  • + *
+ * The second is only possible when the name is a bare translation key, so {@link #translationKey()} exists to say + * whether it is. A styled or literal name has none, and relies on {@code display_name} alone. + *

+ * A type rather than a {@code String} because the string form is what went wrong: a field that was sometimes text + * and sometimes a key, with no way to tell, so a key got written where text was expected and items were called + * {@code item.default.flame_cane} in game. + */ +public final class ItemName { + + private final TextComponent component; + private final String translationKey; + + private ItemName(TextComponent component, String translationKey) { + this.component = component; + this.translationKey = translationKey; + } + + /** Plain text, exactly as written. */ + public static ItemName literal(String text) { + return new ItemName(TextComponent.literal(text), null); + } + + /** A bare translation key, which can also be localised through the pack's lang files. */ + public static ItemName translatable(String key) { + return new ItemName(TextComponent.translatable(key), key); + } + + /** + * An arbitrary component — styled text, a coloured translation, several parts. + *

+ * The translation key is recovered only from a component that is nothing but a {@code translate}. Once a + * colour or a second part is involved the name cannot be expressed as a single lang entry, so it goes through + * {@code display_name} alone and loses per-language resolution. That is a real trade, and it is the pack + * author's to make: they chose the styling. + */ + public static ItemName of(TextComponent component) { + if (component == null) return null; + boolean bareTranslate = component.translate() != null + && component.text() == null + && component.extra().isEmpty() + && component.serialize().isJsonObject() + && component.serialize().getAsJsonObject().size() == 1; + return new ItemName(component, bareTranslate ? component.translate() : null); + } + + /** The value for {@code display_name}: a plain string when it can be, an object when it must be. */ + public JsonElement toDisplayNameJson() { + return this.component.serialize(); + } + + /** The key to register under {@code item..name}, or {@code null} when there is none. */ + public String translationKey() { + return this.translationKey; + } + + public TextComponent component() { + return this.component; + } +} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/text/MiniMessageToComponent.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/text/MiniMessageToComponent.java new file mode 100644 index 00000000..8cefdc22 --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/text/MiniMessageToComponent.java @@ -0,0 +1,188 @@ +package fr.robie.craftengineconverter.api.configuration.bedrock.text; + +import java.util.ArrayDeque; +import java.util.Deque; +import java.util.List; +import java.util.Locale; +import java.util.Set; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * Turns the MiniMessage string CraftEngine names an item with into a {@link TextComponent}. + *

+ * What this replaces threw the formatting away: {@code input.replaceAll("<[^>]+>", "")} deleted every tag, so + * {@code Flame Cane} reached Bedrock as plain white "Flame Cane". The colour is in the + * pack because the author put it there. + *

+ * {@code } is the one to understand. Java renders a custom item name in italics by default, so nearly + * every CraftEngine name opens with {@code } to turn that off. Bedrock does not italicise by default, so the + * tag looks redundant — it is not. It has to be emitted as an explicit {@code "italic": false}, because a name that + * also sets a colour becomes a component, and a component without the flag would let Java's default back in. + *

+ * This parser is deliberately partial. MiniMessage is a large grammar and a half-understood tag mangles a + * name, which is worse than dropping formatting. Only the tags CraftEngine actually emits are handled; anything + * else makes {@link #parse} return {@code null} so the caller can fall back to the old strip-to-plain-text + * behaviour. Failing to the previous result is always available, so this can never be worse than what it replaces. + */ +public final class MiniMessageToComponent { + + private MiniMessageToComponent() { + throw new UnsupportedOperationException("MiniMessageToComponent is a utility class."); + } + + private static final Pattern TAG = Pattern.compile("<([^<>]+)>"); + private static final Pattern HEX = Pattern.compile("#[0-9a-fA-F]{6}"); + + /** The sixteen Java colour names, which MiniMessage and the component format spell identically. */ + private static final Set COLORS = Set.of( + "black", "dark_blue", "dark_green", "dark_aqua", "dark_red", "dark_purple", "gold", "gray", + "dark_gray", "blue", "green", "aqua", "red", "light_purple", "yellow", "white"); + + // MiniMessage's short spellings, mapped onto the component field each one sets. + private static final java.util.Map STYLES = java.util.Map.of( + "bold", "bold", "b", "bold", + "italic", "italic", "i", "italic", "em", "italic", + "underlined", "underlined", "u", "underlined", + "strikethrough", "strikethrough", "st", "strikethrough", + "obfuscated", "obfuscated"); + + /** One level of styling, as the tag stack sees it. */ + private record Style(String color, java.util.Map flags) { + + static Style empty() { + return new Style(null, java.util.Map.of()); + } + + Style withColor(String value) { + return new Style(value, this.flags); + } + + Style withFlag(String name, boolean value) { + java.util.Map next = new java.util.LinkedHashMap<>(this.flags); + next.put(name, value); + return new Style(this.color, next); + } + + void applyTo(TextComponent component) { + if (this.color != null) component.withColor(this.color); + for (var flag : this.flags.entrySet()) { + switch (flag.getKey()) { + case "bold" -> component.withBold(flag.getValue()); + case "italic" -> component.withItalic(flag.getValue()); + case "underlined" -> component.withUnderlined(flag.getValue()); + case "strikethrough" -> component.withStrikethrough(flag.getValue()); + case "obfuscated" -> component.withObfuscated(flag.getValue()); + default -> { } + } + } + } + + boolean isEmpty() { + return this.color == null && this.flags.isEmpty(); + } + } + + /** + * @return the parsed name, or {@code null} when the string uses a tag this does not understand and the caller + * should fall back + */ + public static TextComponent parse(String input) { + if (input == null) return null; + + Deque + +

+
+
Bedrock attachable · frame calibration
+

Held Item Pose Calibrator

+
+

+ Left is fixed: where the Java client draws the item, from Java's own numbers. Right is what the converter emits, + and it is the only side that moves as you edit. Drag either viewport to orbit; scroll to zoom. +

+
+ +
+
+
+
+
Javadisplay transform on the rig
+ +
+
+
Bedrockemitted animation on the bound bone
+ +
+
+ +
+
+
Offset from Java's placement
+ 0.00 + model units +
+ Matches Java +
+ ΔX 0.00 + ΔY 0.00 + ΔZ 0.00 + from fist 0.00 + gripped at - + off arm axis 0 +
+
+ +

+ Java item   + Bedrock item   + player rig, drawn identically in both — + it is the same body. The small cross marks Bedrock's rightItem bone. +

+
+ + +
+ + From 08200fe65d64e8c3c131b92b1476dbd214687a8e Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Mon, 24 Aug 2026 10:50:17 +0200 Subject: [PATCH 082/116] fix(nexo): recognise STRINGBLOCK custom blocks Nexo's CustomBlockFactory only defines NOTEBLOCK, STRINGBLOCK and CHORUSBLOCK, but the type switch tested for "TRIPWIRE". Every string block therefore fell through to the noteblock branch: it was emitted as a SOLID block and no tripwire blockstate mapping was stored, so both the appearance and the in-world migration were wrong. The bit layout below the branch already matches Nexo's StringMechanicHelpers exactly, so only the type name was wrong. --- .../craftengineconverter/converter/nexo/NexoItemConverter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoItemConverter.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoItemConverter.java index ec6408b0..395d2fba 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoItemConverter.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoItemConverter.java @@ -2014,7 +2014,7 @@ private void convertCustomBlockMechanic(ConfigurationSection nexoCustomBlockSect ); } } - } else if (nexoCustomBlockType.equalsIgnoreCase("TRIPWIRE")) { + } else if (nexoCustomBlockType.equalsIgnoreCase("STRINGBLOCK")) { state = CraftEngineBlockState.TRIPWIRE; if (customVariation >= 0) { BlockData blockData = Bukkit.createBlockData(Material.TRIPWIRE); From 39e0463ba8bae28ba063071f51f2a77bdd18f327 Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Mon, 24 Aug 2026 10:51:07 +0200 Subject: [PATCH 083/116] fix(itemsadder): do not return a null future from convertEmojis Converter#convert chains thenRun on whatever the per-option method returns, so `/converter itemsadder emojis` threw a NullPointerException and left the converter settings backup unrestored. ItemsAdder has no dedicated emoji configuration - its emojis are font_images, which the images converter already handles - so return a completed task that says so instead of null. --- .../java/fr/robie/craftengineconverter/api/format/Message.java | 1 + .../craftengineconverter/converter/itemsadder/IAConverter.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/format/Message.java b/API/src/main/java/fr/robie/craftengineconverter/api/format/Message.java index 87ea6567..3960b326 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/format/Message.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/format/Message.java @@ -169,6 +169,7 @@ public enum Message implements fr.robie.messageflow.model.Message { WARNING__CONVERTER__IA__FURNITURE__UNKNOWN_DISPLAY_TRANSFORM("warning.converter.ia.furniture.unknown-display-transform", "§cUnknown furniture display transform type §e%transform%§c for item §e%item%§c."), WARNING__CONVERTER__IA__ITEMS__NO_SECTION("warning.converter.ia.items.no-section", "No 'items' section found in: §e%file%§c"), WARNING__CONVERTER__IA__ITEMS__SKIPPED_NO_SECTION("warning.converter.ia.items.skipped-no-section", "Skipped item (no section): §e%item%§c in file: §e%file%§c"), + WARNING__CONVERTER__IA__EMOJIS__NOT_APPLICABLE("warning.converter.ia.emojis.not-applicable", "ItemsAdder has no dedicated emoji configuration; its emojis are declared as font images and are converted by the images converter."), WARNING__CONVERTER__IA__IMAGES__NONE_FOUND("warning.converter.ia.images.none-found", "No ItemsAdder font images found to convert"), WARNING__CONVERTER__IA__LANGUAGES__NONE_FOUND("warning.converter.ia.languages.none-found", "No ItemsAdder language files found to convert"), WARNING__CONVERTER__IA__SOUNDS__NO_SECTION("warning.converter.ia.sounds.no-section", "No 'sounds' section found in: §e%file%§c"), diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/itemsadder/IAConverter.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/itemsadder/IAConverter.java index 2a8b8b69..0bc5cba8 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/itemsadder/IAConverter.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/itemsadder/IAConverter.java @@ -234,7 +234,7 @@ private String getFileName(@NotNull String path) { @Override public CompletableFuture convertEmojis(boolean async, Optional player) { - return null; + return this.executeTask(async, () -> this.log(Message.WARNING__CONVERTER__IA__EMOJIS__NOT_APPLICABLE, Logger.LogType.INFO, Placeholder.empty())); } @Override From 25eff98ed0e104cbd3ba7038793310c20ea584d1 Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Mon, 24 Aug 2026 10:51:53 +0200 Subject: [PATCH 084/116] fix(itemsadder): stop converting 3D shields and tridents as fishing rods Model-type detection was `containsAny(keys) && keys.size() == count`. FISHING_ROD, TRIDENT and SHIELD all declare two keys and all share `normal`, so containsAny matched on `normal` alone and the first branch won: a shield's {normal, blocking} was read as a fishing rod, and its `cast` model resolved to ":null". Replace containsAny/getKeysCount with a single matches() that requires the key set to be exactly the type's keys. --- .../common/utils/enums/ia/IAModelsKeys.java | 31 ++++++++++++------- .../itemsadder/IAItemsConverter.java | 16 +++++----- 2 files changed, 28 insertions(+), 19 deletions(-) diff --git a/Common/src/main/java/fr/robie/craftengineconverter/common/utils/enums/ia/IAModelsKeys.java b/Common/src/main/java/fr/robie/craftengineconverter/common/utils/enums/ia/IAModelsKeys.java index 9b9861d8..f999b110 100644 --- a/Common/src/main/java/fr/robie/craftengineconverter/common/utils/enums/ia/IAModelsKeys.java +++ b/Common/src/main/java/fr/robie/craftengineconverter/common/utils/enums/ia/IAModelsKeys.java @@ -14,22 +14,31 @@ public enum IAModelsKeys { this.keys = keys; } - public String[] getKeys() { - return this.keys; + /** + * Whether the given keys are exactly this model type's key set. + * + *

Several types share the {@code normal} key and have the same key count + * (fishing rod, trident and shield all have two), so a partial match is not + * enough to tell them apart - every key has to be present. + */ + public boolean matches(Collection keysToCheck) { + if (keysToCheck.size() != this.keys.length) { + return false; + } + for (String key : this.keys) { + if (!this.contains(keysToCheck, key)) { + return false; + } + } + return true; } - public boolean containsAny(Collection keysToCheck) { + private boolean contains(Collection keysToCheck, String key) { for (String keyToCheck : keysToCheck) { - for (String key : this.keys) { - if (key.equalsIgnoreCase(keyToCheck)) { - return true; - } + if (key.equalsIgnoreCase(keyToCheck)) { + return true; } } return false; } - - public int getKeysCount() { - return this.keys.length; - } } diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/itemsadder/IAItemsConverter.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/itemsadder/IAItemsConverter.java index ebc0ac5c..a1bcb36a 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/itemsadder/IAItemsConverter.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/itemsadder/IAItemsConverter.java @@ -998,11 +998,11 @@ private void handleComplexModels(ConfigurationSection graphicsSection) { private void handle2DModels(ConfigurationSection texturesSection) { Set keys = texturesSection.getKeys(false); - if (IAModelsKeys.BOW.containsAny(keys) && keys.size() == IAModelsKeys.BOW.getKeysCount()) { + if (IAModelsKeys.BOW.matches(keys)) { this.handleBow2D(texturesSection); - } else if (IAModelsKeys.FISHING_ROD.containsAny(keys) && keys.size() == IAModelsKeys.FISHING_ROD.getKeysCount()) { + } else if (IAModelsKeys.FISHING_ROD.matches(keys)) { this.handleFishingRod2D(texturesSection); - } else if (IAModelsKeys.CROSSBOW.containsAny(keys) && keys.size() == IAModelsKeys.CROSSBOW.getKeysCount()) { + } else if (IAModelsKeys.CROSSBOW.matches(keys)) { this.handleCrossbow2D(texturesSection); } } @@ -1010,19 +1010,19 @@ private void handle2DModels(ConfigurationSection texturesSection) { private void handle3DModels(ConfigurationSection modelsSection) { Set keys = modelsSection.getKeys(false); - if (IAModelsKeys.BOW.containsAny(keys) && keys.size() == IAModelsKeys.BOW.getKeysCount()) { + if (IAModelsKeys.BOW.matches(keys)) { this.handleBow3D(this.namespaced(modelsSection.getString("normal"), this.namespace), this.namespaced(modelsSection.getString("pulling_0"), this.namespace), this.namespaced(modelsSection.getString("pulling_1"), this.namespace), this.namespaced(modelsSection.getString("pulling_2"), this.namespace) ); - } else if (IAModelsKeys.FISHING_ROD.containsAny(keys) && keys.size() == IAModelsKeys.FISHING_ROD.getKeysCount()) { + } else if (IAModelsKeys.FISHING_ROD.matches(keys)) { this.handleFishingRod3D(this.namespaced(modelsSection.getString("normal"), this.namespace), this.namespaced(modelsSection.getString("cast"), this.namespace)); - } else if (IAModelsKeys.CROSSBOW.containsAny(keys) && keys.size() == IAModelsKeys.CROSSBOW.getKeysCount()) { + } else if (IAModelsKeys.CROSSBOW.matches(keys)) { this.handleCrossbow3D(modelsSection); - } else if (IAModelsKeys.TRIDENT.containsAny(keys) && keys.size() == IAModelsKeys.TRIDENT.getKeysCount()) { + } else if (IAModelsKeys.TRIDENT.matches(keys)) { this.handleTrident3D(modelsSection); - } else if (IAModelsKeys.SHIELD.containsAny(keys) && keys.size() == IAModelsKeys.SHIELD.getKeysCount()) { + } else if (IAModelsKeys.SHIELD.matches(keys)) { this.handleShield3D(this.namespaced(modelsSection.getString("normal"), this.namespace), this.namespaced(modelsSection.getString("blocking"), this.namespace) ); From e0c147e40786da8e7cedaa3b0d4c1d819c682c2b Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Mon, 24 Aug 2026 10:52:05 +0200 Subject: [PATCH 085/116] fix(itemsadder): parse drop.glow.color with the right case DyeColor's constants are uppercase, so DyeColor.valueOf on a lowercased string always threw: every configured glow colour fell into the error branch and no GlowDropColorConfiguration was ever emitted. --- .../converter/itemsadder/IAItemsConverter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/itemsadder/IAItemsConverter.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/itemsadder/IAItemsConverter.java index a1bcb36a..f2fcaefc 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/itemsadder/IAItemsConverter.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/itemsadder/IAItemsConverter.java @@ -334,7 +334,7 @@ public void convertGlowDropColor() { if (glow) { String color = glowSection.getString("color"); try { - this.craftEngineItemsConfiguration.addItemConfiguration(new GlowDropColorConfiguration(DyeColor.valueOf(color.toLowerCase(Locale.ROOT)))); + this.craftEngineItemsConfiguration.addItemConfiguration(new GlowDropColorConfiguration(DyeColor.valueOf(color.toUpperCase(Locale.ROOT)))); } catch (Exception e) { Placeholder.Builder builder = Placeholder.builder(); builder.register("converter", "IAItemsConverter") From 2cccacaf84623219c6220f105dd6654e99abc0ac Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Mon, 24 Aug 2026 10:52:35 +0200 Subject: [PATCH 086/116] fix(itemsadder): honour an explicit equipment.slot resolveEquipmentSlot returned null as soon as `slot` was set, so an explicitly configured slot produced an EquippableConfiguration with no slot at all and also suppressed slot_attribute_modifiers, which bails out on a null slot. The configured value now wins, falling back to the item id and then the material suffix. The suffix helper also took an `uppercase` flag and only compared _SKULL/_HAT/_ELYTRA in uppercase, so those three never matched on the lowercased item-id path. It now uppercases its input once. --- .../itemsadder/IAItemsConverter.java | 29 ++++++++++--------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/itemsadder/IAItemsConverter.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/itemsadder/IAItemsConverter.java index f2fcaefc..1eaa0f20 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/itemsadder/IAItemsConverter.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/itemsadder/IAItemsConverter.java @@ -417,31 +417,34 @@ private void convertEquipmentSection() { } private EquipmentSlot resolveEquipmentSlot(ConfigurationSection equipmentSection) { - EquipmentSlot fromItemId = this.getEquipmentSlotFromSuffix(this.itemId.toLowerCase(Locale.ROOT), false); - if (fromItemId != null) { - return fromItemId; - } - String slot = equipmentSection.getString("slot"); if (this.isValidString(slot)) { - return null; + EquipmentSlot configuredSlot = this.parseEquipmentSlot(slot); + if (configuredSlot != null) { + return configuredSlot; + } + } + + EquipmentSlot fromItemId = this.getEquipmentSlotFromSuffix(this.itemId); + if (fromItemId != null) { + return fromItemId; } - return this.getEquipmentSlotFromSuffix(this.craftEngineItemsConfiguration.getMaterial().name(), true); + return this.getEquipmentSlotFromSuffix(this.craftEngineItemsConfiguration.getMaterial().name()); } - private EquipmentSlot getEquipmentSlotFromSuffix(String name, boolean uppercase) { - String upString = uppercase ? name.toUpperCase(Locale.ROOT) : name; - if (upString.endsWith(uppercase ? "_HELMET" : "_helmet") || upString.endsWith("_SKULL") || upString.endsWith("_HAT")) { + private EquipmentSlot getEquipmentSlotFromSuffix(String name) { + String upperName = name.toUpperCase(Locale.ROOT); + if (upperName.endsWith("_HELMET") || upperName.endsWith("_SKULL") || upperName.endsWith("_HAT")) { return EquipmentSlot.HEAD; } - if (upString.endsWith(uppercase ? "_CHESTPLATE" : "_chestplate") || upString.endsWith("_ELYTRA")) { + if (upperName.endsWith("_CHESTPLATE") || upperName.endsWith("_ELYTRA")) { return EquipmentSlot.CHEST; } - if (upString.endsWith(uppercase ? "_LEGGINGS" : "_leggings")) { + if (upperName.endsWith("_LEGGINGS")) { return EquipmentSlot.LEGS; } - if (upString.endsWith(uppercase ? "_BOOTS" : "_boots")) { + if (upperName.endsWith("_BOOTS")) { return EquipmentSlot.FEET; } return null; From bbf80f17724b8d4a684769d2a1508664c96cbda8 Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Mon, 24 Aug 2026 10:53:16 +0200 Subject: [PATCH 087/116] fix(itemsadder): stop inverting armor-stand furniture size `boolean isBig = getBoolean("small", true)` followed by `if (!isBig) setSmall(true)` inverted the flag: `small: true` produced a full-size stand and `small: false` a small one. The default was wrong too - ItemsAdder reads behaviours.furniture.small with a default of false. --- .../converter/itemsadder/IAItemsConverter.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/itemsadder/IAItemsConverter.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/itemsadder/IAItemsConverter.java index 1eaa0f20..bab03d78 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/itemsadder/IAItemsConverter.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/itemsadder/IAItemsConverter.java @@ -1198,7 +1198,7 @@ private void convertFurniture(ConfigurationSection furnitureSection, Configurati } catch (Exception ignored) { } - boolean isBig = furnitureSection.getBoolean("small", true); + boolean small = furnitureSection.getBoolean("small", false); Set placements = new HashSet<>(); ConfigurationSection placeableSection = furnitureSection.getConfigurationSection("placeable_on"); @@ -1226,7 +1226,7 @@ private void convertFurniture(ConfigurationSection furnitureSection, Configurati Billboard transformType = Billboard.FIXED; ItemDisplayType displayType = ItemDisplayType.NONE; FloatsUtils displayTranslation = new FloatsUtils(3, new float[]{0f, 0f, 0f}); -// if (isBig) { +// if (!small) { // displayTranslation.addValue(1, 1f); // } FloatsUtils scale = new FloatsUtils(3, new float[]{1f, 1f, 1f}); @@ -1291,7 +1291,7 @@ private void convertFurniture(ConfigurationSection furnitureSection, Configurati if (scale.isUpdated()) { armorStand.setScale(scale.getValue(0), scale.getValue(1), scale.getValue(2)); } - if (!isBig) { + if (small) { armorStand.setSmall(true); } element = armorStand; From 0e004d40bfb3f1ce99df6a851232f17997081f29 Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Mon, 24 Aug 2026 10:54:05 +0200 Subject: [PATCH 088/116] fix(nexo): do not abort the whole recipe pass on a flat recipe layout populateRecipeQueue deliberately admitted a root-level smithing.yml even though determineRecipeType could not type it, and the recipe loop then called recipeType.name() on null. The NPE was swallowed by the catch-all in convertRecipesSync, so a single untypable file silently discarded *every* recipe, not just its own. determineRecipeType now falls back to the file name when the directory does not name a type, which covers the flat layout generally instead of special-casing smithing.yml, and processRecipeConfigFile skips (and reports) a file it still cannot type. --- .../converter/nexo/NexoConverter.java | 34 ++++++++++++++----- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoConverter.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoConverter.java index 968d91d6..3f803357 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoConverter.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoConverter.java @@ -310,7 +310,7 @@ private void processRecipeConfigs(Map> toConvert, F } } - private void processRecipeConfigFile(ConfigFile configFile, File outputFolder, RecipeType recipeType, BukkitProgressBar progress) { + private void processRecipeConfigFile(ConfigFile configFile, File outputFolder, @Nullable RecipeType recipeType, BukkitProgressBar progress) { File recipeFile = configFile.sourceFile(); YamlConfiguration config = configFile.config(); @@ -333,6 +333,13 @@ private void processRecipeConfigFile(ConfigFile configFile, File outputFolder, R } Set keys = config.getKeys(false); + + if (recipeType == null) { + this.logDebug(Message.WARNING__CONVERTER__NEXO__RECIPE__COULD_NOT_DETERMINE_RECIPE_TYPE, Logger.LogType.WARNING, Placeholder.of("file", recipeFile.getAbsolutePath())); + keys.forEach(key -> progress.increment()); + return; + } + YamlConfiguration convertedConfig = new YamlConfiguration(); ConfigurationSection recipesSection = convertedConfig.createSection("recipes"); int convertedCount = 0; @@ -665,7 +672,7 @@ private void populateRecipeQueue(File baseDir, File currentDir, Map> entry = FileCacheManager.getYamlCache().getEntryFile(file.toPath()); if (entry.isPresent()) { RecipeType recipeType = this.determineRecipeType(file, baseDir); - if (recipeType != null || file.getName().equalsIgnoreCase("disabled_recipes.yml") || file.getName().equalsIgnoreCase("smithing.yml")) { + if (recipeType != null || file.getName().equalsIgnoreCase("disabled_recipes.yml")) { ConfigFile configFile = new ConfigFile(file, baseDir, entry.get().getData()); toConvert.computeIfAbsent(recipeType, k -> new ArrayList<>()).add(configFile); } else { @@ -678,22 +685,33 @@ private void populateRecipeQueue(File baseDir, File currentDir, Map 0) { + RecipeType fromDirectory = this.parseRecipeType(pathParts[0]); + if (fromDirectory != null) { + return fromDirectory; + } } - String recipeTypeName = pathParts[0].toUpperCase(Locale.ROOT); + // Nexo also accepts a flat layout where the file itself names the type, e.g. recipes/smithing.yml + String fileName = file.getName(); + return this.parseRecipeType(fileName.substring(0, fileName.length() - ".yml".length())); + } + + private @Nullable RecipeType parseRecipeType(String name) { + if (!this.isValidString(name)) { + return null; + } - if (recipeTypeName.equalsIgnoreCase("SMITHING")) { + if (name.equalsIgnoreCase("SMITHING")) { return RecipeType.SMITHING_TRANSFORM; } try { - return RecipeType.valueOf(recipeTypeName); + return RecipeType.valueOf(name.toUpperCase(Locale.ROOT)); } catch (IllegalArgumentException e) { return null; } From 270427102c574516bd8494161926315075ae4cb0 Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Mon, 24 Aug 2026 10:55:52 +0200 Subject: [PATCH 089/116] fix(itemsadder): drop recipes whose items cannot be resolved convertItemReference logged a failure and then returned the raw reference lowercased, so an unresolvable item was written into the recipe as a bare, namespace-less id that CraftEngine cannot parse. It now returns null. That alone would only move the problem: a null result previously left the recipe serialized with no result at all. Crafting, smithing and cooking recipes are now skipped (with a warning naming the recipe and file) when their result does not resolve, and the cooking output section is only created once the recipe is known to be valid. --- .../api/format/Message.java | 1 + .../converter/itemsadder/IAConverter.java | 40 ++++++++++++------- 2 files changed, 26 insertions(+), 15 deletions(-) diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/format/Message.java b/API/src/main/java/fr/robie/craftengineconverter/api/format/Message.java index 3960b326..40440a02 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/format/Message.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/format/Message.java @@ -180,6 +180,7 @@ public enum Message implements fr.robie.messageflow.model.Message { WARNING__CONVERTER__IA__RECIPES__ANVIL_REPAIR_NOT_IMPLEMENTED("warning.converter.ia.recipes.anvil-repair-not-implemented", "Anvil Repair recipe conversion not implemented yet for recipe: §e%recipe%§c"), WARNING__CONVERTER__IA__RECIPES__UNSUPPORTED_TYPE("warning.converter.ia.recipes.unsupported-type", "Unsupported recipe type: §e%type%§c for recipe: §e%recipe%§c"), WARNING__CONVERTER__IA__RECIPES__UNKNOWN_MACHINE_TYPE("warning.converter.ia.recipes.unknown-machine-type", "Unknown machine type: §e%machine%§c for recipe: §e%recipe%§c"), + WARNING__CONVERTER__IA__RECIPES__SKIPPED_NO_RESULT("warning.converter.ia.recipes.skipped-no-result", "Skipped recipe (its result could not be resolved): §e%recipe%§c in file: §e%file%§c"), WARNING__CONVERTER__IA__RECIPES__SMITHING_MISSING_BASE("warning.converter.ia.recipes.smithing-missing-base", "Missing required 'base' for smithing recipe: §e%recipe%§c in file: §e%file%§c"), WARNING__CONVERTER__IA__RECIPES__UNKNOWN_ITEM_REFERENCE("warning.converter.ia.recipes.unknown-item-reference", "Unknown ItemsAdder item: §e%item%§c for recipe: §e%recipe%§c in file: §e%file%§c"), WARNING__CONVERTER__IA__RECIPES__ITEM_REFERENCE_CONVERSION_FAILURE("warning.converter.ia.recipes.item-reference-conversion-failure", "Could not convert item reference: §e%item%§c for recipe: §e%recipe%§c in file: §e%file%§c"), diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/itemsadder/IAConverter.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/itemsadder/IAConverter.java index 0bc5cba8..9a37f7ac 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/itemsadder/IAConverter.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/itemsadder/IAConverter.java @@ -41,6 +41,7 @@ import fr.robie.yamllibrary.file.YamlConfiguration; import org.bukkit.entity.Player; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; import java.io.File; import java.nio.file.Path; @@ -754,9 +755,11 @@ private AbstractRecipe convertCraftingTableRecipe(ConfigurationSection iaRecipe, } RecipeResult result = this.convertRecipeResult(iaRecipe, recipeId, fileName); - if (result != null) { - recipe.setResult(result); + if (result == null) { + this.logDebug(Message.WARNING__CONVERTER__IA__RECIPES__SKIPPED_NO_RESULT, Logger.LogType.WARNING, Placeholder.of("recipe", recipeId, "file", fileName)); + return null; } + recipe.setResult(result); return recipe; } @@ -778,15 +781,18 @@ private void convertCookingRecipes(ConfigurationSection iaRecipe, ConfigurationS continue; } - String finalRecipeId = machines.size() > 1 ? baseRecipeId + "_" + (i + 1) : baseRecipeId; + CookingRecipe cookingRecipe = this.buildCookingRecipe(iaRecipe, recipeType, recipeId, fileName); + if (cookingRecipe == null) { + continue; + } - ConfigurationSection ceRecipe = recipesSection.createSection(finalRecipeId); - this.convertSingleCookingRecipe(iaRecipe, ceRecipe, recipeType, recipeId, fileName); + String finalRecipeId = machines.size() > 1 ? baseRecipeId + "_" + (i + 1) : baseRecipeId; + cookingRecipe.serialize(recipesSection.createSection(finalRecipeId)); } } - private void convertSingleCookingRecipe(ConfigurationSection iaRecipe, ConfigurationSection ceRecipe, - RecipeType recipeType, String recipeId, String fileName) { + private @Nullable CookingRecipe buildCookingRecipe(ConfigurationSection iaRecipe, RecipeType recipeType, + String recipeId, String fileName) { CookingRecipe cookingRecipe = new CookingRecipe(recipeType); ConfigurationSection ingredientSection = iaRecipe.getConfigurationSection("ingredient"); @@ -807,12 +813,14 @@ private void convertSingleCookingRecipe(ConfigurationSection iaRecipe, Configura cookingRecipe.setTime(cookTime); RecipeResult result = this.convertRecipeResult(iaRecipe, recipeId, fileName); - if (result != null) { - cookingRecipe.setResult(result); + if (result == null) { + this.logDebug(Message.WARNING__CONVERTER__IA__RECIPES__SKIPPED_NO_RESULT, Logger.LogType.WARNING, Placeholder.of("recipe", recipeId, "file", fileName)); + return null; } + cookingRecipe.setResult(result); cookingRecipe.setCategory(CookingRecipeCategory.MISC); - cookingRecipe.serialize(ceRecipe); + return cookingRecipe; } private AbstractRecipe convertSmithingRecipe(ConfigurationSection iaRecipe, String recipeId, String fileName) { @@ -845,9 +853,11 @@ private AbstractRecipe convertSmithingRecipe(ConfigurationSection iaRecipe, Stri } RecipeResult result = this.convertRecipeResult(iaRecipe, recipeId, fileName); - if (result != null) { - smithingRecipe.setResult(result); + if (result == null) { + this.logDebug(Message.WARNING__CONVERTER__IA__RECIPES__SKIPPED_NO_RESULT, Logger.LogType.WARNING, Placeholder.of("recipe", recipeId, "file", fileName)); + return null; } + smithingRecipe.setResult(result); return smithingRecipe; } @@ -862,7 +872,7 @@ private RecipeType getCookingTypeFromMachine(String machine) { }; } - private String convertItemReference(String itemReference, String recipeId, String fileName) { + private @Nullable String convertItemReference(String itemReference, String recipeId, String fileName) { if (!this.isValidString(itemReference)) { return null; } @@ -902,8 +912,8 @@ private String convertItemReference(String itemReference, String recipeId, Strin placeholderBuilder.register("item", itemReference) .register("recipe", recipeId) .register("file", fileName); - this.logDebug(Message.WARNING__CONVERTER__IA__RECIPES__ITEM_REFERENCE_CONVERSION_FAILURE, Logger.LogType.WARNING, placeholderBuilder.build()); - return itemReferenceLowerCase; + this.logDebug(Message.WARNING__CONVERTER__IA__RECIPES__ITEM_REFERENCE_CONVERSION_FAILURE, Logger.LogType.WARNING, placeholderBuilder.build()); + return null; } private RecipeResult convertRecipeResult(ConfigurationSection iaRecipe, String recipeId, String fileName) { From 808c44cc9ec73948080cac6ed36be3e263e80eb2 Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Mon, 24 Aug 2026 10:56:21 +0200 Subject: [PATCH 090/116] fix(converter): restore settings on failure, honour dry run for disabled recipes Converter#convert chained restoreBackup with thenRun, so a failing conversion left the temporarily-applied settings (dry run, thread count) in place for the rest of the session. Use whenComplete instead. Nexo's disabled_recipes.yml handler also wrote CraftEngine's config.yml unconditionally, which is the one thing a dry run must not do. --- .../java/fr/robie/craftengineconverter/converter/Converter.java | 2 +- .../craftengineconverter/converter/nexo/NexoConverter.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/Converter.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/Converter.java index 9f48d25b..f79239a7 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/Converter.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/Converter.java @@ -65,7 +65,7 @@ public CompletableFuture convert(@NotNull ConverterOption converterOption, case RECIPES -> this.convertRecipes(true, optionalPlayer); case PACKS -> this.convertPack(true, optionalPlayer); }; - return conversionTask.thenRun(this.settings::restoreBackup); + return conversionTask.whenComplete((ignored, throwable) -> this.settings.restoreBackup()); } public CompletableFuture convertAll(Optional player) { diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoConverter.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoConverter.java index 3f803357..91507dbf 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoConverter.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoConverter.java @@ -317,7 +317,7 @@ private void processRecipeConfigFile(ConfigFile configFile, File outputFolder, @ if (recipeFile.getName().equalsIgnoreCase("disabled_recipes.yml")) { List disabledRecipes = config.getStringList("disabled_recipes"); - if (!disabledRecipes.isEmpty()) { + if (!disabledRecipes.isEmpty() && !this.settings.dryRunEnabled()) { YamlConfiguration convertedConfig = new YamlConfiguration(); ConfigurationSection disableRecipeSection = this.getOrCreateSection(this.getOrCreateSection(convertedConfig, "recipe"), "disable-vanilla-recipes"); disableRecipeSection.set("list", disabledRecipes); From e9fb6114b232178f29250aeec9815538369710ff Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Mon, 24 Aug 2026 11:04:10 +0200 Subject: [PATCH 091/116] fix(converter): key item conversion on the final id, not the raw id ItemConversionContext kept its converters in maps keyed by the raw item id. ItemsAdder scopes item ids per namespace, so two packs may both define "ruby": the second put overwrote the first, and the losing item was never converted, never serialized and never registered in PluginNameMapper. It disappeared with no diagnostic at all. The maps are now keyed by the final id, which is what actually has to be unique. A genuine collision (same id twice in one namespace, or two same-named files in different Nexo subfolders) is reported and the first definition kept instead of being silently clobbered. Dependencies are still declared as raw ids, so idByRawId translates them back, claiming on a first-come basis and reporting the ambiguity. Only Nexo declares dependencies today, and Nexo ids are globally unique, so the mapping there stays one to one. For ItemsAdder, PluginNameMapper still gets both an unqualified and a "namespace:id" entry, but the unqualified one no longer silently changes meaning: the first namespace to claim it wins and later claims are reported. A qualified reference always resolves correctly. The raw-id-keyed accessors are dropped along with the other unused ones, since their contract no longer means anything; the post processors read the final id off the converter, which has always carried it. --- .../api/format/Message.java | 2 + .../converter/Converter.java | 159 +++++++++--------- .../converter/itemsadder/IAConverter.java | 18 +- .../converter/nexo/NexoConverter.java | 2 +- 4 files changed, 100 insertions(+), 81 deletions(-) diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/format/Message.java b/API/src/main/java/fr/robie/craftengineconverter/api/format/Message.java index 40440a02..ddb85ad3 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/format/Message.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/format/Message.java @@ -165,6 +165,8 @@ public enum Message implements fr.robie.messageflow.model.Message { WARNING__FURNITURE__NON_NUMERIC_BARRIER_RANGE_BOUNDS("warning.furniture.non-numeric-barrier-range-bounds", "§cNon-numeric range bounds §e%range%§c in barrier entry §e%entry%§c."), WARNING__FURNITURE__NON_NUMERIC_BARRIER_VALUE("warning.furniture.non-numeric-barrier-value", "§cNon-numeric value §e%value%§c in barrier entry §e%entry%§c."), + WARNING__CONVERTER__DUPLICATE_ITEM_ID("warning.converter.duplicate-item-id", "§eTwo items resolve to the same id §6%item%§e (§6%first-file%§e and §6%second-file%§e); keeping the first one."), + WARNING__CONVERTER__AMBIGUOUS_DEPENDENCY("warning.converter.ambiguous-dependency", "§eItem id §6%raw-item%§e is defined in more than one namespace (§6%first%§e, §6%second%§e); dependencies on it resolve to the first."), WARNING__CONVERTER__CIRCULAR_DEPENDENCY("warning.converter.circular-dependency", "§eCircular dependency detected, falling back to original order for unresolved items."), WARNING__CONVERTER__IA__FURNITURE__UNKNOWN_DISPLAY_TRANSFORM("warning.converter.ia.furniture.unknown-display-transform", "§cUnknown furniture display transform type §e%transform%§c for item §e%item%§c."), WARNING__CONVERTER__IA__ITEMS__NO_SECTION("warning.converter.ia.items.no-section", "No 'items' section found in: §e%file%§c"), diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/Converter.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/Converter.java index f79239a7..151012b7 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/Converter.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/Converter.java @@ -480,9 +480,14 @@ protected static class ItemConversionContext implements private final List fileList; private final Set scannedFiles = new HashSet<>(); - private final Map convertersByRawId = new LinkedHashMap<>(); - private final Map fileByRawId = new HashMap<>(); - private final Map finalIdByRawId = new HashMap<>(); + // Keyed by final item id, which is the only identifier guaranteed to be unique: ItemsAdder scopes item ids + // per namespace, so two packs may legitimately both define "ruby". + private final Map convertersById = new LinkedHashMap<>(); + private final Map fileById = new HashMap<>(); + // Dependencies are declared with raw ids, so they need a way back to a final id. Ambiguous raw ids resolve to + // the first item that claimed them. + private final Map idByRawId = new HashMap<>(); + private final Map rawIdById = new HashMap<>(); private final Map convertedConfigByFile = new LinkedHashMap<>(); private final Map itemsSectionByFile = new LinkedHashMap<>(); @@ -522,9 +527,9 @@ public void scanWithDependencies() { boolean pendingDependenciesFound = true; while (pendingDependenciesFound) { pendingDependenciesFound = false; - for (T converter : new ArrayList<>(this.convertersByRawId.values())) { + for (T converter : new ArrayList<>(this.convertersById.values())) { for (String depRawId : converter.getDependencies()) { - if (!this.convertersByRawId.containsKey(depRawId) && this.scanFileContaining(depRawId)) { + if (!this.idByRawId.containsKey(depRawId) && this.scanFileContaining(depRawId)) { pendingDependenciesFound = true; } } @@ -554,6 +559,16 @@ private void scanFile(ConfigFile configFile) { } String finalItemId = this.finalIdBuilder.build(configFile, rawItemId); try { + ConfigFile owner = this.fileById.get(finalItemId); + if (owner != null) { + Logger.warn(Message.WARNING__CONVERTER__DUPLICATE_ITEM_ID, Placeholder.builder() + .register("item", finalItemId) + .register("first-file", owner.sourceFile().getName()) + .register("second-file", configFile.sourceFile().getName()) + .build()); + continue; + } + T converter = this.factory.create( configFile, rawItemId, finalItemId, itemSection, convertedConfig @@ -561,9 +576,18 @@ private void scanFile(ConfigFile configFile) { if (converter == null) { continue; } - this.convertersByRawId.put(rawItemId, converter); - this.fileByRawId.put(rawItemId, configFile); - this.finalIdByRawId.put(rawItemId, finalItemId); + this.convertersById.put(finalItemId, converter); + this.fileById.put(finalItemId, configFile); + this.rawIdById.put(finalItemId, rawItemId); + + String claimedBy = this.idByRawId.putIfAbsent(rawItemId, finalItemId); + if (claimedBy != null) { + Logger.warn(Message.WARNING__CONVERTER__AMBIGUOUS_DEPENDENCY, Placeholder.builder() + .register("raw-item", rawItemId) + .register("first", claimedBy) + .register("second", finalItemId) + .build()); + } } catch (Exception e) { Logger.error(Message.ERROR__CONVERTER__ITEM_LOAD_FAILURE, e, Placeholder.of("item", finalItemId, "file", configFile.sourceFile().getName())); } @@ -571,7 +595,7 @@ private void scanFile(ConfigFile configFile) { } private boolean scanFileContaining(String rawItemId) { - if (this.fileByRawId.containsKey(rawItemId)) { + if (this.idByRawId.containsKey(rawItemId)) { return false; } for (ConfigFile file : this.fileList) { @@ -579,7 +603,7 @@ private boolean scanFileContaining(String rawItemId) { continue; } this.scanFile(file); - if (this.fileByRawId.containsKey(rawItemId)) { + if (this.idByRawId.containsKey(rawItemId)) { return true; } } @@ -589,76 +613,88 @@ private boolean scanFileContaining(String rawItemId) { private List topologicalSort() { - Map pendingDepsCountByRawId = new LinkedHashMap<>(); - Map> dependantsByRawId = new HashMap<>(); + Map pendingDepsCountById = new LinkedHashMap<>(); + Map> dependantsById = new HashMap<>(); - for (String rawItemId : this.convertersByRawId.keySet()) { - pendingDepsCountByRawId.put(rawItemId, 0); - dependantsByRawId.put(rawItemId, new ArrayList<>()); + for (String itemId : this.convertersById.keySet()) { + pendingDepsCountById.put(itemId, 0); + dependantsById.put(itemId, new ArrayList<>()); } - for (Map.Entry entry : this.convertersByRawId.entrySet()) { - for (String depRawId : entry.getValue().getDependencies()) { - if (!this.convertersByRawId.containsKey(depRawId)) { - continue; - } - dependantsByRawId.get(depRawId).add(entry.getKey()); - pendingDepsCountByRawId.merge(entry.getKey(), 1, Integer::sum); + for (Map.Entry entry : this.convertersById.entrySet()) { + for (String depId : this.resolveDependencies(entry.getValue())) { + dependantsById.get(depId).add(entry.getKey()); + pendingDepsCountById.merge(entry.getKey(), 1, Integer::sum); } } Queue resolvedQueue = new LinkedList<>(); - for (Map.Entry entry : pendingDepsCountByRawId.entrySet()) { + for (Map.Entry entry : pendingDepsCountById.entrySet()) { if (entry.getValue() == 0) { resolvedQueue.add(entry.getKey()); } } - List sortedRawIds = new ArrayList<>(); + List sortedIds = new ArrayList<>(); while (!resolvedQueue.isEmpty()) { - String currentRawId = resolvedQueue.poll(); - sortedRawIds.add(currentRawId); - for (String dependantRawId : dependantsByRawId.getOrDefault(currentRawId, Collections.emptyList())) { - if (pendingDepsCountByRawId.merge(dependantRawId, -1, Integer::sum) == 0) { - resolvedQueue.add(dependantRawId); + String currentId = resolvedQueue.poll(); + sortedIds.add(currentId); + for (String dependantId : dependantsById.getOrDefault(currentId, Collections.emptyList())) { + if (pendingDepsCountById.merge(dependantId, -1, Integer::sum) == 0) { + resolvedQueue.add(dependantId); } } } - if (sortedRawIds.size() != this.convertersByRawId.size()) { + if (sortedIds.size() != this.convertersById.size()) { Logger.warn(Message.WARNING__CONVERTER__CIRCULAR_DEPENDENCY); - this.convertersByRawId.keySet().stream() - .filter(rawId -> !sortedRawIds.contains(rawId)) - .forEach(sortedRawIds::add); + Set sorted = new HashSet<>(sortedIds); + this.convertersById.keySet().stream() + .filter(itemId -> !sorted.contains(itemId)) + .forEach(sortedIds::add); } - return sortedRawIds; + return sortedIds; + } + + /** + * Translates a converter's declared dependencies - which are raw, unqualified ids - into the final ids this + * context is keyed by, dropping the ones that no scanned file provides. + */ + private List resolveDependencies(T converter) { + List resolved = new ArrayList<>(); + for (String depRawId : converter.getDependencies()) { + String depId = this.idByRawId.get(depRawId); + if (depId != null && this.convertersById.containsKey(depId)) { + resolved.add(depId); + } + } + return resolved; } public void convertInOrder(BukkitProgressBar progress, @Nullable ItemPostProcessor itemPostProcessor) { - List sortedRawIds = this.topologicalSort(); + List sortedIds = this.topologicalSort(); - for (String rawItemId : sortedRawIds) { - T converter = this.convertersByRawId.get(rawItemId); + for (String finalItemId : sortedIds) { + T converter = this.convertersById.get(finalItemId); if (converter == null) { continue; } try { converter.convertItem(); if (itemPostProcessor != null) { - itemPostProcessor.process(rawItemId, converter); + itemPostProcessor.process(this.rawIdById.get(finalItemId), converter); } - this.injectResolvedDependency(rawItemId, converter); + this.injectResolvedDependency(this.rawIdById.get(finalItemId), converter); } catch (Exception e) { - Logger.error(Message.ERROR__CONVERTER__ITEM_CONVERT_EXCEPTION, e, Placeholder.of("item", this.finalIdByRawId.get(rawItemId))); + Logger.error(Message.ERROR__CONVERTER__ITEM_CONVERT_EXCEPTION, e, Placeholder.of("item", finalItemId)); } finally { progress.increment(); } } - for (String rawItemId : sortedRawIds) { - T converter = this.convertersByRawId.get(rawItemId); + for (String finalItemId : sortedIds) { + T converter = this.convertersById.get(finalItemId); if (converter == null || converter.isInternalOnly()) { continue; } - String finalItemId = this.finalIdByRawId.get(rawItemId); - ConfigFile configFile = this.fileByRawId.get(rawItemId); + ConfigFile configFile = this.fileById.get(finalItemId); try { converter.getCraftEngineItemsConfiguration().serialize( @@ -698,49 +734,16 @@ public void saveAll(File outputBase, Converter converter) { public void injectResolvedDependency(String rawItemId, T resolvedConverter) { - for (T converter : this.convertersByRawId.values()) { + for (T converter : this.convertersById.values()) { if (converter.getDependencies().contains(rawItemId)) { converter.addResolvedDependency(rawItemId, resolvedConverter); } } } - - public T getConverter(String rawItemId) { - return this.convertersByRawId.get(rawItemId); - } - - public ConfigFile getFile(String rawItemId) { - return this.fileByRawId.get(rawItemId); - } - - public String getFinalId(String rawItemId) { - return this.finalIdByRawId.get(rawItemId); - } - - public YamlConfiguration getConvertedConfig(ConfigFile file) { - return this.convertedConfigByFile.get(file); - } - - public ConfigurationSection getItemsSection(ConfigFile file) { - return this.itemsSectionByFile.get(file); - } - public List getFinalItemIds(ConfigFile file) { return this.finalItemIdsByFile.getOrDefault(file, Collections.emptyList()); } - public void addFinalItemId(ConfigFile file, String finalItemId) { - this.finalItemIdsByFile.get(file).add(finalItemId); - } - - public List getFiles() { - return this.fileList; - } - - public Set getAllRawIds() { - return this.convertersByRawId.keySet(); - } - } } \ No newline at end of file diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/itemsadder/IAConverter.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/itemsadder/IAConverter.java index 9a37f7ac..de7a75c0 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/itemsadder/IAConverter.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/itemsadder/IAConverter.java @@ -167,8 +167,22 @@ private void processItemFiles(Queue toConvert, File outputFolder, Bu ctx.scanWithDependencies(); ctx.convertInOrder(progressBar, (rawItemId, converter) -> { PluginNameMapper pluginNameMapper = PluginNameMapper.getInstance(); - pluginNameMapper.storeMapping(Plugins.ITEMS_ADDER, rawItemId, ctx.getFinalId(rawItemId)); - pluginNameMapper.storeMapping(Plugins.ITEMS_ADDER, ctx.getFinalId(rawItemId), ctx.getFinalId(rawItemId)); + String finalItemId = converter.getItemId(); + pluginNameMapper.storeMapping(Plugins.ITEMS_ADDER, finalItemId, finalItemId); + + // An unqualified id is only unambiguous while a single namespace claims it, so the first one wins and the + // rest are reported - a "namespace:id" reference still resolves correctly for every one of them. + String claimedBy = pluginNameMapper.getNewName(Plugins.ITEMS_ADDER, rawItemId); + if (claimedBy == null) { + pluginNameMapper.storeMapping(Plugins.ITEMS_ADDER, rawItemId, finalItemId); + } else if (!claimedBy.equals(finalItemId)) { + this.logDebug(Message.WARNING__CONVERTER__AMBIGUOUS_DEPENDENCY, Logger.LogType.WARNING, + Placeholder.builder() + .register("raw-item", rawItemId) + .register("first", claimedBy) + .register("second", finalItemId) + .build()); + } }); ctx.saveAll(outputFolder, this); } diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoConverter.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoConverter.java index 91507dbf..72728ba5 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoConverter.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoConverter.java @@ -118,7 +118,7 @@ private void processConfigs(Queue toConvert, File outputBase, Bukkit ); ctx.scanWithDependencies(); ctx.convertInOrder(progress, (rawItemId, converter) -> - PluginNameMapper.getInstance().storeMapping(Plugins.NEXO, rawItemId, ctx.getFinalId(rawItemId)) + PluginNameMapper.getInstance().storeMapping(Plugins.NEXO, rawItemId, converter.getItemId()) ); ctx.saveAll(outputBase, this); } From faceed95f698e617791bc20d9a97d9239a7d8ee9 Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Mon, 24 Aug 2026 11:05:00 +0200 Subject: [PATCH 092/116] perf(converter): ask each item for its dependencies once injectResolvedDependency walked every converter and called getDependencies() on each one, and it runs once per converted item. NexoItemConverter#getDependencies re-reads its configuration section and allocates a fresh list on every call, so a pack of n items performed n^2 of those reads - a few million on a large pack, all to answer a question whose answer never changes. Dependencies are now collected once at scan time, along with the inverse index, so injection is proportional to the number of actual dependants. topologicalSort's cycle fallback also used List#contains inside a filter over every item; it uses a set now. --- .../converter/Converter.java | 33 ++++++++++++------- 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/Converter.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/Converter.java index 151012b7..3302d360 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/Converter.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/Converter.java @@ -488,6 +488,10 @@ protected static class ItemConversionContext implements // the first item that claimed them. private final Map idByRawId = new HashMap<>(); private final Map rawIdById = new HashMap<>(); + // getDependencies() re-reads the item's configuration section on every call, so it is asked exactly once per + // item and the answer - plus its inverse - is kept here. + private final Map> dependenciesById = new HashMap<>(); + private final Map> dependantsByRawDepId = new HashMap<>(); private final Map convertedConfigByFile = new LinkedHashMap<>(); private final Map itemsSectionByFile = new LinkedHashMap<>(); @@ -527,8 +531,8 @@ public void scanWithDependencies() { boolean pendingDependenciesFound = true; while (pendingDependenciesFound) { pendingDependenciesFound = false; - for (T converter : new ArrayList<>(this.convertersById.values())) { - for (String depRawId : converter.getDependencies()) { + for (List dependencies : new ArrayList<>(this.dependenciesById.values())) { + for (String depRawId : dependencies) { if (!this.idByRawId.containsKey(depRawId) && this.scanFileContaining(depRawId)) { pendingDependenciesFound = true; } @@ -576,9 +580,16 @@ private void scanFile(ConfigFile configFile) { if (converter == null) { continue; } + + List dependencies = converter.getDependencies(); + this.convertersById.put(finalItemId, converter); this.fileById.put(finalItemId, configFile); this.rawIdById.put(finalItemId, rawItemId); + this.dependenciesById.put(finalItemId, dependencies); + for (String depRawId : dependencies) { + this.dependantsByRawDepId.computeIfAbsent(depRawId, k -> new ArrayList<>()).add(converter); + } String claimedBy = this.idByRawId.putIfAbsent(rawItemId, finalItemId); if (claimedBy != null) { @@ -620,10 +631,10 @@ private List topologicalSort() { pendingDepsCountById.put(itemId, 0); dependantsById.put(itemId, new ArrayList<>()); } - for (Map.Entry entry : this.convertersById.entrySet()) { - for (String depId : this.resolveDependencies(entry.getValue())) { - dependantsById.get(depId).add(entry.getKey()); - pendingDepsCountById.merge(entry.getKey(), 1, Integer::sum); + for (String itemId : this.convertersById.keySet()) { + for (String depId : this.resolveDependencies(itemId)) { + dependantsById.get(depId).add(itemId); + pendingDepsCountById.merge(itemId, 1, Integer::sum); } } Queue resolvedQueue = new LinkedList<>(); @@ -656,9 +667,9 @@ private List topologicalSort() { * Translates a converter's declared dependencies - which are raw, unqualified ids - into the final ids this * context is keyed by, dropping the ones that no scanned file provides. */ - private List resolveDependencies(T converter) { + private List resolveDependencies(String itemId) { List resolved = new ArrayList<>(); - for (String depRawId : converter.getDependencies()) { + for (String depRawId : this.dependenciesById.getOrDefault(itemId, Collections.emptyList())) { String depId = this.idByRawId.get(depRawId); if (depId != null && this.convertersById.containsKey(depId)) { resolved.add(depId); @@ -734,10 +745,8 @@ public void saveAll(File outputBase, Converter converter) { public void injectResolvedDependency(String rawItemId, T resolvedConverter) { - for (T converter : this.convertersById.values()) { - if (converter.getDependencies().contains(rawItemId)) { - converter.addResolvedDependency(rawItemId, resolvedConverter); - } + for (T converter : this.dependantsByRawDepId.getOrDefault(rawItemId, Collections.emptyList())) { + converter.addResolvedDependency(rawItemId, resolvedConverter); } } From 294a46bec80d0ab7e3e3b55b156c412e163ae3ab Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Mon, 24 Aug 2026 11:18:16 +0200 Subject: [PATCH 093/116] feat(nexo): resolve item templates Nexo lets an item inherit from one or more others via `template`, and skips any item that is named as a template rather than emitting it. The converter read neither: templated items lost everything they inherited - often their material, model and pack section - and the template stubs were converted into real items alongside them. NexoItemTemplates reproduces what Nexo's ItemParser does: - templates are indexed globally, so an item can inherit from one declared in another file, and `template` also answers to `templates` - several templates merge in declaration order, the item merges on top, and nested sections merge key by key rather than being replaced - templates may name templates; a cycle is reported and broken instead of recursing forever - the placeholders a template is written against - , , , , , - resolve against the inheriting item, including splicing that item's own lore into the position the template chose for it - `injectId` is dropped from the inherited section Resolution works on a detached copy, so nothing is written back into the loaded configuration, and template ids are excluded from both the item key set and the progress-bar total. --- .../api/format/Message.java | 2 + .../converter/nexo/NexoConverter.java | 33 +- .../converter/nexo/NexoItemTemplates.java | 320 ++++++++++++++++++ .../NexoItemTemplatesTest.java | 243 +++++++++++++ 4 files changed, 594 insertions(+), 4 deletions(-) create mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoItemTemplates.java create mode 100644 Plugin/src/test/java/fr/robie/craftengineconverter/NexoItemTemplatesTest.java diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/format/Message.java b/API/src/main/java/fr/robie/craftengineconverter/api/format/Message.java index ddb85ad3..10223213 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/format/Message.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/format/Message.java @@ -126,6 +126,8 @@ public enum Message implements fr.robie.messageflow.model.Message { WARNING__CONVERTER__NEXO__CUSTOM_BLOCK__UNKNOWN_BEST_TOOL("warning.converter.nexo.custom-block.unknown-best-tool", "Unknown best_tool §e%tool%§c for custom block item §e%item%§c. Skipping best_tool conversion."), WARNING__CONVERTER__NEXO__RECIPE__NO_MAPPING_INGREDIENT("warning.converter.nexo.recipe.no-mapping-ingredient", "§cNo mapping found for ingredient §e%item%§c in recipe §e%recipe%§c."), WARNING__CONVERTER__NEXO__RECIPE__NO_MAPPING_RESULT("warning.converter.nexo.recipe.no-mapping-result", "§cNo mapping found for result item §e%item%§c in recipe §e%recipe%§c."), + WARNING__CONVERTER__NEXO__TEMPLATE__NOT_FOUND("warning.converter.nexo.template.not-found", "§eItem §6%item%§e references the template §6%template%§e, which no item file defines; it is ignored."), + WARNING__CONVERTER__NEXO__TEMPLATE__CIRCULAR("warning.converter.nexo.template.circular", "§eTemplate §6%template%§e is part of a cycle reached from §6%item%§e; the repeated reference is ignored."), WARNING__CONVERTER__NEXO__RECIPE__NO_MAPPING_INPUT("warning.converter.nexo.recipe.no-mapping-input", "§cNo mapping found for input item §e%item%§c in recipe §e%recipe%§c."), WARNING__CONVERTER__NEXO__RECIPE__NO_MAPPING_CONTAINER("warning.converter.nexo.recipe.no-mapping-container", "§cNo mapping found for container item §e%item%§c in recipe §e%recipe%§c."), WARNING__CONVERTER__NEXO__RECIPE__COULD_NOT_DETERMINE_RECIPE_TYPE("warning.converter.nexo.recipe.could-not-determine-recipe-type", "§cCould not determine recipe type for file §e%file%§c. Skipping file conversion."), diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoConverter.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoConverter.java index 72728ba5..d908e999 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoConverter.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoConverter.java @@ -84,9 +84,13 @@ private void convertItemsSync(Optional player) { return; } + // Templates span every file, so they have to be known before anything is counted: an item that only exists to + // be inherited from is never converted, and must not be counted towards the progress bar either. + NexoItemTemplates templates = NexoItemTemplates.collect(toConvert); + int totalItems = 0; for (ConfigFile configFile : toConvert) { - totalItems += this.countItemsInConfig(configFile.config()); + totalItems += this.countConvertibleItems(configFile.config(), templates); } BukkitProgressBar progress = this.createProgressBar(player, totalItems, "Converting Nexo items", "items", ConverterOption.ITEMS); @@ -97,7 +101,7 @@ private void convertItemsSync(Optional player) { BlockStatesMapper.getInstance().clearMappingsForPlugin(this.pluginType); try { - this.processConfigs(toConvert, outputBase, progress); + this.processConfigs(toConvert, outputBase, progress, templates); toConvert.clear(); } catch (Exception e) { Logger.error(Message.ERROR__CONVERTER__NEXO__ITEMS__CONVERSION_EXCEPTION, e); @@ -111,10 +115,31 @@ private int countItemsInConfig(YamlConfiguration config) { return keys.size(); } - private void processConfigs(Queue toConvert, File outputBase, BukkitProgressBar progress) { + private int countConvertibleItems(YamlConfiguration config, NexoItemTemplates templates) { + int count = 0; + for (String itemId : config.getKeys(false)) { + if (!templates.isTemplate(itemId)) { + count++; + } + } + return count; + } + + private void processConfigs(Queue toConvert, File outputBase, BukkitProgressBar progress, NexoItemTemplates templates) { ItemConversionContext ctx = new ItemConversionContext<>(new ArrayList<>(toConvert), (configFile, rawItemId, finalItemId, itemSection, convertedConfig) -> - new NexoItemConverter(this, itemSection, finalItemId, convertedConfig) + new NexoItemConverter(this, itemSection, finalItemId, convertedConfig), + null, + configFile -> { + Set itemIds = new LinkedHashSet<>(configFile.config().getKeys(false)); + itemIds.removeIf(templates::isTemplate); + return itemIds; + }, + (configFile, rawItemId) -> { + ConfigurationSection itemSection = configFile.config().getConfigurationSection(rawItemId); + return itemSection == null ? null : templates.resolve(rawItemId, itemSection); + }, + (configFile, rawItemId) -> configFile.sourceFile().getName().replace(".yml", "") + ":" + rawItemId ); ctx.scanWithDependencies(); ctx.convertInOrder(progress, (rawItemId, converter) -> diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoItemTemplates.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoItemTemplates.java new file mode 100644 index 00000000..fabe4623 --- /dev/null +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoItemTemplates.java @@ -0,0 +1,320 @@ +package fr.robie.craftengineconverter.converter.nexo; + +import fr.robie.craftengineconverter.api.format.Message; +import fr.robie.craftengineconverter.utils.ConfigFile; +import fr.robie.messageflow.formatter.Placeholder; +import fr.robie.messageflow.logger.Logger; +import fr.robie.yamllibrary.ConfigurationSection; +import fr.robie.yamllibrary.file.YamlConfiguration; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.Set; +import java.util.function.Function; + +/** + * Nexo's item templates. + * + *

An item may name one or more other items under {@code template} (or {@code templates}); their sections are merged + * together in declaration order and the item is then merged on top, so the item always wins. Any item that is named as + * a template is not itself turned into an item. + * + *

Templates are written against placeholders - {@code }, {@code }, {@code } and friends - + * that are resolved against the item doing the inheriting, which is what makes one template usable by many items. + */ +public final class NexoItemTemplates { + private static final String ITEM_GENERATED = "minecraft:item/generated"; + + /** Resolved against the inheriting item's own section, never the template's. */ + private static final Map> PLACEHOLDERS = new LinkedHashMap<>(); + + static { + PLACEHOLDERS.put("item_id", PlaceholderContext::itemId); + PLACEHOLDERS.put("item_id_capitalized", context -> capitalize(context.itemId())); + PLACEHOLDERS.put("lore", PlaceholderContext::takeLore); + PLACEHOLDERS.put("parent", context -> { + String parentModel = context.string("Pack.parent_model"); + if (parentModel != null) { + return parentModel; + } + String parent = context.string("Pack.parent"); + return parent != null ? parent : ITEM_GENERATED; + }); + PLACEHOLDERS.put("model", context -> { + String model = context.string("Pack.model"); + return model != null ? model : context.itemId(); + }); + PLACEHOLDERS.put("texture", context -> stringListOrSingle(context.item(), "Pack.texture")); + } + + private final Map sectionsByItemId; + private final Set templateIds; + + private NexoItemTemplates(Map sectionsByItemId, Set templateIds) { + this.sectionsByItemId = sectionsByItemId; + this.templateIds = templateIds; + } + + /** + * Indexes every item across every file, then marks as a template each item that some other item inherits from. + * Templates are looked up globally, so an item can inherit from one declared in a different file. + */ + public static NexoItemTemplates collect(Collection files) { + Map sectionsByItemId = new LinkedHashMap<>(); + for (ConfigFile file : files) { + YamlConfiguration config = file.config(); + for (String itemId : config.getKeys(false)) { + ConfigurationSection section = config.getConfigurationSection(itemId); + if (section != null) { + sectionsByItemId.putIfAbsent(itemId, section); + } + } + } + + Set templateIds = new LinkedHashSet<>(); + for (ConfigurationSection section : sectionsByItemId.values()) { + templateIds.addAll(stringListOrSingle(section, "template")); + } + return new NexoItemTemplates(sectionsByItemId, templateIds); + } + + /** Whether this item only exists to be inherited from, and so must not be converted into an item of its own. */ + public boolean isTemplate(String itemId) { + return this.templateIds.contains(itemId); + } + + /** + * The item's section with everything it inherits folded in. Returns a detached copy, so the source configuration + * is never modified; an item without a template still gets a copy, which keeps the caller's contract uniform. + */ + public ConfigurationSection resolve(String itemId, ConfigurationSection itemSection) { + ConfigurationSection item = copyOf(itemId, itemSection); + + ConfigurationSection template = this.mergedTemplateOf(itemId, item, new LinkedHashSet<>()); + if (template == null) { + return item; + } + + template.set("injectId", null); + replacePlaceholders(template, new PlaceholderContext(itemId, item)); + + return deepMerge(template, item); + } + + /** + * Merges every template the section names, in declaration order, so a later template wins over an earlier one. + * Templates may themselves name templates; {@code visiting} keeps a self-referencing chain from recursing forever. + */ + private @Nullable ConfigurationSection mergedTemplateOf(String itemId, ConfigurationSection section, Set visiting) { + List templateIds = stringListOrSingle(section, "template"); + if (templateIds.isEmpty()) { + return null; + } + + ConfigurationSection merged = null; + for (String templateId : templateIds) { + ConfigurationSection templateSection = this.sectionsByItemId.get(templateId); + if (templateSection == null) { + Logger.warn(Message.WARNING__CONVERTER__NEXO__TEMPLATE__NOT_FOUND, Placeholder.of("item", itemId, "template", templateId)); + continue; + } + if (!visiting.add(templateId)) { + Logger.warn(Message.WARNING__CONVERTER__NEXO__TEMPLATE__CIRCULAR, Placeholder.of("item", itemId, "template", templateId)); + continue; + } + + ConfigurationSection resolved = this.resolveTemplate(itemId, templateId, templateSection, visiting); + visiting.remove(templateId); + + merged = merged == null ? resolved : deepMerge(merged, resolved); + } + return merged; + } + + /** + * A template with its own templates folded in. Placeholders are deliberately left alone here: they belong to the + * item that ends up inheriting the chain, not to the intermediate templates. + */ + private ConfigurationSection resolveTemplate(String itemId, String templateId, ConfigurationSection templateSection, Set visiting) { + ConfigurationSection template = copyOf(templateId, templateSection); + + ConfigurationSection parent = this.mergedTemplateOf(itemId, template, visiting); + if (parent == null) { + return template; + } + + parent.set("injectId", null); + return deepMerge(parent, template); + } + + // --- placeholders --------------------------------------------------------------------------------------------- + + private static void replacePlaceholders(ConfigurationSection section, PlaceholderContext context) { + for (String key : new ArrayList<>(section.getKeys(false))) { + if (section.isConfigurationSection(key)) { + ConfigurationSection child = section.getConfigurationSection(key); + if (child != null) { + replacePlaceholders(child, context); + } + continue; + } + + Object value = section.get(key); + if (value instanceof String string) { + List expanded = context.expand(string); + if (expanded.isEmpty()) { + // The placeholder resolved to nothing, so the key it was standing in for has nothing left to say. + section.set(key, null); + } else { + section.set(key, expanded.size() == 1 ? expanded.getFirst() : expanded); + } + } else if (value instanceof List list) { + List expanded = context.expandAll(list); + // A list that had entries and now has none was standing entirely on a placeholder that resolved empty. + section.set(key, expanded.isEmpty() && !list.isEmpty() ? null : expanded); + } + // Anything else - numbers, booleans - cannot carry a placeholder, so it is left exactly as it is. + } + } + + private record PlaceholderContext(String itemId, ConfigurationSection item, Map resolved) { + private PlaceholderContext(String itemId, ConfigurationSection item) { + this(itemId, item, new LinkedHashMap<>()); + } + + private @Nullable String string(String path) { + String value = this.item.getString(path); + return value == null || value.isEmpty() ? null : value; + } + + /** + * The inheriting item's own lore, which the template is expected to place somewhere inside its own. It is + * removed from the item so that the template's copy - the one with the placeholder expanded - is what survives + * the merge. + */ + private List takeLore() { + List lore = this.item.getStringList("lore"); + this.item.set("lore", null); + return lore; + } + + private @Nullable Object valueOf(String key) { + // Memoised because takeLore has a side effect: asking twice would give an empty list the second time. + return this.resolved.computeIfAbsent(key, k -> PLACEHOLDERS.get(k).apply(this)); + } + + private List expandAll(List values) { + List expanded = new ArrayList<>(); + for (Object value : values) { + if (value instanceof String string) { + expanded.addAll(this.expand(string)); + } else { + expanded.add(value); + } + } + return expanded; + } + + /** + * Substitutes every placeholder the value mentions. A list-valued placeholder only expands when the value is + * nothing but that placeholder - {@code lore: " and more"} cannot become several lines - which matches + * how Nexo resolves them. + */ + private List expand(String value) { + List current = new ArrayList<>(List.of(value)); + + for (String key : PLACEHOLDERS.keySet()) { + String token = "<" + key + ">"; + if (!value.contains(token)) { + continue; + } + + Object replacement = this.valueOf(key); + if (replacement == null) { + continue; + } + + List next = new ArrayList<>(); + for (Object element : current) { + if (!(element instanceof String string)) { + next.add(element); + } else if (!(replacement instanceof List list)) { + next.add(string.replace(token, String.valueOf(replacement))); + } else if (string.equals(token)) { + next.addAll(list); + } else { + next.add(string); + } + } + current = next; + } + return current; + } + } + + // --- section helpers ------------------------------------------------------------------------------------------ + + /** + * Nexo accepts either a single string or a list wherever one of these keys appears, and falls back to the same key + * with its plural flipped - {@code texture} also answers to {@code textures}. + */ + private static List stringListOrSingle(ConfigurationSection section, String key) { + List values = readStringListOrSingle(section, key); + if (!values.isEmpty()) { + return values; + } + + String alternateKey = key.endsWith("s") ? key.substring(0, key.length() - 1) : key + "s"; + return readStringListOrSingle(section, alternateKey); + } + + private static List readStringListOrSingle(ConfigurationSection section, String key) { + if (section.isList(key)) { + return section.getStringList(key); + } + String value = section.getString(key); + return value == null || value.isEmpty() ? List.of() : List.of(value); + } + + private static ConfigurationSection copyOf(String name, ConfigurationSection section) { + return deepMerge(new YamlConfiguration().createSection(name), section); + } + + /** Copies {@code source} over {@code target}, merging nested sections key by key so the two are not clobbered. */ + private static @NotNull ConfigurationSection deepMerge(@NotNull ConfigurationSection target, @NotNull ConfigurationSection source) { + for (String key : source.getKeys(false)) { + Object sourceValue = source.get(key); + if (!(sourceValue instanceof ConfigurationSection sourceSection)) { + target.set(key, sourceValue); + continue; + } + + ConfigurationSection targetSection = target.isConfigurationSection(key) + ? target.getConfigurationSection(key) + : target.createSection(key); + deepMerge(targetSection, sourceSection); + } + return target; + } + + private static String capitalize(String itemId) { + StringBuilder capitalized = new StringBuilder(); + for (String word : itemId.split("_")) { + if (!capitalized.isEmpty()) { + capitalized.append(' '); + } + if (word.isEmpty()) { + continue; + } + capitalized.append(word.substring(0, 1).toUpperCase(Locale.ROOT)).append(word.substring(1)); + } + return capitalized.toString(); + } +} diff --git a/Plugin/src/test/java/fr/robie/craftengineconverter/NexoItemTemplatesTest.java b/Plugin/src/test/java/fr/robie/craftengineconverter/NexoItemTemplatesTest.java new file mode 100644 index 00000000..00abb932 --- /dev/null +++ b/Plugin/src/test/java/fr/robie/craftengineconverter/NexoItemTemplatesTest.java @@ -0,0 +1,243 @@ +package fr.robie.craftengineconverter; + +import fr.robie.craftengineconverter.converter.nexo.NexoItemTemplates; +import fr.robie.craftengineconverter.utils.ConfigFile; +import fr.robie.yamllibrary.ConfigurationSection; +import fr.robie.yamllibrary.InvalidConfigurationException; +import fr.robie.yamllibrary.file.YamlConfiguration; +import org.junit.jupiter.api.Test; + +import java.io.File; +import java.util.List; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +/** + * Nexo item templates, checked against how Nexo's own {@code ItemParser} resolves them: templates are looked up + * globally, merged in declaration order, overridden by the inheriting item, and never emitted as items themselves. + */ +class NexoItemTemplatesTest { + + private static YamlConfiguration yaml(String content) { + YamlConfiguration config = new YamlConfiguration(); + try { + config.loadFromString(content); + } catch (InvalidConfigurationException e) { + throw new IllegalArgumentException(e); + } + return config; + } + + private static ConfigFile file(String name, String content) { + return new ConfigFile(new File(name), new File("."), yaml(content)); + } + + private static ConfigurationSection resolve(NexoItemTemplates templates, ConfigFile file, String itemId) { + return templates.resolve(itemId, file.config().getConfigurationSection(itemId)); + } + + @Test + void inheritsFromTheTemplateAndLetsTheItemWin() { + ConfigFile items = file("swords.yml", """ + base_sword: + material: IRON_SWORD + unbreakable: true + Components: + max_damage: 500 + enchantment_glint_override: true + ruby_sword: + template: base_sword + Components: + max_damage: 900 + """); + NexoItemTemplates templates = NexoItemTemplates.collect(List.of(items)); + + assertTrue(templates.isTemplate("base_sword"), "an item named by a template key is a template"); + assertFalse(templates.isTemplate("ruby_sword")); + + ConfigurationSection sword = resolve(templates, items, "ruby_sword"); + assertEquals("IRON_SWORD", sword.getString("material"), "inherited from the template"); + assertTrue(sword.getBoolean("unbreakable")); + assertEquals(900, sword.getInt("Components.max_damage"), "the item overrides the template"); + // Sibling keys inside a nested section survive: the merge is per key, not per section. + assertTrue(sword.getBoolean("Components.enchantment_glint_override")); + } + + @Test + void doesNotTouchTheSourceConfiguration() { + ConfigFile items = file("swords.yml", """ + base_sword: + material: IRON_SWORD + ruby_sword: + template: base_sword + """); + NexoItemTemplates templates = NexoItemTemplates.collect(List.of(items)); + + resolve(templates, items, "ruby_sword"); + + assertNull(items.config().getString("ruby_sword.material"), "resolving must not write back into the file"); + } + + @Test + void mergesSeveralTemplatesWithTheLastWinning() { + ConfigFile items = file("swords.yml", """ + glowing: + Components: + enchantment_glint_override: true + max_damage: 100 + sturdy: + Components: + max_damage: 800 + ruby_sword: + template: + - glowing + - sturdy + """); + NexoItemTemplates templates = NexoItemTemplates.collect(List.of(items)); + + ConfigurationSection sword = resolve(templates, items, "ruby_sword"); + assertTrue(sword.getBoolean("Components.enchantment_glint_override"), "kept from the first template"); + assertEquals(800, sword.getInt("Components.max_damage"), "the later template wins"); + } + + @Test + void followsTemplateChains() { + ConfigFile items = file("swords.yml", """ + metal: + material: IRON_SWORD + unbreakable: true + sturdy: + template: metal + Components: + max_damage: 800 + ruby_sword: + template: sturdy + """); + NexoItemTemplates templates = NexoItemTemplates.collect(List.of(items)); + + ConfigurationSection sword = resolve(templates, items, "ruby_sword"); + assertEquals("IRON_SWORD", sword.getString("material"), "reached through sturdy's own template"); + assertTrue(sword.getBoolean("unbreakable")); + assertEquals(800, sword.getInt("Components.max_damage")); + } + + @Test + void findsTemplatesDeclaredInAnotherFile() { + ConfigFile bases = file("bases.yml", """ + base_sword: + material: IRON_SWORD + """); + ConfigFile swords = file("swords.yml", """ + ruby_sword: + template: base_sword + """); + NexoItemTemplates templates = NexoItemTemplates.collect(List.of(bases, swords)); + + assertTrue(templates.isTemplate("base_sword")); + assertEquals("IRON_SWORD", resolve(templates, swords, "ruby_sword").getString("material")); + } + + @Test + void acceptsThePluralSpelling() { + ConfigFile items = file("swords.yml", """ + base_sword: + material: IRON_SWORD + ruby_sword: + templates: base_sword + """); + NexoItemTemplates templates = NexoItemTemplates.collect(List.of(items)); + + assertTrue(templates.isTemplate("base_sword")); + assertEquals("IRON_SWORD", resolve(templates, items, "ruby_sword").getString("material")); + } + + @Test + void expandsIdAndModelPlaceholders() { + ConfigFile items = file("swords.yml", """ + base_sword: + itemname: "" + Pack: + generate_model: true + parent_model: "" + model: "" + texture: "" + ruby_sword: + template: base_sword + Pack: + texture: item/ruby_sword + """); + NexoItemTemplates templates = NexoItemTemplates.collect(List.of(items)); + + ConfigurationSection sword = resolve(templates, items, "ruby_sword"); + assertEquals("Ruby Sword", sword.getString("itemname")); + // No Pack.parent_model or Pack.parent on the item, so falls back to the vanilla generated model. + assertEquals("minecraft:item/generated", sword.getString("Pack.parent_model")); + // No Pack.model either, so falls back to the item id. + assertEquals("ruby_sword", sword.getString("Pack.model")); + // The item's own texture wins over the template's expanded placeholder anyway, but it must not stay literal. + assertEquals("item/ruby_sword", sword.getString("Pack.texture")); + } + + @Test + void expandsAListPlaceholderIntoSeveralEntries() { + ConfigFile items = file("swords.yml", """ + base_sword: + lore: + - "A blade." + - "" + - "Forged in Nexo." + ruby_sword: + template: base_sword + lore: + - "Rare" + - "Sharp" + """); + NexoItemTemplates templates = NexoItemTemplates.collect(List.of(items)); + + ConfigurationSection sword = resolve(templates, items, "ruby_sword"); + assertEquals( + List.of("A blade.", "Rare", "Sharp", "Forged in Nexo."), + sword.getStringList("lore"), + "the item's own lore is spliced in where the template asked for it"); + // consumes the item's own lore, but only on the working copy. + assertEquals(List.of("Rare", "Sharp"), items.config().getStringList("ruby_sword.lore")); + } + + @Test + void leavesAnItemWithoutTemplatesAlone() { + ConfigFile items = file("swords.yml", """ + ruby_sword: + material: IRON_SWORD + Components: + max_damage: 900 + """); + NexoItemTemplates templates = NexoItemTemplates.collect(List.of(items)); + + ConfigurationSection sword = resolve(templates, items, "ruby_sword"); + assertEquals("IRON_SWORD", sword.getString("material")); + assertEquals(900, sword.getInt("Components.max_damage")); + } + + @Test + void survivesATemplateCycle() { + ConfigFile items = file("swords.yml", """ + a: + template: b + material: IRON_SWORD + b: + template: a + unbreakable: true + ruby_sword: + template: a + """); + NexoItemTemplates templates = NexoItemTemplates.collect(List.of(items)); + + // The point is that this terminates rather than blowing the stack; what it inherits on the way is incidental. + ConfigurationSection sword = resolve(templates, items, "ruby_sword"); + assertEquals("IRON_SWORD", sword.getString("material")); + assertTrue(sword.getBoolean("unbreakable")); + } +} From 5ad152c785d326a73e097308d7767181b49f7bcd Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Mon, 24 Aug 2026 11:28:37 +0200 Subject: [PATCH 094/116] feat(converter): report the configuration a conversion leaves behind Both converters dispatched on a switch whose default arm was empty, so eleven of Nexo's thirteen mechanics and every ItemsAdder behaviour bar two were dropped without a word. The same was true of whole item-level keys - Nexo's PotionEffects and trim, ItemsAdder's potion and book properties - and of most of Nexo's furniture and custom-block sub-keys. Nothing in the output said so, so a pack could convert "successfully" and quietly lose half of what it configured. Converters now record what they skipped and print it once at the end, as one line per feature with a count and a few example items: a mechanic shared by two thousand items is one line, not two thousand warnings. The unread keys are derived by diffing the item's actual configuration against the set of keys each converter reads, rather than against a list of what the source plugin supports. A key nobody thought to handle is therefore reported by default, instead of needing to be remembered. --- .../api/format/Message.java | 2 + .../converter/Converter.java | 25 ++++ .../converter/ItemConverter.java | 19 +++ .../converter/UnsupportedFeatures.java | 77 ++++++++++ .../converter/itemsadder/IAConverter.java | 2 + .../itemsadder/IAItemsConverter.java | 19 ++- .../converter/nexo/NexoConverter.java | 2 + .../converter/nexo/NexoItemConverter.java | 27 +++- .../UnsupportedFeaturesTest.java | 133 ++++++++++++++++++ 9 files changed, 301 insertions(+), 5 deletions(-) create mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/UnsupportedFeatures.java create mode 100644 Plugin/src/test/java/fr/robie/craftengineconverter/UnsupportedFeaturesTest.java diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/format/Message.java b/API/src/main/java/fr/robie/craftengineconverter/api/format/Message.java index 10223213..8103d222 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/format/Message.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/format/Message.java @@ -167,6 +167,8 @@ public enum Message implements fr.robie.messageflow.model.Message { WARNING__FURNITURE__NON_NUMERIC_BARRIER_RANGE_BOUNDS("warning.furniture.non-numeric-barrier-range-bounds", "§cNon-numeric range bounds §e%range%§c in barrier entry §e%entry%§c."), WARNING__FURNITURE__NON_NUMERIC_BARRIER_VALUE("warning.furniture.non-numeric-barrier-value", "§cNon-numeric value §e%value%§c in barrier entry §e%entry%§c."), + WARNING__CONVERTER__UNSUPPORTED_SUMMARY_HEADER("warning.converter.unsupported-summary-header", "§eSome configuration has no CraftEngine equivalent and was left out:"), + WARNING__CONVERTER__UNSUPPORTED_SUMMARY_LINE("warning.converter.unsupported-summary-line", "§e - §6%feature%§e on §6%count%§e item(s), e.g. §6%examples%"), WARNING__CONVERTER__DUPLICATE_ITEM_ID("warning.converter.duplicate-item-id", "§eTwo items resolve to the same id §6%item%§e (§6%first-file%§e and §6%second-file%§e); keeping the first one."), WARNING__CONVERTER__AMBIGUOUS_DEPENDENCY("warning.converter.ambiguous-dependency", "§eItem id §6%raw-item%§e is defined in more than one namespace (§6%first%§e, §6%second%§e); dependencies on it resolve to the first."), WARNING__CONVERTER__CIRCULAR_DEPENDENCY("warning.converter.circular-dependency", "§eCircular dependency detected, falling back to original order for unresolved items."), diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/Converter.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/Converter.java index 3302d360..874181c9 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/Converter.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/Converter.java @@ -41,6 +41,7 @@ public abstract class Converter extends ObjectUtils { protected final String converterName; protected final ConverterSettings settings; protected final Map> packMappings = new HashMap<>(); + protected final UnsupportedFeatures unsupportedFeatures = new UnsupportedFeatures(); public Converter(@NotNull CraftEngineConverter plugin, @NotNull String converterName, @NotNull Plugins pluginType) { this.plugin = plugin; @@ -94,6 +95,30 @@ public CompletableFuture convertAll(Optional player) { public abstract CompletableFuture convertPack(boolean async, Optional player); + /** Notes configuration this conversion cannot carry over; see {@link #logUnsupportedFeatures()}. */ + public void reportUnsupported(@NotNull String feature, @NotNull String itemId) { + this.unsupportedFeatures.record(feature, itemId); + } + + /** + * Prints everything {@link #reportUnsupported} collected as one digest. Called once a conversion finishes, so a + * mechanic shared by a thousand items is reported on a single line instead of drowning the console. + */ + protected void logUnsupportedFeatures() { + if (this.unsupportedFeatures.isEmpty()) { + return; + } + + this.log(Message.WARNING__CONVERTER__UNSUPPORTED_SUMMARY_HEADER, Logger.LogType.WARNING, Placeholder.empty()); + for (UnsupportedFeatures.Summary summary : this.unsupportedFeatures.summaries()) { + this.log(Message.WARNING__CONVERTER__UNSUPPORTED_SUMMARY_LINE, Logger.LogType.WARNING, Placeholder.builder() + .register("feature", summary.feature()) + .register("count", String.valueOf(summary.count())) + .register("examples", summary.examples()) + .build()); + } + } + protected void log(@NotNull Message message, Logger.LogType logType, Placeholder placeholder) { this.processConverterLog(message, logType, placeholder); } diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/ItemConverter.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/ItemConverter.java index 0d5d2881..cd99e903 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/ItemConverter.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/ItemConverter.java @@ -16,6 +16,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Set; public abstract class ItemConverter extends ObjectUtils { private final Map resolvedDependencies = new HashMap<>(); @@ -95,6 +96,7 @@ public void convertItem() { this.convertProfileComponent(); this.convertItemTexture(); this.convertOther(); + this.reportUnsupportedConfiguration(); } public void convertMaterial() { @@ -247,6 +249,23 @@ public void convertExcludeFromInventory() { public void convertOther() { } + /** + * Runs last, once everything that could be converted has been. Implementations report the configuration they had + * to skip through {@link #reportUnsupported}, which the converter prints as one digest at the end. + */ + public void reportUnsupportedConfiguration() { + } + + /** Notes that this item configured something the conversion does not carry over. */ + protected void reportUnsupported(@NotNull String feature) { + this.converter.reportUnsupported(feature, this.itemId); + } + + /** Notes every key of {@code section} that this converter does not read, reported under {@code prefix}. */ + protected void reportUnhandledKeys(@NotNull String prefix, @Nullable ConfigurationSection section, @NotNull Set handledKeys) { + this.converter.unsupportedFeatures.recordUnhandledKeys(prefix, section, handledKeys, this.itemId); + } + protected boolean notEmptyOrNull(List list, int index) { return list != null && list.size() > index && list.get(index) != null && !list.get(index).isEmpty(); } diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/UnsupportedFeatures.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/UnsupportedFeatures.java new file mode 100644 index 00000000..dfa7b983 --- /dev/null +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/UnsupportedFeatures.java @@ -0,0 +1,77 @@ +package fr.robie.craftengineconverter.converter; + +import fr.robie.yamllibrary.ConfigurationSection; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.TreeMap; + +/** + * Collects the configuration a converter had to leave behind, so it can be reported once at the end rather than as a + * warning per item. A pack with two thousand items that all use the same unsupported mechanic should produce one line, + * not two thousand. + */ +public final class UnsupportedFeatures { + private static final int MAX_EXAMPLES = 3; + + private final Map occurrencesByFeature = new TreeMap<>(); + + /** Notes that {@code itemId} configured {@code feature}, which the conversion does not carry over. */ + public void record(@NotNull String feature, @NotNull String itemId) { + this.occurrencesByFeature.computeIfAbsent(feature, key -> new Occurrences()).add(itemId); + } + + /** + * Records every key of {@code section} the converter does not read, reported under {@code prefix}. Driving this + * off what the converter actually reads - rather than off a list of what the source plugin supports - means a key + * cannot go quietly missing just because nobody remembered to add it here. + */ + public void recordUnhandledKeys(@NotNull String prefix, @Nullable ConfigurationSection section, + @NotNull Set handledKeys, @NotNull String itemId) { + if (section == null) { + return; + } + for (String key : section.getKeys(false)) { + if (!handledKeys.contains(key)) { + this.record(prefix.isEmpty() ? key : prefix + "." + key, itemId); + } + } + } + + public boolean isEmpty() { + return this.occurrencesByFeature.isEmpty(); + } + + public void clear() { + this.occurrencesByFeature.clear(); + } + + /** One entry per feature, ordered by name, each with how many items used it and a few of their ids. */ + public @NotNull Collection summaries() { + List summaries = new ArrayList<>(); + this.occurrencesByFeature.forEach((feature, occurrences) -> + summaries.add(new Summary(feature, occurrences.count, String.join(", ", occurrences.examples)))); + return summaries; + } + + public record Summary(String feature, int count, String examples) { + } + + private static final class Occurrences { + private final Set examples = new LinkedHashSet<>(); + private int count; + + private void add(String itemId) { + this.count++; + if (this.examples.size() < MAX_EXAMPLES) { + this.examples.add(itemId); + } + } + } +} diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/itemsadder/IAConverter.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/itemsadder/IAConverter.java index de7a75c0..8596184e 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/itemsadder/IAConverter.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/itemsadder/IAConverter.java @@ -96,9 +96,11 @@ private void convertItemsSync(Optional player) { PluginNameMapper.getInstance().clearMappingsForPlugin(this.pluginType); BlockStatesMapper.getInstance().clearMappingsForPlugin(this.pluginType); + this.unsupportedFeatures.clear(); try { this.processItemFiles(toConvert, outputFolder, progressBar); + this.logUnsupportedFeatures(); for (CacheConversion conversion : this.conversions) { Optional> entryFile = FileCacheManager.getYamlCache() diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/itemsadder/IAItemsConverter.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/itemsadder/IAItemsConverter.java index bab03d78..98e738de 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/itemsadder/IAItemsConverter.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/itemsadder/IAItemsConverter.java @@ -1183,14 +1183,27 @@ public void convertOther() { // machines fuel type not supported } } - default -> { - - } + default -> this.reportUnsupported("behaviours." + behaviourKey); } } } } + /** Every key this converter reads off the item itself; anything else is reported as left out. */ + private static final Set HANDLED_ITEM_KEYS = Set.of( + "name", "display_name", "lore", "resource", "graphics", "durability", "item_flags", + "attribute_modifiers", "enchants", "item_model", "max_stack_size", "glint", "drop", "tooltip_style", + "consumable", "jukebox_disc", "equipment", "specific_properties", "behaviours"); + + private static final Set HANDLED_SPECIFIC_PROPERTIES = Set.of("armor", "block"); + + @Override + public void reportUnsupportedConfiguration() { + this.reportUnhandledKeys("", this.iaItemSection, HANDLED_ITEM_KEYS); + this.reportUnhandledKeys("specific_properties", + this.iaItemSection.getConfigurationSection("specific_properties"), HANDLED_SPECIFIC_PROPERTIES); + } + private void convertFurniture(ConfigurationSection furnitureSection, ConfigurationSection behavioursSection) { IAEntityTypes entityType = IAEntityTypes.ITEM_FRAME; try { diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoConverter.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoConverter.java index d908e999..b83599a2 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoConverter.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoConverter.java @@ -99,9 +99,11 @@ private void convertItemsSync(Optional player) { PluginNameMapper.getInstance().clearMappingsForPlugin(this.pluginType); BlockStatesMapper.getInstance().clearMappingsForPlugin(this.pluginType); + this.unsupportedFeatures.clear(); try { this.processConfigs(toConvert, outputBase, progress, templates); + this.logUnsupportedFeatures(); toConvert.clear(); } catch (Exception e) { Logger.error(Message.ERROR__CONVERTER__NEXO__ITEMS__CONVERSION_EXCEPTION, e); diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoItemConverter.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoItemConverter.java index 395d2fba..d885a3a2 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoItemConverter.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoItemConverter.java @@ -1965,12 +1965,35 @@ public void convertOther() { this.convertCustomBlockMechanic(nexoCustomBlockSection); } //TODO: convert energyblast mechanic - default -> { - } + default -> this.reportUnsupported("Mechanics." + mechanicsKey); } } } + /** Every key this converter reads off the item itself; anything else is reported as left out. */ + private static final Set HANDLED_ITEM_KEYS = Set.of( + "material", "itemname", "lore", "color", "unbreakable", "excludeFromInventory", "ItemFlags", + "AttributeModifiers", "Enchantments", "Components", "Pack", "Mechanics", + // Consumed before conversion, by NexoItemTemplates. + "template", "templates", "injectId"); + + private static final Set HANDLED_CUSTOM_BLOCK_KEYS = Set.of( + "type", "custom_variation", "log_strip", "directional", "block_sounds", "hardness", + "beacon_base_block", "is_falling", "sapling", "drop"); + + private static final Set HANDLED_FURNITURE_KEYS = Set.of( + "modelengine_id", "better-model", "block_sounds", "rotatable", "restricted_rotation", "seats", + "properties", "drop", "limited_placing", "hitbox"); + + @Override + public void reportUnsupportedConfiguration() { + this.reportUnhandledKeys("", this.nexoItemSection, HANDLED_ITEM_KEYS); + this.reportUnhandledKeys("Mechanics.custom_block", + this.nexoItemSection.getConfigurationSection("Mechanics.custom_block"), HANDLED_CUSTOM_BLOCK_KEYS); + this.reportUnhandledKeys("Mechanics.furniture", + this.nexoItemSection.getConfigurationSection("Mechanics.furniture"), HANDLED_FURNITURE_KEYS); + } + private void convertCustomBlockMechanic(ConfigurationSection nexoCustomBlockSection) { ModelConfiguration modelConfiguration = this.craftEngineItemsConfiguration.getModelConfiguration(); if (modelConfiguration == null) { diff --git a/Plugin/src/test/java/fr/robie/craftengineconverter/UnsupportedFeaturesTest.java b/Plugin/src/test/java/fr/robie/craftengineconverter/UnsupportedFeaturesTest.java new file mode 100644 index 00000000..eb39732b --- /dev/null +++ b/Plugin/src/test/java/fr/robie/craftengineconverter/UnsupportedFeaturesTest.java @@ -0,0 +1,133 @@ +package fr.robie.craftengineconverter; + +import fr.robie.craftengineconverter.converter.UnsupportedFeatures; +import fr.robie.yamllibrary.InvalidConfigurationException; +import fr.robie.yamllibrary.file.YamlConfiguration; +import org.junit.jupiter.api.Test; + +import java.util.List; +import java.util.Set; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + +/** + * The digest a converter prints for configuration it could not carry over. + */ +class UnsupportedFeaturesTest { + + private static YamlConfiguration yaml(String content) { + YamlConfiguration config = new YamlConfiguration(); + try { + config.loadFromString(content); + } catch (InvalidConfigurationException e) { + throw new IllegalArgumentException(e); + } + return config; + } + + private static List summaries(UnsupportedFeatures features) { + return List.copyOf(features.summaries()); + } + + @Test + void collapsesTheSameFeatureAcrossItems() { + UnsupportedFeatures features = new UnsupportedFeatures(); + features.record("Mechanics.soulbound", "sword"); + features.record("Mechanics.soulbound", "axe"); + features.record("Mechanics.backpack", "pouch"); + + List summaries = summaries(features); + assertEquals(2, summaries.size(), "one line per feature, not per item"); + // Ordered by feature name so the digest reads the same way every run. + assertEquals("Mechanics.backpack", summaries.get(0).feature()); + assertEquals(1, summaries.get(0).count()); + assertEquals("Mechanics.soulbound", summaries.get(1).feature()); + assertEquals(2, summaries.get(1).count()); + assertEquals("sword, axe", summaries.get(1).examples()); + } + + @Test + void keepsOnlyAFewExamplesButCountsEverything() { + UnsupportedFeatures features = new UnsupportedFeatures(); + for (int i = 1; i <= 500; i++) { + features.record("Mechanics.soulbound", "item_" + i); + } + + UnsupportedFeatures.Summary summary = summaries(features).getFirst(); + assertEquals(500, summary.count()); + assertEquals("item_1, item_2, item_3", summary.examples(), "a digest should not print five hundred ids"); + } + + @Test + void countsTheSameItemTwiceOnlyOnceInTheExamples() { + UnsupportedFeatures features = new UnsupportedFeatures(); + features.record("Mechanics.soulbound", "sword"); + features.record("Mechanics.soulbound", "sword"); + + UnsupportedFeatures.Summary summary = summaries(features).getFirst(); + assertEquals(2, summary.count()); + assertEquals("sword", summary.examples()); + } + + @Test + void reportsExactlyTheKeysTheConverterDoesNotRead() { + YamlConfiguration config = yaml(""" + ruby_sword: + material: IRON_SWORD + soulbound: true + PotionEffects: + - effect: SPEED + """); + + UnsupportedFeatures features = new UnsupportedFeatures(); + features.recordUnhandledKeys("", config.getConfigurationSection("ruby_sword"), + Set.of("material", "lore"), "swords:ruby_sword"); + + assertEquals( + List.of("PotionEffects", "soulbound"), + summaries(features).stream().map(UnsupportedFeatures.Summary::feature).toList(), + "a handled key is never reported, and a key absent from the config is not invented"); + assertEquals("swords:ruby_sword", summaries(features).getFirst().examples()); + } + + @Test + void qualifiesNestedKeysWithTheirPrefix() { + YamlConfiguration config = yaml(""" + ruby_sword: + Mechanics: + furniture: + hitbox: + barriers: [ "0,0,0" ] + storage: + rows: 3 + jukebox: + playing_song: true + """); + + UnsupportedFeatures features = new UnsupportedFeatures(); + features.recordUnhandledKeys("Mechanics.furniture", + config.getConfigurationSection("ruby_sword.Mechanics.furniture"), Set.of("hitbox"), "ruby_sword"); + + assertEquals( + List.of("Mechanics.furniture.jukebox", "Mechanics.furniture.storage"), + summaries(features).stream().map(UnsupportedFeatures.Summary::feature).toList()); + } + + @Test + void staysQuietWhenThereIsNothingToSayAndClearsBetweenRuns() { + UnsupportedFeatures features = new UnsupportedFeatures(); + assertTrue(features.isEmpty()); + + // A missing section is not a complaint: the item simply did not configure that part. + features.recordUnhandledKeys("Mechanics.furniture", null, Set.of(), "ruby_sword"); + assertTrue(features.isEmpty()); + + features.record("Mechanics.soulbound", "sword"); + assertFalse(features.isEmpty()); + + features.clear(); + assertTrue(features.isEmpty(), "a second conversion must not inherit the first one's findings"); + } +} From 9efd9d6c7cb84413f39375daed696bb64d4a459e Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Mon, 24 Aug 2026 11:31:51 +0200 Subject: [PATCH 095/116] fix(nexo): map furniture placement rotation to the right granularity restricted_rotation is Nexo's placement snap: VERY_STRICT turns in 45 degree steps, STRICT in 22.5, and the key defaults to STRICT when absent or unrecognised. The converter mapped VERY_STRICT and STRICT to FOUR and EIGHT - 90 and 45 degrees - so every piece of furniture snapped to half the directions it should, and NONE was not handled at all. CraftEngine's RotationRule uses the same steps, so the mapping is now direct: NONE to ANY, VERY_STRICT to EIGHT, STRICT to SIXTEEN. `rotatable` no longer takes part. It is a {rotatable, on_sneak} pair controlling whether a player may turn furniture that is already placed, which has nothing to do with placement snapping and no equivalent in CraftEngine's placement rules; it is reported as unconverted instead. --- .../converter/nexo/NexoItemConverter.java | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoItemConverter.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoItemConverter.java index d885a3a2..2250efea 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoItemConverter.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoItemConverter.java @@ -79,6 +79,8 @@ import org.bukkit.enchantments.Enchantment; import org.bukkit.inventory.ItemFlag; +import org.jetbrains.annotations.Nullable; + import java.util.*; import java.util.concurrent.atomic.AtomicBoolean; @@ -1982,7 +1984,7 @@ public void convertOther() { "beacon_base_block", "is_falling", "sapling", "drop"); private static final Set HANDLED_FURNITURE_KEYS = Set.of( - "modelengine_id", "better-model", "block_sounds", "rotatable", "restricted_rotation", "seats", + "modelengine_id", "better-model", "block_sounds", "restricted_rotation", "seats", "properties", "drop", "limited_placing", "hitbox"); @Override @@ -2309,6 +2311,10 @@ private void convertCustomBlockMechanic(ConfigurationSection nexoCustomBlockSect this.getCraftEngineItemsConfiguration().addItemConfiguration(blockConfiguration); } + private String upperCaseOrEmpty(@Nullable String value) { + return value == null ? "" : value.toUpperCase(Locale.ROOT); + } + private void convertFurnitureMechanic(ConfigurationSection nexoFurnitureMechanicsSection) { String nexoMEGModel = nexoFurnitureMechanicsSection.getString("modelengine_id"); String nexoBetterModel = nexoFurnitureMechanicsSection.getString("better-model"); @@ -2325,18 +2331,14 @@ private void convertFurnitureMechanic(ConfigurationSection nexoFurnitureMechanic } // --- Rotation --- - FurnitureRotation furnitureRotation = FurnitureRotation.EIGHT; - if (!nexoFurnitureMechanicsSection.getBoolean("rotatable", true)) { - furnitureRotation = FurnitureRotation.FOUR; - } - String restrictedRotation = nexoFurnitureMechanicsSection.getString("restricted_rotation"); - if (this.isValidString(restrictedRotation)) { - if (restrictedRotation.equals("VERY_STRICT")) { - furnitureRotation = FurnitureRotation.FOUR; - } else if (restrictedRotation.equals("STRICT")) { - furnitureRotation = FurnitureRotation.EIGHT; - } - } + // Nexo snaps placement yaw by restricted_rotation - VERY_STRICT in 45 degree steps, STRICT in 22.5 - and + // defaults to STRICT when the key is absent or unrecognised. `rotatable` is a different feature entirely + // (whether a player may turn furniture that is already placed), so it must not change the placement rule. + FurnitureRotation furnitureRotation = switch (this.upperCaseOrEmpty(nexoFurnitureMechanicsSection.getString("restricted_rotation"))) { + case "NONE" -> FurnitureRotation.ANY; + case "VERY_STRICT" -> FurnitureRotation.EIGHT; + default -> FurnitureRotation.SIXTEEN; + }; // --- Seats --- FloatsUtils seatPosition = new FloatsUtils(3, new float[]{0f, 0f, 0f}); From 38bbfb4e7e6cfc3a75f5f65119a8208b3372c68b Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Mon, 24 Aug 2026 11:38:27 +0200 Subject: [PATCH 096/116] fix(api): write item components where CraftEngine actually reads them Thirty configuration classes emitted their vanilla data components onto a `components` section on the item itself. CraftEngine never looks there: AbstractItemManager feeds only the item's `data` section to ItemProcessors, and raw components belong under `data.components`. The output parsed as valid YAML and was then ignored in full, so every converted food, consumable, equippable, tool, max_damage, use_cooldown, weapon, jukebox_playable and custom_data component did nothing at all. Verified against the CraftEngine version this converter targets (26.5, commit ca314a81d) as well as current 26.8: neither reads a top-level `components`, and CraftEngine's own bundled configs put it under `data`. Both destinations now go through getDataSection/getComponentsSection on ItemConfigurationSerializable rather than being spelled out at each call site, and ItemDataPlacementTest pins the placement - it fails on the previous output. --- .../item/ItemConfigurationSerializable.java | 16 ++++ .../configuration/item/LoreConfiguration.java | 2 +- .../components/AttackRangeConfiguration.java | 2 +- .../BlocksAttacksConfiguration.java | 2 +- .../components/BreakSoundConfiguration.java | 2 +- .../components/ConsumableConfiguration.java | 2 +- .../components/CustomDataConfiguration.java | 2 +- .../DamageResistantConfiguration.java | 2 +- .../components/DamageTypeConfiguration.java | 2 +- .../DeathProtectionConfiguration.java | 2 +- .../components/EnchantableConfiguration.java | 2 +- ...EnchantmentGlintOverrideConfiguration.java | 2 +- .../item/components/FoodConfiguration.java | 2 +- .../item/components/GliderConfiguration.java | 2 +- .../HideTooltipDisplayConfiguration.java | 2 +- .../components/ItemModelConfiguration.java | 2 +- .../JukeboxPlayableConfiguration.java | 2 +- .../KineticWeaponConfiguration.java | 2 +- .../item/components/MaxDamageComponent.java | 2 +- .../components/MaxStackSizeConfiguration.java | 2 +- .../MinimumAttackChargeConfiguration.java | 2 +- .../PaintingVariantConfiguration.java | 2 +- .../PiercingWeaponConfiguration.java | 2 +- .../PlayerProfileConfiguration.java | 2 +- .../SwingAnimationConfiguration.java | 2 +- .../item/components/ToolConfiguration.java | 2 +- .../TooltipDisplayConfiguration.java | 2 +- .../components/UseCooldownConfiguration.java | 2 +- .../components/UseEffectsConfiguration.java | 2 +- .../components/UseRemainderConfiguration.java | 2 +- .../item/components/WeaponConfiguration.java | 2 +- .../data/AttributeModifiersConfiguration.java | 2 +- .../item/data/BlockStateConfiguration.java | 2 +- .../data/CustomModelDataConfiguration.java | 2 +- .../item/data/CustomNameConfiguration.java | 2 +- .../item/data/DyedColorConfiguration.java | 2 +- .../item/data/EnchantmentConfiguration.java | 2 +- .../item/data/HideTooltipConfiguration.java | 2 +- .../item/data/ItemNameConfiguration.java | 2 +- .../item/data/MaxDamageConfiguration.java | 2 +- .../item/data/TooltipStyleConfiguration.java | 2 +- .../item/data/UnbreakableConfiguration.java | 2 +- .../settings/EquippableConfiguration.java | 2 +- .../utils/BlockPredicateConfiguration.java | 2 +- .../ItemDataPlacementTest.java | 79 +++++++++++++++++++ 45 files changed, 138 insertions(+), 43 deletions(-) create mode 100644 Plugin/src/test/java/fr/robie/craftengineconverter/ItemDataPlacementTest.java diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/ItemConfigurationSerializable.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/ItemConfigurationSerializable.java index d0124e28..e4d77026 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/ItemConfigurationSerializable.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/ItemConfigurationSerializable.java @@ -8,4 +8,20 @@ public interface ItemConfigurationSerializable extends SectionProvider { void serialize(@NotNull YamlConfiguration yamlConfiguration, @NotNull String path, @NotNull ConfigurationSection itemSection, @NotNull String itemId); + + /** + * CraftEngine reads everything that shapes the item stack from a {@code data} section on the item; keys placed + * anywhere else on the item are simply not looked at. + */ + default ConfigurationSection getDataSection(@NotNull ConfigurationSection itemSection) { + return this.getOrCreateSection(itemSection, "data"); + } + + /** + * Raw vanilla data components, which live under {@code data.components}. Anything CraftEngine has no dedicated + * {@code data} entry for - {@code minecraft:food}, {@code minecraft:consumable} and the rest - goes here. + */ + default ConfigurationSection getComponentsSection(@NotNull ConfigurationSection itemSection) { + return this.getOrCreateSection(this.getDataSection(itemSection), "components"); + } } diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/LoreConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/LoreConfiguration.java index d4b006b8..bc2ef9e6 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/LoreConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/LoreConfiguration.java @@ -24,7 +24,7 @@ public void serialize(@NotNull YamlConfiguration yamlConfiguration, @NotNull Str if (this.lore == null || this.lore.isEmpty()) { return; } - ConfigurationSection data = this.getOrCreateSection(itemSection, "data"); + ConfigurationSection data = this.getDataSection(itemSection); data.set("lore", this.applyNoItalic(this.lore)); } } diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/AttackRangeConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/AttackRangeConfiguration.java index 94a2d55f..c8719fb7 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/AttackRangeConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/AttackRangeConfiguration.java @@ -27,7 +27,7 @@ public AttackRangeConfiguration(double minReach, double maxReach, double minCrea @Override public void serialize(@NotNull YamlConfiguration yamlConfiguration, @NotNull String path, @NotNull ConfigurationSection itemSection, @NotNull String itemId) { - ConfigurationSection components = this.getOrCreateSection(itemSection, "components"); + ConfigurationSection components = this.getComponentsSection(itemSection); ConfigurationSection attackRangeSection = this.getOrCreateSection(components, "minecraft:attack_range"); if (this.minReach != 0.0) { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/BlocksAttacksConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/BlocksAttacksConfiguration.java index d8550dc9..70fed3c4 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/BlocksAttacksConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/BlocksAttacksConfiguration.java @@ -35,7 +35,7 @@ public record DamageReduction(double base, double factor, double horizontalBlock @Override public void serialize(@NotNull YamlConfiguration yamlConfiguration, @NotNull String path, @NotNull ConfigurationSection itemSection, @NotNull String itemId) { - ConfigurationSection components = this.getOrCreateSection(itemSection, "components"); + ConfigurationSection components = this.getComponentsSection(itemSection); ConfigurationSection blocksAttacksSection = this.getOrCreateSection(components, "minecraft:blocks_attacks"); if (this.blockDelaySeconds != 0) { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/BreakSoundConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/BreakSoundConfiguration.java index 7585dadd..71103068 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/BreakSoundConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/BreakSoundConfiguration.java @@ -16,7 +16,7 @@ public BreakSoundConfiguration(@NotNull String breakSound, float range) { @Override public void serialize(@NotNull YamlConfiguration yamlConfiguration, @NotNull String path, @NotNull ConfigurationSection itemSection, @NotNull String itemId) { - ConfigurationSection components = this.getOrCreateSection(itemSection, "components"); + ConfigurationSection components = this.getComponentsSection(itemSection); ConfigurationSection breakSoundComponent = this.getOrCreateSection(components, "minecraft:break_sound"); breakSoundComponent.set("sound_id", this.breakSound); breakSoundComponent.set("range", this.range); diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/ConsumableConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/ConsumableConfiguration.java index 7e53bd85..da379228 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/ConsumableConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/ConsumableConfiguration.java @@ -33,7 +33,7 @@ public ConsumableConfiguration(double consumeSeconds, ConsumableAnimation animat @Override public void serialize(@NotNull YamlConfiguration yamlConfiguration, @NotNull String path, @NotNull ConfigurationSection itemSection, @NotNull String itemId) { - ConfigurationSection components = this.getOrCreateSection(itemSection, "components"); + ConfigurationSection components = this.getComponentsSection(itemSection); ConfigurationSection consumableSection = this.getOrCreateSection(components, "minecraft:consumable"); if (!this.sound.equals("entity.generic.eat")) { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/CustomDataConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/CustomDataConfiguration.java index f9509ad1..9236a565 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/CustomDataConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/CustomDataConfiguration.java @@ -17,7 +17,7 @@ public CustomDataConfiguration(@NotNull List customDataEntries) @Override public void serialize(@NotNull YamlConfiguration yamlConfiguration, @NotNull String path, @NotNull ConfigurationSection itemSection, @NotNull String itemId) { - ConfigurationSection components = this.getOrCreateSection(itemSection, "components"); + ConfigurationSection components = this.getComponentsSection(itemSection); ConfigurationSection customDataComponent = this.getOrCreateSection(components, "minecraft:custom_data"); for (CustomDataEntry entry : this.customDataEntries) { customDataComponent.set(entry.key(), entry.value()); diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/DamageResistantConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/DamageResistantConfiguration.java index 9b457724..07352347 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/DamageResistantConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/DamageResistantConfiguration.java @@ -14,7 +14,7 @@ public DamageResistantConfiguration(@NotNull String damageResistantType) { @Override public void serialize(@NotNull YamlConfiguration yamlConfiguration, @NotNull String path, @NotNull ConfigurationSection itemSection, @NotNull String itemId) { - ConfigurationSection components = this.getOrCreateSection(itemSection, "components"); + ConfigurationSection components = this.getComponentsSection(itemSection); ConfigurationSection damageResistantComponent = this.getOrCreateSection(components, "minecraft:damage_resistant"); damageResistantComponent.set("types", this.damageResistantType); } diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/DamageTypeConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/DamageTypeConfiguration.java index 9287f5aa..548a9b20 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/DamageTypeConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/DamageTypeConfiguration.java @@ -17,7 +17,7 @@ public void serialize(@NotNull YamlConfiguration yamlConfiguration, @NotNull Str if (this.damageType.isEmpty()) { return; } - ConfigurationSection components = this.getOrCreateSection(itemSection, "components"); + ConfigurationSection components = this.getComponentsSection(itemSection); components.set("minecraft:damage_type", this.damageType); } } diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/DeathProtectionConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/DeathProtectionConfiguration.java index 8b7f389f..d57b4a21 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/DeathProtectionConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/DeathProtectionConfiguration.java @@ -19,7 +19,7 @@ public DeathProtectionConfiguration(List deathEffects) { @Override public void serialize(@NotNull YamlConfiguration yamlConfiguration, @NotNull String path, @NotNull ConfigurationSection itemSection, @NotNull String itemId) { - ConfigurationSection components = this.getOrCreateSection(itemSection, "components"); + ConfigurationSection components = this.getComponentsSection(itemSection); ConfigurationSection deathProtectionSection = this.getOrCreateSection(components, "minecraft:death_protection"); if (this.deathEffects == null || this.deathEffects.isEmpty()) { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/EnchantableConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/EnchantableConfiguration.java index 9ee5b7ff..58b58c3b 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/EnchantableConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/EnchantableConfiguration.java @@ -16,7 +16,7 @@ public EnchantableConfiguration(int enchantability) { @Override public void serialize(@NotNull YamlConfiguration yamlConfiguration, @NotNull String path, @NotNull ConfigurationSection itemSection, @NotNull String itemId) { - ConfigurationSection components = this.getOrCreateSection(itemSection, "components"); + ConfigurationSection components = this.getComponentsSection(itemSection); ConfigurationSection enchantableComponent = this.getOrCreateSection(components, "minecraft:enchantable"); enchantableComponent.set("value", this.enchantability); } diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/EnchantmentGlintOverrideConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/EnchantmentGlintOverrideConfiguration.java index 6e3fbf80..2aadc196 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/EnchantmentGlintOverrideConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/EnchantmentGlintOverrideConfiguration.java @@ -16,7 +16,7 @@ public EnchantmentGlintOverrideConfiguration(boolean enchantGlintOverride) { @Override public void serialize(@NotNull YamlConfiguration yamlConfiguration, @NotNull String path, @NotNull ConfigurationSection itemSection, @NotNull String itemId) { - this.getOrCreateSection(itemSection, "components").set("minecraft:enchantment_glint_override", this.enchantGlintOverride); + this.getComponentsSection(itemSection).set("minecraft:enchantment_glint_override", this.enchantGlintOverride); } @Override diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/FoodConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/FoodConfiguration.java index 2395e998..6b60bad5 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/FoodConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/FoodConfiguration.java @@ -25,7 +25,7 @@ public FoodConfiguration(int nutrition, float saturation) { @Override public void serialize(@NotNull YamlConfiguration yamlConfiguration, @NotNull String path, @NotNull ConfigurationSection itemSection, @NotNull String itemId) { - ConfigurationSection components = this.getOrCreateSection(itemSection, "components"); + ConfigurationSection components = this.getComponentsSection(itemSection); ConfigurationSection foodComponent = this.getOrCreateSection(components, "minecraft:food"); foodComponent.set("nutrition", this.nutrition); foodComponent.set("saturation", this.saturation); diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/GliderConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/GliderConfiguration.java index 3b9e17c7..70916fdd 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/GliderConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/GliderConfiguration.java @@ -17,7 +17,7 @@ public void serialize(@NotNull YamlConfiguration yamlConfiguration, @NotNull Str if (!this.hasGlider) { return; } - ConfigurationSection components = this.getOrCreateSection(itemSection, "components"); + ConfigurationSection components = this.getComponentsSection(itemSection); components.set("minecraft:glider", true); } } diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/HideTooltipDisplayConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/HideTooltipDisplayConfiguration.java index 93fee1be..5ca88cb3 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/HideTooltipDisplayConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/HideTooltipDisplayConfiguration.java @@ -14,7 +14,7 @@ public HideTooltipDisplayConfiguration(boolean hideTooltip) { @Override public void serialize(@NotNull YamlConfiguration yamlConfiguration, @NotNull String path, @NotNull ConfigurationSection itemSection, @NotNull String itemId) { - ConfigurationSection components = this.getOrCreateSection(itemSection, "components"); + ConfigurationSection components = this.getComponentsSection(itemSection); ConfigurationSection tooltipDisplay = this.getOrCreateSection(components, "minecraft:tooltip_display"); tooltipDisplay.set("hide_tooltip", this.hideTooltip); } diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/ItemModelConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/ItemModelConfiguration.java index 6ab9d010..2c737368 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/ItemModelConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/ItemModelConfiguration.java @@ -14,6 +14,6 @@ public ItemModelConfiguration(String model) { @Override public void serialize(@NotNull YamlConfiguration yamlConfiguration, @NotNull String path, @NotNull ConfigurationSection itemSection, @NotNull String itemId) { - this.getOrCreateSection(itemSection, "components").set("minecraft:item_model", this.model); + this.getComponentsSection(itemSection).set("minecraft:item_model", this.model); } } diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/JukeboxPlayableConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/JukeboxPlayableConfiguration.java index f8e1468f..f6a49b6b 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/JukeboxPlayableConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/JukeboxPlayableConfiguration.java @@ -14,7 +14,7 @@ public JukeboxPlayableConfiguration(@NotNull String song) { @Override public void serialize(@NotNull YamlConfiguration yamlConfiguration, @NotNull String path, @NotNull ConfigurationSection itemSection, @NotNull String itemId) { - ConfigurationSection components = this.getOrCreateSection(itemSection, "components"); + ConfigurationSection components = this.getComponentsSection(itemSection); ConfigurationSection jukeboxPlayableComponent = this.getOrCreateSection(components, "minecraft:jukebox_playable"); jukeboxPlayableComponent.set("song", this.song); } diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/KineticWeaponConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/KineticWeaponConfiguration.java index d3ee4048..2bdd66a6 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/KineticWeaponConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/KineticWeaponConfiguration.java @@ -101,7 +101,7 @@ public void serializeBedrock(@NotNull JsonObject target) { @Override public void serialize(@NotNull YamlConfiguration yamlConfiguration, @NotNull String path, @NotNull ConfigurationSection itemSection, @NotNull String itemId) { - ConfigurationSection components = this.getOrCreateSection(itemSection, "components"); + ConfigurationSection components = this.getComponentsSection(itemSection); ConfigurationSection kineticSection = this.getOrCreateSection(components, "minecraft:kinetic_weapon"); if (this.delayTicks > 0) { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/MaxDamageComponent.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/MaxDamageComponent.java index b961c61b..0b818dae 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/MaxDamageComponent.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/MaxDamageComponent.java @@ -22,7 +22,7 @@ public void applyTo(@NotNull JsonObject componentObject) { @Override public void serialize(@NotNull YamlConfiguration yamlConfiguration, @NotNull String path, @NotNull ConfigurationSection itemSection, @NotNull String itemId) { - ConfigurationSection components = this.getOrCreateSection(itemSection, "components"); + ConfigurationSection components = this.getComponentsSection(itemSection); components.set("minecraft:max_damage", this.maxDamage); } } diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/MaxStackSizeConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/MaxStackSizeConfiguration.java index 76cd8fa0..c4a6b0bf 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/MaxStackSizeConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/MaxStackSizeConfiguration.java @@ -16,7 +16,7 @@ public MaxStackSizeConfiguration(int maxStackSize) { @Override public void serialize(@NotNull YamlConfiguration yamlConfiguration, @NotNull String path, @NotNull ConfigurationSection itemSection, @NotNull String itemId) { - this.getOrCreateSection(itemSection, "components").set("minecraft:max_stack_size", this.maxStackSize); + this.getComponentsSection(itemSection).set("minecraft:max_stack_size", this.maxStackSize); } @Override diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/MinimumAttackChargeConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/MinimumAttackChargeConfiguration.java index dd602a52..05bbcd07 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/MinimumAttackChargeConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/MinimumAttackChargeConfiguration.java @@ -17,7 +17,7 @@ public void serialize(@NotNull YamlConfiguration yamlConfiguration, @NotNull Str if (this.minimumAttackCharge < 0 || this.minimumAttackCharge > 1) { return; } - ConfigurationSection components = this.getOrCreateSection(itemSection, "components"); + ConfigurationSection components = this.getComponentsSection(itemSection); ConfigurationSection attackChargeComponent = this.getOrCreateSection(components, "minecraft:attack_charge"); attackChargeComponent.set("minimum_attack_charge", this.minimumAttackCharge); } diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/PaintingVariantConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/PaintingVariantConfiguration.java index db983b53..0fa84f9d 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/PaintingVariantConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/PaintingVariantConfiguration.java @@ -17,7 +17,7 @@ public void serialize(@NotNull YamlConfiguration yamlConfiguration, @NotNull Str if (this.variant.isEmpty()) { return; } - ConfigurationSection components = this.getOrCreateSection(itemSection, "components"); + ConfigurationSection components = this.getComponentsSection(itemSection); components.set("minecraft:painting/variant", this.variant); } } diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/PiercingWeaponConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/PiercingWeaponConfiguration.java index 36eca184..19dcb42e 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/PiercingWeaponConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/PiercingWeaponConfiguration.java @@ -23,7 +23,7 @@ public PiercingWeaponConfiguration(boolean dealsKnockback, boolean dismounts, St @Override public void serialize(@NotNull YamlConfiguration yamlConfiguration, @NotNull String path, @NotNull ConfigurationSection itemSection, @NotNull String itemId) { - ConfigurationSection components = this.getOrCreateSection(itemSection, "components"); + ConfigurationSection components = this.getComponentsSection(itemSection); ConfigurationSection piercingSection = this.getOrCreateSection(components, "minecraft:piercing_weapon"); if (!this.dealsKnockback) { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/PlayerProfileConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/PlayerProfileConfiguration.java index a82681ec..dae3d991 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/PlayerProfileConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/PlayerProfileConfiguration.java @@ -35,7 +35,7 @@ public record Property(String name, String value, String signature) { @Override public void serialize(@NotNull YamlConfiguration yamlConfiguration, @NotNull String path, @NotNull ConfigurationSection itemSection, @NotNull String itemId) { - ConfigurationSection components = this.getOrCreateSection(itemSection, "components"); + ConfigurationSection components = this.getComponentsSection(itemSection); ConfigurationSection profileSection = this.getOrCreateSection(components, "minecraft:profile"); if (this.name != null && !this.name.isBlank()) { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/SwingAnimationConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/SwingAnimationConfiguration.java index 8ec9f4ef..3763b8e4 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/SwingAnimationConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/SwingAnimationConfiguration.java @@ -49,7 +49,7 @@ public String toKey() { @Override public void serialize(@NotNull YamlConfiguration yamlConfiguration, @NotNull String path, @NotNull ConfigurationSection itemSection, @NotNull String itemId) { - ConfigurationSection components = this.getOrCreateSection(itemSection, "components"); + ConfigurationSection components = this.getComponentsSection(itemSection); ConfigurationSection swingAnimationSection = this.getOrCreateSection(components, "minecraft:swing_animation"); if (this.type != AnimationType.WHACK) { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/ToolConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/ToolConfiguration.java index 57a91c99..b5a5af29 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/ToolConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/ToolConfiguration.java @@ -27,7 +27,7 @@ public ToolConfiguration(float defaultMiningSpeed, int damagePerBlock, boolean c @Override public void serialize(@NotNull YamlConfiguration yamlConfiguration, @NotNull String path, @NotNull ConfigurationSection itemSection, @NotNull String itemId) { - ConfigurationSection components = this.getOrCreateSection(itemSection, "components"); + ConfigurationSection components = this.getComponentsSection(itemSection); ConfigurationSection toolComponent = this.getOrCreateSection(components, "minecraft:tool"); if (this.defaultMiningSpeed != 1.0f) { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/TooltipDisplayConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/TooltipDisplayConfiguration.java index b77dfefe..cf9f1c4c 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/TooltipDisplayConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/TooltipDisplayConfiguration.java @@ -19,7 +19,7 @@ public void serialize(@NotNull YamlConfiguration yamlConfiguration, @NotNull Str if (this.hiddenComponents.isEmpty()) { return; } - ConfigurationSection components = this.getOrCreateSection(itemSection, "components"); + ConfigurationSection components = this.getComponentsSection(itemSection); ConfigurationSection tooltipDisplayComponent = this.getOrCreateSection(components, "minecraft:tooltip_display"); tooltipDisplayComponent.set("hidden_components", this.hiddenComponents); } diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/UseCooldownConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/UseCooldownConfiguration.java index 39853ea6..1af87246 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/UseCooldownConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/UseCooldownConfiguration.java @@ -18,7 +18,7 @@ public UseCooldownConfiguration(float seconds, String cooldownGroup) { @Override public void serialize(@NotNull YamlConfiguration yamlConfiguration, @NotNull String path, @NotNull ConfigurationSection itemSection, @NotNull String itemId) { - ConfigurationSection components = this.getOrCreateSection(itemSection, "components"); + ConfigurationSection components = this.getComponentsSection(itemSection); ConfigurationSection useCooldownComponent = this.getOrCreateSection(components, "minecraft:use_cooldown"); useCooldownComponent.set("seconds", this.seconds); if (this.cooldownGroup != null) { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/UseEffectsConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/UseEffectsConfiguration.java index eb1bc679..19f2bb57 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/UseEffectsConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/UseEffectsConfiguration.java @@ -31,7 +31,7 @@ public UseEffectsConfiguration(double speedMultiplier, boolean interactVibration @Override public void serialize(@NotNull YamlConfiguration yamlConfiguration, @NotNull String path, @NotNull ConfigurationSection itemSection, @NotNull String itemId) { - ConfigurationSection components = this.getOrCreateSection(itemSection, "components"); + ConfigurationSection components = this.getComponentsSection(itemSection); ConfigurationSection useEffectsSection = this.getOrCreateSection(components, "minecraft:use_effects"); if (this.canSprint) { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/UseRemainderConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/UseRemainderConfiguration.java index eae3edb3..ebc52392 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/UseRemainderConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/UseRemainderConfiguration.java @@ -20,7 +20,7 @@ public void serialize(@NotNull YamlConfiguration yamlConfiguration, @NotNull Str return; } - ConfigurationSection components = this.getOrCreateSection(itemSection, "components"); + ConfigurationSection components = this.getComponentsSection(itemSection); ConfigurationSection useRemainderSection = this.getOrCreateSection(components, "minecraft:use_remainder"); useRemainderSection.set("item", this.remainderItemId); if (this.remainderCount > 1) { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/WeaponConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/WeaponConfiguration.java index 0819b20e..448f69b5 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/WeaponConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/WeaponConfiguration.java @@ -16,7 +16,7 @@ public WeaponConfiguration(int itemDamagePerAttack, float disableBlockingForSeco @Override public void serialize(@NotNull YamlConfiguration yamlConfiguration, @NotNull String path, @NotNull ConfigurationSection itemSection, @NotNull String itemId) { - ConfigurationSection components = this.getOrCreateSection(itemSection, "components"); + ConfigurationSection components = this.getComponentsSection(itemSection); ConfigurationSection weaponComponent = this.getOrCreateSection(components, "minecraft:weapon"); if (this.itemDamagePerAttack != 1) { weaponComponent.set("item_damage_per_attack", this.itemDamagePerAttack); diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/AttributeModifiersConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/AttributeModifiersConfiguration.java index 949d76e2..39db2786 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/AttributeModifiersConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/AttributeModifiersConfiguration.java @@ -16,7 +16,7 @@ public AttributeModifiersConfiguration(List attributeModifier @Override public void serialize(@NotNull YamlConfiguration yamlConfiguration, @NotNull String path, @NotNull ConfigurationSection itemSection, @NotNull String itemId) { - ConfigurationSection data = this.getOrCreateSection(itemSection, "data"); + ConfigurationSection data = this.getDataSection(itemSection); List> serializedModifiers = new ArrayList<>(); for (AttributeModifier modifier : this.attributeModifiers) { Map serializedModifier = new HashMap<>(); diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/BlockStateConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/BlockStateConfiguration.java index b225d1fb..087ca81a 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/BlockStateConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/BlockStateConfiguration.java @@ -16,7 +16,7 @@ public BlockStateConfiguration(@NotNull BlockStateEntry blockStateEntry) { @Override public void serialize(@NotNull YamlConfiguration yamlConfiguration, @NotNull String path, @NotNull ConfigurationSection itemSection, @NotNull String itemId) { - ConfigurationSection dataSection = this.getOrCreateSection(itemSection, "data"); + ConfigurationSection dataSection = this.getDataSection(itemSection); this.blockStateEntry.serialize(dataSection); } diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/CustomModelDataConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/CustomModelDataConfiguration.java index 4cfbedb9..59c9a260 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/CustomModelDataConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/CustomModelDataConfiguration.java @@ -14,6 +14,6 @@ public CustomModelDataConfiguration(int customModelData) { @Override public void serialize(@NotNull YamlConfiguration yamlConfiguration, @NotNull String path, @NotNull ConfigurationSection itemSection, @NotNull String itemId) { - this.getOrCreateSection(itemSection, "data").set("custom-model-data", this.customModelData); + this.getDataSection(itemSection).set("custom-model-data", this.customModelData); } } diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/CustomNameConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/CustomNameConfiguration.java index 4458706f..5efea003 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/CustomNameConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/CustomNameConfiguration.java @@ -14,7 +14,7 @@ public CustomNameConfiguration(@NotNull String customName) { @Override public void serialize(@NotNull YamlConfiguration yamlConfiguration, @NotNull String path, @NotNull ConfigurationSection itemSection, @NotNull String itemId) { - ConfigurationSection dataSection = this.getOrCreateSection(itemSection, "data"); + ConfigurationSection dataSection = this.getDataSection(itemSection); dataSection.set("custom-name", this.customName); } } diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/DyedColorConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/DyedColorConfiguration.java index a54fb717..e9167bb8 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/DyedColorConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/DyedColorConfiguration.java @@ -42,6 +42,6 @@ public static DyedColorConfiguration parse(Object color) throws Exception { @Override public void serialize(@NotNull YamlConfiguration yamlConfiguration, @NotNull String path, @NotNull ConfigurationSection itemSection, @NotNull String itemId) { - this.getOrCreateSection(itemSection, "data").set("dyed-color", String.format("%d,%d,%d", (this.rgb >> 16) & 0xFF, (this.rgb >> 8) & 0xFF, this.rgb & 0xFF)); + this.getDataSection(itemSection).set("dyed-color", String.format("%d,%d,%d", (this.rgb >> 16) & 0xFF, (this.rgb >> 8) & 0xFF, this.rgb & 0xFF)); } } diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/EnchantmentConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/EnchantmentConfiguration.java index a46de033..9bb96818 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/EnchantmentConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/EnchantmentConfiguration.java @@ -33,7 +33,7 @@ public boolean isMerge() { @Override public void serialize(@NotNull YamlConfiguration yamlConfiguration, @NotNull String path, @NotNull ConfigurationSection itemSection, @NotNull String itemId) { - ConfigurationSection data = this.getOrCreateSection(itemSection, "data"); + ConfigurationSection data = this.getDataSection(itemSection); ConfigurationSection enchantment = this.getOrCreateSection(data, "enchantment"); if (this.merge) { enchantment.set("merge", true); diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/HideTooltipConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/HideTooltipConfiguration.java index 293209c7..00d6f483 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/HideTooltipConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/HideTooltipConfiguration.java @@ -21,6 +21,6 @@ public void serialize(@NotNull YamlConfiguration yamlConfiguration, @NotNull Str for (ComponentFlag flag : this.flags) { flagNames.add(flag.getKey()); } - this.getOrCreateSection(itemSection, "data").set("hide-tooltip", flagNames); + this.getDataSection(itemSection).set("hide-tooltip", flagNames); } } diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/ItemNameConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/ItemNameConfiguration.java index f3496421..f4a50e05 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/ItemNameConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/ItemNameConfiguration.java @@ -23,7 +23,7 @@ public void serialize(@NotNull YamlConfiguration yamlConfiguration, @NotNull Str if (this.itemName == null || this.itemName.isEmpty()) { return; } - ConfigurationSection data = this.getOrCreateSection(itemSection, "data"); + ConfigurationSection data = this.getDataSection(itemSection); data.set("item-name", this.applyNoItalic(this.itemName)); } } diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/MaxDamageConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/MaxDamageConfiguration.java index b0920e9f..9f978240 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/MaxDamageConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/MaxDamageConfiguration.java @@ -14,6 +14,6 @@ public MaxDamageConfiguration(int maxDamage) { @Override public void serialize(@NotNull YamlConfiguration yamlConfiguration, @NotNull String path, @NotNull ConfigurationSection itemSection, @NotNull String itemId) { - this.getOrCreateSection(itemSection, "data").set("max-damage", this.maxDamage); + this.getDataSection(itemSection).set("max-damage", this.maxDamage); } } diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/TooltipStyleConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/TooltipStyleConfiguration.java index 8eb10aa8..47be8e0a 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/TooltipStyleConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/TooltipStyleConfiguration.java @@ -20,7 +20,7 @@ public TooltipStyleConfiguration(String styleKey) { @Override public void serialize(@NotNull YamlConfiguration yamlConfiguration, @NotNull String path, @NotNull ConfigurationSection itemSection, @NotNull String itemId) { if (this.styleKey != null) { - this.getOrCreateSection(itemSection, "data").set("tooltip-style", this.styleKey.asString()); + this.getDataSection(itemSection).set("tooltip-style", this.styleKey.asString()); } } } diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/UnbreakableConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/UnbreakableConfiguration.java index 934eb30e..0c22d428 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/UnbreakableConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/UnbreakableConfiguration.java @@ -17,7 +17,7 @@ public void serialize(@NotNull YamlConfiguration yamlConfiguration, @NotNull Str if (!this.unbreakable) { return; } - ConfigurationSection dataSection = this.getOrCreateSection(itemSection, "data"); + ConfigurationSection dataSection = this.getDataSection(itemSection); dataSection.set("unbreakable", true); } } diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/settings/EquippableConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/settings/EquippableConfiguration.java index 0805c9af..cc48c5cd 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/settings/EquippableConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/settings/EquippableConfiguration.java @@ -71,7 +71,7 @@ public EquippableConfiguration(String assetId, String wings) { public void serialize(@NotNull YamlConfiguration yamlConfiguration, @NotNull String path, @NotNull ConfigurationSection itemSection, @NotNull String itemId) { ConfigurationSection ceEquippableSection = this.assetId != null && !this.assetId.isBlank() ? this.getOrCreateSection(this.getOrCreateSection(itemSection, "settings"), "equippable") - : this.getOrCreateSection(this.getOrCreateSection(itemSection, "data"), "equippable"); + : this.getOrCreateSection(this.getDataSection(itemSection), "equippable"); if (this.equipmentSlot != null) { ceEquippableSection.set("slot", this.equipmentSlot.name().toLowerCase(Locale.ROOT)); diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/utils/BlockPredicateConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/utils/BlockPredicateConfiguration.java index 0c390d21..3f5e81fb 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/utils/BlockPredicateConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/utils/BlockPredicateConfiguration.java @@ -44,7 +44,7 @@ public void serialize(@NotNull YamlConfiguration yamlConfiguration, @NotNull Str return; } - ConfigurationSection components = this.getOrCreateSection(itemSection, "components"); + ConfigurationSection components = this.getComponentsSection(itemSection); ConfigurationSection predicateSection = this.getOrCreateSection(components, this.type.getComponentKey()); List> serialized = new ArrayList<>(); diff --git a/Plugin/src/test/java/fr/robie/craftengineconverter/ItemDataPlacementTest.java b/Plugin/src/test/java/fr/robie/craftengineconverter/ItemDataPlacementTest.java new file mode 100644 index 00000000..97275c1f --- /dev/null +++ b/Plugin/src/test/java/fr/robie/craftengineconverter/ItemDataPlacementTest.java @@ -0,0 +1,79 @@ +package fr.robie.craftengineconverter; + +import fr.robie.craftengineconverter.api.configuration.CraftEngineItemsConfiguration; +import fr.robie.craftengineconverter.api.configuration.item.components.FoodConfiguration; +import fr.robie.craftengineconverter.api.configuration.item.components.ItemModelConfiguration; +import fr.robie.craftengineconverter.api.configuration.item.components.MaxStackSizeConfiguration; +import fr.robie.craftengineconverter.api.configuration.item.data.CustomNameConfiguration; +import fr.robie.craftengineconverter.api.configuration.item.data.UnbreakableConfiguration; +import fr.robie.yamllibrary.ConfigurationSection; +import fr.robie.yamllibrary.file.YamlConfiguration; +import org.bukkit.Material; +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + +/** + * Where converted item configuration has to land for CraftEngine to read it. + * + *

{@code AbstractItemManager} only feeds an item's {@code data} section to {@code ItemProcessors}, and raw vanilla + * components live under {@code data.components}. A key written straight onto the item is parsed as YAML perfectly + * happily and then ignored, which is the kind of mistake nothing downstream complains about - hence this test. + */ +class ItemDataPlacementTest { + + private static ConfigurationSection serialize(CraftEngineItemsConfiguration configuration) { + YamlConfiguration yaml = new YamlConfiguration(); + ConfigurationSection itemSection = yaml.createSection("items.default:test_item"); + configuration.serialize(yaml, "items.default:test_item", itemSection); + return itemSection; + } + + private static CraftEngineItemsConfiguration configuration() { + return new CraftEngineItemsConfiguration("default:test_item", Material.PAPER); + } + + @Test + void putsVanillaComponentsUnderDataComponents() { + CraftEngineItemsConfiguration configuration = configuration(); + configuration.addItemConfiguration(new FoodConfiguration(4, 2.5f)); + configuration.addItemConfiguration(new MaxStackSizeConfiguration(16)); + configuration.addItemConfiguration(new ItemModelConfiguration("default:test_item")); + + ConfigurationSection item = serialize(configuration); + + assertTrue(item.isConfigurationSection("data.components"), "components belong under data"); + assertFalse(item.contains("components"), "a top-level components section is never read by CraftEngine"); + assertEquals(16, item.getInt("data.components.minecraft:max_stack_size")); + assertEquals("default:test_item", item.getString("data.components.minecraft:item_model")); + assertEquals(4, item.getInt("data.components.minecraft:food.nutrition")); + } + + @Test + void keepsDedicatedDataEntriesOnDataItself() { + CraftEngineItemsConfiguration configuration = configuration(); + configuration.addItemConfiguration(new CustomNameConfiguration("Test")); + configuration.addItemConfiguration(new UnbreakableConfiguration(true)); + + ConfigurationSection item = serialize(configuration); + + // These have their own processors, so they sit directly on data rather than among the raw components. + assertEquals("Test", item.getString("data.custom-name")); + assertTrue(item.getBoolean("data.unbreakable")); + } + + @Test + void sharesOneDataSectionBetweenBothKinds() { + CraftEngineItemsConfiguration configuration = configuration(); + configuration.addItemConfiguration(new CustomNameConfiguration("Test")); + configuration.addItemConfiguration(new FoodConfiguration(4, 2.5f)); + + ConfigurationSection item = serialize(configuration); + + // One data section holding both, not two competing ones. + assertEquals("Test", item.getString("data.custom-name")); + assertEquals(4, item.getInt("data.components.minecraft:food.nutrition")); + } +} From 95dda0bf1262415b653d683f80e236684bfdf7c2 Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Mon, 24 Aug 2026 11:42:38 +0200 Subject: [PATCH 097/116] feat(nexo): convert customname, armour trims and potion effects Three item-level keys Nexo reads that the converter did not: - `customname` is the display name written onto the stack, distinct from `itemname`, which is the item_name component. Items relying on it converted with no name at all. - `trim_material` and `trim_pattern` become CraftEngine's `data.trim`, which has its own processor and needs both halves; half a trim is reported rather than emitted. - `PotionEffects` becomes a `minecraft:potion_contents` component, as CraftEngine has no dedicated processor for it. The type is read from `type` or `effect` - Nexo accepts the first and hands the rest of the map to Bukkit's PotionEffect, which spells it the second way - and only flags that were actually set are written, so a plain effect stays three keys instead of carrying vanilla's defaults explicitly. --- .../PotionContentsConfiguration.java | 69 +++++++++++ .../item/data/TrimConfiguration.java | 27 +++++ .../converter/ItemConverter.java | 12 ++ .../converter/nexo/NexoItemConverter.java | 73 +++++++++++- .../TrimAndPotionContentsTest.java | 108 ++++++++++++++++++ 5 files changed, 288 insertions(+), 1 deletion(-) create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/PotionContentsConfiguration.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/TrimConfiguration.java create mode 100644 Plugin/src/test/java/fr/robie/craftengineconverter/TrimAndPotionContentsTest.java diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/PotionContentsConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/PotionContentsConfiguration.java new file mode 100644 index 00000000..6e5ff0f7 --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/PotionContentsConfiguration.java @@ -0,0 +1,69 @@ +package fr.robie.craftengineconverter.api.configuration.item.components; + +import fr.robie.craftengineconverter.api.configuration.item.ItemConfigurationSerializable; +import fr.robie.yamllibrary.ConfigurationSection; +import fr.robie.yamllibrary.file.YamlConfiguration; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +/** + * The {@code minecraft:potion_contents} component. CraftEngine has no dedicated processor for it, so it is written as + * a raw component under {@code data.components}. + */ +public class PotionContentsConfiguration implements ItemConfigurationSerializable { + private final List customEffects = new ArrayList<>(); + + public PotionContentsConfiguration addEffect(@NotNull CustomEffect effect) { + this.customEffects.add(effect); + return this; + } + + public boolean hasEffects() { + return !this.customEffects.isEmpty(); + } + + @Override + public void serialize(@NotNull YamlConfiguration yamlConfiguration, @NotNull String path, @NotNull ConfigurationSection itemSection, @NotNull String itemId) { + if (this.customEffects.isEmpty()) { + return; + } + + List> effects = new ArrayList<>(this.customEffects.size()); + for (CustomEffect effect : this.customEffects) { + effects.add(effect.serialize()); + } + + ConfigurationSection components = this.getComponentsSection(itemSection); + this.getOrCreateSection(components, "minecraft:potion_contents").set("custom_effects", effects); + } + + /** + * One entry of {@code custom_effects}. Only values that differ from the vanilla defaults are written, so a plain + * effect stays a three-key map rather than carrying every flag. + */ + public record CustomEffect(@NotNull String id, int duration, int amplifier, + @Nullable Boolean ambient, @Nullable Boolean showParticles, @Nullable Boolean showIcon) { + + private Map serialize() { + Map effect = new LinkedHashMap<>(); + effect.put("id", this.id); + effect.put("duration", this.duration); + effect.put("amplifier", this.amplifier); + if (this.ambient != null) { + effect.put("ambient", this.ambient); + } + if (this.showParticles != null) { + effect.put("show_particles", this.showParticles); + } + if (this.showIcon != null) { + effect.put("show_icon", this.showIcon); + } + return effect; + } + } +} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/TrimConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/TrimConfiguration.java new file mode 100644 index 00000000..535d25f2 --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/TrimConfiguration.java @@ -0,0 +1,27 @@ +package fr.robie.craftengineconverter.api.configuration.item.data; + +import fr.robie.craftengineconverter.api.configuration.item.ItemConfigurationSerializable; +import fr.robie.yamllibrary.ConfigurationSection; +import fr.robie.yamllibrary.file.YamlConfiguration; +import org.jetbrains.annotations.NotNull; + +/** + * The armour trim baked onto an item stack. CraftEngine has a dedicated {@code trim} processor for this, so it goes + * straight on {@code data} rather than among the raw components; the processor requires both halves. + */ +public class TrimConfiguration implements ItemConfigurationSerializable { + private final String material; + private final String pattern; + + public TrimConfiguration(@NotNull String material, @NotNull String pattern) { + this.material = material; + this.pattern = pattern; + } + + @Override + public void serialize(@NotNull YamlConfiguration yamlConfiguration, @NotNull String path, @NotNull ConfigurationSection itemSection, @NotNull String itemId) { + ConfigurationSection trimSection = this.getOrCreateSection(this.getDataSection(itemSection), "trim"); + trimSection.set("material", this.material); + trimSection.set("pattern", this.pattern); + } +} diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/ItemConverter.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/ItemConverter.java index cd99e903..cbb978cc 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/ItemConverter.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/ItemConverter.java @@ -48,6 +48,7 @@ public ItemConverter(@NotNull String itemId, Converter converter, YamlConfigurat public void convertItem() { this.convertMaterial(); this.convertItemName(); + this.convertCustomName(); this.convertLore(); this.convertDyedColor(); this.convertUnbreakable(); @@ -94,6 +95,8 @@ public void convertItem() { this.convertDamageTypeComponent(); this.convertMinimumAttackChargeComponent(); this.convertProfileComponent(); + this.convertTrim(); + this.convertPotionEffects(); this.convertItemTexture(); this.convertOther(); this.reportUnsupportedConfiguration(); @@ -105,6 +108,9 @@ public void convertMaterial() { public void convertItemName() { } + public void convertCustomName() { + } + public void convertLore() { } @@ -240,6 +246,12 @@ public void convertMinimumAttackChargeComponent() { public void convertProfileComponent() { } + public void convertTrim() { + } + + public void convertPotionEffects() { + } + public void convertItemTexture() { } diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoItemConverter.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoItemConverter.java index 2250efea..a421d788 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoItemConverter.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoItemConverter.java @@ -135,6 +135,76 @@ public void convertItemName() { } } + @Override + public void convertCustomName() { + // Nexo sets both: `itemname` is the item_name component, `customname` the display name written onto the stack. + String customName = this.nexoItemSection.getString("customname"); + if (this.isValidString(customName)) { + this.craftEngineItemsConfiguration.addItemConfiguration(new CustomNameConfiguration(customName)); + } + } + + @Override + public void convertTrim() { + String material = this.nexoItemSection.getString("trim_material"); + String pattern = this.nexoItemSection.getString("trim_pattern"); + // CraftEngine's trim processor needs both halves; half a trim is not a trim. + if (!this.isValidString(material) || !this.isValidString(pattern)) { + if (this.isValidString(material) || this.isValidString(pattern)) { + this.reportUnsupported(this.isValidString(material) ? "trim_pattern (missing)" : "trim_material (missing)"); + } + return; + } + this.craftEngineItemsConfiguration.addItemConfiguration( + new TrimConfiguration(this.namespaced(material), this.namespaced(pattern))); + } + + @Override + public void convertPotionEffects() { + List> effects = this.nexoItemSection.getMapList("PotionEffects"); + if (effects.isEmpty()) { + return; + } + + PotionContentsConfiguration potionContents = new PotionContentsConfiguration(); + for (Map effect : effects) { + // Nexo reads the type from `type` and hands the rest of the map to Bukkit's PotionEffect, which spells + // its own key `effect`; accept either. + String type = this.stringOrNull(effect.get("type")); + if (!this.isValidString(type)) { + type = this.stringOrNull(effect.get("effect")); + } + if (!this.isValidString(type)) { + continue; + } + + potionContents.addEffect(new PotionContentsConfiguration.CustomEffect( + this.namespaced(type.toLowerCase(Locale.ROOT)), + this.intOrDefault(effect.get("duration"), 0), + this.intOrDefault(effect.get("amplifier"), 0), + this.booleanOrNull(effect.get("ambient")), + this.booleanOrNull(effect.get("has-particles")), + this.booleanOrNull(effect.get("has-icon")) + )); + } + + if (potionContents.hasEffects()) { + this.craftEngineItemsConfiguration.addItemConfiguration(potionContents); + } + } + + private @Nullable String stringOrNull(@Nullable Object value) { + return value instanceof String string ? string : null; + } + + private int intOrDefault(@Nullable Object value, int fallback) { + return value instanceof Number number ? number.intValue() : fallback; + } + + private @Nullable Boolean booleanOrNull(@Nullable Object value) { + return value instanceof Boolean bool ? bool : null; + } + @Override public void convertLore() { List lore = this.nexoItemSection.getStringList("lore"); @@ -1974,8 +2044,9 @@ public void convertOther() { /** Every key this converter reads off the item itself; anything else is reported as left out. */ private static final Set HANDLED_ITEM_KEYS = Set.of( - "material", "itemname", "lore", "color", "unbreakable", "excludeFromInventory", "ItemFlags", + "material", "itemname", "customname", "lore", "color", "unbreakable", "excludeFromInventory", "ItemFlags", "AttributeModifiers", "Enchantments", "Components", "Pack", "Mechanics", + "trim_material", "trim_pattern", "PotionEffects", // Consumed before conversion, by NexoItemTemplates. "template", "templates", "injectId"); diff --git a/Plugin/src/test/java/fr/robie/craftengineconverter/TrimAndPotionContentsTest.java b/Plugin/src/test/java/fr/robie/craftengineconverter/TrimAndPotionContentsTest.java new file mode 100644 index 00000000..bca8ffd0 --- /dev/null +++ b/Plugin/src/test/java/fr/robie/craftengineconverter/TrimAndPotionContentsTest.java @@ -0,0 +1,108 @@ +package fr.robie.craftengineconverter; + +import fr.robie.craftengineconverter.api.configuration.CraftEngineItemsConfiguration; +import fr.robie.craftengineconverter.api.configuration.item.components.PotionContentsConfiguration; +import fr.robie.craftengineconverter.api.configuration.item.data.TrimConfiguration; +import fr.robie.yamllibrary.ConfigurationSection; +import fr.robie.yamllibrary.file.YamlConfiguration; +import org.bukkit.Material; +import org.junit.jupiter.api.Test; + +import java.util.List; +import java.util.Map; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + +/** + * The two shapes Nexo's {@code trim_material}/{@code trim_pattern} and {@code PotionEffects} convert into. + * + *

They land in different places on purpose: CraftEngine registers a {@code trim} processor, so a trim sits directly + * on {@code data}, while nothing handles potion contents and it has to go through {@code data.components} as a raw + * vanilla component. + */ +class TrimAndPotionContentsTest { + + private static ConfigurationSection serialize(CraftEngineItemsConfiguration configuration) { + YamlConfiguration yaml = new YamlConfiguration(); + ConfigurationSection itemSection = yaml.createSection("items.default:test_item"); + configuration.serialize(yaml, "items.default:test_item", itemSection); + return itemSection; + } + + private static CraftEngineItemsConfiguration configuration() { + return new CraftEngineItemsConfiguration("default:test_item", Material.PAPER); + } + + @SuppressWarnings("unchecked") + private static List> effects(ConfigurationSection item) { + return (List>) item.getList("data.components.minecraft:potion_contents.custom_effects"); + } + + @Test + void writesATrimOnDataWhereTheProcessorLooksForIt() { + CraftEngineItemsConfiguration configuration = configuration(); + configuration.addItemConfiguration(new TrimConfiguration("minecraft:gold", "minecraft:coast")); + + ConfigurationSection item = serialize(configuration); + + assertEquals("minecraft:gold", item.getString("data.trim.material")); + assertEquals("minecraft:coast", item.getString("data.trim.pattern")); + assertFalse(item.contains("data.components.minecraft:trim"), "the dedicated processor takes precedence"); + } + + @Test + void writesPotionEffectsAsARawComponent() { + CraftEngineItemsConfiguration configuration = configuration(); + configuration.addItemConfiguration(new PotionContentsConfiguration() + .addEffect(new PotionContentsConfiguration.CustomEffect("minecraft:speed", 200, 1, null, null, null))); + + ConfigurationSection item = serialize(configuration); + + List> effects = effects(item); + assertEquals(1, effects.size()); + assertEquals("minecraft:speed", effects.getFirst().get("id")); + assertEquals(200, effects.getFirst().get("duration")); + assertEquals(1, effects.getFirst().get("amplifier")); + // Nothing was configured beyond the essentials, so no flags are written and vanilla's defaults stand. + assertEquals(3, effects.getFirst().size()); + } + + @Test + void keepsOnlyTheFlagsThatWereActuallySet() { + CraftEngineItemsConfiguration configuration = configuration(); + configuration.addItemConfiguration(new PotionContentsConfiguration() + .addEffect(new PotionContentsConfiguration.CustomEffect("minecraft:speed", 200, 0, true, false, null))); + + ConfigurationSection item = serialize(configuration); + + Map effect = effects(item).getFirst(); + assertEquals(Boolean.TRUE, effect.get("ambient")); + assertEquals(Boolean.FALSE, effect.get("show_particles")); + assertFalse(effect.containsKey("show_icon"), "an unset flag must not be invented"); + } + + @Test + void carriesEveryEffectInOrder() { + CraftEngineItemsConfiguration configuration = configuration(); + configuration.addItemConfiguration(new PotionContentsConfiguration() + .addEffect(new PotionContentsConfiguration.CustomEffect("minecraft:speed", 200, 0, null, null, null)) + .addEffect(new PotionContentsConfiguration.CustomEffect("minecraft:strength", 400, 2, null, null, null))); + + List> effects = effects(serialize(configuration)); + assertEquals(List.of("minecraft:speed", "minecraft:strength"), effects.stream().map(e -> e.get("id")).toList()); + } + + @Test + void writesNothingWhenThereAreNoEffects() { + CraftEngineItemsConfiguration configuration = configuration(); + PotionContentsConfiguration potionContents = new PotionContentsConfiguration(); + assertFalse(potionContents.hasEffects()); + configuration.addItemConfiguration(potionContents); + + ConfigurationSection item = serialize(configuration); + assertFalse(item.contains("data.components.minecraft:potion_contents")); + assertTrue(item.contains("material"), "the item itself is still written"); + } +} From af07200b4bedd3b14138eba6be1205719fd4b793 Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Mon, 24 Aug 2026 11:47:58 +0200 Subject: [PATCH 098/116] feat(itemsadder): convert potion, book and horse-armour properties Three of the specific_properties the converter ignored: - `potion` becomes a minecraft:potion_contents component. The base `type` goes through Bukkit's PotionType so it lands on the vanilla registry name - SPEED is minecraft:swiftness, not minecraft:speed - and the effects are read as a section keyed by arbitrary labels, which is how ItemsAdder writes them, with its own flag defaults (ambient false, particles and icon true). - `book` becomes CraftEngine's written_book_content processor, titled from the item's display name the way ItemsAdder titles it, with the Generation name mapped to vanilla's number. - `leather_horse_armor.color` now feeds the dyed colour, which previously only looked at graphics.color. The remaining specific_properties - bow, crossbow and seed - are gameplay behaviours with no component or processor behind them; they stay in the unconverted report. --- .../PotionContentsConfiguration.java | 34 +++++- .../item/data/DyedColorConfiguration.java | 12 ++- .../data/WrittenBookContentConfiguration.java | 52 +++++++++ .../converter/ItemConverter.java | 4 + .../itemsadder/IAItemsConverter.java | 100 +++++++++++++++++- .../converter/nexo/NexoItemConverter.java | 2 +- .../TrimAndPotionContentsTest.java | 48 ++++++++- 7 files changed, 239 insertions(+), 13 deletions(-) create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/WrittenBookContentConfiguration.java diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/PotionContentsConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/PotionContentsConfiguration.java index 6e5ff0f7..1ac4b5d3 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/PotionContentsConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/components/PotionContentsConfiguration.java @@ -17,18 +17,44 @@ */ public class PotionContentsConfiguration implements ItemConfigurationSerializable { private final List customEffects = new ArrayList<>(); + private @Nullable String potion; + private @Nullable Integer customColor; public PotionContentsConfiguration addEffect(@NotNull CustomEffect effect) { this.customEffects.add(effect); return this; } - public boolean hasEffects() { - return !this.customEffects.isEmpty(); + /** The base potion this stack is brewed from, e.g. {@code minecraft:swiftness}. */ + public PotionContentsConfiguration setPotion(@Nullable String potion) { + this.potion = potion; + return this; + } + + public PotionContentsConfiguration setCustomColor(@Nullable Integer customColor) { + this.customColor = customColor; + return this; + } + + public boolean hasContents() { + return !this.customEffects.isEmpty() || this.potion != null || this.customColor != null; } @Override public void serialize(@NotNull YamlConfiguration yamlConfiguration, @NotNull String path, @NotNull ConfigurationSection itemSection, @NotNull String itemId) { + if (!this.hasContents()) { + return; + } + + ConfigurationSection components = this.getComponentsSection(itemSection); + ConfigurationSection potionContents = this.getOrCreateSection(components, "minecraft:potion_contents"); + + if (this.potion != null) { + potionContents.set("potion", this.potion); + } + if (this.customColor != null) { + potionContents.set("custom_color", this.customColor); + } if (this.customEffects.isEmpty()) { return; } @@ -37,9 +63,7 @@ public void serialize(@NotNull YamlConfiguration yamlConfiguration, @NotNull Str for (CustomEffect effect : this.customEffects) { effects.add(effect.serialize()); } - - ConfigurationSection components = this.getComponentsSection(itemSection); - this.getOrCreateSection(components, "minecraft:potion_contents").set("custom_effects", effects); + potionContents.set("custom_effects", effects); } /** diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/DyedColorConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/DyedColorConfiguration.java index e9167bb8..28b2c433 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/DyedColorConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/DyedColorConfiguration.java @@ -16,17 +16,22 @@ public DyedColorConfiguration(int rgb) { } public static DyedColorConfiguration parse(Object color) throws Exception { + return new DyedColorConfiguration(parseRgb(color)); + } + + /** Accepts a dye name, {@code #rrggbb} or {@code r,g,b}, which is every spelling the source plugins allow. */ + public static int parseRgb(Object color) throws Exception { String colorStr = color.toString().trim(); try { DyeColor dyeColor = DyeColor.valueOf(colorStr.toUpperCase(Locale.ROOT)); - return new DyedColorConfiguration(dyeColor.getColor().asRGB()); + return dyeColor.getColor().asRGB(); } catch (IllegalArgumentException ignored) { } String hex = colorStr.startsWith("#") ? colorStr.substring(1) : colorStr; if (hex.matches("[0-9a-fA-F]{6}")) { - return new DyedColorConfiguration(Integer.parseInt(hex, 16)); + return Integer.parseInt(hex, 16); } String[] parts = colorStr.split(","); @@ -36,8 +41,7 @@ public static DyedColorConfiguration parse(Object color) throws Exception { int r = Integer.parseInt(parts[0].trim()); int g = Integer.parseInt(parts[1].trim()); int b = Integer.parseInt(parts[2].trim()); - int rgb = ((r & 0xFF) << 16) | ((g & 0xFF) << 8) | (b & 0xFF); - return new DyedColorConfiguration(rgb); + return ((r & 0xFF) << 16) | ((g & 0xFF) << 8) | (b & 0xFF); } @Override diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/WrittenBookContentConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/WrittenBookContentConfiguration.java new file mode 100644 index 00000000..f9253e26 --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/WrittenBookContentConfiguration.java @@ -0,0 +1,52 @@ +package fr.robie.craftengineconverter.api.configuration.item.data; + +import fr.robie.craftengineconverter.api.configuration.item.ItemConfigurationSerializable; +import fr.robie.yamllibrary.ConfigurationSection; +import fr.robie.yamllibrary.file.YamlConfiguration; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.List; + +/** + * A written book's contents. CraftEngine has a {@code written_book_content} processor, so this goes on {@code data} + * rather than among the raw components. + */ +public class WrittenBookContentConfiguration implements ItemConfigurationSerializable { + /** Matches vanilla's ordering, which is what the component stores. */ + public static final int GENERATION_ORIGINAL = 0; + public static final int GENERATION_COPY_OF_ORIGINAL = 1; + public static final int GENERATION_COPY_OF_COPY = 2; + public static final int GENERATION_TATTERED = 3; + + private final @Nullable String title; + private final @Nullable String author; + private final int generation; + private final List pages; + + public WrittenBookContentConfiguration(@Nullable String title, @Nullable String author, int generation, @NotNull List pages) { + this.title = title; + this.author = author; + this.generation = generation; + this.pages = List.copyOf(pages); + } + + @Override + public void serialize(@NotNull YamlConfiguration yamlConfiguration, @NotNull String path, @NotNull ConfigurationSection itemSection, @NotNull String itemId) { + ConfigurationSection bookSection = this.getOrCreateSection(this.getDataSection(itemSection), "written_book_content"); + + if (this.title != null && !this.title.isBlank()) { + bookSection.set("title", this.title); + } + if (this.author != null && !this.author.isBlank()) { + bookSection.set("author", this.author); + } + // Vanilla's default is 0, and the processor already assumes it. + if (this.generation != GENERATION_ORIGINAL) { + bookSection.set("generation", this.generation); + } + if (!this.pages.isEmpty()) { + bookSection.set("pages", this.pages); + } + } +} diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/ItemConverter.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/ItemConverter.java index cbb978cc..16d94951 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/ItemConverter.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/ItemConverter.java @@ -97,6 +97,7 @@ public void convertItem() { this.convertProfileComponent(); this.convertTrim(); this.convertPotionEffects(); + this.convertWrittenBookContent(); this.convertItemTexture(); this.convertOther(); this.reportUnsupportedConfiguration(); @@ -252,6 +253,9 @@ public void convertTrim() { public void convertPotionEffects() { } + public void convertWrittenBookContent() { + } + public void convertItemTexture() { } diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/itemsadder/IAItemsConverter.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/itemsadder/IAItemsConverter.java index 98e738de..7a3f84e3 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/itemsadder/IAItemsConverter.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/itemsadder/IAItemsConverter.java @@ -61,6 +61,7 @@ import org.bukkit.NamespacedKey; import org.bukkit.Registry; import org.bukkit.attribute.Attribute; +import org.bukkit.potion.PotionType; import org.bukkit.block.BlockFace; import fr.robie.yamllibrary.file.YamlConfiguration; import org.bukkit.inventory.ItemFlag; @@ -118,13 +119,107 @@ public void convertLore() { @Override public void convertDyedColor() { + // Leather horse armour carries its tint under its own property rather than under graphics. Object color = this.iaItemSection.get("graphics.color"); + if (this.isNull(color)) { + color = this.iaItemSection.get("specific_properties.leather_horse_armor.color"); + } if (this.isNotNull(color)) { try { this.craftEngineItemsConfiguration.addItemConfiguration(DyedColorConfiguration.parse(color)); - } catch (Exception ignored) { + } catch (Exception e) { + Logger.debug("[IAItemsConverter] Invalid colour '" + color + "' for item " + this.itemId); + } + } + } + + @Override + public void convertPotionEffects() { + ConfigurationSection potionSection = this.iaItemSection.getConfigurationSection("specific_properties.potion"); + if (this.isNull(potionSection)) { + return; + } + + PotionContentsConfiguration potionContents = new PotionContentsConfiguration(); + + String type = potionSection.getString("type"); + if (this.isValidString(type)) { + potionContents.setPotion(this.potionTypeKey(type)); + } + + String color = potionSection.getString("color"); + if (this.isValidString(color)) { + try { + potionContents.setCustomColor(DyedColorConfiguration.parseRgb(color)); + } catch (Exception e) { + Logger.debug("[IAItemsConverter] Invalid potion colour '" + color + "' for item " + this.itemId); + } + } + + // ItemsAdder keys the effects by an arbitrary label rather than listing them. + ConfigurationSection effectsSection = potionSection.getConfigurationSection("effects"); + if (this.isNotNull(effectsSection)) { + for (String label : effectsSection.getKeys(false)) { + ConfigurationSection effectSection = effectsSection.getConfigurationSection(label); + if (this.isNull(effectSection)) { + continue; + } + String effectType = effectSection.getString("type"); + if (!this.isValidString(effectType)) { + continue; + } + + potionContents.addEffect(new PotionContentsConfiguration.CustomEffect( + this.namespaced(effectType.toLowerCase(Locale.ROOT)), + effectSection.getInt("duration", 0), + effectSection.getInt("amplifier", 0), + effectSection.getBoolean("ambient", false), + effectSection.getBoolean("particles", true), + effectSection.getBoolean("icon", true) + )); } } + + if (potionContents.hasContents()) { + this.craftEngineItemsConfiguration.addItemConfiguration(potionContents); + } + } + + /** + * Bukkit's PotionType names do not all match the vanilla registry - SPEED is {@code minecraft:swiftness} - so the + * enum's own key is authoritative, with the raw name as a fallback if it is not a PotionType at all. + */ + private String potionTypeKey(String type) { + try { + return PotionType.valueOf(type.toUpperCase(Locale.ROOT)).getKey().toString(); + } catch (Exception e) { + return this.namespaced(type.toLowerCase(Locale.ROOT), "minecraft"); + } + } + + @Override + public void convertWrittenBookContent() { + ConfigurationSection bookSection = this.iaItemSection.getConfigurationSection("specific_properties.book"); + if (this.isNull(bookSection)) { + return; + } + + // ItemsAdder titles the book with the item's display name. + String title = this.iaItemSection.getString("name", this.iaItemSection.getString("display_name")); + String author = bookSection.getString("author"); + int generation = this.bookGeneration(bookSection.getString("generation", "TATTERED")); + + this.craftEngineItemsConfiguration.addItemConfiguration( + new WrittenBookContentConfiguration(title, author, generation, bookSection.getStringList("pages"))); + } + + private int bookGeneration(String generation) { + return switch (generation.toUpperCase(Locale.ROOT)) { + case "ORIGINAL" -> WrittenBookContentConfiguration.GENERATION_ORIGINAL; + case "COPY_OF_ORIGINAL" -> WrittenBookContentConfiguration.GENERATION_COPY_OF_ORIGINAL; + case "COPY_OF_COPY" -> WrittenBookContentConfiguration.GENERATION_COPY_OF_COPY; + default -> WrittenBookContentConfiguration.GENERATION_TATTERED; + }; } @Override @@ -1195,7 +1290,8 @@ public void convertOther() { "attribute_modifiers", "enchants", "item_model", "max_stack_size", "glint", "drop", "tooltip_style", "consumable", "jukebox_disc", "equipment", "specific_properties", "behaviours"); - private static final Set HANDLED_SPECIFIC_PROPERTIES = Set.of("armor", "block"); + private static final Set HANDLED_SPECIFIC_PROPERTIES = Set.of( + "armor", "block", "potion", "book", "leather_horse_armor"); @Override public void reportUnsupportedConfiguration() { diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoItemConverter.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoItemConverter.java index a421d788..12c8c85b 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoItemConverter.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoItemConverter.java @@ -188,7 +188,7 @@ public void convertPotionEffects() { )); } - if (potionContents.hasEffects()) { + if (potionContents.hasContents()) { this.craftEngineItemsConfiguration.addItemConfiguration(potionContents); } } diff --git a/Plugin/src/test/java/fr/robie/craftengineconverter/TrimAndPotionContentsTest.java b/Plugin/src/test/java/fr/robie/craftengineconverter/TrimAndPotionContentsTest.java index bca8ffd0..e1f422e2 100644 --- a/Plugin/src/test/java/fr/robie/craftengineconverter/TrimAndPotionContentsTest.java +++ b/Plugin/src/test/java/fr/robie/craftengineconverter/TrimAndPotionContentsTest.java @@ -3,6 +3,7 @@ import fr.robie.craftengineconverter.api.configuration.CraftEngineItemsConfiguration; import fr.robie.craftengineconverter.api.configuration.item.components.PotionContentsConfiguration; import fr.robie.craftengineconverter.api.configuration.item.data.TrimConfiguration; +import fr.robie.craftengineconverter.api.configuration.item.data.WrittenBookContentConfiguration; import fr.robie.yamllibrary.ConfigurationSection; import fr.robie.yamllibrary.file.YamlConfiguration; import org.bukkit.Material; @@ -94,11 +95,56 @@ void carriesEveryEffectInOrder() { assertEquals(List.of("minecraft:speed", "minecraft:strength"), effects.stream().map(e -> e.get("id")).toList()); } + @Test + void carriesTheBasePotionAndItsTint() { + CraftEngineItemsConfiguration configuration = configuration(); + configuration.addItemConfiguration(new PotionContentsConfiguration() + .setPotion("minecraft:swiftness") + .setCustomColor(0xFF0000)); + + ConfigurationSection item = serialize(configuration); + + assertEquals("minecraft:swiftness", item.getString("data.components.minecraft:potion_contents.potion")); + assertEquals(0xFF0000, item.getInt("data.components.minecraft:potion_contents.custom_color")); + // A base potion on its own is a complete component; there is nothing to list under custom_effects. + assertFalse(item.contains("data.components.minecraft:potion_contents.custom_effects")); + } + + @Test + void writesBookContentOnDataWithVanillaGenerationNumbers() { + CraftEngineItemsConfiguration configuration = configuration(); + configuration.addItemConfiguration(new WrittenBookContentConfiguration( + "Field Notes", "A. Cartographer", + WrittenBookContentConfiguration.GENERATION_COPY_OF_ORIGINAL, + List.of("page one", "page two"))); + + ConfigurationSection item = serialize(configuration); + + assertEquals("Field Notes", item.getString("data.written_book_content.title")); + assertEquals("A. Cartographer", item.getString("data.written_book_content.author")); + assertEquals(1, item.getInt("data.written_book_content.generation")); + assertEquals(List.of("page one", "page two"), item.getStringList("data.written_book_content.pages")); + } + + @Test + void leavesOutBookFieldsThatWereNotConfigured() { + CraftEngineItemsConfiguration configuration = configuration(); + configuration.addItemConfiguration(new WrittenBookContentConfiguration( + null, " ", WrittenBookContentConfiguration.GENERATION_ORIGINAL, List.of())); + + ConfigurationSection item = serialize(configuration); + + assertFalse(item.contains("data.written_book_content.title")); + assertFalse(item.contains("data.written_book_content.author"), "a blank author is not an author"); + assertFalse(item.contains("data.written_book_content.generation"), "0 is the processor's own default"); + assertFalse(item.contains("data.written_book_content.pages")); + } + @Test void writesNothingWhenThereAreNoEffects() { CraftEngineItemsConfiguration configuration = configuration(); PotionContentsConfiguration potionContents = new PotionContentsConfiguration(); - assertFalse(potionContents.hasEffects()); + assertFalse(potionContents.hasContents()); configuration.addItemConfiguration(potionContents); ConfigurationSection item = serialize(configuration); From 2e3234040ea819c2ecf1a98ca67d08d7b73d30c2 Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Mon, 24 Aug 2026 11:51:09 +0200 Subject: [PATCH 099/116] feat(nexo): convert every furniture seat, not just the first The converter read seats[0], parsed it, and attached it to whichever shulker or happy-ghast hitbox happened to be built first. A bench with three seats therefore converted with one, and furniture whose hitboxes are all interactions converted with none at all. Every entry is parsed now, and they are attached once the hitboxes exist rather than while they are being built - so the hitbox type no longer decides whether seats survive. They all hang off a single hitbox because CraftEngine keys seats by their offset and shares them across a furniture's hitboxes, and Nexo's offsets are relative to the furniture origin rather than to any one hitbox. Seats configured on furniture with no hitbox at all are reported instead of silently dropped. --- .../converter/nexo/NexoItemConverter.java | 36 ++++++++++--------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoItemConverter.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoItemConverter.java index 12c8c85b..a96dd5e1 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoItemConverter.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoItemConverter.java @@ -19,6 +19,7 @@ import fr.robie.craftengineconverter.api.configuration.item.behavior.block.states.defaults.PillarBlockState; import fr.robie.craftengineconverter.api.configuration.item.behavior.furniture.*; import fr.robie.craftengineconverter.api.configuration.item.behavior.furniture.element.ItemDisplayElement; +import fr.robie.craftengineconverter.api.configuration.item.behavior.furniture.hitbox.BaseHitbox; import fr.robie.craftengineconverter.api.configuration.item.behavior.furniture.hitbox.HappyGhastHitbox; import fr.robie.craftengineconverter.api.configuration.item.behavior.furniture.hitbox.Hitbox; import fr.robie.craftengineconverter.api.configuration.item.behavior.furniture.hitbox.InteractionHitbox; @@ -82,7 +83,6 @@ import org.jetbrains.annotations.Nullable; import java.util.*; -import java.util.concurrent.atomic.AtomicBoolean; public class NexoItemConverter extends ItemConverter { private final ConfigurationSection nexoItemSection; @@ -2412,15 +2412,15 @@ private void convertFurnitureMechanic(ConfigurationSection nexoFurnitureMechanic }; // --- Seats --- - FloatsUtils seatPosition = new FloatsUtils(3, new float[]{0f, 0f, 0f}); - List seats = nexoFurnitureMechanicsSection.getStringList("seats"); - if (!seats.isEmpty()) { - String seat = seats.getFirst(); + // Nexo writes each seat as an "x,y,z" offset from the furniture origin, and allows any number of them. + List seatPositions = new ArrayList<>(); + for (String seat : nexoFurnitureMechanicsSection.getStringList("seats")) { String[] split = seat.split(",", 3); try { - seatPosition.setValue(0, Float.parseFloat(split[0].trim())); - seatPosition.setValue(1, Float.parseFloat(split[1].trim())); - seatPosition.setValue(2, Float.parseFloat(split[2].trim())); + seatPositions.add(new float[]{ + Float.parseFloat(split[0].trim()), + Float.parseFloat(split[1].trim()), + Float.parseFloat(split[2].trim())}); } catch (Exception e) { Logger.debug(Message.WARNING__FURNITURE__INVALID_SEAT_FORMAT, Placeholder.of("item", this.itemId, "value", seat)); } @@ -2605,8 +2605,6 @@ private void convertFurnitureMechanic(ConfigurationSection nexoFurnitureMechanic List hitboxList = new ArrayList<>(); ConfigurationSection nexoHitboxesSection = nexoFurnitureMechanicsSection.getConfigurationSection("hitbox"); if (this.isNotNull(nexoHitboxesSection)) { - AtomicBoolean seatsAdded = new AtomicBoolean(false); - // Barriers for (Position pos : this.expandBarrierPositions(nexoHitboxesSection.getStringList("barriers"))) { ShulkerHitbox hitbox = new ShulkerHitbox(); @@ -2637,9 +2635,6 @@ private void convertFurnitureMechanic(ConfigurationSection nexoFurnitureMechanic String dir = parts[3].toUpperCase(Locale.ROOT); hitbox.setDirection(this.getDirectionFromString(dir)); } - if (seatPosition.isUpdated() && !seatsAdded.getAndSet(true)) { - hitbox.addSeat(seatPosition.getValue(0), seatPosition.getValue(1), seatPosition.getValue(2), 0); - } hitboxList.add(hitbox); } catch (NumberFormatException e) { Logger.debug(Message.WARNING__FURNITURE__NON_NUMERIC_SHULKER_VALUES, Placeholder.of("item", this.itemId, "entry", shulker)); @@ -2664,9 +2659,6 @@ private void convertFurnitureMechanic(ConfigurationSection nexoFurnitureMechanic HappyGhastHitbox hitbox = new HappyGhastHitbox(); hitbox.setPosition(Float.parseFloat(coords[0]), Float.parseFloat(coords[1]), Float.parseFloat(coords[2])); hitbox.setScale(Float.parseFloat(parts[1])); - if (seatPosition.isUpdated() && !seatsAdded.getAndSet(true)) { - hitbox.addSeat(seatPosition.getValue(0), seatPosition.getValue(1), seatPosition.getValue(2), 0); - } hitboxList.add(hitbox); } catch (NumberFormatException e) { Logger.debug(Message.WARNING__FURNITURE__NON_NUMERIC_GHAST_VALUES, Placeholder.of("item", this.itemId, "entry", ghast)); @@ -2700,6 +2692,18 @@ private void convertFurnitureMechanic(ConfigurationSection nexoFurnitureMechanic } } + // CraftEngine keys seats by their offset and shares them across a furniture's hitboxes, so they all + // hang off one hitbox rather than being spread over them. + if (!seatPositions.isEmpty()) { + if (hitboxList.isEmpty()) { + this.reportUnsupported("Mechanics.furniture.seats (no hitbox to sit on)"); + } else if (hitboxList.getFirst() instanceof BaseHitbox seatHitbox) { + for (float[] seat : seatPositions) { + seatHitbox.addSeat(seat[0], seat[1], seat[2], 0); + } + } + } + for (FurniturePlacement furniturePlacement : placementKeys) { Placement p = furnitureConfiguration.getOrCreatePlacement(furniturePlacement); Rules rules = p.getRules(); From 0450ee0879cf36563ad233d54cd81a7ce7534769 Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Mon, 24 Aug 2026 11:54:39 +0200 Subject: [PATCH 100/116] feat(nexo): convert storage furniture Nexo's furniture storage mechanic had no counterpart in the output, so a chest, barrel or cabinet converted into furniture you cannot open. CraftEngine registers simple_storage_furniture for exactly this, and it takes the same four things Nexo configures - rows, title, and the open and close sounds - with Nexo's defaults (6 rows, "Storage", the vanilla chest sounds) carried over. Furniture behaviours reach CraftEngine as a list of maps keyed by type rather than as a section each, so FurnitureConfiguration grew a behavior list to serialize them that way. Only Nexo's plain STORAGE type maps across. PERSONAL, ENDERCHEST, DISPOSAL and SHULKER open a player's own inventory, a bin or a shulker rather than storage the furniture owns, and are reported by type instead of being converted into something they are not. --- .../behavior/furniture/FurnitureBehavior.java | 14 ++++ .../furniture/FurnitureConfiguration.java | 15 ++++ .../SimpleStorageFurnitureBehavior.java | 47 ++++++++++++ .../converter/nexo/NexoItemConverter.java | 29 ++++++- .../FurnitureBehaviorTest.java | 76 +++++++++++++++++++ 5 files changed, 180 insertions(+), 1 deletion(-) create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/furniture/FurnitureBehavior.java create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/furniture/SimpleStorageFurnitureBehavior.java create mode 100644 Plugin/src/test/java/fr/robie/craftengineconverter/FurnitureBehaviorTest.java diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/furniture/FurnitureBehavior.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/furniture/FurnitureBehavior.java new file mode 100644 index 00000000..a1c44f35 --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/furniture/FurnitureBehavior.java @@ -0,0 +1,14 @@ +package fr.robie.craftengineconverter.api.configuration.item.behavior.furniture; + +import org.jetbrains.annotations.NotNull; + +import java.util.Map; + +/** + * One entry of a furniture's {@code behavior} list. CraftEngine reads that list as maps keyed by {@code type}, so + * each behaviour describes itself as a map rather than writing into a section of its own. + */ +public interface FurnitureBehavior { + + @NotNull Map serialize(); +} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/furniture/FurnitureConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/furniture/FurnitureConfiguration.java index 10543334..ca62ab34 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/furniture/FurnitureConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/furniture/FurnitureConfiguration.java @@ -8,7 +8,9 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; +import java.util.ArrayList; import java.util.EnumMap; +import java.util.List; import java.util.Map; public class FurnitureConfiguration implements ItemConfigurationSerializable { @@ -16,6 +18,7 @@ public class FurnitureConfiguration implements ItemConfigurationSerializable { private final Map placements = new EnumMap<>(FurniturePlacement.class); private LootConfiguration loot; private Event events; + private final List behaviors = new ArrayList<>(); @NotNull public FurnitureSettings getOrCreateSettings(String itemId) { @@ -37,6 +40,10 @@ public void setEvents(@Nullable Event events) { this.events = events; } + public void addBehavior(@NotNull FurnitureBehavior behavior) { + this.behaviors.add(behavior); + } + @Override public void serialize(@NotNull YamlConfiguration yamlConfiguration, @NotNull String path, @NotNull ConfigurationSection itemSection, @NotNull String itemId) { ConfigurationSection behaviorSection = this.getOrCreateSection(itemSection, "behavior"); @@ -71,6 +78,14 @@ public void serialize(@NotNull YamlConfiguration yamlConfiguration, @NotNull Str this.events.serialize(furnitureSection); } + if (!this.behaviors.isEmpty()) { + List> serializedBehaviors = new ArrayList<>(this.behaviors.size()); + for (FurnitureBehavior behavior : this.behaviors) { + serializedBehaviors.add(behavior.serialize()); + } + furnitureSection.set("behavior", serializedBehaviors); + } + if (!this.placements.isEmpty()) { ConfigurationSection placementSection = this.getOrCreateSection(furnitureSection, "placement"); for (Placement placement : this.placements.values()) { diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/furniture/SimpleStorageFurnitureBehavior.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/furniture/SimpleStorageFurnitureBehavior.java new file mode 100644 index 00000000..f167c7f3 --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/furniture/SimpleStorageFurnitureBehavior.java @@ -0,0 +1,47 @@ +package fr.robie.craftengineconverter.api.configuration.item.behavior.furniture; + +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.LinkedHashMap; +import java.util.Map; + +/** + * CraftEngine's {@code simple_storage_furniture} behaviour: a container a player opens by interacting with the + * furniture, whose contents belong to the furniture rather than to any block. + */ +public class SimpleStorageFurnitureBehavior implements FurnitureBehavior { + private final int rows; + private final @Nullable String title; + private final @Nullable String openSound; + private final @Nullable String closeSound; + + public SimpleStorageFurnitureBehavior(int rows, @Nullable String title, @Nullable String openSound, @Nullable String closeSound) { + this.rows = rows; + this.title = title; + this.openSound = openSound; + this.closeSound = closeSound; + } + + @Override + public @NotNull Map serialize() { + Map behavior = new LinkedHashMap<>(); + behavior.put("type", "simple_storage_furniture"); + behavior.put("rows", this.rows); + if (this.title != null && !this.title.isBlank()) { + behavior.put("title", this.title); + } + + Map sounds = new LinkedHashMap<>(); + if (this.openSound != null && !this.openSound.isBlank()) { + sounds.put("open", this.openSound); + } + if (this.closeSound != null && !this.closeSound.isBlank()) { + sounds.put("close", this.closeSound); + } + if (!sounds.isEmpty()) { + behavior.put("sounds", sounds); + } + return behavior; + } +} diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoItemConverter.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoItemConverter.java index a96dd5e1..a2f4716e 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoItemConverter.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoItemConverter.java @@ -2056,7 +2056,7 @@ public void convertOther() { private static final Set HANDLED_FURNITURE_KEYS = Set.of( "modelengine_id", "better-model", "block_sounds", "restricted_rotation", "seats", - "properties", "drop", "limited_placing", "hitbox"); + "properties", "drop", "limited_placing", "hitbox", "storage"); @Override public void reportUnsupportedConfiguration() { @@ -2382,6 +2382,30 @@ private void convertCustomBlockMechanic(ConfigurationSection nexoCustomBlockSect this.getCraftEngineItemsConfiguration().addItemConfiguration(blockConfiguration); } + /** + * Nexo's storage furniture. Only the plain STORAGE type has a CraftEngine counterpart - the others are a player's + * ender chest, a personal stash, a bin or a shulker's own inventory, none of which is furniture-owned storage. + */ + private void convertFurnitureStorage(ConfigurationSection nexoFurnitureMechanicsSection, FurnitureConfiguration furnitureConfiguration) { + ConfigurationSection storageSection = nexoFurnitureMechanicsSection.getConfigurationSection("storage"); + if (this.isNull(storageSection)) { + return; + } + + String type = storageSection.getString("type", "STORAGE"); + if (!type.equalsIgnoreCase("STORAGE")) { + this.reportUnsupported("Mechanics.furniture.storage (type " + type.toUpperCase(Locale.ROOT) + ")"); + return; + } + + furnitureConfiguration.addBehavior(new SimpleStorageFurnitureBehavior( + storageSection.getInt("rows", 6), + storageSection.getString("title", "Storage"), + storageSection.getString("open_sound", "minecraft:block.chest.open"), + storageSection.getString("close_sound", "minecraft:block.chest.close") + )); + } + private String upperCaseOrEmpty(@Nullable String value) { return value == null ? "" : value.toUpperCase(Locale.ROOT); } @@ -2468,6 +2492,9 @@ private void convertFurnitureMechanic(ConfigurationSection nexoFurnitureMechanic } } + // --- Storage --- + this.convertFurnitureStorage(nexoFurnitureMechanicsSection, furnitureConfiguration); + // --- Loot --- ConfigurationSection dropSection = nexoFurnitureMechanicsSection.getConfigurationSection("drop"); if (this.isNotNull(dropSection)) { diff --git a/Plugin/src/test/java/fr/robie/craftengineconverter/FurnitureBehaviorTest.java b/Plugin/src/test/java/fr/robie/craftengineconverter/FurnitureBehaviorTest.java new file mode 100644 index 00000000..ebb8a88d --- /dev/null +++ b/Plugin/src/test/java/fr/robie/craftengineconverter/FurnitureBehaviorTest.java @@ -0,0 +1,76 @@ +package fr.robie.craftengineconverter; + +import fr.robie.craftengineconverter.api.configuration.CraftEngineItemsConfiguration; +import fr.robie.craftengineconverter.api.configuration.item.behavior.furniture.FurnitureConfiguration; +import fr.robie.craftengineconverter.api.configuration.item.behavior.furniture.SimpleStorageFurnitureBehavior; +import fr.robie.yamllibrary.ConfigurationSection; +import fr.robie.yamllibrary.file.YamlConfiguration; +import org.bukkit.Material; +import org.junit.jupiter.api.Test; + +import java.util.List; +import java.util.Map; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + +/** + * The {@code behavior} list a furniture definition carries. CraftEngine reads it as a list of maps keyed by + * {@code type}, not as a section per behaviour. + */ +class FurnitureBehaviorTest { + + @SuppressWarnings("unchecked") + private static List> behaviors(FurnitureConfiguration furniture) { + CraftEngineItemsConfiguration configuration = new CraftEngineItemsConfiguration("default:chair", Material.PAPER); + configuration.addItemConfiguration(furniture); + + YamlConfiguration yaml = new YamlConfiguration(); + ConfigurationSection itemSection = yaml.createSection("items.default:chair"); + configuration.serialize(yaml, "items.default:chair", itemSection); + + return (List>) itemSection.getList("behavior.furniture.behavior"); + } + + @Test + void writesStorageAsAnEntryInTheBehaviorList() { + FurnitureConfiguration furniture = new FurnitureConfiguration(); + furniture.addBehavior(new SimpleStorageFurnitureBehavior( + 3, "Chest", "minecraft:block.chest.open", "minecraft:block.chest.close")); + + List> behaviors = behaviors(furniture); + assertEquals(1, behaviors.size()); + + Map storage = behaviors.getFirst(); + assertEquals("simple_storage_furniture", storage.get("type")); + assertEquals(3, storage.get("rows")); + assertEquals("Chest", storage.get("title")); + assertEquals(Map.of("open", "minecraft:block.chest.open", "close", "minecraft:block.chest.close"), + storage.get("sounds")); + } + + @Test + void leavesOutSoundsThatWereNotConfigured() { + FurnitureConfiguration furniture = new FurnitureConfiguration(); + furniture.addBehavior(new SimpleStorageFurnitureBehavior(6, null, null, null)); + + Map storage = behaviors(furniture).getFirst(); + assertEquals(6, storage.get("rows")); + assertFalse(storage.containsKey("title")); + assertFalse(storage.containsKey("sounds"), "an empty sounds map is noise, not configuration"); + } + + @Test + void writesNoBehaviorKeyWhenThereAreNone() { + CraftEngineItemsConfiguration configuration = new CraftEngineItemsConfiguration("default:chair", Material.PAPER); + configuration.addItemConfiguration(new FurnitureConfiguration()); + + YamlConfiguration yaml = new YamlConfiguration(); + ConfigurationSection itemSection = yaml.createSection("items.default:chair"); + configuration.serialize(yaml, "items.default:chair", itemSection); + + assertTrue(itemSection.contains("behavior.furniture"), "the furniture itself is still written"); + assertFalse(itemSection.contains("behavior.furniture.behavior")); + } +} From 1f04d37a7943f69dcc78f6b67a0b347f3c3f0a40 Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Mon, 24 Aug 2026 12:08:11 +0200 Subject: [PATCH 101/116] fix(world): repair the in-world converters A pass over the block, furniture and chunk-load converters. Five separate defects, kept in one commit because they overlap in the same handful of files: - executeFurnitureConversion read getAsString() off an entity it had already allowed to be null. isFurnitureAt and getFurnitureEntityAt do not have to agree - Nexo answers the first from barrier blocks, and the two are asked about locations half a block apart - so propagating a conversion past furniture with no nearby ItemDisplay threw. It now converts without the snapshot rather than dying. - ItemsAdderFurnitureConverter#getNewNameForFurniture returned the ItemsAdder id instead of what it converts to, so the propagation check looked the raw id up in CraftEngine, never found it, and gave up. ItemsAdder furniture propagation has therefore never converted anything. Its block counterpart already mapped the id. - The ItemsAdder chunk-load converter removed the entity and placed replacement furniture without checking CraftEngine knows the id, so an unconverted item silently destroyed the furniture. It also placed at the entity's own position while every other path offsets half a block down, leaving chunk-loaded furniture floating. - PluginNameMapper looked ids straight up in a ConcurrentHashMap, which throws on null. Both chunk-load converters feed it whatever a persistent data container hands back, which is null if the value was not a string. - Neither ItemsAdder converter recorded any history, so `worldconverter restore` had nothing to undo for ItemsAdder while Nexo restored fine. Recording moved into BlockConverter and FurnitureConverter, where both hooks get it, and the ItemsAdder handlers now read the block state and entity NBT before destroying what they describe. Nexo's near-identical overrides are gone. --- .../common/PluginNameMapper.java | 19 ++++++++++++++++--- .../common/converter/BlockConverter.java | 17 ++++++++++++++++- .../common/converter/FurnitureConverter.java | 15 ++++++++++++++- .../itemsadder/ItemsAdderBlockConverter.java | 4 +++- .../ItemsAdderFurnitureConverter.java | 8 +++++--- .../itemsadder/ItemsAdderWorldConverter.java | 14 ++++++++++---- .../hooks/nexo/NexoBlockConverter.java | 16 ---------------- .../hooks/nexo/NexoFurnitureConverter.java | 19 ++----------------- 8 files changed, 66 insertions(+), 46 deletions(-) diff --git a/Common/src/main/java/fr/robie/craftengineconverter/common/PluginNameMapper.java b/Common/src/main/java/fr/robie/craftengineconverter/common/PluginNameMapper.java index cd8e57fc..3fb8d258 100644 --- a/Common/src/main/java/fr/robie/craftengineconverter/common/PluginNameMapper.java +++ b/Common/src/main/java/fr/robie/craftengineconverter/common/PluginNameMapper.java @@ -13,18 +13,31 @@ public class PluginNameMapper { private PluginNameMapper() { } - public boolean hasMapping(Plugins plugin, String oldName) { + public boolean hasMapping(Plugins plugin, @Nullable String oldName) { + if (oldName == null) { + return false; + } Map pluginMappings = this.mappings.get(plugin.name()); return pluginMappings != null && pluginMappings.containsKey(oldName); } + /** + * The name an old id converts to, or null if it has none. A null id answers null rather than throwing: ids read + * back out of a persistent data container are only as trustworthy as whatever wrote them. + */ @Nullable - public String getNewName(Plugins plugin, String oldName) { + public String getNewName(Plugins plugin, @Nullable String oldName) { + if (oldName == null) { + return null; + } Map pluginMappings = this.mappings.get(plugin.name()); return pluginMappings != null ? pluginMappings.get(oldName) : null; } - public void storeMapping(Plugins plugin, String oldName, String newName) { + public void storeMapping(Plugins plugin, @Nullable String oldName, @Nullable String newName) { + if (oldName == null || newName == null) { + return; + } this.mappings.computeIfAbsent(plugin.name(), k -> new ConcurrentHashMap<>()) .put(oldName, newName); } diff --git a/Common/src/main/java/fr/robie/craftengineconverter/common/converter/BlockConverter.java b/Common/src/main/java/fr/robie/craftengineconverter/common/converter/BlockConverter.java index 894c21a3..729a1838 100644 --- a/Common/src/main/java/fr/robie/craftengineconverter/common/converter/BlockConverter.java +++ b/Common/src/main/java/fr/robie/craftengineconverter/common/converter/BlockConverter.java @@ -1,7 +1,9 @@ package fr.robie.craftengineconverter.common.converter; import fr.robie.craftengineconverter.api.enums.Plugins; +import fr.robie.craftengineconverter.api.history.BlockHistory; import fr.robie.craftengineconverter.common.CraftEngineConverterPlugin; +import org.jetbrains.annotations.Nullable; import net.momirealms.craftengine.bukkit.api.CraftEngineBlocks; import net.momirealms.craftengine.core.util.Key; import org.bukkit.Location; @@ -54,7 +56,20 @@ public boolean isRegistered(String itemId) { public abstract boolean removeBlockAt(Location location); - public void placeBlock(String itemId, Location location, String oldBlockState) { + public void placeBlock(String itemId, Location location, @Nullable String oldBlockState) { this.plugin.getPlacementTracker().placeBlock(itemId, location); + if (oldBlockState == null) { + return; + } + + this.serverProfile.addBlockHistory(new BlockHistory(null, + location.getWorld().getName(), + location.getBlockX() >> 4, + location.getBlockZ() >> 4, + location.getBlockX(), + location.getBlockY(), + location.getBlockZ(), + oldBlockState, + false)); } } diff --git a/Common/src/main/java/fr/robie/craftengineconverter/common/converter/FurnitureConverter.java b/Common/src/main/java/fr/robie/craftengineconverter/common/converter/FurnitureConverter.java index 6efc6a5d..51e93843 100644 --- a/Common/src/main/java/fr/robie/craftengineconverter/common/converter/FurnitureConverter.java +++ b/Common/src/main/java/fr/robie/craftengineconverter/common/converter/FurnitureConverter.java @@ -1,6 +1,8 @@ package fr.robie.craftengineconverter.common.converter; +import com.google.gson.Gson; import fr.robie.craftengineconverter.api.enums.Plugins; +import fr.robie.craftengineconverter.api.history.EntityHistory; import fr.robie.craftengineconverter.common.CraftEngineConverterPlugin; import net.momirealms.craftengine.bukkit.api.CraftEngineFurniture; import net.momirealms.craftengine.core.util.Key; @@ -32,7 +34,10 @@ protected void executeFurnitureConversion(Location entityLoc, Set proc if (newName == null || !this.isRegistered(newName)) { continue; } - String entityNBT = furnitureEntityAt.getAsString(); + // isFurnitureAt can be true where no entity was found - Nexo answers it from the barrier blocks, and + // the probe happens half a block above adjacentLoc - so the furniture is still converted, just without + // the snapshot that would let it be restored. + String entityNBT = furnitureEntityAt == null ? null : furnitureEntityAt.getAsString(); if (this.removeFurnitureAt(adjacentLoc)) { this.placeFurniture(newName, adjacentLoc, entityNBT); counter.increment(); @@ -56,6 +61,14 @@ public boolean isRegistered(String itemId) { public void placeFurniture(String itemId, Location location, @Nullable String entityNBT) { this.plugin.getPlacementTracker().placeFurniture(itemId, location); + if (entityNBT == null) { + return; + } + + // Callers place furniture half a block below the entity it replaces; history stores where the entity was. + Location entityLocation = location.clone().add(0, 0.5, 0); + this.serverProfile.addEntityHistory( + new EntityHistory(null, new Gson().toJson(entityLocation.serialize()), entityNBT, false)); } public static boolean isRegisteredStatic(String itemId) { diff --git a/Hooks/ItemsAdder/src/main/java/fr/robie/craftengineconverter/hooks/itemsadder/ItemsAdderBlockConverter.java b/Hooks/ItemsAdder/src/main/java/fr/robie/craftengineconverter/hooks/itemsadder/ItemsAdderBlockConverter.java index 020fd5c7..3536b92e 100644 --- a/Hooks/ItemsAdder/src/main/java/fr/robie/craftengineconverter/hooks/itemsadder/ItemsAdderBlockConverter.java +++ b/Hooks/ItemsAdder/src/main/java/fr/robie/craftengineconverter/hooks/itemsadder/ItemsAdderBlockConverter.java @@ -36,12 +36,14 @@ public void onItemsAdderBlockInteract(CustomBlockInteractEvent event) { Block block = event.getBlockClicked(); Location location = block.getLocation(); + // Read before the block is removed, so the conversion can be restored. + String oldBlockState = block.getBlockData().getAsString(); if (!this.removeBlockAt(location)) { return; } - this.placeBlock(newName, location, null); + this.placeBlock(newName, location, oldBlockState); event.setCancelled(true); if (Configuration.get(Keys.ALLOW_BLOCK_CONVERSION_PROPAGATION) && Configuration.get(Keys.MAX_BLOCK_CONVERSION_PROPAGATION_DEPTH) > 1) { Set processed = new HashSet<>(); diff --git a/Hooks/ItemsAdder/src/main/java/fr/robie/craftengineconverter/hooks/itemsadder/ItemsAdderFurnitureConverter.java b/Hooks/ItemsAdder/src/main/java/fr/robie/craftengineconverter/hooks/itemsadder/ItemsAdderFurnitureConverter.java index ec34e01e..9687afa0 100644 --- a/Hooks/ItemsAdder/src/main/java/fr/robie/craftengineconverter/hooks/itemsadder/ItemsAdderFurnitureConverter.java +++ b/Hooks/ItemsAdder/src/main/java/fr/robie/craftengineconverter/hooks/itemsadder/ItemsAdderFurnitureConverter.java @@ -38,9 +38,11 @@ public void onItemsAdderFurnitureInteract(FurnitureInteractEvent event) { return; } Entity bukkitEntity = event.getBukkitEntity(); - CustomFurniture.remove(bukkitEntity, false); + // Both have to be read before the entity goes away: the snapshot is what makes the conversion restorable. Location location = bukkitEntity.getLocation(); - this.placeFurniture(newName, location.add(0, -0.5, 0), null); + String entityNBT = bukkitEntity.getAsString(); + CustomFurniture.remove(bukkitEntity, false); + this.placeFurniture(newName, location.add(0, -0.5, 0), entityNBT); event.setCancelled(true); if (Configuration.get(Keys.ALLOW_BLOCK_CONVERSION_PROPAGATION) && Configuration.get(Keys.MAX_BLOCK_CONVERSION_PROPAGATION_DEPTH) > 1) { @@ -62,7 +64,7 @@ public String getNewNameForFurniture(Location location) { if (furnitureEntity != null) { CustomFurniture customFurniture = CustomFurniture.byAlreadySpawned(furnitureEntity); if (customFurniture != null) { - return customFurniture.getNamespacedID(); + return this.getNewName(customFurniture.getNamespacedID()); } } return null; diff --git a/Hooks/ItemsAdder/src/main/java/fr/robie/craftengineconverter/hooks/itemsadder/ItemsAdderWorldConverter.java b/Hooks/ItemsAdder/src/main/java/fr/robie/craftengineconverter/hooks/itemsadder/ItemsAdderWorldConverter.java index 5977aff8..e4451778 100644 --- a/Hooks/ItemsAdder/src/main/java/fr/robie/craftengineconverter/hooks/itemsadder/ItemsAdderWorldConverter.java +++ b/Hooks/ItemsAdder/src/main/java/fr/robie/craftengineconverter/hooks/itemsadder/ItemsAdderWorldConverter.java @@ -6,7 +6,9 @@ import fr.robie.craftengineconverter.common.CraftEngineConverterPlugin; import fr.robie.craftengineconverter.common.CraftEnginePlacementTracker; import fr.robie.craftengineconverter.common.PluginNameMapper; +import fr.robie.craftengineconverter.common.converter.FurnitureConverter; import fr.robie.craftengineconverter.common.converter.WorldConverter; +import org.bukkit.Location; import org.bukkit.NamespacedKey; import org.bukkit.entity.Entity; import org.bukkit.persistence.PersistentDataContainer; @@ -28,18 +30,22 @@ public boolean convertEntity(@NotNull Entity entity) { PersistentDataContainer persistentDataContainer = entity.getPersistentDataContainer(); for (NamespacedKey key : persistentDataContainer.getKeys()) { if (key.asString().equalsIgnoreCase("itemsadder:placeable_entity_item")){ - String itemID = persistentDataContainer.get(key, PersistentDataType.STRING); + String itemID = persistentDataContainer.get(key, PersistentDataType.STRING); String newName = this.nameMapper.getNewName(Plugins.ITEMS_ADDER, itemID); - if (newName == null) { + // Without the registration check the entity would be removed and nothing would replace it. + if (newName == null || !FurnitureConverter.isRegisteredStatic(newName)) { return false; } - this.placementTracker.placeFurniture(newName, entity.getLocation()); + Location location = entity.getLocation(); entity.remove(); + // CraftEngine furniture is placed half a block below the entity it stands in for, as everywhere else. + this.placementTracker.placeFurniture(newName, location.add(0, -0.5, 0)); return true; } } } - return false; } + return false; + } @Override public @NotNull Plugins getPlugin() { diff --git a/Hooks/Nexo/src/main/java/fr/robie/craftengineconverter/hooks/nexo/NexoBlockConverter.java b/Hooks/Nexo/src/main/java/fr/robie/craftengineconverter/hooks/nexo/NexoBlockConverter.java index 905552b6..bb843b5f 100644 --- a/Hooks/Nexo/src/main/java/fr/robie/craftengineconverter/hooks/nexo/NexoBlockConverter.java +++ b/Hooks/Nexo/src/main/java/fr/robie/craftengineconverter/hooks/nexo/NexoBlockConverter.java @@ -7,7 +7,6 @@ import fr.robie.craftengineconverter.api.configuration.Configuration; import fr.robie.craftengineconverter.api.configuration.Keys; import fr.robie.craftengineconverter.api.enums.Plugins; -import fr.robie.craftengineconverter.api.history.BlockHistory; import fr.robie.craftengineconverter.common.CraftEngineConverterPlugin; import fr.robie.craftengineconverter.common.converter.BlockConverter; import fr.robie.craftengineconverter.common.permission.Permission; @@ -71,21 +70,6 @@ public String getNewNameForCustomBlock(Location location) { return this.getNewName(mechanic.getItemID()); } - @Override - public void placeBlock(String itemId, Location location, String oldBlockState) { - BlockHistory blockHistory = new BlockHistory(null, - location.getWorld().getName(), - location.getBlockX() >> 4, - location.getBlockZ() >> 4, - location.getBlockX(), - location.getBlockY(), - location.getBlockZ(), - oldBlockState, - false); - super.placeBlock(itemId, location, oldBlockState); - this.serverProfile.addBlockHistory(blockHistory); - } - @Override public boolean removeBlockAt(Location location) { return NexoBlocks.remove(location, null, Drop.emptyDrop()); diff --git a/Hooks/Nexo/src/main/java/fr/robie/craftengineconverter/hooks/nexo/NexoFurnitureConverter.java b/Hooks/Nexo/src/main/java/fr/robie/craftengineconverter/hooks/nexo/NexoFurnitureConverter.java index d2f172e0..a44e583c 100644 --- a/Hooks/Nexo/src/main/java/fr/robie/craftengineconverter/hooks/nexo/NexoFurnitureConverter.java +++ b/Hooks/Nexo/src/main/java/fr/robie/craftengineconverter/hooks/nexo/NexoFurnitureConverter.java @@ -1,13 +1,11 @@ package fr.robie.craftengineconverter.hooks.nexo; -import com.google.gson.Gson; import com.nexomc.nexo.api.NexoFurniture; import com.nexomc.nexo.api.events.furniture.NexoFurnitureInteractEvent; import com.nexomc.nexo.mechanics.furniture.FurnitureMechanic; import fr.robie.craftengineconverter.api.configuration.Configuration; import fr.robie.craftengineconverter.api.configuration.Keys; import fr.robie.craftengineconverter.api.enums.Plugins; -import fr.robie.craftengineconverter.api.history.EntityHistory; import fr.robie.craftengineconverter.common.CraftEngineConverterPlugin; import fr.robie.craftengineconverter.common.converter.FurnitureConverter; import fr.robie.craftengineconverter.common.permission.Permission; @@ -16,7 +14,6 @@ import org.bukkit.entity.ItemDisplay; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; -import org.jetbrains.annotations.Nullable; import java.util.Collection; import java.util.HashSet; @@ -39,9 +36,10 @@ public void onNexoFurnitureInteract(NexoFurnitureInteractEvent event) { return; } ItemDisplay baseEntity = event.getBaseEntity(); + // Both have to be read before the entity goes away. + Location location = baseEntity.getLocation(); String entityNBT = baseEntity.getAsString(); NexoFurniture.remove(baseEntity); - Location location = baseEntity.getLocation(); this.placeFurniture(newName, location.add(0, -0.5, 0), entityNBT); event.setCancelled(true); @@ -64,19 +62,6 @@ public Entity getFurnitureEntityAt(Location location) { return null; } - public void placeFurniture(String itemId, Location location, @Nullable String entityNBT) { - EntityHistory entityHistory = null; - if (entityNBT != null) { - Location duplicateLocation = location.clone().add(0, 0.5, 0); - String locationJson = new Gson().toJson(duplicateLocation.serialize()); - entityHistory = new EntityHistory(null, locationJson, entityNBT, false); - } - this.plugin.getPlacementTracker().placeFurniture(itemId, location); - if (entityHistory != null) { - this.serverProfile.addEntityHistory(entityHistory); - } - } - @Override public boolean isFurnitureAt(Location location) { return NexoFurniture.isFurniture(location); From 186233923343c4c4b27af9b4d358bac0440cc3fa Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Mon, 24 Aug 2026 12:14:52 +0200 Subject: [PATCH 102/116] fix(world): make propagation stop where it should Three things the previous pass left open, all in how a conversion spreads to what adjoins it. The furniture walk could not remember where it had been. It keyed the visited set on Location, which compares exact coordinates, while the same furniture is reached both through its entity's fractional position and through a whole-block offset from a neighbour - two values that never compare equal. So it revisited the same pieces until the budget ran out, cutting the reach short and wasting most of it. Both walks now key on the block a position falls in. max-block-conversion-propagation-depth is not a depth. It caps how many objects one interaction converts, which is what its config comment has always said, so the key is renamed to -limit; existing configs carry their value across on the next start through the usual legacy-path move. getFurnitureEntityAt returned whichever candidate the world listed first. Both hooks search a box a block wide in every direction, where a neighbouring piece is as likely to be found as the one being asked about, so the nearest one wins now. The four hooks also repeated the same six lines to set propagation up. That moved to the bases as propagateFrom, which is what made the rename a three-line change instead of an eight-site one. --- .../api/configuration/Keys.java | 7 ++- .../common/converter/BlockConverter.java | 17 ++++++- .../common/converter/FurnitureConverter.java | 45 ++++++++++++++++++- .../common/converter/ObjectConverter.java | 35 +++++++++++++++ .../itemsadder/ItemsAdderBlockConverter.java | 9 +--- .../ItemsAdderFurnitureConverter.java | 25 +++-------- .../hooks/nexo/NexoBlockConverter.java | 10 +---- .../hooks/nexo/NexoFurnitureConverter.java | 21 ++------- Plugin/src/main/resources/config.yml | 2 +- 9 files changed, 112 insertions(+), 59 deletions(-) diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/Keys.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/Keys.java index 0d0d1845..b54b31b0 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/Keys.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/Keys.java @@ -75,8 +75,11 @@ private Keys() { // Block conversion public static final Key ALLOW_BLOCK_CONVERSION_PROPAGATION = Key.bool(MAIN, "allow-block-conversion-propagation", true); - public static final Key MAX_BLOCK_CONVERSION_PROPAGATION_DEPTH = - Key.integer(MAIN, "max-block-conversion-propagation-depth", 64); + public static final Key MAX_BLOCK_CONVERSION_PROPAGATION_LIMIT = + Key.integer(MAIN, "max-block-conversion-propagation-limit", 64) + .legacy("max-block-conversion-propagation-depth") + .doc("How many blocks or furniture one interaction may convert on top of the one clicked.", + "This is a total, not a distance: propagation spreads outwards until it runs out."); // Formatting public static final Key PACKET_EVENTS_FORMATTING = Key.bool(MAIN, "formatting.packet-events", true); diff --git a/Common/src/main/java/fr/robie/craftengineconverter/common/converter/BlockConverter.java b/Common/src/main/java/fr/robie/craftengineconverter/common/converter/BlockConverter.java index 729a1838..d96896db 100644 --- a/Common/src/main/java/fr/robie/craftengineconverter/common/converter/BlockConverter.java +++ b/Common/src/main/java/fr/robie/craftengineconverter/common/converter/BlockConverter.java @@ -8,6 +8,7 @@ import net.momirealms.craftengine.core.util.Key; import org.bukkit.Location; +import java.util.HashSet; import java.util.Set; public abstract class BlockConverter extends ObjectConverter { @@ -15,7 +16,19 @@ public BlockConverter(CraftEngineConverterPlugin plugin, Plugins pluginType) { super(plugin, pluginType); } - protected void executeBlockConversion(Location blockLoc, Set processed, ConversionCounter counter) { + /** Converts whatever adjoins a block that was just converted, within the configured budget. */ + protected void propagateFrom(Location origin) { + ConversionCounter counter = this.propagationCounter(); + if (counter == null) { + return; + } + + Set processed = new HashSet<>(); + processed.add(BlockKey.of(origin)); + this.executeBlockConversion(origin, processed, counter); + } + + protected void executeBlockConversion(Location blockLoc, Set processed, ConversionCounter counter) { for (int[] offset : this.ADJACENT_OFFSETS) { if (counter.hasReachedLimit()) { return; @@ -23,7 +36,7 @@ protected void executeBlockConversion(Location blockLoc, Set processed Location adjacentLoc = blockLoc.clone().add(offset[0], offset[1], offset[2]); - if (!processed.add(adjacentLoc)) { + if (!processed.add(BlockKey.of(adjacentLoc))) { continue; } diff --git a/Common/src/main/java/fr/robie/craftengineconverter/common/converter/FurnitureConverter.java b/Common/src/main/java/fr/robie/craftengineconverter/common/converter/FurnitureConverter.java index 51e93843..4c7d242d 100644 --- a/Common/src/main/java/fr/robie/craftengineconverter/common/converter/FurnitureConverter.java +++ b/Common/src/main/java/fr/robie/craftengineconverter/common/converter/FurnitureConverter.java @@ -10,21 +10,36 @@ import org.bukkit.entity.Entity; import org.jetbrains.annotations.Nullable; +import java.util.Collection; +import java.util.HashSet; import java.util.Set; +import java.util.function.Predicate; public abstract class FurnitureConverter extends ObjectConverter { public FurnitureConverter(CraftEngineConverterPlugin plugin, Plugins pluginType) { super(plugin, pluginType); } - protected void executeFurnitureConversion(Location entityLoc, Set processed, ConversionCounter counter) { + /** Converts whatever adjoins furniture that was just converted, within the configured budget. */ + protected void propagateFrom(Location origin) { + ConversionCounter counter = this.propagationCounter(); + if (counter == null) { + return; + } + + Set processed = new HashSet<>(); + processed.add(BlockKey.of(origin)); + this.executeFurnitureConversion(origin, processed, counter); + } + + protected void executeFurnitureConversion(Location entityLoc, Set processed, ConversionCounter counter) { for (int[] offset : this.ADJACENT_OFFSETS) { if (counter.hasReachedLimit()) { return; } Entity furnitureEntityAt = this.getFurnitureEntityAt(entityLoc.clone().add(offset[0], offset[1], offset[2])); Location adjacentLoc = (furnitureEntityAt == null ? entityLoc.clone().add(offset[0], offset[1], offset[2]) : furnitureEntityAt.getLocation()).add(0, -0.5, 0); - if (!adjacentLoc.isChunkLoaded() || !processed.add(adjacentLoc)) { + if (!adjacentLoc.isChunkLoaded() || !processed.add(BlockKey.of(adjacentLoc))) { continue; } if (!this.isFurnitureAt(adjacentLoc)) { @@ -51,6 +66,32 @@ public boolean isRegistered(String itemId) { return CraftEngineFurniture.byId(Key.from(itemId)) != null; } + /** How far around a probe point the hooks look for the entity that carries a piece of furniture. */ + protected static final double FURNITURE_SEARCH_RADIUS = 1.0; + + /** + * The candidate closest to {@code location}, rather than whichever the world happened to return first. + *

+ * The search box is a block wide in every direction, so a neighbouring piece of furniture is just as likely to + * be inside it as the one actually being asked about - and picking the wrong one converts the wrong furniture. + */ + @Nullable + protected static Entity nearest(Location location, Collection candidates, Predicate accepted) { + Entity nearest = null; + double nearestDistance = Double.MAX_VALUE; + for (Entity candidate : candidates) { + if (!accepted.test(candidate)) { + continue; + } + double distance = candidate.getLocation().distanceSquared(location); + if (distance < nearestDistance) { + nearestDistance = distance; + nearest = candidate; + } + } + return nearest; + } + public abstract Entity getFurnitureEntityAt(Location location); public abstract boolean isFurnitureAt(Location location); diff --git a/Common/src/main/java/fr/robie/craftengineconverter/common/converter/ObjectConverter.java b/Common/src/main/java/fr/robie/craftengineconverter/common/converter/ObjectConverter.java index d5905fc5..bcd556d5 100644 --- a/Common/src/main/java/fr/robie/craftengineconverter/common/converter/ObjectConverter.java +++ b/Common/src/main/java/fr/robie/craftengineconverter/common/converter/ObjectConverter.java @@ -1,9 +1,14 @@ package fr.robie.craftengineconverter.common.converter; +import fr.robie.craftengineconverter.api.configuration.Configuration; +import fr.robie.craftengineconverter.api.configuration.Keys; import fr.robie.craftengineconverter.api.enums.Plugins; import fr.robie.craftengineconverter.api.profile.ServerProfile; import fr.robie.craftengineconverter.common.CraftEngineConverterPlugin; import fr.robie.craftengineconverter.common.PluginNameMapper; +import org.bukkit.Location; +import org.bukkit.World; +import org.jetbrains.annotations.Nullable; public abstract class ObjectConverter { protected final CraftEngineConverterPlugin plugin; @@ -32,6 +37,36 @@ public String getNewName(String oldName) { public abstract boolean isRegistered(String itemId); + /** + * A budget for one interaction's propagation, or null when it should not propagate at all. The clicked object is + * already converted by the time this is asked for, which is why the budget is one less than the configured limit. + */ + @Nullable + protected ConversionCounter propagationCounter() { + if (!Configuration.get(Keys.ALLOW_BLOCK_CONVERSION_PROPAGATION)) { + return null; + } + int limit = Configuration.get(Keys.MAX_BLOCK_CONVERSION_PROPAGATION_LIMIT); + return limit > 1 ? new ConversionCounter(limit - 1) : null; + } + + /** + * Identifies a position by the block it falls in. + *

+ * Propagation has to remember where it has been, and {@link Location} cannot do that job: it compares exact + * coordinates, and the same piece of furniture is reached both through its entity's own fractional position and + * through a whole-block offset from a neighbour. Those two never compare equal, so a Location-keyed set lets the + * walk revisit the same furniture over and over until the conversion budget runs out. + */ + protected record BlockKey(String world, int x, int y, int z) { + + protected static BlockKey of(Location location) { + World world = location.getWorld(); + return new BlockKey(world == null ? "" : world.getName(), + location.getBlockX(), location.getBlockY(), location.getBlockZ()); + } + } + protected static class ConversionCounter { private final int maxConversions; private int conversions = 0; diff --git a/Hooks/ItemsAdder/src/main/java/fr/robie/craftengineconverter/hooks/itemsadder/ItemsAdderBlockConverter.java b/Hooks/ItemsAdder/src/main/java/fr/robie/craftengineconverter/hooks/itemsadder/ItemsAdderBlockConverter.java index 3536b92e..609f8918 100644 --- a/Hooks/ItemsAdder/src/main/java/fr/robie/craftengineconverter/hooks/itemsadder/ItemsAdderBlockConverter.java +++ b/Hooks/ItemsAdder/src/main/java/fr/robie/craftengineconverter/hooks/itemsadder/ItemsAdderBlockConverter.java @@ -13,8 +13,6 @@ import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; -import java.util.HashSet; -import java.util.Set; public class ItemsAdderBlockConverter extends BlockConverter implements Listener { public ItemsAdderBlockConverter(CraftEngineConverterPlugin plugin) { @@ -45,12 +43,7 @@ public void onItemsAdderBlockInteract(CustomBlockInteractEvent event) { this.placeBlock(newName, location, oldBlockState); event.setCancelled(true); - if (Configuration.get(Keys.ALLOW_BLOCK_CONVERSION_PROPAGATION) && Configuration.get(Keys.MAX_BLOCK_CONVERSION_PROPAGATION_DEPTH) > 1) { - Set processed = new HashSet<>(); - processed.add(location); - ConversionCounter counter = new ConversionCounter(Configuration.get(Keys.MAX_BLOCK_CONVERSION_PROPAGATION_DEPTH) - 1); - this.executeBlockConversion(block.getLocation(), processed, counter); - } + this.propagateFrom(location); } diff --git a/Hooks/ItemsAdder/src/main/java/fr/robie/craftengineconverter/hooks/itemsadder/ItemsAdderFurnitureConverter.java b/Hooks/ItemsAdder/src/main/java/fr/robie/craftengineconverter/hooks/itemsadder/ItemsAdderFurnitureConverter.java index 9687afa0..4b0c5d5b 100644 --- a/Hooks/ItemsAdder/src/main/java/fr/robie/craftengineconverter/hooks/itemsadder/ItemsAdderFurnitureConverter.java +++ b/Hooks/ItemsAdder/src/main/java/fr/robie/craftengineconverter/hooks/itemsadder/ItemsAdderFurnitureConverter.java @@ -18,8 +18,6 @@ import org.jetbrains.annotations.Nullable; import java.util.Collection; -import java.util.HashSet; -import java.util.Set; public class ItemsAdderFurnitureConverter extends FurnitureConverter implements Listener { @@ -44,13 +42,7 @@ public void onItemsAdderFurnitureInteract(FurnitureInteractEvent event) { CustomFurniture.remove(bukkitEntity, false); this.placeFurniture(newName, location.add(0, -0.5, 0), entityNBT); event.setCancelled(true); - - if (Configuration.get(Keys.ALLOW_BLOCK_CONVERSION_PROPAGATION) && Configuration.get(Keys.MAX_BLOCK_CONVERSION_PROPAGATION_DEPTH) > 1) { - Set processed = new HashSet<>(); - processed.add(location); - ConversionCounter counter = new ConversionCounter(Configuration.get(Keys.MAX_BLOCK_CONVERSION_PROPAGATION_DEPTH) - 1); - this.executeFurnitureConversion(location, processed, counter); - } + this.propagateFrom(location); } @Override @@ -70,17 +62,14 @@ public String getNewNameForFurniture(Location location) { return null; } + @Override @Nullable public Entity getFurnitureEntityAt(Location location) { - Collection entities = location.getNearbyEntities(1, 1, 1); - for (Entity entity : entities) { - if (entity instanceof ItemFrame || entity instanceof ItemDisplay || entity instanceof ArmorStand) { - if (CustomFurniture.byAlreadySpawned(entity) != null) { - return entity; - } - } - } - return null; + Collection entities = location.getNearbyEntities( + FURNITURE_SEARCH_RADIUS, FURNITURE_SEARCH_RADIUS, FURNITURE_SEARCH_RADIUS); + return nearest(location, entities, entity -> + (entity instanceof ItemFrame || entity instanceof ItemDisplay || entity instanceof ArmorStand) + && CustomFurniture.byAlreadySpawned(entity) != null); } @Override diff --git a/Hooks/Nexo/src/main/java/fr/robie/craftengineconverter/hooks/nexo/NexoBlockConverter.java b/Hooks/Nexo/src/main/java/fr/robie/craftengineconverter/hooks/nexo/NexoBlockConverter.java index bb843b5f..de6025ce 100644 --- a/Hooks/Nexo/src/main/java/fr/robie/craftengineconverter/hooks/nexo/NexoBlockConverter.java +++ b/Hooks/Nexo/src/main/java/fr/robie/craftengineconverter/hooks/nexo/NexoBlockConverter.java @@ -15,8 +15,6 @@ import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; -import java.util.HashSet; -import java.util.Set; public class NexoBlockConverter extends BlockConverter implements Listener { @@ -46,13 +44,7 @@ public void onNexoBlockInteract(NexoBlockInteractEvent event) { this.placeBlock(newName, location, blockState); event.setCancelled(true); - - if (Configuration.get(Keys.ALLOW_BLOCK_CONVERSION_PROPAGATION) && Configuration.get(Keys.MAX_BLOCK_CONVERSION_PROPAGATION_DEPTH) > 1) { - Set processed = new HashSet<>(); - processed.add(location); - ConversionCounter counter = new ConversionCounter(Configuration.get(Keys.MAX_BLOCK_CONVERSION_PROPAGATION_DEPTH) - 1); - this.executeBlockConversion(block.getLocation(), processed, counter); - } + this.propagateFrom(location); } diff --git a/Hooks/Nexo/src/main/java/fr/robie/craftengineconverter/hooks/nexo/NexoFurnitureConverter.java b/Hooks/Nexo/src/main/java/fr/robie/craftengineconverter/hooks/nexo/NexoFurnitureConverter.java index a44e583c..3c36a939 100644 --- a/Hooks/Nexo/src/main/java/fr/robie/craftengineconverter/hooks/nexo/NexoFurnitureConverter.java +++ b/Hooks/Nexo/src/main/java/fr/robie/craftengineconverter/hooks/nexo/NexoFurnitureConverter.java @@ -15,9 +15,6 @@ import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; -import java.util.Collection; -import java.util.HashSet; -import java.util.Set; public class NexoFurnitureConverter extends FurnitureConverter implements Listener { @@ -42,24 +39,14 @@ public void onNexoFurnitureInteract(NexoFurnitureInteractEvent event) { NexoFurniture.remove(baseEntity); this.placeFurniture(newName, location.add(0, -0.5, 0), entityNBT); event.setCancelled(true); - - if (Configuration.get(Keys.ALLOW_BLOCK_CONVERSION_PROPAGATION) && Configuration.get(Keys.MAX_BLOCK_CONVERSION_PROPAGATION_DEPTH) > 1) { - Set processed = new HashSet<>(); - processed.add(location); - ConversionCounter counter = new ConversionCounter(Configuration.get(Keys.MAX_BLOCK_CONVERSION_PROPAGATION_DEPTH) - 1); - this.executeFurnitureConversion(location, processed, counter); - } + this.propagateFrom(location); } @Override public Entity getFurnitureEntityAt(Location location) { - Collection nearbyEntitiesByType = location.getNearbyEntitiesByType(ItemDisplay.class, 1); - for (ItemDisplay entity : nearbyEntitiesByType) { - if (NexoFurniture.isFurniture(entity)) { - return entity; - } - } - return null; + return nearest(location, + location.getNearbyEntitiesByType(ItemDisplay.class, FURNITURE_SEARCH_RADIUS), + entity -> NexoFurniture.isFurniture((ItemDisplay) entity)); } @Override diff --git a/Plugin/src/main/resources/config.yml b/Plugin/src/main/resources/config.yml index e12eefeb..8e60665f 100644 --- a/Plugin/src/main/resources/config.yml +++ b/Plugin/src/main/resources/config.yml @@ -120,7 +120,7 @@ tag: enabled: true allow-block-conversion-propagation: true # When enabled, if a block is converted, the surrounding blocks will also be checked for conversion -max-block-conversion-propagation-depth: 64 # Maximum number of blocks to propagate conversion in one block interaction event +max-block-conversion-propagation-limit: 64 # Maximum number of blocks to propagate conversion in one block interaction event # Available colors: # BLACK, DARK_BLUE, DARK_GREEN, DARK_AQUA, DARK_RED, DARK_PURPLE, From bb9fbef40d08f0165bc1718935fdfc1d607f78c0 Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Mon, 24 Aug 2026 12:22:44 +0200 Subject: [PATCH 103/116] perf(database): let the write buffer keep up with a conversion saveAll ran once a minute and wrote a single batch, so the buffer emptied at 250 rows per minute. A world conversion produces rows far faster than that, so it grew for as long as the conversion ran - every pending row and its key held in memory, and roughly 66 hours of draining behind a million converted blocks. A save cycle now drains until the buffer is empty, batched at 250 rows per insert as before and capped per cycle so one pass cannot monopolise the connection. The timer became a floor rather than the only trigger: a cache that builds up past a threshold asks to be drained straight away, off the main thread. processBatch reports what it wrote, which is what lets a drain know it is making progress, and flush is now that loop rather than its own nested copy - retrying rather than giving up if a scheduled drain holds the lock, since dropping rows at shutdown is the one outcome worth waiting for. --- .../database/DataBaseManager.java | 23 ++- .../utils/TypedCache.java | 145 +++++++++++++----- .../TypedCacheDrainTest.java | 92 +++++++++++ 3 files changed, 217 insertions(+), 43 deletions(-) create mode 100644 Plugin/src/test/java/fr/robie/craftengineconverter/TypedCacheDrainTest.java diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/database/DataBaseManager.java b/Plugin/src/main/java/fr/robie/craftengineconverter/database/DataBaseManager.java index 33841dc5..63bf0ae7 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/database/DataBaseManager.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/database/DataBaseManager.java @@ -31,8 +31,12 @@ public class DataBaseManager implements StorageManager { private final Map, TypedCache> caches = new ConcurrentHashMap<>(); - private static final int MAX_BATCH_SIZE = 250; // Max objects to process per batch - private static final long SAVE_INTERVAL_TICKS = 1200L; // 5 minutes (6000 ticks = 300 seconds) -> 1 min (1200 ticks = 60 seconds) + private static final int MAX_BATCH_SIZE = 250; // Max rows per INSERT + private static final long SAVE_INTERVAL_TICKS = 1200L; // 1 minute; only a floor, overflow drains sooner + /** Ceiling on one save cycle, so a large backlog cannot monopolise the connection in a single pass. */ + private static final int MAX_OBJECTS_PER_SAVE = 25_000; + /** Pending rows that trigger a drain without waiting for the next cycle. */ + private static final int OVERFLOW_THRESHOLD = 2_000; public DataBaseManager(CraftEngineConverterPlugin plugin) { this.plugin = plugin; @@ -139,6 +143,9 @@ public void loadDatabase() { MigrationManager.setDatabaseConfiguration(databaseConnection.getDatabaseConfiguration()); MigrationManager.execute(databaseConnection, logger); + for (TypedCache cache : this.caches.values()) { + cache.onOverflow(OVERFLOW_THRESHOLD, () -> this.drainSoon(cache)); + } this.plugin.getFoliaCompatibilityManager().runTimerAsync(this::saveAll, SAVE_INTERVAL_TICKS, SAVE_INTERVAL_TICKS); } @@ -152,10 +159,20 @@ private void saveAll() { } for (TypedCache cache : this.caches.values()) { - cache.processBatch(); + cache.drain(MAX_OBJECTS_PER_SAVE); } } + /** + * Drains a cache off the main thread as soon as it has built up, instead of waiting for the next save. + *

+ * A conversion produces rows far faster than one scheduled cycle used to remove them, so the buffer grew for as + * long as the conversion ran - holding every pending row, and its key, in memory the whole time. + */ + private void drainSoon(TypedCache cache) { + this.plugin.getFoliaCompatibilityManager().runAsync(() -> cache.drain(MAX_OBJECTS_PER_SAVE)); + } + /** * Adds a BlockHistory object to the cache for later batch insertion. * diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/utils/TypedCache.java b/Plugin/src/main/java/fr/robie/craftengineconverter/utils/TypedCache.java index f5572dd9..389ed9d9 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/utils/TypedCache.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/utils/TypedCache.java @@ -8,6 +8,7 @@ import java.util.List; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.atomic.AtomicBoolean; import java.util.function.Consumer; import java.util.function.Function; @@ -23,6 +24,12 @@ public class TypedCache { private final Consumer> batchProcessor; private final int maxBatchSize; private final Function keyExtractor; + private final AtomicBoolean draining = new AtomicBoolean(); + private volatile int overflowThreshold = Integer.MAX_VALUE; + private volatile Runnable overflowHandler; + + private static final int FLUSH_ATTEMPTS = 100; + private static final long FLUSH_RETRY_DELAY_MS = 20L; /** * Creates a new TypedCache. @@ -47,10 +54,28 @@ public TypedCache(Class type, Consumer> batchProcessor, int maxBatchS * @param object The object to cache */ public void add(T object) { - if (object != null) { - String key = this.keyExtractor.apply(object); - this.cache.put(key, object); + if (object == null) { + return; } + this.cache.put(this.keyExtractor.apply(object), object); + + Runnable handler = this.overflowHandler; + if (handler != null && this.cache.size() >= this.overflowThreshold && !this.draining.get()) { + handler.run(); + } + } + + /** + * Asks to be drained early once it holds {@code threshold} objects, rather than waiting for the next scheduled + * save. Without this the buffer only empties on a timer, and anything producing rows faster than one cycle + * removes them grows without bound - which is precisely what a world-wide conversion does. + * + * @param threshold how many pending objects trigger the handler + * @param handler runs on the caller's thread; it is expected to schedule the drain elsewhere, not perform it + */ + public void onOverflow(int threshold, Runnable handler) { + this.overflowThreshold = threshold; + this.overflowHandler = handler; } /** @@ -58,9 +83,42 @@ public void add(T object) { * * @return Number of objects processed */ - public void processBatch() { + /** + * Writes out everything pending, a batch at a time, up to {@code maxObjects}. + *

+ * Draining one batch per scheduled save was the whole problem: at 250 rows a minute the buffer could not keep up + * with a conversion, so it grew for as long as the conversion ran. The cap is here only to stop a single cycle + * monopolising the database connection. + * + * @return how many objects were written + */ + public int drain(int maxObjects) { + if (!this.draining.compareAndSet(false, true)) { + return 0; + } + try { + int written = 0; + while (written < maxObjects && !this.cache.isEmpty()) { + int batch = this.processBatch(); + if (batch == 0) { + break; + } + written += batch; + } + return written; + } finally { + this.draining.set(false); + } + } + + /** + * Processes up to maxBatchSize objects from the cache. + * + * @return the number of objects written, or 0 when nothing could be + */ + public int processBatch() { if (this.cache.isEmpty()) { - return; + return 0; } List batch = new ArrayList<>(); @@ -76,49 +134,56 @@ public void processBatch() { count++; } - if (!batch.isEmpty()) { - try { - this.batchProcessor.accept(batch); - keysToRemove.forEach(this.cache::remove); - } catch (Exception e) { - Logger.error( - "Failed to process batch of " + this.type.getSimpleName() + " objects", - e - ); - } + if (batch.isEmpty()) { + return 0; + } + + try { + this.batchProcessor.accept(batch); + keysToRemove.forEach(this.cache::remove); + return batch.size(); + } catch (Exception e) { + Logger.error( + "Failed to process batch of " + this.type.getSimpleName() + " objects", + e + ); + return 0; } } /** - * Processes all remaining objects in the cache without batch size limit. - * Should be called during shutdown. + * Writes out everything pending, however long that takes. Called at shutdown, where losing rows is the one + * outcome worth blocking to avoid. + *

+ * A scheduled drain may hold the lock when this runs, which is why it retries rather than returning: {@code + * drain} declines to run concurrently with itself, and treating that as "nothing left to write" would drop + * whatever the other drain had not reached. */ public void flush() { - while (!this.cache.isEmpty()) { - Logger.info("Flushing " + this.cache.size() + " remaining " + this.type.getSimpleName() + " objects from cache..."); - List all = new ArrayList<>(this.cache.values()); - List allKeys = new ArrayList<>(this.cache.keySet()); - int size = all.size(); - for (int i = 0; i < size; i += this.maxBatchSize) { - int end = Math.min(i + this.maxBatchSize, size); - List batch = all.subList(i, end); - List keysToRemove = allKeys.subList(i, end); - if (!batch.isEmpty()) { - try { - this.batchProcessor.accept(new ArrayList<>(batch)); - for (String k : new ArrayList<>(keysToRemove)) { - this.cache.remove(k); - } - } catch (Exception e) { - Logger.error( - "Failed to flush batch of " + this.type.getSimpleName() + " objects", - e - ); - return; - } + if (this.cache.isEmpty()) { + return; + } + + Logger.info("Flushing " + this.cache.size() + " remaining " + this.type.getSimpleName() + " objects from cache..."); + int written = 0; + for (int attempt = 0; attempt < FLUSH_ATTEMPTS && !this.cache.isEmpty(); attempt++) { + int batch = this.drain(Integer.MAX_VALUE); + written += batch; + if (batch == 0 && !this.cache.isEmpty()) { + try { + Thread.sleep(FLUSH_RETRY_DELAY_MS); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + break; } } - Logger.info("Finished flushing " + this.type.getSimpleName() + " cache."); + } + + if (this.cache.isEmpty()) { + Logger.info("Finished flushing " + written + " " + this.type.getSimpleName() + " objects."); + } else { + Logger.error("Gave up flushing with " + this.cache.size() + " " + this.type.getSimpleName() + + " objects still pending; they will not be written."); } } diff --git a/Plugin/src/test/java/fr/robie/craftengineconverter/TypedCacheDrainTest.java b/Plugin/src/test/java/fr/robie/craftengineconverter/TypedCacheDrainTest.java new file mode 100644 index 00000000..05e98d98 --- /dev/null +++ b/Plugin/src/test/java/fr/robie/craftengineconverter/TypedCacheDrainTest.java @@ -0,0 +1,92 @@ +package fr.robie.craftengineconverter; + +import fr.robie.craftengineconverter.utils.TypedCache; +import org.junit.jupiter.api.Test; + +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.atomic.AtomicInteger; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + +/** + * How fast the write buffer empties. + * + *

It used to write one batch per scheduled save - 250 rows a minute - while a world conversion produces rows far + * faster than that. The buffer therefore grew for as long as the conversion ran, holding every pending row in memory. + */ +class TypedCacheDrainTest { + + private record Row(String id) { + } + + private static TypedCache cache(List> writes) { + return new TypedCache<>(Row.class, batch -> writes.add(List.copyOf(batch)), 250, Row::id); + } + + private static void fill(TypedCache cache, int count) { + for (int i = 0; i < count; i++) { + cache.add(new Row("row-" + i)); + } + } + + @Test + void drainsEverythingRatherThanOneBatch() { + List> writes = new ArrayList<>(); + TypedCache cache = cache(writes); + fill(cache, 1_000); + + int written = cache.drain(Integer.MAX_VALUE); + + assertEquals(1_000, written); + assertTrue(cache.isEmpty(), "a drain leaves nothing behind"); + assertEquals(4, writes.size(), "still batched at 250 rows per insert"); + } + + @Test + void honoursTheCeilingSoOneCycleCannotRunAway() { + List> writes = new ArrayList<>(); + TypedCache cache = cache(writes); + fill(cache, 1_000); + + assertEquals(500, cache.drain(500), "stops once the ceiling is reached"); + assertEquals(500, cache.size(), "the rest waits for the next cycle"); + } + + @Test + void asksToBeDrainedOnceItHasBuiltUp() { + AtomicInteger overflows = new AtomicInteger(); + TypedCache cache = cache(new ArrayList<>()); + cache.onOverflow(100, overflows::incrementAndGet); + + fill(cache, 99); + assertEquals(0, overflows.get(), "quiet below the threshold"); + + cache.add(new Row("row-99")); + assertTrue(overflows.get() > 0, "the hundredth row asks for a drain"); + } + + @Test + void aFailedWriteKeepsItsRowsInsteadOfLosingThem() { + TypedCache cache = new TypedCache<>(Row.class, batch -> { + throw new IllegalStateException("database is down"); + }, 250, Row::id); + fill(cache, 300); + + assertEquals(0, cache.drain(Integer.MAX_VALUE), "nothing was written"); + assertEquals(300, cache.size(), "and nothing was dropped either"); + } + + @Test + void flushLeavesNothingPending() { + List> writes = new ArrayList<>(); + TypedCache cache = cache(writes); + fill(cache, 700); + + cache.flush(); + + assertTrue(cache.isEmpty()); + assertEquals(700, writes.stream().mapToInt(List::size).sum()); + } +} From 2415344ea838b633bf40dd263db7385f52bc033a Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Mon, 24 Aug 2026 12:28:25 +0200 Subject: [PATCH 104/116] perf(database): index converted blocks by position, not by record ServerProfileManager loaded every non-reverted row into a Map at startup and kept it there for the life of the server. Measured at 375 bytes a block: a String key spelling out the coordinates, a per-row copy of the world name, and the block state string - none of which the index is ever asked about. It answers one question, "has this been converted?", and the record behind a position is only wanted when something is restored, which can read it back. Blocks are now a LongOpenHashSet per world of positions packed the way Minecraft packs a BlockPos - 26 bits of x, 12 of y, 26 of z, which fits any world Minecraft can generate with room to spare. Measured at 18.9 bytes a block across three worlds, so a five million block conversion holds 90 MB where it used to hold 1.8 GB. Entity conversions drop their records too, keeping the location strings exact: there is one per piece of furniture rather than one per block, so they are not worth packing, but their NBT snapshots were the largest single thing in the old cache. Building the index no longer materialises what it is reading either. Sarah's select collects every matching row before returning, which would have spiked to the old figure just to populate the new index, so the two startup reads stream over a JDBC cursor and project only the columns they need. clearBlockHistory became one UPDATE rather than one per row. --- .../api/database/ActiveConversionReader.java | 28 +++ .../api/database/StorageManager.java | 12 +- .../database/DataBaseManager.java | 76 +++++++ .../database/ServerProfileManager.java | 187 ++++++++---------- .../database/BlockPositionPackingTest.java | 78 ++++++++ 5 files changed, 275 insertions(+), 106 deletions(-) create mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/database/ActiveConversionReader.java create mode 100644 Plugin/src/test/java/fr/robie/craftengineconverter/database/BlockPositionPackingTest.java diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/database/ActiveConversionReader.java b/API/src/main/java/fr/robie/craftengineconverter/api/database/ActiveConversionReader.java new file mode 100644 index 00000000..fdcec9c5 --- /dev/null +++ b/API/src/main/java/fr/robie/craftengineconverter/api/database/ActiveConversionReader.java @@ -0,0 +1,28 @@ +package fr.robie.craftengineconverter.api.database; + +import org.jetbrains.annotations.NotNull; + +import java.util.function.Consumer; + +/** + * Reads the set of conversions still in effect without building objects for them. + * + *

Only the coordinates are needed to answer "has this already been converted?", and there can be millions of rows. + * Handing back a list of records - each carrying a world name, an id and the block state it replaced - costs a couple + * of hundred bytes per row for data that is thrown away immediately, so these push the few columns that matter at a + * consumer instead and never hold more than one row at a time. + */ +public interface ActiveConversionReader { + + /** Visits the position of every block conversion that has not been reverted. */ + void forEachActiveBlockPosition(@NotNull BlockPositionConsumer consumer); + + /** Visits the serialised location of every entity conversion that has not been reverted. */ + void forEachActiveEntityLocation(@NotNull Consumer consumer); + + @FunctionalInterface + interface BlockPositionConsumer { + + void accept(@NotNull String worldName, int blockX, int blockY, int blockZ); + } +} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/database/StorageManager.java b/API/src/main/java/fr/robie/craftengineconverter/api/database/StorageManager.java index 4ef3a061..1a60c71f 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/database/StorageManager.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/database/StorageManager.java @@ -11,10 +11,20 @@ import java.util.Optional; -public interface StorageManager { +public interface StorageManager extends ActiveConversionReader { void loadDatabase(); + /** + * Marks every block conversion still in effect as reverted, in one statement. + *

+ * The alternative is an update per row, which for a world-sized conversion is a million round trips. + */ + void markAllBlocksAsReverted(); + + /** As {@link #markAllBlocksAsReverted()}, for entity conversions. */ + void markAllEntitiesAsReverted(); + /** * Insert or update a block history record in persistent storage. * @param blockHistory Block history record (not null). diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/database/DataBaseManager.java b/Plugin/src/main/java/fr/robie/craftengineconverter/database/DataBaseManager.java index 63bf0ae7..3728431b 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/database/DataBaseManager.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/database/DataBaseManager.java @@ -31,6 +31,8 @@ public class DataBaseManager implements StorageManager { private final Map, TypedCache> caches = new ConcurrentHashMap<>(); + /** Rows the driver keeps in flight while streaming; a cursor, not a buffer of the whole result. */ + private static final int STREAM_FETCH_SIZE = 1_000; private static final int MAX_BATCH_SIZE = 250; // Max rows per INSERT private static final long SAVE_INTERVAL_TICKS = 1200L; // 1 minute; only a floor, overflow drains sooner /** Ceiling on one save cycle, so a large backlog cannot monopolise the connection in a single pass. */ @@ -245,6 +247,80 @@ public void markEntityAsReverted(@NotNull EntityHistory entityHistory) { }); } + private static final String BLOCK_TABLE = "world_block_converter_historical"; + private static final String ENTITY_TABLE = "world_entity_converter_historical"; + + /** + * Reads straight over the JDBC cursor rather than through the ORM. + *

+ * Sarah's select builds a list of every matching row before returning, which for the startup index means holding + * millions of records at once purely to read four numbers out of each. Streaming keeps one row in flight. + */ + @Override + public void forEachActiveBlockPosition(@NotNull BlockPositionConsumer consumer) { + if (!this.isEnabled) { + return; + } + + this.stream("SELECT world_name, block_x, block_y, block_z FROM " + BLOCK_TABLE + " WHERE reverted = ?", + resultSet -> consumer.accept(resultSet.getString(1), resultSet.getInt(2), resultSet.getInt(3), resultSet.getInt(4))); + } + + @Override + public void forEachActiveEntityLocation(@NotNull java.util.function.Consumer consumer) { + if (!this.isEnabled) { + return; + } + + this.stream("SELECT location FROM " + ENTITY_TABLE + " WHERE reverted = ?", + resultSet -> consumer.accept(resultSet.getString(1))); + } + + @FunctionalInterface + private interface RowReader { + + void read(java.sql.ResultSet resultSet) throws java.sql.SQLException; + } + + private void stream(String sql, RowReader reader) { + try (java.sql.PreparedStatement statement = this.requestHelper.getConnection().getConnection() + .prepareStatement(sql, java.sql.ResultSet.TYPE_FORWARD_ONLY, java.sql.ResultSet.CONCUR_READ_ONLY)) { + statement.setBoolean(1, false); + statement.setFetchSize(STREAM_FETCH_SIZE); + try (java.sql.ResultSet resultSet = statement.executeQuery()) { + while (resultSet.next()) { + reader.read(resultSet); + } + } + } catch (Exception e) { + fr.robie.messageflow.logger.Logger.error("Failed to read active conversions", e); + } + } + + @Override + public void markAllBlocksAsReverted() { + this.execute("UPDATE " + BLOCK_TABLE + " SET reverted = ? WHERE reverted = ?"); + } + + @Override + public void markAllEntitiesAsReverted() { + this.execute("UPDATE " + ENTITY_TABLE + " SET reverted = ? WHERE reverted = ?"); + } + + private void execute(String sql) { + if (!this.isEnabled) { + return; + } + + try (java.sql.PreparedStatement statement = this.requestHelper.getConnection().getConnection().prepareStatement(sql)) { + statement.setBoolean(1, true); + statement.setBoolean(2, false); + statement.executeUpdate(); + } catch (Exception e) { + fr.robie.messageflow.logger.Logger.error("Failed to mark conversions as reverted", e); + } + } + /** * Gets the history of a specific block. * diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/database/ServerProfileManager.java b/Plugin/src/main/java/fr/robie/craftengineconverter/database/ServerProfileManager.java index 45ecb885..dac106f9 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/database/ServerProfileManager.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/database/ServerProfileManager.java @@ -5,96 +5,94 @@ import fr.robie.craftengineconverter.api.history.BlockHistory; import fr.robie.craftengineconverter.api.history.EntityHistory; import fr.robie.craftengineconverter.api.profile.ServerProfile; +import it.unimi.dsi.fastutil.longs.LongOpenHashSet; import org.jetbrains.annotations.NotNull; import org.jspecify.annotations.NonNull; import java.util.Collection; -import java.util.List; import java.util.Map; +import java.util.Set; import java.util.concurrent.ConcurrentHashMap; /** - * Manages an in-memory cache of non-reverted block conversions. - * This cache improves performance by reducing database queries when checking if blocks are already converted. + * Remembers which blocks and entities are currently converted, so a chunk being scanned does not have to ask the + * database once per candidate block. + * + *

It holds positions, not records. The index answers one question - has this been converted? - and the record that + * goes with a position is only wanted when something is being restored, which is rare and can read it back from the + * database. Keeping the records resident instead cost around 375 bytes a block, most of it the block state string and + * a per-row copy of the world name, which put a world-sized conversion in the region of two gigabytes of heap. A + * packed position in a primitive set is ten. */ public class ServerProfileManager implements ServerProfile { private final CraftEngineConverter plugin; private final StorageManager storageManager; - private final Map activeBlockCache = new ConcurrentHashMap<>(); - private final Map activeEntityCache = new ConcurrentHashMap<>(); + /** + * Positions are packed into a long the way Minecraft packs a BlockPos: 26 bits of x, 12 of y, 26 of z. That + * covers the whole of a 60 million block world and every height a world can have, and it means the index is a + * primitive array rather than a graph of boxed objects. + */ + private static final int PACKED_X_BITS = 26; + private static final int PACKED_Z_BITS = 26; + private static final int PACKED_Y_BITS = 64 - PACKED_X_BITS - PACKED_Z_BITS; + private static final long PACKED_X_MASK = (1L << PACKED_X_BITS) - 1; + private static final long PACKED_Y_MASK = (1L << PACKED_Y_BITS) - 1; + private static final long PACKED_Z_MASK = (1L << PACKED_Z_BITS) - 1; + + /** + * One set per world, each guarded by itself: LongOpenHashSet is not thread safe, and both chunk loading and + * interaction conversion touch it. Locking per world rather than globally keeps worlds from waiting on each + * other, and the critical sections are a single hash lookup. + */ + private final Map convertedBlocksByWorld = new ConcurrentHashMap<>(); + + /** + * Entity conversions are keyed by their serialised location. There are orders of magnitude fewer of them than + * blocks - one per piece of furniture - so they stay exact strings rather than being packed. + */ + private final Set convertedEntities = ConcurrentHashMap.newKeySet(); public ServerProfileManager(CraftEngineConverter plugin) { this.plugin = plugin; this.storageManager = plugin.getStorageManager(); } + static long pack(int blockX, int blockY, int blockZ) { + return ((blockX & PACKED_X_MASK) << (PACKED_Y_BITS + PACKED_Z_BITS)) + | ((blockY & PACKED_Y_MASK) << PACKED_Z_BITS) + | (blockZ & PACKED_Z_MASK); + } + /** - * Loads all non-reverted block histories from the database into memory cache. + * Reads back every conversion still in effect, one row at a time, keeping only its position. */ @Override public void load() { if (!this.storageManager.isEnabled()) { return; } - List allBlockHistories = this.storageManager.getAllActiveConversions(); - - for (BlockHistory history : allBlockHistories) { - if (!history.isReverted()) { - String key = this.createCacheKey( - history.getWorldName(), - history.getChunkX(), - history.getChunkZ(), - history.getBlockX(), - history.getBlockY(), - history.getBlockZ() - ); - this.activeBlockCache.put(key, history); - } - } - List allActiveEntityConversions = this.storageManager.getAllActiveEntityConversions(); - for (EntityHistory entityHistory : allActiveEntityConversions) { - if (!entityHistory.isReverted()) { - this.activeEntityCache.put(entityHistory.getLocationString(), entityHistory); + this.storageManager.forEachActiveBlockPosition((worldName, blockX, blockY, blockZ) -> { + LongOpenHashSet positions = this.positionsIn(worldName); + synchronized (positions) { + positions.add(pack(blockX, blockY, blockZ)); } - } + }); + this.storageManager.forEachActiveEntityLocation(this.convertedEntities::add); } - /** - * Creates a cache key from block and chunk coordinates. - * - * @param worldName The world name - * @param chunkX The chunk X coordinate - * @param chunkZ The chunk Z coordinate - * @param blockX The block X coordinate - * @param blockY The block Y coordinate - * @param blockZ The block Z coordinate - * @return The cache key string in format: world=name:chunkx:chunkz:blockx:blocky:blockz - */ - @NotNull - private String createCacheKey(@NotNull String worldName, int chunkX, int chunkZ, int blockX, int blockY, int blockZ) { - return worldName + ":" + chunkX + ":" + chunkZ + ":" + blockX + ":" + blockY + ":" + blockZ; + private LongOpenHashSet positionsIn(@NotNull String worldName) { + return this.convertedBlocksByWorld.computeIfAbsent(worldName, world -> new LongOpenHashSet()); } - /** - * Adds a new block conversion to the cache. - * Should be called after inserting into the database. - * - * @param blockHistory The block history to add to cache - */ @Override public void addBlockHistory(@NotNull BlockHistory blockHistory) { if (!blockHistory.isReverted()) { - String key = this.createCacheKey( - blockHistory.getWorldName(), - blockHistory.getChunkX(), - blockHistory.getChunkZ(), - blockHistory.getBlockX(), - blockHistory.getBlockY(), - blockHistory.getBlockZ() - ); - this.activeBlockCache.put(key, blockHistory); + LongOpenHashSet positions = this.positionsIn(blockHistory.getWorldName()); + synchronized (positions) { + positions.add(pack(blockHistory.getBlockX(), blockHistory.getBlockY(), blockHistory.getBlockZ())); + } } this.storageManager.upsertBlockHistory(blockHistory); } @@ -102,97 +100,76 @@ public void addBlockHistory(@NotNull BlockHistory blockHistory) { @Override public void addEntityHistory(@NotNull EntityHistory entityHistory) { if (!entityHistory.isReverted()) { - this.activeEntityCache.put(entityHistory.getLocationString(), entityHistory); + this.convertedEntities.add(entityHistory.getLocationString()); } this.storageManager.upsertEntityHistory(entityHistory); } - /** - * Checks if a block is already converted (and not reverted) using the cache. - * This is a fast O(1) operation. - * - * @param worldName The world name - * @param blockX The block X coordinate - * @param blockY The block Y coordinate - * @param blockZ The block Z coordinate - * @return true if the block is converted and not reverted - */ @Override public boolean isBlockConverted(@NotNull String worldName, int blockX, int blockY, int blockZ) { - int chunkX = blockX >> 4; // Equivalent to blockX / 16 - int chunkZ = blockZ >> 4; // Equivalent to blockZ / 16 - String key = this.createCacheKey(worldName, chunkX, chunkZ, blockX, blockY, blockZ); - return this.activeBlockCache.containsKey(key); + LongOpenHashSet positions = this.convertedBlocksByWorld.get(worldName); + if (positions == null) { + return false; + } + synchronized (positions) { + return positions.contains(pack(blockX, blockY, blockZ)); + } } @Override public boolean isEntityConverted(@NotNull String locationString) { - return this.activeEntityCache.containsKey(locationString); + return this.convertedEntities.contains(locationString); } - /** - * Gets the current number of cached block conversions. - * - * @return The cache size - */ @Override public int getActiveBlockCount() { - return this.activeBlockCache.size(); + int total = 0; + for (LongOpenHashSet positions : this.convertedBlocksByWorld.values()) { + synchronized (positions) { + total += positions.size(); + } + } + return total; } - /** - * Gets the current number of cached entity conversions. - * - * @return The entity cache size - */ @Override public int getActiveEntityCount() { - return this.activeEntityCache.size(); + return this.convertedEntities.size(); } - /** - * Clears all entries from the cache. - */ @Override public void clearBlockHistory() { - for (var blockHistory : this.activeBlockCache.values()) { - this.storageManager.markBlockAsReverted(blockHistory); - } - this.activeBlockCache.clear(); + this.convertedBlocksByWorld.clear(); + this.storageManager.markAllBlocksAsReverted(); } @Override public void markBlockAsReverted(@NonNull BlockHistory history) { - String key = this.createCacheKey( - history.getWorldName(), - history.getChunkX(), - history.getChunkZ(), - history.getBlockX(), - history.getBlockY(), - history.getBlockZ() - ); - this.activeBlockCache.remove(key); + LongOpenHashSet positions = this.convertedBlocksByWorld.get(history.getWorldName()); + if (positions != null) { + synchronized (positions) { + positions.remove(pack(history.getBlockX(), history.getBlockY(), history.getBlockZ())); + } + } this.storageManager.markBlockAsReverted(history); } @Override public void markEntityAsReverted(@NotNull EntityHistory history) { - this.activeEntityCache.remove(history.getLocationString()); + this.convertedEntities.remove(history.getLocationString()); this.storageManager.markEntityAsReverted(history); } /** - * Gets all active (non-reverted) block conversions from the cache. - * - * @return Collection of all active BlockHistory records in the cache + * Reads the records back from the database, because the index does not keep them. */ @Override public @NonNull Collection getAllActiveConversions() { - return this.activeBlockCache.values(); + return this.storageManager.getAllActiveConversions(); } @Override public @NotNull Collection getAllActiveEntityConversions() { - return this.activeEntityCache.values(); + return this.storageManager.getAllActiveEntityConversions(); } } diff --git a/Plugin/src/test/java/fr/robie/craftengineconverter/database/BlockPositionPackingTest.java b/Plugin/src/test/java/fr/robie/craftengineconverter/database/BlockPositionPackingTest.java new file mode 100644 index 00000000..222a4264 --- /dev/null +++ b/Plugin/src/test/java/fr/robie/craftengineconverter/database/BlockPositionPackingTest.java @@ -0,0 +1,78 @@ +package fr.robie.craftengineconverter.database; + +import org.junit.jupiter.api.Test; + +import java.util.HashSet; +import java.util.Random; +import java.util.Set; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; + +/** + * The packing behind the converted-block index. + * + *

Every position in the index is one long, so two different blocks packing to the same value would make one of + * them look already converted and get skipped. The ranges have room to spare for any world Minecraft can generate, + * but the arithmetic has to survive negative coordinates, which is where a mask like this usually goes wrong. + */ +class BlockPositionPackingTest { + + /** Vanilla's world border caps a coordinate at just under 30 million. */ + private static final int WORLD_LIMIT = 29_999_984; + + @Test + void distinguishesTheCornersOfTheLargestPossibleWorld() { + Set packed = new HashSet<>(); + for (int x : new int[]{-WORLD_LIMIT, -1, 0, 1, WORLD_LIMIT}) { + for (int y : new int[]{-2048, -64, 0, 319, 2047}) { + for (int z : new int[]{-WORLD_LIMIT, -1, 0, 1, WORLD_LIMIT}) { + assertEquals(true, packed.add(ServerProfileManager.pack(x, y, z)), + "collision at " + x + "," + y + "," + z); + } + } + } + assertEquals(5 * 5 * 5, packed.size()); + } + + @Test + void keepsNeighboursApartOnEveryAxis() { + long origin = ServerProfileManager.pack(0, 0, 0); + assertNotEquals(origin, ServerProfileManager.pack(1, 0, 0)); + assertNotEquals(origin, ServerProfileManager.pack(-1, 0, 0)); + assertNotEquals(origin, ServerProfileManager.pack(0, 1, 0)); + assertNotEquals(origin, ServerProfileManager.pack(0, -1, 0)); + assertNotEquals(origin, ServerProfileManager.pack(0, 0, 1)); + assertNotEquals(origin, ServerProfileManager.pack(0, 0, -1)); + } + + @Test + void doesNotConfuseTheAxesWithEachOther() { + // A shift that is one bit out would make these three the same value. + assertNotEquals(ServerProfileManager.pack(5, 0, 0), ServerProfileManager.pack(0, 5, 0)); + assertNotEquals(ServerProfileManager.pack(5, 0, 0), ServerProfileManager.pack(0, 0, 5)); + assertNotEquals(ServerProfileManager.pack(0, 5, 0), ServerProfileManager.pack(0, 0, 5)); + } + + @Test + void isStableForTheSamePosition() { + assertEquals(ServerProfileManager.pack(-1234, 71, 5678), ServerProfileManager.pack(-1234, 71, 5678)); + } + + @Test + void survivesAWideRandomSample() { + Random random = new Random(20260824L); + Set packed = new HashSet<>(); + Set positions = new HashSet<>(); + + for (int i = 0; i < 200_000; i++) { + int x = random.nextInt(2 * WORLD_LIMIT) - WORLD_LIMIT; + int y = random.nextInt(4096) - 2048; + int z = random.nextInt(2 * WORLD_LIMIT) - WORLD_LIMIT; + positions.add(x + "," + y + "," + z); + packed.add(ServerProfileManager.pack(x, y, z)); + } + + assertEquals(positions.size(), packed.size(), "distinct positions must give distinct packed values"); + } +} From 164853a9ed403b436567fe7a2d98652227f21085 Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Mon, 24 Aug 2026 12:32:23 +0200 Subject: [PATCH 105/116] perf(database): restore in pages instead of all at once The restore read every active conversion into a list, copied it, then scheduled one task per fifty rows before doing any work - so a million converted blocks meant a million records resident at once and twenty thousand tasks queued up front, on top of an update per row as they went. It now walks the table a page at a time, each page scheduling the next: constant memory and one pending task no matter how large the world. The walk pages by id rather than by offset, which is what keeps it correct while it marks rows reverted underneath itself - an offset would skip a page every time. Reads and reverts happen off the main thread, with only the block and entity changes on it. A page per tick against a remote database would otherwise have stalled the server for a round trip every tick for the whole restore. Each page is reverted in a single statement rather than row by row. ServerProfile#getAllActiveConversions and its entity twin are gone. The index no longer holds records to hand back, and an API whose contract is "give me every row" is the thing this set out to remove; forgetBlock and forgetEntity replace the part of markAsReverted the paged path still needs, without a second update for a row the page already covered. --- .../api/database/StorageManager.java | 23 +++ .../api/profile/ServerProfile.java | 15 +- ...ConverterCommandWorldConverterRestore.java | 160 +++++++++++------- .../database/DataBaseManager.java | 74 ++++++++ .../database/ServerProfileManager.java | 28 ++- 5 files changed, 218 insertions(+), 82 deletions(-) diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/database/StorageManager.java b/API/src/main/java/fr/robie/craftengineconverter/api/database/StorageManager.java index 1a60c71f..9b9f5715 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/database/StorageManager.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/database/StorageManager.java @@ -25,6 +25,29 @@ public interface StorageManager extends ActiveConversionReader { /** As {@link #markAllBlocksAsReverted()}, for entity conversions. */ void markAllEntitiesAsReverted(); + /** + * The next page of block conversions still in effect, ordered by id and starting after {@code afterId}. + *

+ * Paging by id rather than by offset means the walk stays correct while it is marking rows reverted underneath + * itself, which an OFFSET would not: every page it had already passed would shift. + * + * @param afterId the id the previous page ended on, or 0 to start + * @param limit how many rows to read + * @return the page, empty once there is nothing left + */ + @NotNull + java.util.List nextActiveBlockPage(long afterId, int limit); + + /** As {@link #nextActiveBlockPage}, for entity conversions. */ + @NotNull + java.util.List nextActiveEntityPage(long afterId, int limit); + + /** Marks the given block conversions reverted in one statement. */ + void markBlocksAsReverted(@NotNull java.util.Collection ids); + + /** Marks the given entity conversions reverted in one statement. */ + void markEntitiesAsReverted(@NotNull java.util.Collection ids); + /** * Insert or update a block history record in persistent storage. * @param blockHistory Block history record (not null). diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/profile/ServerProfile.java b/API/src/main/java/fr/robie/craftengineconverter/api/profile/ServerProfile.java index 663fa0d7..c67e0d5a 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/profile/ServerProfile.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/profile/ServerProfile.java @@ -8,7 +8,6 @@ import fr.robie.craftengineconverter.api.history.EntityHistory; import org.jetbrains.annotations.NotNull; -import java.util.Collection; public interface ServerProfile { @@ -52,14 +51,14 @@ public interface ServerProfile { void markEntityAsReverted(@NotNull EntityHistory history); /** - * Gets all active (non-reverted) block conversions from the cache. - * - * @return Collection of all active BlockHistory records (never null, may be empty). + * Drops a block from the index without touching the database. + *

+ * For callers that revert a whole page in one statement: {@link #markBlockAsReverted} would issue a second + * update for the same row. */ - @NotNull - Collection getAllActiveConversions(); + void forgetBlock(@NotNull BlockHistory history); - @NotNull - Collection getAllActiveEntityConversions(); + /** As {@link #forgetBlock}, for an entity conversion. */ + void forgetEntity(@NotNull EntityHistory history); } diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/command/CraftEngineConverterCommandWorldConverterRestore.java b/Plugin/src/main/java/fr/robie/craftengineconverter/command/CraftEngineConverterCommandWorldConverterRestore.java index baaa38f9..688bacdb 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/command/CraftEngineConverterCommandWorldConverterRestore.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/command/CraftEngineConverterCommandWorldConverterRestore.java @@ -31,6 +31,9 @@ import java.util.concurrent.atomic.AtomicInteger; public class CraftEngineConverterCommandWorldConverterRestore extends SubCommand { + /** Rows restored per scheduled tick. */ + private static final int PAGE_SIZE = 50; + private final MessageFormatter messageFormatter; public CraftEngineConverterCommandWorldConverterRestore(CraftEngineConverter plugin) { @@ -105,25 +108,50 @@ private void restoreBlock(Location location, BlockHistory history) { this.messageFormatter.sendMessage(Message.COMMAND__WORLD_CONVERTER__RESTORE__ALL__START, sender, builder.build()); - long startTime = System.currentTimeMillis(); - AtomicInteger restoredBlockCount = new AtomicInteger(0); - AtomicInteger restoredEntityCount = new AtomicInteger(0); - AtomicInteger totalBlockCount = new AtomicInteger(0); - AtomicInteger totalEntityCount = new AtomicInteger(0); + Progress progress = new Progress(System.currentTimeMillis()); + this.restoreBlockPage(sender, builder, progress, 0L); + + return CommandResultType.SUCCESS; + } + + /** Counters shared by the pages of one restore. */ + private record Progress(long startTime, AtomicInteger restoredBlocks, AtomicInteger restoredEntities, + AtomicInteger seenBlocks, AtomicInteger seenEntities) { - // Restore blocks - List allHistory = new ArrayList<>(serverProfile.getAllActiveConversions()); + private Progress(long startTime) { + this(startTime, new AtomicInteger(), new AtomicInteger(), new AtomicInteger(), new AtomicInteger()); + } + } - final int BATCH_SIZE = 50; + /** + * Restores one page of blocks and schedules the next. + *

+ * The pages are read as the restore goes rather than up front. Reading them all first meant holding every record + * in memory at once - on a world-sized conversion, more than the index it replaced - and scheduling one task per + * fifty rows before any work began, which for a million blocks is twenty thousand tasks queued in advance. + */ + private void restoreBlockPage(CommandSender sender, Placeholder.Builder builder, Progress progress, long afterId) { + StorageManager storage = this.plugin.getStorageManager(); + ServerProfile serverProfile = this.plugin.getServerProfile(); - for (int i = 0; i < allHistory.size(); i += BATCH_SIZE) { - final int end = Math.min(i + BATCH_SIZE, allHistory.size()); - final List batch = allHistory.subList(i, end); - final long tickDelay = i / BATCH_SIZE; + // Read off the main thread: a page per tick against a remote database would otherwise stall the server for + // a round trip every tick, for as long as the restore runs. + this.plugin.getFoliaCompatibilityManager().runAsync(() -> { + List page = storage.nextActiveBlockPage(afterId, PAGE_SIZE); + if (page.isEmpty()) { + this.restoreEntityPage(sender, builder, progress, 0L); + return; + } this.plugin.getFoliaCompatibilityManager().runLater(() -> { - for (BlockHistory history : batch) { - totalBlockCount.incrementAndGet(); + List restoredIds = new ArrayList<>(page.size()); + long lastId = afterId; + + for (BlockHistory history : page) { + progress.seenBlocks().incrementAndGet(); + if (history.getId() != null) { + lastId = history.getId(); + } World world = Bukkit.getWorld(history.getWorldName()); if (world == null) { @@ -135,46 +163,56 @@ private void restoreBlock(Location location, BlockHistory history) { chunk.load(); } - Location location = new Location( - world, - history.getBlockX(), - history.getBlockY(), - history.getBlockZ() - ); - + Location location = new Location(world, history.getBlockX(), history.getBlockY(), history.getBlockZ()); try { this.restoreBlock(location, history); - serverProfile.markBlockAsReverted(history); - restoredBlockCount.incrementAndGet(); + serverProfile.forgetBlock(history); + if (history.getId() != null) { + restoredIds.add(history.getId()); + } + progress.restoredBlocks().incrementAndGet(); } catch (Exception e) { Logger.error("Failed to restore block at " + location, e); } } - }, tickDelay); - } - List allEntityHistory = new ArrayList<>(serverProfile.getAllActiveEntityConversions()); + // A page that restored nothing would otherwise be read for ever, since nothing was marked reverted. + long nextId = lastId > afterId ? lastId : afterId + PAGE_SIZE; + this.plugin.getFoliaCompatibilityManager().runAsync(() -> { + storage.markBlocksAsReverted(restoredIds); + this.restoreBlockPage(sender, builder, progress, nextId); + }); + }, 1L); + }); + } + + private void restoreEntityPage(CommandSender sender, Placeholder.Builder builder, Progress progress, long afterId) { + StorageManager storage = this.plugin.getStorageManager(); + ServerProfile serverProfile = this.plugin.getServerProfile(); - for (int i = 0; i < allEntityHistory.size(); i += BATCH_SIZE) { - final int end = Math.min(i + BATCH_SIZE, allEntityHistory.size()); - final List batch = allEntityHistory.subList(i, end); - final long tickDelay = (allHistory.size() / BATCH_SIZE) + (i / BATCH_SIZE); + this.plugin.getFoliaCompatibilityManager().runAsync(() -> { + List page = storage.nextActiveEntityPage(afterId, PAGE_SIZE); + if (page.isEmpty()) { + this.plugin.getFoliaCompatibilityManager().runNextTick(() -> this.reportComplete(sender, builder, progress)); + return; + } this.plugin.getFoliaCompatibilityManager().runLater(() -> { - for (EntityHistory entityHistory : batch) { - totalEntityCount.incrementAndGet(); + List restoredIds = new ArrayList<>(page.size()); + long lastId = afterId; - Location location = entityHistory.getLocation(); - if (location == null) { - continue; + for (EntityHistory entityHistory : page) { + progress.seenEntities().incrementAndGet(); + if (entityHistory.getId() != null) { + lastId = entityHistory.getId(); } - World world = location.getWorld(); - if (world == null) { + Location location = entityHistory.getLocation(); + if (location == null || location.getWorld() == null) { continue; } - world.getNearbyEntities(location, 1, 1, 1).forEach(entity -> { + location.getWorld().getNearbyEntities(location, 1, 1, 1).forEach(entity -> { if (CraftEngineFurniture.isFurniture(entity)) { CraftEngineFurniture.remove(entity); } @@ -184,31 +222,35 @@ private void restoreBlock(Location location, BlockHistory history) { EntitySnapshot entitySnapshot = Bukkit.getEntityFactory().createEntitySnapshot(entityHistory.getNbt()); entitySnapshot.createEntity(location); - serverProfile.markEntityAsReverted(entityHistory); - restoredEntityCount.incrementAndGet(); + serverProfile.forgetEntity(entityHistory); + if (entityHistory.getId() != null) { + restoredIds.add(entityHistory.getId()); + } + progress.restoredEntities().incrementAndGet(); } catch (Exception e) { Logger.error("Failed to restore entity at " + location, e); } } - }, tickDelay); - } - - long totalDelayTicks = (long) Math.ceil((double) (allHistory.size() + allEntityHistory.size()) / BATCH_SIZE); - - this.plugin.getFoliaCompatibilityManager().runLater(() -> { - long endTime = System.currentTimeMillis(); - - builder.register("restored", String.valueOf(restoredBlockCount.get() + restoredEntityCount.get())) - .register("restored_blocks", String.valueOf(restoredBlockCount.get())) - .register("restored_entities", String.valueOf(restoredEntityCount.get())) - .register("total", String.valueOf(totalBlockCount.get() + totalEntityCount.get())) - .register("total_blocks", String.valueOf(totalBlockCount.get())) - .register("total_entities", String.valueOf(totalEntityCount.get())) - .register("time", TimerBuilder.formatTimeAuto(endTime - startTime)); - this.messageFormatter.sendMessage(Message.COMMAND__WORLD_CONVERTER__RESTORE__ALL__COMPLETE, sender, builder.build()); - }, totalDelayTicks + 1); + long nextId = lastId > afterId ? lastId : afterId + PAGE_SIZE; + this.plugin.getFoliaCompatibilityManager().runAsync(() -> { + storage.markEntitiesAsReverted(restoredIds); + this.restoreEntityPage(sender, builder, progress, nextId); + }); + }, 1L); + }); + } - return CommandResultType.SUCCESS; + private void reportComplete(CommandSender sender, Placeholder.Builder builder, Progress progress) { + long endTime = System.currentTimeMillis(); + + builder.register("restored", String.valueOf(progress.restoredBlocks().get() + progress.restoredEntities().get())) + .register("restored_blocks", String.valueOf(progress.restoredBlocks().get())) + .register("restored_entities", String.valueOf(progress.restoredEntities().get())) + .register("total", String.valueOf(progress.seenBlocks().get() + progress.seenEntities().get())) + .register("total_blocks", String.valueOf(progress.seenBlocks().get())) + .register("total_entities", String.valueOf(progress.seenEntities().get())) + .register("time", TimerBuilder.formatTimeAuto(endTime - progress.startTime())); + this.messageFormatter.sendMessage(Message.COMMAND__WORLD_CONVERTER__RESTORE__ALL__COMPLETE, sender, builder.build()); } -} +} \ No newline at end of file diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/database/DataBaseManager.java b/Plugin/src/main/java/fr/robie/craftengineconverter/database/DataBaseManager.java index 3728431b..5b97ecb1 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/database/DataBaseManager.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/database/DataBaseManager.java @@ -297,6 +297,80 @@ private void stream(String sql, RowReader reader) { } } + @Override + public @NotNull List nextActiveBlockPage(long afterId, int limit) { + List page = new java.util.ArrayList<>(Math.min(limit, MAX_BATCH_SIZE)); + this.page(BLOCK_TABLE, "id, world_name, chunk_x, chunk_z, block_x, block_y, block_z, original_block", + afterId, limit, resultSet -> page.add(new BlockHistory( + resultSet.getLong(1), resultSet.getString(2), + resultSet.getInt(3), resultSet.getInt(4), + resultSet.getInt(5), resultSet.getInt(6), resultSet.getInt(7), + resultSet.getString(8), false))); + return page; + } + + @Override + public @NotNull List nextActiveEntityPage(long afterId, int limit) { + List page = new java.util.ArrayList<>(Math.min(limit, MAX_BATCH_SIZE)); + this.page(ENTITY_TABLE, "id, location, nbt", afterId, limit, + resultSet -> page.add(new EntityHistory( + resultSet.getLong(1), resultSet.getString(2), resultSet.getString(3), false))); + return page; + } + + private void page(String table, String columns, long afterId, int limit, RowReader reader) { + if (!this.isEnabled) { + return; + } + + String sql = "SELECT " + columns + " FROM " + table + + " WHERE reverted = ? AND id > ? ORDER BY id LIMIT " + Math.max(1, limit); + try (java.sql.PreparedStatement statement = this.requestHelper.getConnection().getConnection().prepareStatement(sql)) { + statement.setBoolean(1, false); + statement.setLong(2, afterId); + try (java.sql.ResultSet resultSet = statement.executeQuery()) { + while (resultSet.next()) { + reader.read(resultSet); + } + } + } catch (Exception e) { + fr.robie.messageflow.logger.Logger.error("Failed to read a page of active conversions from " + table, e); + } + } + + @Override + public void markBlocksAsReverted(@NotNull java.util.Collection ids) { + this.markPageAsReverted(BLOCK_TABLE, ids); + } + + @Override + public void markEntitiesAsReverted(@NotNull java.util.Collection ids) { + this.markPageAsReverted(ENTITY_TABLE, ids); + } + + /** One statement for a whole page, rather than the round trip per row this replaces. */ + private void markPageAsReverted(String table, java.util.Collection ids) { + if (!this.isEnabled || ids.isEmpty()) { + return; + } + + StringBuilder sql = new StringBuilder("UPDATE ").append(table).append(" SET reverted = ? WHERE id IN ("); + sql.append("?,".repeat(ids.size())); + sql.setLength(sql.length() - 1); + sql.append(')'); + + try (java.sql.PreparedStatement statement = this.requestHelper.getConnection().getConnection().prepareStatement(sql.toString())) { + statement.setBoolean(1, true); + int index = 2; + for (Long id : ids) { + statement.setLong(index++, id); + } + statement.executeUpdate(); + } catch (Exception e) { + fr.robie.messageflow.logger.Logger.error("Failed to mark a page of conversions as reverted in " + table, e); + } + } + @Override public void markAllBlocksAsReverted() { this.execute("UPDATE " + BLOCK_TABLE + " SET reverted = ? WHERE reverted = ?"); diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/database/ServerProfileManager.java b/Plugin/src/main/java/fr/robie/craftengineconverter/database/ServerProfileManager.java index dac106f9..98857f35 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/database/ServerProfileManager.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/database/ServerProfileManager.java @@ -9,7 +9,6 @@ import org.jetbrains.annotations.NotNull; import org.jspecify.annotations.NonNull; -import java.util.Collection; import java.util.Map; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; @@ -145,31 +144,30 @@ public void clearBlockHistory() { @Override public void markBlockAsReverted(@NonNull BlockHistory history) { - LongOpenHashSet positions = this.convertedBlocksByWorld.get(history.getWorldName()); - if (positions != null) { - synchronized (positions) { - positions.remove(pack(history.getBlockX(), history.getBlockY(), history.getBlockZ())); - } - } + this.forgetBlock(history); this.storageManager.markBlockAsReverted(history); } @Override public void markEntityAsReverted(@NotNull EntityHistory history) { - this.convertedEntities.remove(history.getLocationString()); + this.forgetEntity(history); this.storageManager.markEntityAsReverted(history); } - /** - * Reads the records back from the database, because the index does not keep them. - */ @Override - public @NonNull Collection getAllActiveConversions() { - return this.storageManager.getAllActiveConversions(); + public void forgetBlock(@NotNull BlockHistory history) { + LongOpenHashSet positions = this.convertedBlocksByWorld.get(history.getWorldName()); + if (positions == null) { + return; + } + synchronized (positions) { + positions.remove(pack(history.getBlockX(), history.getBlockY(), history.getBlockZ())); + } } @Override - public @NotNull Collection getAllActiveEntityConversions() { - return this.storageManager.getAllActiveEntityConversions(); + public void forgetEntity(@NotNull EntityHistory history) { + this.convertedEntities.remove(history.getLocationString()); } + } From beece4a952fac6fdacbeea47cdcb746e8f380f07 Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Mon, 24 Aug 2026 12:33:43 +0200 Subject: [PATCH 106/116] perf(database): pack the processed-chunk set Chunks already scanned were remembered as a record per chunk, each carrying a world-name reference and an object header to hold two ints, in a set nothing ever evicts. A server up long enough to walk a million chunks paid tens of megabytes for a list of "already looked at this". They are packed x and z into one long per world now, the same shape the converted-block index uses. ChunkPosition had no other caller and goes with it. --- .../common/records/ChunkPosition.java | 20 --------- .../listener/WorldConverterManager.java | 41 +++++++++++++++---- 2 files changed, 33 insertions(+), 28 deletions(-) delete mode 100644 Common/src/main/java/fr/robie/craftengineconverter/common/records/ChunkPosition.java diff --git a/Common/src/main/java/fr/robie/craftengineconverter/common/records/ChunkPosition.java b/Common/src/main/java/fr/robie/craftengineconverter/common/records/ChunkPosition.java deleted file mode 100644 index 9ac9839e..00000000 --- a/Common/src/main/java/fr/robie/craftengineconverter/common/records/ChunkPosition.java +++ /dev/null @@ -1,20 +0,0 @@ -package fr.robie.craftengineconverter.common.records; - -public record ChunkPosition(String worldName, int x, int z) { - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || this.getClass() != o.getClass()) { - return false; - } - ChunkPosition that = (ChunkPosition) o; - return this.x == that.x && this.z == that.z && this.worldName.equals(that.worldName); - } - - @Override - public int hashCode() { - return this.worldName.hashCode() * 31 * 31 + this.x * 31 + this.z; - } -} \ No newline at end of file diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/listener/WorldConverterManager.java b/Plugin/src/main/java/fr/robie/craftengineconverter/listener/WorldConverterManager.java index e8a20734..50c38ac1 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/listener/WorldConverterManager.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/listener/WorldConverterManager.java @@ -11,7 +11,7 @@ import fr.robie.craftengineconverter.common.BlockStatesMapper; import fr.robie.craftengineconverter.common.CraftEnginePlacementTracker; import fr.robie.craftengineconverter.common.converter.WorldConverter; -import fr.robie.craftengineconverter.common.records.ChunkPosition; +import it.unimi.dsi.fastutil.longs.LongOpenHashSet; import fr.robie.messageflow.logger.Logger; import net.momirealms.craftengine.bukkit.api.CraftEngineBlocks; import org.bukkit.*; @@ -29,10 +29,18 @@ import java.util.*; import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ConcurrentHashMap; public class WorldConverterManager implements Listener { private final Set converters = new HashSet<>(); - private final Set processedChunks = new HashSet<>(); + /** + * Chunks already scanned this session, packed as x and z into one long per world. + *

+ * A record per chunk carried a world-name reference and its own object header for two numbers, and nothing ever + * evicts them - a server that stays up long enough to walk a million chunks paid tens of megabytes for a set of + * "already looked at this". Two ints fit in a long exactly. + */ + private final Map processedChunksByWorld = new ConcurrentHashMap<>(); private final CraftEnginePlacementTracker placementTracker; private final FoliaCompatibilityManager foliaCompatibilityManager; private final List> conversionTasks = new ArrayList<>(); @@ -57,14 +65,12 @@ private void processChunk(@NotNull Chunk chunk, @Nullable BukkitProgressBar prog int z = chunk.getZ(); World world = chunk.getWorld(); String worldName = world.getName(); - ChunkPosition position = new ChunkPosition(worldName, x, z); - if (this.processedChunks.contains(position) || !chunk.isLoaded()) { + if (this.alreadyProcessed(worldName, x, z) || !chunk.isLoaded()) { if (progressBar != null) { progressBar.increment(); } return; } - this.processedChunks.add(position); @NotNull Entity[] entities = chunk.getEntities(); List entityHistories = new ArrayList<>(); @@ -191,7 +197,7 @@ record BlockConversion(Location location, String ceEquivalent, String originalBl progressBar.increment(); } if (ex != null) { - Logger.error("[WorldConverterManager] Error during chunk conversion at " + position, ex); + Logger.error("[WorldConverterManager] Error during chunk conversion at " + worldName + " " + x + "," + z, ex); } }); } @@ -235,15 +241,34 @@ public void registerConverter(WorldConverter converter) { this.converters.add(converter); } + /** + * Whether this chunk has been scanned before, marking it scanned if not. + * + * @return true when it had already been seen + */ + private boolean alreadyProcessed(String worldName, int chunkX, int chunkZ) { + LongOpenHashSet processed = this.processedChunksByWorld.computeIfAbsent(worldName, world -> new LongOpenHashSet()); + long key = ((long) chunkX << 32) | (chunkZ & 0xFFFFFFFFL); + synchronized (processed) { + return !processed.add(key); + } + } + public void clearProcessedChunks() { - this.processedChunks.clear(); + this.processedChunksByWorld.clear(); } /** * Get the number of processed chunks */ public int getProcessedChunksCount() { - return this.processedChunks.size(); + int total = 0; + for (LongOpenHashSet processed : this.processedChunksByWorld.values()) { + synchronized (processed) { + total += processed.size(); + } + } + return total; } /** From 8ddc9686960c0796117044623e29134b9859d055 Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Mon, 24 Aug 2026 12:45:34 +0200 Subject: [PATCH 107/116] fix: three shared-state and retention problems outside the database A sweep over the rest of the plugin for the same shapes the database work turned up: state shared across threads without saying so, and things held in memory after they were finished with. WorldConverterManager kept its in-flight conversions in an ArrayList. Chunks are scanned on their region's thread and each conversion removes itself from a completion callback on whichever thread finished it, while the status and shutdown paths walk the list - three-way concurrent access on a collection that supports none. It is a concurrent set now, which also makes the per-completion removal O(1) rather than a scan. SimpleCache was a bare HashMap behind a static field. Its one user maps image names for chat formatting and placeholders: filled by a conversion on its own thread, read from whichever thread is rendering a message. It is a ConcurrentHashMap now, and tolerates the null keys that a ConcurrentHashMap would otherwise throw on, since the keys come from whatever text a player sent. ConversionContext kept every icon it rendered as a decoded raster for the length of a conversion - roughly sixteen kilobytes each at the default size and sixteen times that at the largest, for images that have already been written to disk. They cannot be dropped after their first reader, because several items can share one, so they are kept as encoded PNG instead: a tenth of the size, and the form they get written in anyway, so assigning one is now a byte copy rather than a re-encode. --- .../api/cache/SimpleCache.java | 28 ++++++++++++++----- .../converter/bedrock/ConversionContext.java | 22 ++++++++++++--- .../listener/WorldConverterManager.java | 9 +++++- 3 files changed, 47 insertions(+), 12 deletions(-) diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/cache/SimpleCache.java b/API/src/main/java/fr/robie/craftengineconverter/api/cache/SimpleCache.java index 295c6d81..78445891 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/cache/SimpleCache.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/cache/SimpleCache.java @@ -1,25 +1,39 @@ package fr.robie.craftengineconverter.api.cache; -import java.util.HashMap; import java.util.Map; - +import java.util.concurrent.ConcurrentHashMap; + +/** + * A small keep-forever cache, safe to read while it is being written. + * + *

Its one user is filled by a conversion running on its own thread and read by chat formatting and placeholder + * resolution on whichever thread asks - so a plain map was being written and read at the same time, which costs + * either a stale answer or a corrupted table. Null keys and values are ignored rather than throwing, since the keys + * come from whatever text a player happened to send. + */ public class SimpleCache { - private final Map cache = new HashMap<>(); + private final Map cache = new ConcurrentHashMap<>(); public V get(K key) { - return this.cache.get(key); + return key == null ? null : this.cache.get(key); } public V getOrDefault(K key, Loader loader) { - return this.cache.computeIfAbsent(key, (k) -> loader.load()); + if (key == null) { + return loader.load(); + } + return this.cache.computeIfAbsent(key, k -> loader.load()); } public void put(K key, V value) { + if (key == null || value == null) { + return; + } this.cache.put(key, value); } public boolean containsKey(K key) { - return this.cache.containsKey(key); + return key != null && this.cache.containsKey(key); } public interface Loader { @@ -29,4 +43,4 @@ public interface Loader { public void clear() { this.cache.clear(); } -} \ No newline at end of file +} diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/ConversionContext.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/ConversionContext.java index 7b20c8c5..13a6d00e 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/ConversionContext.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/ConversionContext.java @@ -72,7 +72,7 @@ public class ConversionContext { private final fr.robie.craftengineconverter.converter.bedrock.geometry.JavaModelResolver javaModelResolver = new fr.robie.craftengineconverter.converter.bedrock.geometry.JavaModelResolver(); // Icons drawn from a 3D model, by texture id. See registerRenderedIcon. - private final Map renderedIcons = new HashMap<>(); + private final Map renderedIcons = new HashMap<>(); // Areas to tint, by pack-relative texture path. See registerTintRegions. private final Map> tintRegions = new java.util.LinkedHashMap<>(); @@ -274,7 +274,7 @@ private void assignIcon(ItemMapping mapping) { if (firstTd.getTextures().isEmpty()) return; String firstTex = firstTd.getTextures().getFirst(); - java.awt.image.BufferedImage rendered = this.renderedIcons.get(iconKey(firstTd.getBedrockIdentifier())); + byte[] rendered = this.renderedIcons.get(iconKey(firstTd.getBedrockIdentifier())); // A rendered icon is named after the item, not its texture. Several items can share one texture and still // have different models — sofa, sofa_inner and sleeper_sofa all use item/custom/sofa — so deriving the @@ -295,7 +295,7 @@ private void assignIcon(ItemMapping mapping) { java.nio.file.Files.createDirectories(dstPng.getParent()); if (rendered != null) { - javax.imageio.ImageIO.write(rendered, "png", dstPng.toFile()); + java.nio.file.Files.write(dstPng, rendered); } else { Path srcPng = this.texturesDir.resolve(firstTex.substring("textures/".length()) + ".png"); java.nio.file.Files.copy(srcPng, dstPng, java.nio.file.StandardCopyOption.REPLACE_EXISTING); @@ -413,9 +413,23 @@ public void reportTrimmedIcons() { + " worn overlay is per pattern"); } + /** + * Keeps a rendered icon until the mapping that needs it is added, as encoded PNG rather than as pixels. + *

+ * Every icon rendered during a conversion stays here - several items can share one, so an entry cannot be + * dropped after its first reader - and a raster is around sixteen kilobytes at the default size, sixteen times + * that at the largest. Encoded, the same icon is one or two, and it is the form it gets written in anyway. + */ public void registerRenderedIcon(String textureId, java.awt.image.BufferedImage icon) { if (textureId == null || icon == null) return; - this.renderedIcons.put(iconKey(textureId), icon); + + try (java.io.ByteArrayOutputStream encoded = new java.io.ByteArrayOutputStream()) { + javax.imageio.ImageIO.write(icon, "png", encoded); + this.renderedIcons.put(iconKey(textureId), encoded.toByteArray()); + } catch (Exception e) { + fr.robie.messageflow.logger.Logger.warn("Could not encode a rendered icon for " + textureId + + ": " + e.getMessage()); + } } /** diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/listener/WorldConverterManager.java b/Plugin/src/main/java/fr/robie/craftengineconverter/listener/WorldConverterManager.java index 50c38ac1..81ec63af 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/listener/WorldConverterManager.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/listener/WorldConverterManager.java @@ -43,7 +43,14 @@ public class WorldConverterManager implements Listener { private final Map processedChunksByWorld = new ConcurrentHashMap<>(); private final CraftEnginePlacementTracker placementTracker; private final FoliaCompatibilityManager foliaCompatibilityManager; - private final List> conversionTasks = new ArrayList<>(); + /** + * Conversions still running, added as a chunk starts one and removed as it finishes. + *

+ * Those two happen on different threads - a chunk is scanned on its region's thread, while the completion + * callback runs on whichever thread finished the last batch - and the set is iterated by the status and + * shutdown paths at the same time. An ArrayList corrupts under that, or throws part way through a walk. + */ + private final Set> conversionTasks = ConcurrentHashMap.newKeySet(); private final StorageManager storageManager; private final ServerProfile serverProfile; From 8e39de38aaec2ab6bb68faf2dc0e0d09d8bcd924 Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Mon, 24 Aug 2026 13:13:26 +0200 Subject: [PATCH 108/116] test(database): run the conversion-history SQL against a real database The queries added for the memory work were written by hand rather than built by the ORM, so nothing checked them: a mistyped column, a paging clause that skips rows and a boolean a driver spells differently all compile the same. They only run at startup and during a restore, which is the worst place to find out. They move to ConversionHistoryQueries, which takes a connection instead of a plugin, and run against a real SQLite database - the storage the plugin ships with by default. The paging test does exactly what the restore does, reading a page and reverting it before asking for the next, and checks that all 250 rows are visited exactly once and none survives; another checks the walk still moves on past a page it could not revert, which is the case that would otherwise loop for ever. The block index came out of ServerProfileManager for the same reason, so one test can carry rows from the database through the real queries into the real index and assert what comes out - which is the only thing that shows those four columns arrive in the order the index reads them. IconEncodingTest pins the other assumption from that work: that encoding an icon once and writing the bytes later produces the same PNG as encoding it at the point of writing. --- .../database/ConversionHistoryQueries.java | 171 +++++++++++ .../database/ConvertedBlockIndex.java | 88 ++++++ .../database/DataBaseManager.java | 127 ++------ .../database/ServerProfileManager.java | 94 +----- .../IconEncodingTest.java | 90 ++++++ .../database/BlockPositionPackingTest.java | 26 +- .../ConversionHistoryQueriesTest.java | 278 ++++++++++++++++++ 7 files changed, 674 insertions(+), 200 deletions(-) create mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/database/ConversionHistoryQueries.java create mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/database/ConvertedBlockIndex.java create mode 100644 Plugin/src/test/java/fr/robie/craftengineconverter/IconEncodingTest.java create mode 100644 Plugin/src/test/java/fr/robie/craftengineconverter/database/ConversionHistoryQueriesTest.java diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/database/ConversionHistoryQueries.java b/Plugin/src/main/java/fr/robie/craftengineconverter/database/ConversionHistoryQueries.java new file mode 100644 index 00000000..b74a1faa --- /dev/null +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/database/ConversionHistoryQueries.java @@ -0,0 +1,171 @@ +package fr.robie.craftengineconverter.database; + +import fr.robie.craftengineconverter.api.database.ActiveConversionReader; +import fr.robie.craftengineconverter.api.history.BlockHistory; +import fr.robie.craftengineconverter.api.history.EntityHistory; +import fr.robie.messageflow.logger.Logger; +import org.jetbrains.annotations.NotNull; + +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.function.Consumer; +import java.util.function.Supplier; + +/** + * The hand-written SQL behind the conversion history. + * + *

Separate from {@link DataBaseManager} because it is the part no compiler checks: a mistyped column, a paging + * clause that skips rows, a dialect that spells something differently. Taking a connection rather than a plugin is + * what lets it be run against a real database in a test. + */ +public class ConversionHistoryQueries implements ActiveConversionReader { + public static final String BLOCK_TABLE = "world_block_converter_historical"; + public static final String ENTITY_TABLE = "world_entity_converter_historical"; + + /** Rows the driver keeps in flight while streaming; a cursor, not a buffer of the whole result. */ + private static final int STREAM_FETCH_SIZE = 1_000; + + private final Supplier connections; + + public ConversionHistoryQueries(@NotNull Supplier connections) { + this.connections = connections; + } + + /** + * Reads straight over the JDBC cursor rather than through the ORM. + *

+ * Sarah's select builds a list of every matching row before returning, which for the startup index means holding + * millions of records at once purely to read four numbers out of each. Streaming keeps one row in flight. + */ + @Override + public void forEachActiveBlockPosition(@NotNull BlockPositionConsumer consumer) { + this.stream("SELECT world_name, block_x, block_y, block_z FROM " + BLOCK_TABLE + " WHERE reverted = ?", + row -> consumer.accept(row.getString(1), row.getInt(2), row.getInt(3), row.getInt(4))); + } + + @Override + public void forEachActiveEntityLocation(@NotNull Consumer consumer) { + this.stream("SELECT location FROM " + ENTITY_TABLE + " WHERE reverted = ?", + row -> consumer.accept(row.getString(1))); + } + + /** + * The next page of block conversions still in effect, ordered by id and starting after {@code afterId}. + *

+ * Paging by id rather than by offset is what keeps the walk correct while it marks rows reverted underneath + * itself: with an OFFSET, every page already passed would shift and the walk would skip rows. + */ + @NotNull + public List nextActiveBlockPage(long afterId, int limit) { + List page = new ArrayList<>(); + this.page(BLOCK_TABLE, "id, world_name, chunk_x, chunk_z, block_x, block_y, block_z, original_block", + afterId, limit, row -> page.add(new BlockHistory( + row.getLong(1), row.getString(2), + row.getInt(3), row.getInt(4), + row.getInt(5), row.getInt(6), row.getInt(7), + row.getString(8), false))); + return page; + } + + @NotNull + public List nextActiveEntityPage(long afterId, int limit) { + List page = new ArrayList<>(); + this.page(ENTITY_TABLE, "id, location, nbt", afterId, limit, + row -> page.add(new EntityHistory(row.getLong(1), row.getString(2), row.getString(3), false))); + return page; + } + + /** Marks the given block conversions reverted in one statement, rather than a round trip per row. */ + public void markBlocksAsReverted(@NotNull Collection ids) { + this.markAsReverted(BLOCK_TABLE, ids); + } + + public void markEntitiesAsReverted(@NotNull Collection ids) { + this.markAsReverted(ENTITY_TABLE, ids); + } + + public void markAllBlocksAsReverted() { + this.markAllAsReverted(BLOCK_TABLE); + } + + public void markAllEntitiesAsReverted() { + this.markAllAsReverted(ENTITY_TABLE); + } + + // --- plumbing --------------------------------------------------------------------------------------------- + + @FunctionalInterface + private interface RowReader { + + void read(ResultSet row) throws SQLException; + } + + private void stream(String sql, RowReader reader) { + try (PreparedStatement statement = this.connections.get() + .prepareStatement(sql, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY)) { + statement.setBoolean(1, false); + statement.setFetchSize(STREAM_FETCH_SIZE); + try (ResultSet rows = statement.executeQuery()) { + while (rows.next()) { + reader.read(rows); + } + } + } catch (Exception e) { + Logger.error("Failed to read active conversions", e); + } + } + + private void page(String table, String columns, long afterId, int limit, RowReader reader) { + String sql = "SELECT " + columns + " FROM " + table + + " WHERE reverted = ? AND id > ? ORDER BY id LIMIT " + Math.max(1, limit); + try (PreparedStatement statement = this.connections.get().prepareStatement(sql)) { + statement.setBoolean(1, false); + statement.setLong(2, afterId); + try (ResultSet rows = statement.executeQuery()) { + while (rows.next()) { + reader.read(rows); + } + } + } catch (Exception e) { + Logger.error("Failed to read a page of active conversions from " + table, e); + } + } + + private void markAsReverted(String table, Collection ids) { + if (ids.isEmpty()) { + return; + } + + StringBuilder sql = new StringBuilder("UPDATE ").append(table).append(" SET reverted = ? WHERE id IN ("); + sql.append("?,".repeat(ids.size())); + sql.setLength(sql.length() - 1); + sql.append(')'); + + try (PreparedStatement statement = this.connections.get().prepareStatement(sql.toString())) { + statement.setBoolean(1, true); + int index = 2; + for (Long id : ids) { + statement.setLong(index++, id); + } + statement.executeUpdate(); + } catch (Exception e) { + Logger.error("Failed to mark a page of conversions as reverted in " + table, e); + } + } + + private void markAllAsReverted(String table) { + try (PreparedStatement statement = this.connections.get() + .prepareStatement("UPDATE " + table + " SET reverted = ? WHERE reverted = ?")) { + statement.setBoolean(1, true); + statement.setBoolean(2, false); + statement.executeUpdate(); + } catch (Exception e) { + Logger.error("Failed to mark every conversion in " + table + " as reverted", e); + } + } +} diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/database/ConvertedBlockIndex.java b/Plugin/src/main/java/fr/robie/craftengineconverter/database/ConvertedBlockIndex.java new file mode 100644 index 00000000..b4d0c643 --- /dev/null +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/database/ConvertedBlockIndex.java @@ -0,0 +1,88 @@ +package fr.robie.craftengineconverter.database; + +import fr.robie.craftengineconverter.api.database.ActiveConversionReader; +import it.unimi.dsi.fastutil.longs.LongOpenHashSet; +import org.jetbrains.annotations.NotNull; + +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +/** + * Which blocks are currently converted, as positions rather than records. + * + *

It answers one question - has this been converted? - which is asked once per candidate block of every chunk + * that loads, so it has to be in memory. What does not have to be in memory is everything else about a conversion: + * holding the records cost around 375 bytes a block, most of it the block state string and a per-row copy of the + * world name, which put a world-sized conversion near two gigabytes of heap. A packed position is a tenth of that, + * and the record behind one is only wanted when something is restored, which reads it back from the database. + * + *

Positions are packed the way Minecraft packs a BlockPos: 26 bits of x, 12 of y, 26 of z. That covers every + * coordinate inside the world border and every height a world can have. + */ +public class ConvertedBlockIndex { + private static final int PACKED_X_BITS = 26; + private static final int PACKED_Z_BITS = 26; + private static final int PACKED_Y_BITS = 64 - PACKED_X_BITS - PACKED_Z_BITS; + private static final long PACKED_X_MASK = (1L << PACKED_X_BITS) - 1; + private static final long PACKED_Y_MASK = (1L << PACKED_Y_BITS) - 1; + private static final long PACKED_Z_MASK = (1L << PACKED_Z_BITS) - 1; + + /** + * One set per world, each guarded by itself. LongOpenHashSet is not thread safe and both chunk loading and + * interaction conversion touch it; locking per world rather than globally keeps worlds off each other's backs, + * and every critical section here is a single hash lookup. + */ + private final Map positionsByWorld = new ConcurrentHashMap<>(); + + static long pack(int blockX, int blockY, int blockZ) { + return ((blockX & PACKED_X_MASK) << (PACKED_Y_BITS + PACKED_Z_BITS)) + | ((blockY & PACKED_Y_MASK) << PACKED_Z_BITS) + | (blockZ & PACKED_Z_MASK); + } + + /** Fills the index from storage, one row at a time, keeping only each row's position. */ + public void loadFrom(@NotNull ActiveConversionReader reader) { + reader.forEachActiveBlockPosition(this::add); + } + + public void add(@NotNull String worldName, int blockX, int blockY, int blockZ) { + LongOpenHashSet positions = this.positionsByWorld.computeIfAbsent(worldName, world -> new LongOpenHashSet()); + synchronized (positions) { + positions.add(pack(blockX, blockY, blockZ)); + } + } + + public boolean contains(@NotNull String worldName, int blockX, int blockY, int blockZ) { + LongOpenHashSet positions = this.positionsByWorld.get(worldName); + if (positions == null) { + return false; + } + synchronized (positions) { + return positions.contains(pack(blockX, blockY, blockZ)); + } + } + + public void remove(@NotNull String worldName, int blockX, int blockY, int blockZ) { + LongOpenHashSet positions = this.positionsByWorld.get(worldName); + if (positions == null) { + return; + } + synchronized (positions) { + positions.remove(pack(blockX, blockY, blockZ)); + } + } + + public int size() { + int total = 0; + for (LongOpenHashSet positions : this.positionsByWorld.values()) { + synchronized (positions) { + total += positions.size(); + } + } + return total; + } + + public void clear() { + this.positionsByWorld.clear(); + } +} diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/database/DataBaseManager.java b/Plugin/src/main/java/fr/robie/craftengineconverter/database/DataBaseManager.java index 5b97ecb1..7e201b3c 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/database/DataBaseManager.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/database/DataBaseManager.java @@ -31,8 +31,6 @@ public class DataBaseManager implements StorageManager { private final Map, TypedCache> caches = new ConcurrentHashMap<>(); - /** Rows the driver keeps in flight while streaming; a cursor, not a buffer of the whole result. */ - private static final int STREAM_FETCH_SIZE = 1_000; private static final int MAX_BATCH_SIZE = 250; // Max rows per INSERT private static final long SAVE_INTERVAL_TICKS = 1200L; // 1 minute; only a floor, overflow drains sooner /** Ceiling on one save cycle, so a large backlog cannot monopolise the connection in a single pass. */ @@ -247,23 +245,17 @@ public void markEntityAsReverted(@NotNull EntityHistory entityHistory) { }); } - private static final String BLOCK_TABLE = "world_block_converter_historical"; - private static final String ENTITY_TABLE = "world_entity_converter_historical"; + /** Delegated so the raw SQL can be exercised against a real database without a plugin around it. */ + private ConversionHistoryQueries queries() { + return new ConversionHistoryQueries(() -> this.requestHelper.getConnection().getConnection()); + } - /** - * Reads straight over the JDBC cursor rather than through the ORM. - *

- * Sarah's select builds a list of every matching row before returning, which for the startup index means holding - * millions of records at once purely to read four numbers out of each. Streaming keeps one row in flight. - */ @Override public void forEachActiveBlockPosition(@NotNull BlockPositionConsumer consumer) { if (!this.isEnabled) { return; } - - this.stream("SELECT world_name, block_x, block_y, block_z FROM " + BLOCK_TABLE + " WHERE reverted = ?", - resultSet -> consumer.accept(resultSet.getString(1), resultSet.getInt(2), resultSet.getInt(3), resultSet.getInt(4))); + this.queries().forEachActiveBlockPosition(consumer); } @Override @@ -271,127 +263,44 @@ public void forEachActiveEntityLocation(@NotNull java.util.function.Consumer consumer.accept(resultSet.getString(1))); - } - - @FunctionalInterface - private interface RowReader { - - void read(java.sql.ResultSet resultSet) throws java.sql.SQLException; - } - - private void stream(String sql, RowReader reader) { - try (java.sql.PreparedStatement statement = this.requestHelper.getConnection().getConnection() - .prepareStatement(sql, java.sql.ResultSet.TYPE_FORWARD_ONLY, java.sql.ResultSet.CONCUR_READ_ONLY)) { - statement.setBoolean(1, false); - statement.setFetchSize(STREAM_FETCH_SIZE); - try (java.sql.ResultSet resultSet = statement.executeQuery()) { - while (resultSet.next()) { - reader.read(resultSet); - } - } - } catch (Exception e) { - fr.robie.messageflow.logger.Logger.error("Failed to read active conversions", e); - } + this.queries().forEachActiveEntityLocation(consumer); } @Override public @NotNull List nextActiveBlockPage(long afterId, int limit) { - List page = new java.util.ArrayList<>(Math.min(limit, MAX_BATCH_SIZE)); - this.page(BLOCK_TABLE, "id, world_name, chunk_x, chunk_z, block_x, block_y, block_z, original_block", - afterId, limit, resultSet -> page.add(new BlockHistory( - resultSet.getLong(1), resultSet.getString(2), - resultSet.getInt(3), resultSet.getInt(4), - resultSet.getInt(5), resultSet.getInt(6), resultSet.getInt(7), - resultSet.getString(8), false))); - return page; + return this.isEnabled ? this.queries().nextActiveBlockPage(afterId, limit) : List.of(); } @Override public @NotNull List nextActiveEntityPage(long afterId, int limit) { - List page = new java.util.ArrayList<>(Math.min(limit, MAX_BATCH_SIZE)); - this.page(ENTITY_TABLE, "id, location, nbt", afterId, limit, - resultSet -> page.add(new EntityHistory( - resultSet.getLong(1), resultSet.getString(2), resultSet.getString(3), false))); - return page; - } - - private void page(String table, String columns, long afterId, int limit, RowReader reader) { - if (!this.isEnabled) { - return; - } - - String sql = "SELECT " + columns + " FROM " + table - + " WHERE reverted = ? AND id > ? ORDER BY id LIMIT " + Math.max(1, limit); - try (java.sql.PreparedStatement statement = this.requestHelper.getConnection().getConnection().prepareStatement(sql)) { - statement.setBoolean(1, false); - statement.setLong(2, afterId); - try (java.sql.ResultSet resultSet = statement.executeQuery()) { - while (resultSet.next()) { - reader.read(resultSet); - } - } - } catch (Exception e) { - fr.robie.messageflow.logger.Logger.error("Failed to read a page of active conversions from " + table, e); - } + return this.isEnabled ? this.queries().nextActiveEntityPage(afterId, limit) : List.of(); } @Override public void markBlocksAsReverted(@NotNull java.util.Collection ids) { - this.markPageAsReverted(BLOCK_TABLE, ids); + if (this.isEnabled) { + this.queries().markBlocksAsReverted(ids); + } } @Override public void markEntitiesAsReverted(@NotNull java.util.Collection ids) { - this.markPageAsReverted(ENTITY_TABLE, ids); - } - - /** One statement for a whole page, rather than the round trip per row this replaces. */ - private void markPageAsReverted(String table, java.util.Collection ids) { - if (!this.isEnabled || ids.isEmpty()) { - return; - } - - StringBuilder sql = new StringBuilder("UPDATE ").append(table).append(" SET reverted = ? WHERE id IN ("); - sql.append("?,".repeat(ids.size())); - sql.setLength(sql.length() - 1); - sql.append(')'); - - try (java.sql.PreparedStatement statement = this.requestHelper.getConnection().getConnection().prepareStatement(sql.toString())) { - statement.setBoolean(1, true); - int index = 2; - for (Long id : ids) { - statement.setLong(index++, id); - } - statement.executeUpdate(); - } catch (Exception e) { - fr.robie.messageflow.logger.Logger.error("Failed to mark a page of conversions as reverted in " + table, e); + if (this.isEnabled) { + this.queries().markEntitiesAsReverted(ids); } } @Override public void markAllBlocksAsReverted() { - this.execute("UPDATE " + BLOCK_TABLE + " SET reverted = ? WHERE reverted = ?"); + if (this.isEnabled) { + this.queries().markAllBlocksAsReverted(); + } } @Override public void markAllEntitiesAsReverted() { - this.execute("UPDATE " + ENTITY_TABLE + " SET reverted = ? WHERE reverted = ?"); - } - - private void execute(String sql) { - if (!this.isEnabled) { - return; - } - - try (java.sql.PreparedStatement statement = this.requestHelper.getConnection().getConnection().prepareStatement(sql)) { - statement.setBoolean(1, true); - statement.setBoolean(2, false); - statement.executeUpdate(); - } catch (Exception e) { - fr.robie.messageflow.logger.Logger.error("Failed to mark conversions as reverted", e); + if (this.isEnabled) { + this.queries().markAllEntitiesAsReverted(); } } diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/database/ServerProfileManager.java b/Plugin/src/main/java/fr/robie/craftengineconverter/database/ServerProfileManager.java index 98857f35..f9eed635 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/database/ServerProfileManager.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/database/ServerProfileManager.java @@ -5,11 +5,9 @@ import fr.robie.craftengineconverter.api.history.BlockHistory; import fr.robie.craftengineconverter.api.history.EntityHistory; import fr.robie.craftengineconverter.api.profile.ServerProfile; -import it.unimi.dsi.fastutil.longs.LongOpenHashSet; import org.jetbrains.annotations.NotNull; import org.jspecify.annotations.NonNull; -import java.util.Map; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; @@ -17,81 +15,39 @@ * Remembers which blocks and entities are currently converted, so a chunk being scanned does not have to ask the * database once per candidate block. * - *

It holds positions, not records. The index answers one question - has this been converted? - and the record that - * goes with a position is only wanted when something is being restored, which is rare and can read it back from the - * database. Keeping the records resident instead cost around 375 bytes a block, most of it the block state string and - * a per-row copy of the world name, which put a world-sized conversion in the region of two gigabytes of heap. A - * packed position in a primitive set is ten. + *

Blocks live in a {@link ConvertedBlockIndex}, which holds positions rather than records. Entity conversions are + * keyed by their serialised location: there is one per piece of furniture rather than one per block, so they are not + * worth packing, but their NBT snapshots were the largest single thing this used to keep. */ public class ServerProfileManager implements ServerProfile { - private final CraftEngineConverter plugin; private final StorageManager storageManager; - - /** - * Positions are packed into a long the way Minecraft packs a BlockPos: 26 bits of x, 12 of y, 26 of z. That - * covers the whole of a 60 million block world and every height a world can have, and it means the index is a - * primitive array rather than a graph of boxed objects. - */ - private static final int PACKED_X_BITS = 26; - private static final int PACKED_Z_BITS = 26; - private static final int PACKED_Y_BITS = 64 - PACKED_X_BITS - PACKED_Z_BITS; - private static final long PACKED_X_MASK = (1L << PACKED_X_BITS) - 1; - private static final long PACKED_Y_MASK = (1L << PACKED_Y_BITS) - 1; - private static final long PACKED_Z_MASK = (1L << PACKED_Z_BITS) - 1; - - /** - * One set per world, each guarded by itself: LongOpenHashSet is not thread safe, and both chunk loading and - * interaction conversion touch it. Locking per world rather than globally keeps worlds from waiting on each - * other, and the critical sections are a single hash lookup. - */ - private final Map convertedBlocksByWorld = new ConcurrentHashMap<>(); - - /** - * Entity conversions are keyed by their serialised location. There are orders of magnitude fewer of them than - * blocks - one per piece of furniture - so they stay exact strings rather than being packed. - */ + private final ConvertedBlockIndex convertedBlocks = new ConvertedBlockIndex(); private final Set convertedEntities = ConcurrentHashMap.newKeySet(); public ServerProfileManager(CraftEngineConverter plugin) { - this.plugin = plugin; - this.storageManager = plugin.getStorageManager(); + this(plugin.getStorageManager()); } - static long pack(int blockX, int blockY, int blockZ) { - return ((blockX & PACKED_X_MASK) << (PACKED_Y_BITS + PACKED_Z_BITS)) - | ((blockY & PACKED_Y_MASK) << PACKED_Z_BITS) - | (blockZ & PACKED_Z_MASK); + ServerProfileManager(StorageManager storageManager) { + this.storageManager = storageManager; } - /** - * Reads back every conversion still in effect, one row at a time, keeping only its position. - */ + /** Reads back every conversion still in effect, one row at a time, keeping only its position. */ @Override public void load() { if (!this.storageManager.isEnabled()) { return; } - this.storageManager.forEachActiveBlockPosition((worldName, blockX, blockY, blockZ) -> { - LongOpenHashSet positions = this.positionsIn(worldName); - synchronized (positions) { - positions.add(pack(blockX, blockY, blockZ)); - } - }); + this.convertedBlocks.loadFrom(this.storageManager); this.storageManager.forEachActiveEntityLocation(this.convertedEntities::add); } - private LongOpenHashSet positionsIn(@NotNull String worldName) { - return this.convertedBlocksByWorld.computeIfAbsent(worldName, world -> new LongOpenHashSet()); - } - @Override public void addBlockHistory(@NotNull BlockHistory blockHistory) { if (!blockHistory.isReverted()) { - LongOpenHashSet positions = this.positionsIn(blockHistory.getWorldName()); - synchronized (positions) { - positions.add(pack(blockHistory.getBlockX(), blockHistory.getBlockY(), blockHistory.getBlockZ())); - } + this.convertedBlocks.add(blockHistory.getWorldName(), + blockHistory.getBlockX(), blockHistory.getBlockY(), blockHistory.getBlockZ()); } this.storageManager.upsertBlockHistory(blockHistory); } @@ -106,13 +62,7 @@ public void addEntityHistory(@NotNull EntityHistory entityHistory) { @Override public boolean isBlockConverted(@NotNull String worldName, int blockX, int blockY, int blockZ) { - LongOpenHashSet positions = this.convertedBlocksByWorld.get(worldName); - if (positions == null) { - return false; - } - synchronized (positions) { - return positions.contains(pack(blockX, blockY, blockZ)); - } + return this.convertedBlocks.contains(worldName, blockX, blockY, blockZ); } @Override @@ -122,13 +72,7 @@ public boolean isEntityConverted(@NotNull String locationString) { @Override public int getActiveBlockCount() { - int total = 0; - for (LongOpenHashSet positions : this.convertedBlocksByWorld.values()) { - synchronized (positions) { - total += positions.size(); - } - } - return total; + return this.convertedBlocks.size(); } @Override @@ -138,7 +82,7 @@ public int getActiveEntityCount() { @Override public void clearBlockHistory() { - this.convertedBlocksByWorld.clear(); + this.convertedBlocks.clear(); this.storageManager.markAllBlocksAsReverted(); } @@ -156,18 +100,12 @@ public void markEntityAsReverted(@NotNull EntityHistory history) { @Override public void forgetBlock(@NotNull BlockHistory history) { - LongOpenHashSet positions = this.convertedBlocksByWorld.get(history.getWorldName()); - if (positions == null) { - return; - } - synchronized (positions) { - positions.remove(pack(history.getBlockX(), history.getBlockY(), history.getBlockZ())); - } + this.convertedBlocks.remove(history.getWorldName(), + history.getBlockX(), history.getBlockY(), history.getBlockZ()); } @Override public void forgetEntity(@NotNull EntityHistory history) { this.convertedEntities.remove(history.getLocationString()); } - } diff --git a/Plugin/src/test/java/fr/robie/craftengineconverter/IconEncodingTest.java b/Plugin/src/test/java/fr/robie/craftengineconverter/IconEncodingTest.java new file mode 100644 index 00000000..e6c956b9 --- /dev/null +++ b/Plugin/src/test/java/fr/robie/craftengineconverter/IconEncodingTest.java @@ -0,0 +1,90 @@ +package fr.robie.craftengineconverter; + +import org.junit.jupiter.api.Test; + +import javax.imageio.ImageIO; +import java.awt.image.BufferedImage; +import java.io.ByteArrayOutputStream; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Random; + +import static org.junit.jupiter.api.Assertions.assertArrayEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + +/** + * Encoding a rendered icon once and writing the bytes later has to produce the same file as encoding it at the point + * of writing. + * + *

Rendered icons used to be kept as decoded rasters and encoded when the mapping that needed one was assigned; + * they are kept encoded now, so the write is a byte copy. That is only a memory change if the resulting PNG is + * identical, and nothing else in the pipeline would notice if it were not. + */ +class IconEncodingTest { + + private static BufferedImage icon(int size, long seed) { + BufferedImage image = new BufferedImage(size, size, BufferedImage.TYPE_INT_ARGB); + Random random = new Random(seed); + for (int x = 0; x < size; x++) { + for (int y = 0; y < size; y++) { + // Flat runs and transparency, the way a rendered item sprite actually looks. + int alpha = (x + y) % 7 == 0 ? 0 : 0xFF; + int shade = ((x / 4) * 37 + (y / 4) * 11 + random.nextInt(3)) & 0xFF; + image.setRGB(x, y, (alpha << 24) | (shade << 16) | (shade << 8) | shade); + } + } + return image; + } + + private static byte[] encodeToMemory(BufferedImage image) throws Exception { + try (ByteArrayOutputStream encoded = new ByteArrayOutputStream()) { + ImageIO.write(image, "png", encoded); + return encoded.toByteArray(); + } + } + + private static byte[] encodeToFile(BufferedImage image) throws Exception { + Path file = Files.createTempFile("icon", ".png"); + try { + ImageIO.write(image, "png", file.toFile()); + return Files.readAllBytes(file); + } finally { + Files.deleteIfExists(file); + } + } + + @Test + void producesTheSameFileWhicheverWayItIsWritten() throws Exception { + for (int size : new int[]{16, 64, 128, 256}) { + BufferedImage image = icon(size, size); + assertArrayEquals(encodeToFile(image), encodeToMemory(image), + "a " + size + "px icon must encode identically"); + } + } + + @Test + void theEncodedFormIsWorthKeepingInsteadOfTheRaster() throws Exception { + BufferedImage image = icon(64, 1); + int rasterBytes = 64 * 64 * 4; + byte[] encoded = encodeToMemory(image); + + assertTrue(encoded.length < rasterBytes / 2, + "encoded " + encoded.length + " bytes against " + rasterBytes + " raw - if this ever stops holding, " + + "keeping icons encoded is no longer buying anything"); + } + + @Test + void surviveARoundTripUnchanged() throws Exception { + BufferedImage original = icon(64, 3); + BufferedImage decoded = ImageIO.read(new java.io.ByteArrayInputStream(encodeToMemory(original))); + + assertEquals(original.getWidth(), decoded.getWidth()); + assertEquals(original.getHeight(), decoded.getHeight()); + for (int x = 0; x < original.getWidth(); x++) { + for (int y = 0; y < original.getHeight(); y++) { + assertEquals(original.getRGB(x, y), decoded.getRGB(x, y), "pixel " + x + "," + y); + } + } + } +} diff --git a/Plugin/src/test/java/fr/robie/craftengineconverter/database/BlockPositionPackingTest.java b/Plugin/src/test/java/fr/robie/craftengineconverter/database/BlockPositionPackingTest.java index 222a4264..856f72ba 100644 --- a/Plugin/src/test/java/fr/robie/craftengineconverter/database/BlockPositionPackingTest.java +++ b/Plugin/src/test/java/fr/robie/craftengineconverter/database/BlockPositionPackingTest.java @@ -27,7 +27,7 @@ void distinguishesTheCornersOfTheLargestPossibleWorld() { for (int x : new int[]{-WORLD_LIMIT, -1, 0, 1, WORLD_LIMIT}) { for (int y : new int[]{-2048, -64, 0, 319, 2047}) { for (int z : new int[]{-WORLD_LIMIT, -1, 0, 1, WORLD_LIMIT}) { - assertEquals(true, packed.add(ServerProfileManager.pack(x, y, z)), + assertEquals(true, packed.add(ConvertedBlockIndex.pack(x, y, z)), "collision at " + x + "," + y + "," + z); } } @@ -37,26 +37,26 @@ void distinguishesTheCornersOfTheLargestPossibleWorld() { @Test void keepsNeighboursApartOnEveryAxis() { - long origin = ServerProfileManager.pack(0, 0, 0); - assertNotEquals(origin, ServerProfileManager.pack(1, 0, 0)); - assertNotEquals(origin, ServerProfileManager.pack(-1, 0, 0)); - assertNotEquals(origin, ServerProfileManager.pack(0, 1, 0)); - assertNotEquals(origin, ServerProfileManager.pack(0, -1, 0)); - assertNotEquals(origin, ServerProfileManager.pack(0, 0, 1)); - assertNotEquals(origin, ServerProfileManager.pack(0, 0, -1)); + long origin = ConvertedBlockIndex.pack(0, 0, 0); + assertNotEquals(origin, ConvertedBlockIndex.pack(1, 0, 0)); + assertNotEquals(origin, ConvertedBlockIndex.pack(-1, 0, 0)); + assertNotEquals(origin, ConvertedBlockIndex.pack(0, 1, 0)); + assertNotEquals(origin, ConvertedBlockIndex.pack(0, -1, 0)); + assertNotEquals(origin, ConvertedBlockIndex.pack(0, 0, 1)); + assertNotEquals(origin, ConvertedBlockIndex.pack(0, 0, -1)); } @Test void doesNotConfuseTheAxesWithEachOther() { // A shift that is one bit out would make these three the same value. - assertNotEquals(ServerProfileManager.pack(5, 0, 0), ServerProfileManager.pack(0, 5, 0)); - assertNotEquals(ServerProfileManager.pack(5, 0, 0), ServerProfileManager.pack(0, 0, 5)); - assertNotEquals(ServerProfileManager.pack(0, 5, 0), ServerProfileManager.pack(0, 0, 5)); + assertNotEquals(ConvertedBlockIndex.pack(5, 0, 0), ConvertedBlockIndex.pack(0, 5, 0)); + assertNotEquals(ConvertedBlockIndex.pack(5, 0, 0), ConvertedBlockIndex.pack(0, 0, 5)); + assertNotEquals(ConvertedBlockIndex.pack(0, 5, 0), ConvertedBlockIndex.pack(0, 0, 5)); } @Test void isStableForTheSamePosition() { - assertEquals(ServerProfileManager.pack(-1234, 71, 5678), ServerProfileManager.pack(-1234, 71, 5678)); + assertEquals(ConvertedBlockIndex.pack(-1234, 71, 5678), ConvertedBlockIndex.pack(-1234, 71, 5678)); } @Test @@ -70,7 +70,7 @@ void survivesAWideRandomSample() { int y = random.nextInt(4096) - 2048; int z = random.nextInt(2 * WORLD_LIMIT) - WORLD_LIMIT; positions.add(x + "," + y + "," + z); - packed.add(ServerProfileManager.pack(x, y, z)); + packed.add(ConvertedBlockIndex.pack(x, y, z)); } assertEquals(positions.size(), packed.size(), "distinct positions must give distinct packed values"); diff --git a/Plugin/src/test/java/fr/robie/craftengineconverter/database/ConversionHistoryQueriesTest.java b/Plugin/src/test/java/fr/robie/craftengineconverter/database/ConversionHistoryQueriesTest.java new file mode 100644 index 00000000..d57398e4 --- /dev/null +++ b/Plugin/src/test/java/fr/robie/craftengineconverter/database/ConversionHistoryQueriesTest.java @@ -0,0 +1,278 @@ +package fr.robie.craftengineconverter.database; + +import fr.robie.craftengineconverter.api.history.BlockHistory; +import fr.robie.craftengineconverter.api.history.EntityHistory; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +import java.nio.file.Files; +import java.nio.file.Path; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.Statement; +import java.util.ArrayList; +import java.util.List; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + +/** + * The conversion-history SQL, run against a real database. + * + *

These queries are written by hand rather than built by the ORM, so nothing but running them catches a mistyped + * column, a paging clause that skips rows, or a boolean comparison a driver spells differently. SQLite is what the + * plugin ships with by default, so it is what this runs on. + */ +class ConversionHistoryQueriesTest { + + private Path databaseFile; + private Connection connection; + private ConversionHistoryQueries queries; + + @BeforeEach + void openDatabase() throws Exception { + this.databaseFile = Files.createTempFile("conversion-history", ".db"); + this.connection = DriverManager.getConnection("jdbc:sqlite:" + this.databaseFile); + this.queries = new ConversionHistoryQueries(() -> this.connection); + + try (Statement statement = this.connection.createStatement()) { + statement.executeUpdate(""" + CREATE TABLE %s ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + world_name TEXT NOT NULL, + chunk_x INTEGER NOT NULL, chunk_z INTEGER NOT NULL, + block_x INTEGER NOT NULL, block_y INTEGER NOT NULL, block_z INTEGER NOT NULL, + original_block TEXT NOT NULL, + reverted BOOLEAN NOT NULL)""".formatted(ConversionHistoryQueries.BLOCK_TABLE)); + statement.executeUpdate(""" + CREATE TABLE %s ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + location TEXT NOT NULL, + nbt TEXT NOT NULL, + reverted BOOLEAN NOT NULL)""".formatted(ConversionHistoryQueries.ENTITY_TABLE)); + } + } + + @AfterEach + void closeDatabase() throws Exception { + this.connection.close(); + Files.deleteIfExists(this.databaseFile); + } + + private void insertBlock(String world, int x, int y, int z, boolean reverted) throws Exception { + try (PreparedStatement statement = this.connection.prepareStatement( + "INSERT INTO " + ConversionHistoryQueries.BLOCK_TABLE + + " (world_name, chunk_x, chunk_z, block_x, block_y, block_z, original_block, reverted)" + + " VALUES (?,?,?,?,?,?,?,?)")) { + statement.setString(1, world); + statement.setInt(2, x >> 4); + statement.setInt(3, z >> 4); + statement.setInt(4, x); + statement.setInt(5, y); + statement.setInt(6, z); + statement.setString(7, "minecraft:note_block[instrument=harp,note=5,powered=false]"); + statement.setBoolean(8, reverted); + statement.executeUpdate(); + } + } + + private void insertEntity(String location, boolean reverted) throws Exception { + try (PreparedStatement statement = this.connection.prepareStatement( + "INSERT INTO " + ConversionHistoryQueries.ENTITY_TABLE + " (location, nbt, reverted) VALUES (?,?,?)")) { + statement.setString(1, location); + statement.setString(2, "{id:\"minecraft:item_display\"}"); + statement.setBoolean(3, reverted); + statement.executeUpdate(); + } + } + + private long activeBlockCount() throws Exception { + try (Statement statement = this.connection.createStatement(); + ResultSet rows = statement.executeQuery( + "SELECT COUNT(*) FROM " + ConversionHistoryQueries.BLOCK_TABLE + " WHERE reverted = 0")) { + rows.next(); + return rows.getLong(1); + } + } + + @Test + void streamsOnlyThePositionsOfConversionsStillInEffect() throws Exception { + insertBlock("world", 10, 64, -20, false); + insertBlock("world_nether", -3000, 31, 4000, false); + insertBlock("world", 99, 12, 99, true); + + List seen = new ArrayList<>(); + this.queries.forEachActiveBlockPosition((world, x, y, z) -> seen.add(world + " " + x + "," + y + "," + z)); + + assertEquals(List.of("world 10,64,-20", "world_nether -3000,31,4000"), seen, + "a reverted row is not part of the index"); + } + + @Test + void streamsEntityLocations() throws Exception { + insertEntity("{\"world\":\"world\",\"x\":1.5}", false); + insertEntity("{\"world\":\"world\",\"x\":2.5}", true); + + List seen = new ArrayList<>(); + this.queries.forEachActiveEntityLocation(seen::add); + + assertEquals(List.of("{\"world\":\"world\",\"x\":1.5}"), seen); + } + + @Test + void readsEveryRowExactlyOnceWhilePagingMarksThemReverted() throws Exception { + for (int i = 0; i < 250; i++) { + insertBlock("world", i, 64, 0, false); + } + + // Exactly what the restore does: read a page, revert it, ask for the next. + List restored = new ArrayList<>(); + long afterId = 0L; + while (true) { + List page = this.queries.nextActiveBlockPage(afterId, 50); + if (page.isEmpty()) { + break; + } + + List ids = new ArrayList<>(page.size()); + for (BlockHistory history : page) { + restored.add(history.getBlockX()); + ids.add(history.getId()); + afterId = history.getId(); + } + this.queries.markBlocksAsReverted(ids); + } + + assertEquals(250, restored.size(), "every row is visited"); + assertEquals(250, restored.stream().distinct().count(), "and none of them twice"); + assertEquals(0, activeBlockCount(), "the walk left nothing behind"); + } + + @Test + void keepsGoingPastAPageItCouldNotRevert() throws Exception { + for (int i = 0; i < 30; i++) { + insertBlock("world", i, 64, 0, false); + } + + // A page whose rows all fail to restore reverts nothing, so paging by id is the only thing moving the walk on. + List first = this.queries.nextActiveBlockPage(0L, 10); + assertEquals(10, first.size()); + long afterId = first.getLast().getId(); + + List second = this.queries.nextActiveBlockPage(afterId, 10); + assertEquals(10, second.size()); + assertFalse(second.stream().anyMatch(history -> history.getId() <= afterId), "no row is served twice"); + assertEquals(30, activeBlockCount(), "and nothing was reverted along the way"); + } + + @Test + void carriesEveryColumnThroughAPage() throws Exception { + insertBlock("world_the_end", -1234, 71, 5678, false); + + BlockHistory history = this.queries.nextActiveBlockPage(0L, 10).getFirst(); + assertEquals("world_the_end", history.getWorldName()); + assertEquals(-1234 >> 4, history.getChunkX()); + assertEquals(5678 >> 4, history.getChunkZ()); + assertEquals(-1234, history.getBlockX()); + assertEquals(71, history.getBlockY()); + assertEquals(5678, history.getBlockZ()); + assertEquals("minecraft:note_block[instrument=harp,note=5,powered=false]", history.getOriginalBlock()); + } + + @Test + void carriesEveryColumnThroughAnEntityPage() throws Exception { + insertEntity("{\"world\":\"world\",\"x\":1.5}", false); + + EntityHistory history = this.queries.nextActiveEntityPage(0L, 10).getFirst(); + assertEquals("{\"world\":\"world\",\"x\":1.5}", history.getLocationString()); + assertEquals("{id:\"minecraft:item_display\"}", history.getNbt()); + } + + @Test + void revertsAWholePageInOneStatement() throws Exception { + for (int i = 0; i < 5; i++) { + insertBlock("world", i, 64, 0, false); + } + + List page = this.queries.nextActiveBlockPage(0L, 5); + this.queries.markBlocksAsReverted(List.of(page.get(0).getId(), page.get(2).getId())); + + assertEquals(3, activeBlockCount(), "only the ids handed over are reverted"); + } + + @Test + void revertingNothingIsNotAnError() throws Exception { + insertBlock("world", 1, 64, 1, false); + + this.queries.markBlocksAsReverted(List.of()); + this.queries.markEntitiesAsReverted(List.of()); + + assertEquals(1, activeBlockCount()); + } + + @Test + void revertsEverythingLeftInOneSweep() throws Exception { + for (int i = 0; i < 20; i++) { + insertBlock("world", i, 64, 0, false); + } + insertEntity("{\"world\":\"world\"}", false); + + this.queries.markAllBlocksAsReverted(); + this.queries.markAllEntitiesAsReverted(); + + assertEquals(0, activeBlockCount()); + List remaining = new ArrayList<>(); + this.queries.forEachActiveEntityLocation(remaining::add); + assertTrue(remaining.isEmpty()); + } + + /** + * The whole of the startup path: rows in a real database, read through the real queries, into the real index - + * which is the only thing that shows the four columns come back out in the order the index expects them. + */ + @Test + void buildsTheConvertedBlockIndexFromWhatIsStored() throws Exception { + insertBlock("world", 10, 64, -20, false); + insertBlock("world", -1234, 71, 5678, false); + insertBlock("world_nether", 10, 64, -20, false); + insertBlock("world", 500, 12, 500, true); + + ConvertedBlockIndex index = new ConvertedBlockIndex(); + index.loadFrom(this.queries); + + assertEquals(3, index.size(), "a reverted row does not enter the index"); + assertTrue(index.contains("world", 10, 64, -20)); + assertTrue(index.contains("world", -1234, 71, 5678), "negative coordinates survive the round trip"); + assertTrue(index.contains("world_nether", 10, 64, -20), "the same position in another world is its own entry"); + assertFalse(index.contains("world", 500, 12, 500), "the reverted one is not converted any more"); + assertFalse(index.contains("world", 11, 64, -20), "a neighbour is not confused for it"); + assertFalse(index.contains("world_the_end", 10, 64, -20), "nor is an unknown world"); + } + + @Test + void forgettingABlockTakesItOutOfTheIndex() throws Exception { + insertBlock("world", 10, 64, -20, false); + + ConvertedBlockIndex index = new ConvertedBlockIndex(); + index.loadFrom(this.queries); + assertTrue(index.contains("world", 10, 64, -20)); + + index.remove("world", 10, 64, -20); + assertFalse(index.contains("world", 10, 64, -20)); + assertEquals(0, index.size()); + } + + @Test + void readsNothingFromAnEmptyTable() { + List seen = new ArrayList<>(); + this.queries.forEachActiveBlockPosition((world, x, y, z) -> seen.add(world)); + + assertTrue(seen.isEmpty()); + assertTrue(this.queries.nextActiveBlockPage(0L, 50).isEmpty()); + assertTrue(this.queries.nextActiveEntityPage(0L, 50).isEmpty()); + } +} From 5e47d7487155d61660947a8fa3da79ba4d5e593e Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Thu, 5 Nov 2026 10:38:41 +0100 Subject: [PATCH 109/116] fix(dependencies): update yamllibrary and itemsadder versions --- API/build.gradle.kts | 1 + Common/build.gradle.kts | 1 + Plugin/build.gradle.kts | 4 +++- gradle/libs.versions.toml | 11 ++++++----- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/API/build.gradle.kts b/API/build.gradle.kts index 985d7e48..3a1c3dfc 100644 --- a/API/build.gradle.kts +++ b/API/build.gradle.kts @@ -16,4 +16,5 @@ dependencies { compileOnly(libs.reflections) compileOnly(libs.message.flow) compileOnly(libs.yamllibrary) + compileOnly(libs.yamllibrary.core) } diff --git a/Common/build.gradle.kts b/Common/build.gradle.kts index 77f6bdad..580fc18b 100644 --- a/Common/build.gradle.kts +++ b/Common/build.gradle.kts @@ -11,6 +11,7 @@ dependencies { compileOnly(libs.craftengine.bukkit) compileOnly(libs.message.flow) compileOnly(libs.yamllibrary) + compileOnly(libs.yamllibrary.core) testImplementation(platform(libs.junit.bom)) testImplementation(libs.junit.jupiter) diff --git a/Plugin/build.gradle.kts b/Plugin/build.gradle.kts index 3ecf5c08..bfb8f9ca 100644 --- a/Plugin/build.gradle.kts +++ b/Plugin/build.gradle.kts @@ -31,6 +31,7 @@ dependencies { implementation(libs.bstats.bukkit) implementation(libs.bstats.base) implementation(libs.yamllibrary) + implementation(libs.yamllibrary.core) implementation(libs.paper.dispatch) compileOnly(libs.craftengine.core) @@ -83,7 +84,8 @@ tasks.named("shadowJar") { include(dependency("org.bstats:bstats-base")) include(dependency("fr.maxlego08.sarah:sarah")) include(dependency("com.github.1robie.MessageFlow:message-flow")) - include(dependency("fr.robie:yamllibrary")) + include(dependency("com.github.1robie.YamlLibrary:yamllibrary-core")) + include(dependency("com.github.1robie.YamlLibrary:yamllibrary-paper")) include(dependency("com.github.1robie.paper-dispatch:paper-dispatch")) } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index d0b249c8..4f78a3c4 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -19,9 +19,9 @@ craftengine = "26.5-SNAPSHOT" adventure = "4.26.1" bstats = "3.2.1" folialib = "0.5.1" -itemsadder = "4.0.10" +itemsadder = "4.0.17" junit = "6.0.3" -messageflow = "main-SNAPSHOT" +messageflow = "1.1.2" nexo = "1.20.1" packetevents = "2.11.2" paperdispatch = "1.0.2" @@ -29,7 +29,7 @@ placeholderapi = "2.12.2" reflections = "0.10.2" sarah = "1.23" snakeyaml = "2.6" -yamllibrary = "1.0-SNAPSHOT" +yamllibrary = "-SNAPSHOT" # Build plugins paperweight = "2.0.0-beta.21" @@ -51,11 +51,12 @@ folialib = { module = "com.tcoded:FoliaLib", version.ref = "folialib" } message-flow = { module = "com.github.1robie.MessageFlow:message-flow", version.ref = "messageflow" } paper-dispatch = { module = "com.github.1robie.paper-dispatch:paper-dispatch", version.ref = "paperdispatch" } sarah = { module = "fr.maxlego08.sarah:sarah", version.ref = "sarah" } -yamllibrary = { module = "fr.robie:yamllibrary", version.ref = "yamllibrary" } +yamllibrary = { module = "com.github.1robie.YamlLibrary:yamllibrary-paper", version.ref = "yamllibrary" } +yamllibrary-core = { module = "com.github.1robie.YamlLibrary:yamllibrary-core", version.ref = "yamllibrary" } # --- Provided by the server / by CraftEngine at runtime ---------------------- adventure-api = { module = "net.kyori:adventure-api", version.ref = "adventure" } -itemsadder = { module = "dev.lone:api-itemsadder", version.ref = "itemsadder" } +itemsadder = { group = "beer.devs", name = "itemsadder-api", version.ref = "itemsadder" } nexo = { module = "com.nexomc:nexo", version.ref = "nexo" } packetevents-spigot = { module = "com.github.retrooper:packetevents-spigot", version.ref = "packetevents" } placeholderapi = { module = "me.clip:placeholderapi", version.ref = "placeholderapi" } From 65663ba44b8b516c74e7cea718abea44be56e132 Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Thu, 5 Nov 2026 10:42:35 +0100 Subject: [PATCH 110/116] fix(dependencies): relocate paperdispatch and yamllibrary packages --- Plugin/build.gradle.kts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Plugin/build.gradle.kts b/Plugin/build.gradle.kts index bfb8f9ca..eabdb273 100644 --- a/Plugin/build.gradle.kts +++ b/Plugin/build.gradle.kts @@ -93,6 +93,8 @@ tasks.named("shadowJar") { relocate("org.bstats", "fr.robie.craftengineconverter.lib.bstats") relocate("fr.maxlego08.sarah", "fr.robie.craftengineconverter.lib.sarah") relocate("fr.robie.messageflow", "fr.robie.craftengineconverter.lib.messageflow") + relocate("fr.robie.paperdispatch", "fr.robie.craftengineconverter.lib.paperdispatch") + relocate("fr.robie.yamllibrary", "fr.robie.craftengineconverter.lib.yamllibrary") duplicatesStrategy = DuplicatesStrategy.INCLUDE mergeServiceFiles() From 05f5f15f60cf5651fea8c49f99e516cbd7001568 Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Sat, 7 Nov 2026 16:30:23 +0100 Subject: [PATCH 111/116] refactor: remove the Bedrock converter CraftEngine now ships its own Bedrock converter, so this plugin no longer carries one. Removes the converter, its tests and fixtures, the bedrock.yml settings file, the /cec bedrock command, the devConvert task, the Bedrock developer tool and roadmap. Settings that item converters still read (disable-default-italic, armor-converter-type, default-material) move from bedrock.yml into config.yml. The Bedrock-only settings are dropped. --- .gitignore | 1 - .../api/configuration/ConfigFile.java | 3 +- .../api/configuration/Keys.java | 67 +- .../bedrock/ItemTextureConfiguration.java | 69 - .../bedrock/ManifestConfiguration.java | 665 --- .../mapping/MappingsConfiguration.java | 65 - .../mapping/block/BlockDefinition.java | 276 - .../block/BlockMappingConfiguration.java | 120 - .../mapping/item/GroupDefinitionMapping.java | 59 - .../bedrock/mapping/item/ItemMapping.java | 135 - .../mapping/item/ItemModelItemMapping.java | 30 - .../mapping/item/LegacyItemMapping.java | 22 - .../item/component/BedrockComponent.java | 8 - .../item/component/EquippableComponent.java | 42 - .../component/GenericBedrockComponent.java | 59 - .../mapping/item/option/BedrockOptions.java | 130 - .../item/option/CreativeGroupRules.java | 214 - .../item/option/VanillaItemGroups.java | 112 - .../item/predicate/BedrockPredicate.java | 50 - .../predicate/condition/BrokenPredicate.java | 14 - .../condition/ConditionPredicate.java | 18 - .../condition/CustomModelDataPredicate.java | 26 - .../predicate/condition/DamagedPredicate.java | 17 - .../condition/FishingRodCastPredicate.java | 18 - .../condition/HasComponentPredicate.java | 27 - .../predicate/match/ChargeTypePredicate.java | 26 - .../match/ContextDimensionPredicate.java | 29 - .../match/CustomModelDataPredicate.java | 31 - .../match/TrimMaterialPredicate.java | 29 - .../BundleFullnessPredicate.java | 14 - .../range_dispatch/CountPredicate.java | 13 - .../CustomModelDataPredicate.java | 13 - .../range_dispatch/DamagePredicate.java | 13 - .../RangeDispatchPredicate.java | 30 - .../configuration/bedrock/molang/Molang.java | 211 - .../bedrock/molang/MolangMath.java | 75 - .../bedrock/molang/MolangQuery.java | 148 - .../bedrock/molang/MolangScript.java | 42 - .../configuration/bedrock/text/ItemName.java | 89 - .../bedrock/text/MiniMessageToComponent.java | 188 - .../bedrock/text/TextComponent.java | 151 - .../texture/FlipbookTextureConfiguration.java | 31 - .../bedrock/texture/FlipbookTextureData.java | 53 - .../bedrock/texture/TextureData.java | 49 - .../conditions/IsBedrockPlayerCondition.java | 7 - .../components/AttackRangeConfiguration.java | 33 +- .../components/ConsumableConfiguration.java | 14 +- .../components/EnchantableConfiguration.java | 9 +- ...EnchantmentGlintOverrideConfiguration.java | 7 +- .../item/components/FoodConfiguration.java | 14 +- .../KineticWeaponConfiguration.java | 59 +- .../item/components/MaxDamageComponent.java | 8 +- .../components/MaxStackSizeConfiguration.java | 7 +- .../PiercingWeaponConfiguration.java | 23 +- .../SwingAnimationConfiguration.java | 16 +- .../item/components/ToolConfiguration.java | 52 +- .../components/UseCooldownConfiguration.java | 12 +- .../components/UseEffectsConfiguration.java | 19 +- .../ConditionModelConfiguration.java | 33 - .../models/model/GenerationConfiguration.java | 12 - .../model/SimpleModelConfiguration.java | 1 - .../item/models/tints/TintConfiguration.java | 2 +- .../models/ModelConfigurationRegistry.java | 13 +- .../SpecialModelConfigurationLoader.java | 4 +- BEDROCK-ROADMAP.md | 34 - .../common/permission/Permission.java | 3 +- DEVELOPMENT.md | 51 +- Plugin/build.gradle.kts | 24 - .../command/CraftEngineConverterCommand.java | 1 - .../CraftEngineConverterCommandBedrock.java | 67 - ...eConverterCommandBedrockVanillaAssets.java | 71 - .../converter/ItemConverter.java | 2 +- .../converter/bedrock/BedrockConverter.java | 475 -- .../converter/bedrock/BedrockItemLoader.java | 1938 ------- .../converter/bedrock/BedrockSettings.java | 78 - .../converter/bedrock/ConversionContext.java | 1035 ---- .../bedrock/DefaultMaterialResolver.java | 87 - .../bedrock/animation/AnimationMapper.java | 121 - .../bedrock/animation/BedrockAnimation.java | 118 - .../animation/BedrockAnimationContext.java | 69 - .../animation/BedrockAnimationController.java | 31 - .../animation/BedrockRenderControllers.java | 200 - .../bedrock/asset/VanillaAssetDownloader.java | 138 - .../bedrock/asset/VanillaAssetStore.java | 102 - .../bedrock/asset/VanillaAssets.java | 125 - .../bedrock/attachable/BedrockAttachable.java | 187 - .../attachable/BedrockAttachableContext.java | 196 - .../bedrock/attachable/DrawStates.java | 280 -- .../bedrock/block/BlockGeometryBuilder.java | 248 - .../bedrock/block/BlockStateMapper.java | 732 --- .../bedrock/display/AttachableSlot.java | 87 - .../bedrock/display/DisplayPoses.java | 140 - .../bedrock/display/DisplayPresets.java | 183 - .../bedrock/display/HandAnchors.java | 157 - .../converter/bedrock/display/PoseSolver.java | 322 -- .../converter/bedrock/display/Transform.java | 431 -- .../converter/bedrock/font/FontMapper.java | 342 -- .../bedrock/font/JsonUiImageWriter.java | 327 -- .../bedrock/geometry/BedrockGeometry.java | 289 -- .../bedrock/geometry/DisplayContext.java | 76 - .../bedrock/geometry/GeometryMapper.java | 756 --- .../bedrock/geometry/JavaBlockModel.java | 273 - .../bedrock/geometry/JavaModelResolver.java | 207 - .../bedrock/geometry/VanillaBlockShapes.java | 126 - .../bedrock/icon/ItemIconRenderer.java | 428 -- .../bedrock/icon/ModelTextureTinter.java | 166 - .../bedrock/item/ConfigFactoryExpander.java | 180 - .../bedrock/item/EquipmentAssetRegistry.java | 118 - .../item/ItemModelDefinitionMapper.java | 102 - .../converter/bedrock/item/VersionGates.java | 141 - .../bedrock/lang/LanguageMapper.java | 192 - .../bedrock/pack/PackPathShortener.java | 214 - .../converter/bedrock/sound/SoundMapper.java | 198 - .../bedrock/texture/ArmorTrimBaker.java | 281 -- .../bedrock/texture/CachedTextureInfo.java | 36 - .../bedrock/texture/TexturePipeline.java | 435 -- .../bedrock/waypoint/WaypointStyleMapper.java | 156 - Plugin/src/main/resources/bedrock.yml | 161 - .../bedrock/vanilla_item_groups.json | 1393 ----- Plugin/src/main/resources/config.yml | 9 +- .../AnimatedItemTest.java | 129 - .../ArmorTrimBakerTest.java | 206 - .../ArmorTrimReproTest.java | 65 - .../AttachablePoseTest.java | 764 --- .../BakedBlockRotationTest.java | 134 - .../BlockItemHeldFormTest.java | 119 - .../BlockShadingTest.java | 106 - .../BlockStateMapperShapeTest.java | 255 - .../BlockTextureTest.java | 236 - .../BlockbenchAlignmentTest.java | 237 - .../ConfigFactoryExpanderTest.java | 167 - .../ConfigurationUpdateTest.java | 169 - .../ConversionWarningsTest.java | 158 - .../CreativeGroupRulesTest.java | 315 -- .../craftengineconverter/DoorHingeUvTest.java | 105 - .../craftengineconverter/DrawStatesTest.java | 448 -- .../EquipmentAssetRegistryTest.java | 81 - .../GreyscaleTextureTest.java | 113 - .../HeldGeometrySourceTest.java | 182 - .../HitboxMirrorTest.java | 65 - .../InheritedVanillaTextureTest.java | 123 - .../InvisibleBlockTest.java | 187 - .../ItemIconRendererTest.java | 426 -- .../ItemModelDefinitionMapperTest.java | 116 - .../JavaModelResolverVanillaTest.java | 136 - .../craftengineconverter/KeyRegistryTest.java | 2 +- .../craftengineconverter/ManifestTest.java | 111 - .../ModelTextureTinterTest.java | 180 - .../craftengineconverter/MolangTest.java | 160 - .../MultipartAndWeightedRandomTest.java | 196 - .../PackPathShortenerTest.java | 207 - .../PixelLatticeGeometryTest.java | 126 - .../robie/craftengineconverter/PoseChain.java | 270 - .../craftengineconverter/PoseChainTest.java | 268 - .../RenderMethodBackfaceTest.java | 100 - .../ShippedConfigCoverageTest.java | 4 +- .../TextComponentNameTest.java | 153 - .../craftengineconverter/TransformTest.java | 338 -- .../TranslatableItemNameTest.java | 109 - .../UpDownUvConventionTest.java | 77 - .../VanillaAssetsTest.java | 154 - .../VanillaReferenceTest.java | 174 - .../VersionGatesTest.java | 105 - .../converter/bedrock/DevConvert.java | 95 - .../configuration/blocks/amethyst_torch.yml | 151 - .../configuration/blocks/chessboard_block.yml | 75 - .../configuration/blocks/chinese_lantern.yml | 43 - .../configuration/blocks/copper_coil.yml | 75 - .../configuration/blocks/drawer_block.yml | 71 - .../blocks/ender_pearl_flower.yml | 136 - .../configuration/blocks/fairy_flower.yml | 49 - .../configuration/blocks/flame_cane.yml | 101 - .../configuration/blocks/gunpowder_block.yml | 72 - .../configuration/blocks/hami_melon.yml | 209 - .../configuration/blocks/magma_plant.yml | 149 - .../configuration/blocks/netherite_anvil.yml | 83 - .../configuration/blocks/pebble.yml | 122 - .../configuration/blocks/reed.yml | 36 - .../configuration/blocks/safe_block.yml | 124 - .../configuration/blocks/sofa.yml | 220 - .../configuration/blocks/table_lamp.yml | 124 - .../blocks/togglable_light_block.yml | 67 - .../configuration/blocks/topaz_ore.yml | 107 - .../configuration/blocks/tree.yml | 764 --- .../configuration/categories.yml | 75 - .../default_assets/configuration/emoji.yml | 138 - .../configuration/furniture/bench.yml | 47 - .../configuration/furniture/candelabrum.yml | 250 - .../configuration/furniture/flower_basket.yml | 113 - .../configuration/furniture/globe.yml | 49 - .../configuration/furniture/showcase.yml | 45 - .../configuration/furniture/wooden_chair.yml | 45 - .../configuration/items/cap.yml | 21 - .../configuration/items/drill.yml | 61 - .../configuration/items/flame_elytra.yml | 18 - .../configuration/items/gui_head.yml | 43 - .../configuration/items/topaz_armor.yml | 216 - .../configuration/items/topaz_tool_weapon.yml | 316 -- .../configuration/langs/en_us.yml | 130 - .../configuration/langs/fr_fr.yml | 130 - .../configuration/langs/ko_kr.yml | 130 - .../configuration/langs/zh_cn.yml | 130 - .../configuration/langs/zh_hk.yml | 130 - .../configuration/langs/zh_tw.yml | 130 - .../bedrock/items/default_assets/pack.yml | 4 - .../items/default_feature_populator/pack.yml | 10 - .../subpacks/26_1/configuration/features.yml | 370 -- .../fallback/configuration/features.yml | 380 -- .../templates/block_settings.yml | 219 - .../configuration/templates/block_states.yml | 2324 --------- .../configuration/templates/events.yml | 77 - .../configuration/templates/loot_tables.yml | 267 - .../configuration/templates/tool_levels.yml | 25 - .../bedrock/items/default_templates/pack.yml | 5 - .../items/internal/configuration/gui.yml | 181 - .../items/internal/configuration/mappings.yml | 4474 ----------------- .../internal/configuration/offset_chars.yml | 253 - .../items/internal/configuration/special.yml | 54 - .../configuration/translations/de.yml | 15 - .../configuration/translations/en.yml | 15 - .../configuration/translations/fr_fr.yml | 15 - .../configuration/translations/ko_kr.yml | 15 - .../configuration/translations/zh_cn.yml | 15 - .../configuration/translations/zh_hk.yml | 15 - .../configuration/translations/zh_tw.yml | 15 - .../bedrock/items/internal/pack.yml | 5 - .../legacy_armor/configuration/chainmail.yml | 30 - .../bedrock/items/legacy_armor/pack.yml | 5 - .../items/remove_shulker_head/pack.yml | 5 - .../assets/default/equipment/flame.json | 1 - .../assets/default/equipment/topaz.json | 1 - .../items/amethyst_standing_torch.json | 1 - .../assets/default/items/amethyst_torch.json | 1 - .../default/items/amethyst_wall_torch.json | 1 - .../assets/default/items/bench.json | 1 - .../assets/default/items/candelabrum.json | 1 - .../default/items/candelabrum_ceiling.json | 1 - .../default/items/candelabrum_ground.json | 1 - .../items/candelabrum_lit_ceiling.json | 1 - .../default/items/candelabrum_lit_ground.json | 1 - .../default/items/candelabrum_lit_wall.json | 1 - .../default/items/candelabrum_wall.json | 1 - .../assets/default/items/cap.json | 1 - .../default/items/chessboard_block.json | 1 - .../assets/default/items/chinese_lantern.json | 1 - .../assets/default/items/copper_coil.json | 1 - .../default/items/deepslate_topaz_ore.json | 1 - .../assets/default/items/drawer_block.json | 1 - .../assets/default/items/drill.json | 1 - .../items/ender_pearl_flower_seeds.json | 1 - .../assets/default/items/fairy_flower.json | 1 - .../assets/default/items/flame_cane.json | 1 - .../assets/default/items/flame_elytra.json | 1 - .../assets/default/items/flower_basket.json | 1 - .../default/items/flower_basket_ceiling.json | 1 - .../default/items/flower_basket_ground.json | 1 - .../default/items/flower_basket_wall.json | 1 - .../assets/default/items/globe.json | 1 - .../assets/default/items/globe_base.json | 1 - .../assets/default/items/globe_earth.json | 1 - .../assets/default/items/gui_head_size_1.json | 1 - .../assets/default/items/gui_head_size_4.json | 1 - .../assets/default/items/gunpowder_block.json | 1 - .../assets/default/items/hami_melon.json | 1 - .../default/items/hami_melon_seeds.json | 1 - .../default/items/hami_melon_slice.json | 1 - .../assets/default/items/magma_fruit.json | 1 - .../assets/default/items/netherite_anvil.json | 1 - .../assets/default/items/palm_button.json | 1 - .../items/palm_button_not_pressed.json | 1 - .../default/items/palm_button_pressed.json | 1 - .../assets/default/items/palm_door.json | 1 - .../assets/default/items/palm_fence.json | 1 - .../assets/default/items/palm_fence_gate.json | 1 - .../assets/default/items/palm_fence_post.json | 1 - .../assets/default/items/palm_fence_side.json | 1 - .../assets/default/items/palm_leaves.json | 1 - .../assets/default/items/palm_log.json | 1 - .../assets/default/items/palm_planks.json | 1 - .../default/items/palm_pressure_plate.json | 1 - .../assets/default/items/palm_sapling.json | 1 - .../assets/default/items/palm_slab.json | 1 - .../assets/default/items/palm_stairs.json | 1 - .../assets/default/items/palm_trapdoor.json | 1 - .../assets/default/items/palm_wood.json | 1 - .../assets/default/items/pebble.json | 1 - .../assets/default/items/reed.json | 1 - .../assets/default/items/safe_block.json | 1 - .../assets/default/items/showcase.json | 1 - .../assets/default/items/sleeper_sofa.json | 1 - .../assets/default/items/sofa.json | 1 - .../assets/default/items/sofa_inner.json | 1 - .../default/items/solid_gunpowder_block.json | 1 - .../default/items/stripped_palm_log.json | 1 - .../default/items/stripped_palm_wood.json | 1 - .../assets/default/items/table_lamp.json | 1 - .../assets/default/items/table_lamp_on.json | 1 - .../default/items/togglable_light_block.json | 1 - .../assets/default/items/topaz.json | 1 - .../assets/default/items/topaz_axe.json | 1 - .../assets/default/items/topaz_boots.json | 1 - .../assets/default/items/topaz_bow.json | 1 - .../default/items/topaz_chestplate.json | 1 - .../assets/default/items/topaz_crossbow.json | 1 - .../assets/default/items/topaz_helmet.json | 1 - .../assets/default/items/topaz_hoe.json | 1 - .../assets/default/items/topaz_leggings.json | 1 - .../assets/default/items/topaz_ore.json | 1 - .../assets/default/items/topaz_pickaxe.json | 1 - .../assets/default/items/topaz_rod.json | 1 - .../assets/default/items/topaz_shield.json | 1 - .../assets/default/items/topaz_shovel.json | 1 - .../assets/default/items/topaz_spear.json | 1 - .../assets/default/items/topaz_sword.json | 1 - .../assets/default/items/topaz_trident.json | 1 - .../assets/default/items/wooden_chair.json | 1 - .../default/models/item/amethyst_torch.json | 1 - .../default/models/item/candelabrum.json | 1 - .../models/item/ender_pearl_flower_seeds.json | 1 - .../default/models/item/fairy_flower.json | 1 - .../default/models/item/flame_cane.json | 1 - .../default/models/item/flame_elytra.json | 1 - .../models/item/flame_elytra_broken.json | 1 - .../default/models/item/flower_basket.json | 1 - .../default/models/item/hami_melon_seeds.json | 1 - .../default/models/item/hami_melon_slice.json | 1 - .../default/models/item/magma_fruit.json | 1 - .../assets/default/models/item/palm_door.json | 1 - .../default/models/item/palm_sapling.json | 1 - .../assets/default/models/item/pebble.json | 1 - .../assets/default/models/item/reed.json | 1 - .../models/item/togglable_light_block.json | 1 - .../assets/default/models/item/topaz.json | 1 - .../assets/default/models/item/topaz_axe.json | 1 - .../default/models/item/topaz_boots.json | 1 - .../item/topaz_boots_amethyst_trim.json | 1 - .../models/item/topaz_boots_copper_trim.json | 1 - .../models/item/topaz_boots_diamond_trim.json | 1 - .../models/item/topaz_boots_emerald_trim.json | 1 - .../models/item/topaz_boots_gold_trim.json | 1 - .../models/item/topaz_boots_iron_trim.json | 1 - .../models/item/topaz_boots_lapis_trim.json | 1 - .../item/topaz_boots_netherite_trim.json | 1 - .../models/item/topaz_boots_quartz_trim.json | 1 - .../item/topaz_boots_redstone_trim.json | 1 - .../models/item/topaz_boots_resin_trim.json | 1 - .../assets/default/models/item/topaz_bow.json | 1 - .../models/item/topaz_bow_pulling_0.json | 1 - .../models/item/topaz_bow_pulling_1.json | 1 - .../models/item/topaz_bow_pulling_2.json | 1 - .../default/models/item/topaz_chestplate.json | 1 - .../item/topaz_chestplate_amethyst_trim.json | 1 - .../item/topaz_chestplate_copper_trim.json | 1 - .../item/topaz_chestplate_diamond_trim.json | 1 - .../item/topaz_chestplate_emerald_trim.json | 1 - .../item/topaz_chestplate_gold_trim.json | 1 - .../item/topaz_chestplate_iron_trim.json | 1 - .../item/topaz_chestplate_lapis_trim.json | 1 - .../item/topaz_chestplate_netherite_trim.json | 1 - .../item/topaz_chestplate_quartz_trim.json | 1 - .../item/topaz_chestplate_redstone_trim.json | 1 - .../item/topaz_chestplate_resin_trim.json | 1 - .../default/models/item/topaz_crossbow.json | 1 - .../models/item/topaz_crossbow_arrow.json | 1 - .../models/item/topaz_crossbow_firework.json | 1 - .../models/item/topaz_crossbow_pulling_0.json | 1 - .../models/item/topaz_crossbow_pulling_1.json | 1 - .../models/item/topaz_crossbow_pulling_2.json | 1 - .../default/models/item/topaz_helmet.json | 1 - .../item/topaz_helmet_amethyst_trim.json | 1 - .../models/item/topaz_helmet_copper_trim.json | 1 - .../item/topaz_helmet_diamond_trim.json | 1 - .../item/topaz_helmet_emerald_trim.json | 1 - .../models/item/topaz_helmet_gold_trim.json | 1 - .../models/item/topaz_helmet_iron_trim.json | 1 - .../models/item/topaz_helmet_lapis_trim.json | 1 - .../item/topaz_helmet_netherite_trim.json | 1 - .../models/item/topaz_helmet_quartz_trim.json | 1 - .../item/topaz_helmet_redstone_trim.json | 1 - .../models/item/topaz_helmet_resin_trim.json | 1 - .../assets/default/models/item/topaz_hoe.json | 1 - .../default/models/item/topaz_leggings.json | 1 - .../item/topaz_leggings_amethyst_trim.json | 1 - .../item/topaz_leggings_copper_trim.json | 1 - .../item/topaz_leggings_diamond_trim.json | 1 - .../item/topaz_leggings_emerald_trim.json | 1 - .../models/item/topaz_leggings_gold_trim.json | 1 - .../models/item/topaz_leggings_iron_trim.json | 1 - .../item/topaz_leggings_lapis_trim.json | 1 - .../item/topaz_leggings_netherite_trim.json | 1 - .../item/topaz_leggings_quartz_trim.json | 1 - .../item/topaz_leggings_redstone_trim.json | 1 - .../item/topaz_leggings_resin_trim.json | 1 - .../default/models/item/topaz_pickaxe.json | 1 - .../assets/default/models/item/topaz_rod.json | 1 - .../default/models/item/topaz_rod_cast.json | 1 - .../default/models/item/topaz_shovel.json | 1 - .../default/models/item/topaz_spear.json | 1 - .../models/item/topaz_spear_in_hand.json | 1 - .../default/models/item/topaz_sword.json | 1 - .../assets/internal/items/cooking_info.json | 1 - .../assets/internal/items/exit.json | 1 - .../assets/internal/items/get_item.json | 1 - .../assets/internal/items/next_page_0.json | 1 - .../assets/internal/items/next_page_1.json | 1 - .../internal/items/previous_page_0.json | 1 - .../internal/items/previous_page_1.json | 1 - .../assets/internal/items/return.json | 1 - .../assets/minecraft/blockstates/anvil.json | 11 - .../blockstates/brown_mushroom_block.json | 1 - .../assets/minecraft/blockstates/cactus.json | 1 - .../blockstates/cut_copper_stairs.json | 1 - .../light_weighted_pressure_plate.json | 1 - .../minecraft/blockstates/note_block.json | 1 - .../minecraft/blockstates/oak_door.json | 1 - .../minecraft/blockstates/oak_fence_gate.json | 1 - .../minecraft/blockstates/oak_leaves.json | 1 - .../minecraft/blockstates/oak_sapling.json | 1 - .../minecraft/blockstates/oak_trapdoor.json | 1 - .../blockstates/petrified_oak_slab.json | 1 - .../minecraft/blockstates/sugar_cane.json | 1 - .../minecraft/blockstates/tripwire.json | 1 - .../assets/minecraft/font/default.json | 394 -- .../assets/minecraft/font/gui.json | 1 - .../assets/minecraft/font/uniform.json | 1 - .../assets/minecraft/items/arrow.json | 1 - .../assets/minecraft/lang/en_us.json | 107 - .../assets/minecraft/lang/fr_fr.json | 1 - .../assets/minecraft/lang/ko_kr.json | 1 - .../assets/minecraft/lang/zh_cn.json | 1 - .../assets/minecraft/lang/zh_hk.json | 1 - .../assets/minecraft/lang/zh_tw.json | 1 - .../models/block/custom/amethyst_torch.json | 1 - .../block/custom/amethyst_wall_torch.json | 1 - .../models/block/custom/chessboard_block.json | 1 - .../models/block/custom/chinese_lantern.json | 1 - .../models/block/custom/copper_coil.json | 1 - .../models/block/custom/copper_coil_on.json | 1 - .../block/custom/deepslate_topaz_ore.json | 1 - .../models/block/custom/drawer_block.json | 1 - .../custom/ender_pearl_flower_stage_0.json | 1 - .../custom/ender_pearl_flower_stage_1.json | 1 - .../custom/ender_pearl_flower_stage_2.json | 1 - .../models/block/custom/fairy_flower_1.json | 48 - .../models/block/custom/fairy_flower_2.json | 1 - .../models/block/custom/fairy_flower_3.json | 1 - .../models/block/custom/fairy_flower_4.json | 1 - .../models/block/custom/fence_side.json | 29 - .../models/block/custom/flame_cane_1.json | 1 - .../models/block/custom/flame_cane_2.json | 1 - .../models/block/custom/gunpowder_block.json | 1 - .../models/block/custom/hami_melon.json | 1 - .../models/block/custom/large_mushroom.json | 138 - .../block/custom/magma_plant_stage_0.json | 36 - .../block/custom/magma_plant_stage_1.json | 36 - .../block/custom/magma_plant_stage_2.json | 36 - .../block/custom/magma_plant_stage_3.json | 120 - .../models/block/custom/medium_mushroom.json | 73 - .../models/block/custom/netherite_anvil.json | 1 - .../models/block/custom/palm_button.json | 1 - .../block/custom/palm_button_not_pressed.json | 1 - .../block/custom/palm_button_pressed.json | 1 - .../block/custom/palm_door_bottom_left.json | 1 - .../custom/palm_door_bottom_left_open.json | 1 - .../block/custom/palm_door_bottom_right.json | 1 - .../custom/palm_door_bottom_right_open.json | 1 - .../block/custom/palm_door_top_left.json | 1 - .../block/custom/palm_door_top_left_open.json | 1 - .../block/custom/palm_door_top_right.json | 1 - .../custom/palm_door_top_right_open.json | 1 - .../models/block/custom/palm_fence_gate.json | 1 - .../block/custom/palm_fence_gate_open.json | 1 - .../block/custom/palm_fence_gate_wall.json | 1 - .../custom/palm_fence_gate_wall_open.json | 1 - .../block/custom/palm_fence_inventory.json | 1 - .../models/block/custom/palm_fence_post.json | 1 - .../models/block/custom/palm_fence_side.json | 1 - .../models/block/custom/palm_leaves.json | 1 - .../models/block/custom/palm_log.json | 1 - .../block/custom/palm_log_horizontal.json | 1 - .../models/block/custom/palm_planks.json | 1 - .../block/custom/palm_pressure_plate.json | 1 - .../custom/palm_pressure_plate_powered.json | 1 - .../models/block/custom/palm_sapling.json | 1 - .../models/block/custom/palm_slab.json | 1 - .../models/block/custom/palm_slab_top.json | 1 - .../models/block/custom/palm_stairs.json | 1 - .../block/custom/palm_stairs_inner.json | 1 - .../block/custom/palm_stairs_outer.json | 1 - .../block/custom/palm_trapdoor_bottom.json | 1 - .../block/custom/palm_trapdoor_open.json | 1 - .../block/custom/palm_trapdoor_top.json | 1 - .../models/block/custom/palm_wood.json | 1 - .../block/custom/palm_wood_horizontal.json | 1 - .../models/block/custom/pebble_1.json | 34 - .../models/block/custom/pebble_2.json | 47 - .../models/block/custom/pebble_3.json | 47 - .../minecraft/models/block/custom/reed.json | 37 - .../models/block/custom/safe_block.json | 1 - .../models/block/custom/safe_block_open.json | 1 - .../models/block/custom/small_mushroom.json | 61 - .../block/custom/solid_gunpowder_block.json | 1 - .../block/custom/stripped_palm_log.json | 1 - .../custom/stripped_palm_log_horizontal.json | 1 - .../block/custom/stripped_palm_wood.json | 1 - .../custom/stripped_palm_wood_horizontal.json | 1 - .../models/block/custom/topaz_ore.json | 1 - .../assets/minecraft/models/block/empty.json | 1 - .../block/template_glazed_terracotta.json | 26 - .../minecraft/models/item/custom/bench.json | 253 - .../item/custom/candelabrum_ceiling.json | 230 - .../item/custom/candelabrum_ground.json | 191 - .../item/custom/candelabrum_lit_ceiling.json | 230 - .../item/custom/candelabrum_lit_ground.json | 191 - .../item/custom/candelabrum_lit_wall.json | 138 - .../models/item/custom/candelabrum_wall.json | 138 - .../minecraft/models/item/custom/cap.json | 84 - .../minecraft/models/item/custom/drill.json | 1 - .../models/item/custom/drill_selected.json | 1 - .../item/custom/flower_basket_ceiling.json | 284 -- .../item/custom/flower_basket_ground.json | 206 - .../item/custom/flower_basket_wall.json | 232 - .../minecraft/models/item/custom/globe.json | 164 - .../models/item/custom/globe_base.json | 109 - .../models/item/custom/globe_earth.json | 95 - .../models/item/custom/gui/cooking_info.json | 1 - .../models/item/custom/gui/exit.json | 1 - .../models/item/custom/gui/get_item.json | 1 - .../models/item/custom/gui/next_page_0.json | 1 - .../models/item/custom/gui/next_page_1.json | 1 - .../item/custom/gui/previous_page_0.json | 1 - .../item/custom/gui/previous_page_1.json | 1 - .../models/item/custom/gui/return.json | 1 - .../models/item/custom/gui_head_size_1.json | 1 - .../models/item/custom/gui_head_size_4.json | 1 - .../models/item/custom/showcase.json | 78 - .../models/item/custom/sleeper_sofa.json | 113 - .../minecraft/models/item/custom/sofa.json | 122 - .../models/item/custom/sofa_inner.json | 135 - .../item/custom/solid_gunpowder_block.json | 1 - .../models/item/custom/table_lamp.json | 121 - .../models/item/custom/table_lamp_on.json | 1 - .../models/item/custom/topaz_shield.json | 1 - .../item/custom/topaz_shield_blocking.json | 1 - .../models/item/custom/topaz_trident.json | 1 - .../item/custom/topaz_trident_in_hand.json | 107 - .../item/custom/topaz_trident_throwing.json | 109 - .../models/item/custom/wooden_chair.json | 162 - .../minecraft/particles/tinted_leaves.json | 1 - .../shaders/core/rendertype_entity_solid.fsh | 29 - .../assets/minecraft/sounds.json | 677 --- .../minecraft/sounds/internal/silence.ogg | Bin 2380 -> 0 bytes .../textures/block/custom/amethyst_torch.png | Bin 140 -> 0 bytes .../block/custom/chessboard_block.png | Bin 256 -> 0 bytes .../textures/block/custom/chinese_lantern.png | Bin 443 -> 0 bytes .../block/custom/chinese_lantern.png.mcmeta | 1 - .../block/custom/chinese_lantern_top.png | Bin 492 -> 0 bytes .../custom/chinese_lantern_top.png.mcmeta | 1 - .../textures/block/custom/copper_coil.png | Bin 157 -> 0 bytes .../textures/block/custom/copper_coil_on.png | Bin 168 -> 0 bytes .../block/custom/copper_coil_on_side.png | Bin 148 -> 0 bytes .../block/custom/copper_coil_side.png | Bin 137 -> 0 bytes .../block/custom/deepslate_topaz_ore.png | Bin 346 -> 0 bytes .../custom/deepslate_topaz_ore.png.mcmeta | 1 - .../block/custom/drawer_block_back.png | Bin 387 -> 0 bytes .../block/custom/drawer_block_bottom.png | Bin 165 -> 0 bytes .../block/custom/drawer_block_front.png | Bin 411 -> 0 bytes .../block/custom/drawer_block_side_left.png | Bin 427 -> 0 bytes .../block/custom/drawer_block_side_right.png | Bin 431 -> 0 bytes .../block/custom/drawer_block_top.png | Bin 378 -> 0 bytes .../custom/ender_pearl_flower_stage_0.png | Bin 118 -> 0 bytes .../custom/ender_pearl_flower_stage_1.png | Bin 182 -> 0 bytes .../custom/ender_pearl_flower_stage_2.png | Bin 224 -> 0 bytes .../textures/block/custom/fairy_flower_1.png | Bin 262 -> 0 bytes .../textures/block/custom/fairy_flower_2.png | Bin 300 -> 0 bytes .../textures/block/custom/fairy_flower_3.png | Bin 295 -> 0 bytes .../textures/block/custom/fairy_flower_4.png | Bin 305 -> 0 bytes .../textures/block/custom/flame_cane_1.png | Bin 182 -> 0 bytes .../textures/block/custom/flame_cane_2.png | Bin 184 -> 0 bytes .../textures/block/custom/gunpowder_block.png | Bin 202 -> 0 bytes .../textures/block/custom/hami_melon.png | Bin 204 -> 0 bytes .../block/custom/hami_melon_bottom.png | Bin 172 -> 0 bytes .../textures/block/custom/hami_melon_top.png | Bin 195 -> 0 bytes .../textures/block/custom/magma_plant.png | Bin 377 -> 0 bytes .../block/custom/magma_plant.png.mcmeta | 1 - .../textures/block/custom/mushroom.png | Bin 770 -> 0 bytes .../textures/block/custom/netherite_anvil.png | Bin 202 -> 0 bytes .../block/custom/netherite_anvil_top.png | Bin 214 -> 0 bytes .../textures/block/custom/palm_door.png | Bin 139 -> 0 bytes .../block/custom/palm_door_bottom.png | Bin 195 -> 0 bytes .../textures/block/custom/palm_door_top.png | Bin 209 -> 0 bytes .../textures/block/custom/palm_leaves.png | Bin 207 -> 0 bytes .../textures/block/custom/palm_log.png | Bin 163 -> 0 bytes .../textures/block/custom/palm_log_top.png | Bin 203 -> 0 bytes .../textures/block/custom/palm_planks.png | Bin 174 -> 0 bytes .../textures/block/custom/palm_sapling.png | Bin 190 -> 0 bytes .../textures/block/custom/palm_trapdoor.png | Bin 209 -> 0 bytes .../textures/block/custom/pebble.png | Bin 434 -> 0 bytes .../minecraft/textures/block/custom/reed.png | Bin 360 -> 0 bytes .../block/custom/safe_block_bottom.png | Bin 143 -> 0 bytes .../block/custom/safe_block_front.png | Bin 231 -> 0 bytes .../block/custom/safe_block_front_open.png | Bin 221 -> 0 bytes .../textures/block/custom/safe_block_side.png | Bin 287 -> 0 bytes .../textures/block/custom/safe_block_top.png | Bin 168 -> 0 bytes .../block/custom/solid_gunpowder_block.png | Bin 72 -> 0 bytes .../block/custom/stripped_palm_log.png | Bin 184 -> 0 bytes .../block/custom/stripped_palm_log_top.png | Bin 203 -> 0 bytes .../textures/block/custom/topaz_ore.png | Bin 333 -> 0 bytes .../block/custom/topaz_ore.png.mcmeta | 1 - .../assets/minecraft/textures/block/empty.png | Bin 75 -> 0 bytes .../entity/equipment/humanoid/topaz.png | Bin 424 -> 0 bytes .../equipment/humanoid_leggings/topaz.png | Bin 259 -> 0 bytes .../textures/entity/equipment/wings/flame.png | Bin 280 -> 0 bytes .../textures/entity/shulker/shulker_white.png | Bin 1122 -> 0 bytes .../textures/font/gui/custom/blasting.png | Bin 340 -> 0 bytes .../font/gui/custom/brewing_recipe.png | Bin 1515 -> 0 bytes .../textures/font/gui/custom/campfire.png | Bin 352 -> 0 bytes .../textures/font/gui/custom/category.png | Bin 996 -> 0 bytes .../font/gui/custom/cooking_recipe.png | Bin 1274 -> 0 bytes .../font/gui/custom/crafting_recipe.png | Bin 1747 -> 0 bytes .../textures/font/gui/custom/item_browser.png | Bin 1000 -> 0 bytes .../textures/font/gui/custom/no_recipe.png | Bin 994 -> 0 bytes .../textures/font/gui/custom/smelting.png | Bin 349 -> 0 bytes .../gui/custom/smithing_transform_recipe.png | Bin 1283 -> 0 bytes .../textures/font/gui/custom/smoking.png | Bin 348 -> 0 bytes .../font/gui/custom/stonecutting_recipe.png | Bin 1391 -> 0 bytes .../minecraft/textures/font/image/emojis.png | Bin 626 -> 0 bytes .../textures/font/offset/space_split.png | Bin 67 -> 0 bytes .../gui/sprites/tooltip/topaz_background.png | Bin 116 -> 0 bytes .../tooltip/topaz_background.png.mcmeta | 1 - .../gui/sprites/tooltip/topaz_frame.png | Bin 338 -> 0 bytes .../sprites/tooltip/topaz_frame.png.mcmeta | 1 - .../minecraft/textures/item/custom/bench.png | Bin 582 -> 0 bytes .../textures/item/custom/candelabrum.png | Bin 922 -> 0 bytes .../textures/item/custom/candelabrum_2d.png | Bin 315 -> 0 bytes .../item/custom/candelabrum_flame.png | Bin 165 -> 0 bytes .../item/custom/candelabrum_flame.png.mcmeta | 5 - .../minecraft/textures/item/custom/cap.png | Bin 443 -> 0 bytes .../minecraft/textures/item/custom/drill.png | Bin 394 -> 0 bytes .../textures/item/custom/drill_selected.png | Bin 540 -> 0 bytes .../item/custom/drill_selected.png.mcmeta | 1 - .../item/custom/ender_pearl_flower_seeds.png | Bin 164 -> 0 bytes .../textures/item/custom/fairy_flower.png | Bin 201 -> 0 bytes .../textures/item/custom/flame_cane.png | Bin 185 -> 0 bytes .../textures/item/custom/flame_elytra.png | Bin 208 -> 0 bytes .../item/custom/flame_elytra_broken.png | Bin 198 -> 0 bytes .../textures/item/custom/flower_basket.png | Bin 1038 -> 0 bytes .../textures/item/custom/flower_basket_2d.png | Bin 275 -> 0 bytes .../minecraft/textures/item/custom/globe.png | Bin 1119 -> 0 bytes .../textures/item/custom/gui/cooking_info.png | Bin 334 -> 0 bytes .../item/custom/gui/cooking_info.png.mcmeta | 1 - .../textures/item/custom/gui/exit.png | Bin 165 -> 0 bytes .../textures/item/custom/gui/get_item.png | Bin 134 -> 0 bytes .../textures/item/custom/gui/next_page_0.png | Bin 158 -> 0 bytes .../textures/item/custom/gui/next_page_1.png | Bin 154 -> 0 bytes .../item/custom/gui/previous_page_0.png | Bin 158 -> 0 bytes .../item/custom/gui/previous_page_1.png | Bin 155 -> 0 bytes .../textures/item/custom/gui/return.png | Bin 162 -> 0 bytes .../textures/item/custom/hami_melon_seeds.png | Bin 207 -> 0 bytes .../textures/item/custom/hami_melon_slice.png | Bin 203 -> 0 bytes .../textures/item/custom/magma_fruit.png | Bin 227 -> 0 bytes .../item/custom/magma_fruit.png.mcmeta | 1 - .../minecraft/textures/item/custom/pebble.png | Bin 173 -> 0 bytes .../minecraft/textures/item/custom/reed.png | Bin 186 -> 0 bytes .../textures/item/custom/showcase.png | Bin 776 -> 0 bytes .../minecraft/textures/item/custom/sofa.png | Bin 1230 -> 0 bytes .../textures/item/custom/table_lamp.png | Bin 279 -> 0 bytes .../textures/item/custom/table_lamp_on.png | Bin 275 -> 0 bytes .../minecraft/textures/item/custom/topaz.png | Bin 289 -> 0 bytes .../textures/item/custom/topaz.png.mcmeta | 1 - .../textures/item/custom/topaz_axe.png | Bin 240 -> 0 bytes .../textures/item/custom/topaz_axe.png.mcmeta | 1 - .../textures/item/custom/topaz_boots.png | Bin 252 -> 0 bytes .../item/custom/topaz_boots.png.mcmeta | 1 - .../textures/item/custom/topaz_bow.png | Bin 184 -> 0 bytes .../item/custom/topaz_bow_pulling_0.png | Bin 231 -> 0 bytes .../item/custom/topaz_bow_pulling_1.png | Bin 231 -> 0 bytes .../item/custom/topaz_bow_pulling_2.png | Bin 223 -> 0 bytes .../textures/item/custom/topaz_chestplate.png | Bin 528 -> 0 bytes .../item/custom/topaz_chestplate.png.mcmeta | 1 - .../textures/item/custom/topaz_crossbow.png | Bin 304 -> 0 bytes .../item/custom/topaz_crossbow_arrow.png | Bin 341 -> 0 bytes .../item/custom/topaz_crossbow_firework.png | Bin 351 -> 0 bytes .../item/custom/topaz_crossbow_pulling_0.png | Bin 308 -> 0 bytes .../item/custom/topaz_crossbow_pulling_1.png | Bin 315 -> 0 bytes .../item/custom/topaz_crossbow_pulling_2.png | Bin 308 -> 0 bytes .../textures/item/custom/topaz_helmet.png | Bin 234 -> 0 bytes .../item/custom/topaz_helmet.png.mcmeta | 1 - .../textures/item/custom/topaz_hoe.png | Bin 216 -> 0 bytes .../textures/item/custom/topaz_hoe.png.mcmeta | 1 - .../textures/item/custom/topaz_leggings.png | Bin 258 -> 0 bytes .../item/custom/topaz_leggings.png.mcmeta | 1 - .../textures/item/custom/topaz_pickaxe.png | Bin 251 -> 0 bytes .../item/custom/topaz_pickaxe.png.mcmeta | 1 - .../textures/item/custom/topaz_rod.png | Bin 199 -> 0 bytes .../textures/item/custom/topaz_rod_cast.png | Bin 161 -> 0 bytes .../textures/item/custom/topaz_shield.png | Bin 174 -> 0 bytes .../item/custom/topaz_shield_blocking.png | Bin 174 -> 0 bytes .../textures/item/custom/topaz_shovel.png | Bin 220 -> 0 bytes .../item/custom/topaz_shovel.png.mcmeta | 1 - .../textures/item/custom/topaz_spear.png | Bin 1081 -> 0 bytes .../item/custom/topaz_spear_in_hand.png | Bin 1167 -> 0 bytes .../textures/item/custom/topaz_sword.png | Bin 291 -> 0 bytes .../item/custom/topaz_sword.png.mcmeta | 1 - .../textures/item/custom/topaz_trident.png | Bin 166 -> 0 bytes .../textures/item/custom/topaz_trident_3d.png | Bin 266 -> 0 bytes .../textures/item/custom/wooden_chair.png | Bin 284 -> 0 bytes .../minecraft/textures/particle/empty.png | Bin 68 -> 0 bytes .../trims/entity/humanoid/chainmail.png | Bin 258 -> 0 bytes .../entity/humanoid_leggings/chainmail.png | Bin 167 -> 0 bytes .../assets/default/items/gui_head_size_1.json | 1 - .../assets/default/items/gui_head_size_4.json | 1 - .../resource_pack_unprotected/pack.mcmeta | 1 - .../pack/resource_pack_unprotected/pack.png | Bin 27402 -> 0 bytes campfire-converter/campfire.mcpack | Bin 1040429 -> 0 bytes campfire-converter/campfirev2.json | 1 - tools/pose-calibrator.html | 2179 -------- 717 files changed, 41 insertions(+), 47751 deletions(-) delete mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/ItemTextureConfiguration.java delete mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/ManifestConfiguration.java delete mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/MappingsConfiguration.java delete mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/block/BlockDefinition.java delete mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/block/BlockMappingConfiguration.java delete mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/GroupDefinitionMapping.java delete mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/ItemMapping.java delete mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/ItemModelItemMapping.java delete mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/LegacyItemMapping.java delete mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/component/BedrockComponent.java delete mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/component/EquippableComponent.java delete mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/component/GenericBedrockComponent.java delete mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/option/BedrockOptions.java delete mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/option/CreativeGroupRules.java delete mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/option/VanillaItemGroups.java delete mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/BedrockPredicate.java delete mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/condition/BrokenPredicate.java delete mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/condition/ConditionPredicate.java delete mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/condition/CustomModelDataPredicate.java delete mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/condition/DamagedPredicate.java delete mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/condition/FishingRodCastPredicate.java delete mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/condition/HasComponentPredicate.java delete mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/match/ChargeTypePredicate.java delete mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/match/ContextDimensionPredicate.java delete mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/match/CustomModelDataPredicate.java delete mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/match/TrimMaterialPredicate.java delete mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/range_dispatch/BundleFullnessPredicate.java delete mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/range_dispatch/CountPredicate.java delete mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/range_dispatch/CustomModelDataPredicate.java delete mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/range_dispatch/DamagePredicate.java delete mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/range_dispatch/RangeDispatchPredicate.java delete mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/molang/Molang.java delete mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/molang/MolangMath.java delete mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/molang/MolangQuery.java delete mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/molang/MolangScript.java delete mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/text/ItemName.java delete mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/text/MiniMessageToComponent.java delete mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/text/TextComponent.java delete mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/texture/FlipbookTextureConfiguration.java delete mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/texture/FlipbookTextureData.java delete mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/texture/TextureData.java delete mode 100644 API/src/main/java/fr/robie/craftengineconverter/api/configuration/conditions/IsBedrockPlayerCondition.java delete mode 100644 BEDROCK-ROADMAP.md delete mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/command/CraftEngineConverterCommandBedrock.java delete mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/command/CraftEngineConverterCommandBedrockVanillaAssets.java delete mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockConverter.java delete mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockItemLoader.java delete mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/BedrockSettings.java delete mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/ConversionContext.java delete mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/DefaultMaterialResolver.java delete mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/animation/AnimationMapper.java delete mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/animation/BedrockAnimation.java delete mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/animation/BedrockAnimationContext.java delete mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/animation/BedrockAnimationController.java delete mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/animation/BedrockRenderControllers.java delete mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/asset/VanillaAssetDownloader.java delete mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/asset/VanillaAssetStore.java delete mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/asset/VanillaAssets.java delete mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/attachable/BedrockAttachable.java delete mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/attachable/BedrockAttachableContext.java delete mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/attachable/DrawStates.java delete mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/block/BlockGeometryBuilder.java delete mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/block/BlockStateMapper.java delete mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/display/AttachableSlot.java delete mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/display/DisplayPoses.java delete mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/display/DisplayPresets.java delete mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/display/HandAnchors.java delete mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/display/PoseSolver.java delete mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/display/Transform.java delete mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/font/FontMapper.java delete mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/font/JsonUiImageWriter.java delete mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/geometry/BedrockGeometry.java delete mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/geometry/DisplayContext.java delete mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/geometry/GeometryMapper.java delete mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/geometry/JavaBlockModel.java delete mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/geometry/JavaModelResolver.java delete mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/geometry/VanillaBlockShapes.java delete mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/icon/ItemIconRenderer.java delete mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/icon/ModelTextureTinter.java delete mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/item/ConfigFactoryExpander.java delete mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/item/EquipmentAssetRegistry.java delete mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/item/ItemModelDefinitionMapper.java delete mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/item/VersionGates.java delete mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/lang/LanguageMapper.java delete mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/pack/PackPathShortener.java delete mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/sound/SoundMapper.java delete mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/texture/ArmorTrimBaker.java delete mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/texture/CachedTextureInfo.java delete mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/texture/TexturePipeline.java delete mode 100644 Plugin/src/main/java/fr/robie/craftengineconverter/converter/bedrock/waypoint/WaypointStyleMapper.java delete mode 100644 Plugin/src/main/resources/bedrock.yml delete mode 100644 Plugin/src/main/resources/bedrock/vanilla_item_groups.json delete mode 100644 Plugin/src/test/java/fr/robie/craftengineconverter/AnimatedItemTest.java delete mode 100644 Plugin/src/test/java/fr/robie/craftengineconverter/ArmorTrimBakerTest.java delete mode 100644 Plugin/src/test/java/fr/robie/craftengineconverter/ArmorTrimReproTest.java delete mode 100644 Plugin/src/test/java/fr/robie/craftengineconverter/AttachablePoseTest.java delete mode 100644 Plugin/src/test/java/fr/robie/craftengineconverter/BakedBlockRotationTest.java delete mode 100644 Plugin/src/test/java/fr/robie/craftengineconverter/BlockItemHeldFormTest.java delete mode 100644 Plugin/src/test/java/fr/robie/craftengineconverter/BlockShadingTest.java delete mode 100644 Plugin/src/test/java/fr/robie/craftengineconverter/BlockStateMapperShapeTest.java delete mode 100644 Plugin/src/test/java/fr/robie/craftengineconverter/BlockTextureTest.java delete mode 100644 Plugin/src/test/java/fr/robie/craftengineconverter/BlockbenchAlignmentTest.java delete mode 100644 Plugin/src/test/java/fr/robie/craftengineconverter/ConfigFactoryExpanderTest.java delete mode 100644 Plugin/src/test/java/fr/robie/craftengineconverter/ConfigurationUpdateTest.java delete mode 100644 Plugin/src/test/java/fr/robie/craftengineconverter/ConversionWarningsTest.java delete mode 100644 Plugin/src/test/java/fr/robie/craftengineconverter/CreativeGroupRulesTest.java delete mode 100644 Plugin/src/test/java/fr/robie/craftengineconverter/DoorHingeUvTest.java delete mode 100644 Plugin/src/test/java/fr/robie/craftengineconverter/DrawStatesTest.java delete mode 100644 Plugin/src/test/java/fr/robie/craftengineconverter/EquipmentAssetRegistryTest.java delete mode 100644 Plugin/src/test/java/fr/robie/craftengineconverter/GreyscaleTextureTest.java delete mode 100644 Plugin/src/test/java/fr/robie/craftengineconverter/HeldGeometrySourceTest.java delete mode 100644 Plugin/src/test/java/fr/robie/craftengineconverter/HitboxMirrorTest.java delete mode 100644 Plugin/src/test/java/fr/robie/craftengineconverter/InheritedVanillaTextureTest.java delete mode 100644 Plugin/src/test/java/fr/robie/craftengineconverter/InvisibleBlockTest.java delete mode 100644 Plugin/src/test/java/fr/robie/craftengineconverter/ItemIconRendererTest.java delete mode 100644 Plugin/src/test/java/fr/robie/craftengineconverter/ItemModelDefinitionMapperTest.java delete mode 100644 Plugin/src/test/java/fr/robie/craftengineconverter/JavaModelResolverVanillaTest.java delete mode 100644 Plugin/src/test/java/fr/robie/craftengineconverter/ManifestTest.java delete mode 100644 Plugin/src/test/java/fr/robie/craftengineconverter/ModelTextureTinterTest.java delete mode 100644 Plugin/src/test/java/fr/robie/craftengineconverter/MolangTest.java delete mode 100644 Plugin/src/test/java/fr/robie/craftengineconverter/MultipartAndWeightedRandomTest.java delete mode 100644 Plugin/src/test/java/fr/robie/craftengineconverter/PackPathShortenerTest.java delete mode 100644 Plugin/src/test/java/fr/robie/craftengineconverter/PixelLatticeGeometryTest.java delete mode 100644 Plugin/src/test/java/fr/robie/craftengineconverter/PoseChain.java delete mode 100644 Plugin/src/test/java/fr/robie/craftengineconverter/PoseChainTest.java delete mode 100644 Plugin/src/test/java/fr/robie/craftengineconverter/RenderMethodBackfaceTest.java delete mode 100644 Plugin/src/test/java/fr/robie/craftengineconverter/TextComponentNameTest.java delete mode 100644 Plugin/src/test/java/fr/robie/craftengineconverter/TransformTest.java delete mode 100644 Plugin/src/test/java/fr/robie/craftengineconverter/TranslatableItemNameTest.java delete mode 100644 Plugin/src/test/java/fr/robie/craftengineconverter/UpDownUvConventionTest.java delete mode 100644 Plugin/src/test/java/fr/robie/craftengineconverter/VanillaAssetsTest.java delete mode 100644 Plugin/src/test/java/fr/robie/craftengineconverter/VanillaReferenceTest.java delete mode 100644 Plugin/src/test/java/fr/robie/craftengineconverter/VersionGatesTest.java delete mode 100644 Plugin/src/test/java/fr/robie/craftengineconverter/converter/bedrock/DevConvert.java delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/configuration/blocks/amethyst_torch.yml delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/configuration/blocks/chessboard_block.yml delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/configuration/blocks/chinese_lantern.yml delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/configuration/blocks/copper_coil.yml delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/configuration/blocks/drawer_block.yml delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/configuration/blocks/ender_pearl_flower.yml delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/configuration/blocks/fairy_flower.yml delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/configuration/blocks/flame_cane.yml delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/configuration/blocks/gunpowder_block.yml delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/configuration/blocks/hami_melon.yml delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/configuration/blocks/magma_plant.yml delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/configuration/blocks/netherite_anvil.yml delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/configuration/blocks/pebble.yml delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/configuration/blocks/reed.yml delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/configuration/blocks/safe_block.yml delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/configuration/blocks/sofa.yml delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/configuration/blocks/table_lamp.yml delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/configuration/blocks/togglable_light_block.yml delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/configuration/blocks/topaz_ore.yml delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/configuration/blocks/tree.yml delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/configuration/categories.yml delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/configuration/emoji.yml delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/configuration/furniture/bench.yml delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/configuration/furniture/candelabrum.yml delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/configuration/furniture/flower_basket.yml delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/configuration/furniture/globe.yml delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/configuration/furniture/showcase.yml delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/configuration/furniture/wooden_chair.yml delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/configuration/items/cap.yml delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/configuration/items/drill.yml delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/configuration/items/flame_elytra.yml delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/configuration/items/gui_head.yml delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/configuration/items/topaz_armor.yml delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/configuration/items/topaz_tool_weapon.yml delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/configuration/langs/en_us.yml delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/configuration/langs/fr_fr.yml delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/configuration/langs/ko_kr.yml delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/configuration/langs/zh_cn.yml delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/configuration/langs/zh_hk.yml delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/configuration/langs/zh_tw.yml delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/default_assets/pack.yml delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/default_feature_populator/pack.yml delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/default_feature_populator/subpacks/26_1/configuration/features.yml delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/default_feature_populator/subpacks/fallback/configuration/features.yml delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/default_templates/configuration/templates/block_settings.yml delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/default_templates/configuration/templates/block_states.yml delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/default_templates/configuration/templates/events.yml delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/default_templates/configuration/templates/loot_tables.yml delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/default_templates/configuration/templates/tool_levels.yml delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/default_templates/pack.yml delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/internal/configuration/gui.yml delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/internal/configuration/mappings.yml delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/internal/configuration/offset_chars.yml delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/internal/configuration/special.yml delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/internal/configuration/translations/de.yml delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/internal/configuration/translations/en.yml delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/internal/configuration/translations/fr_fr.yml delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/internal/configuration/translations/ko_kr.yml delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/internal/configuration/translations/zh_cn.yml delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/internal/configuration/translations/zh_hk.yml delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/internal/configuration/translations/zh_tw.yml delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/internal/pack.yml delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/legacy_armor/configuration/chainmail.yml delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/legacy_armor/pack.yml delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/items/remove_shulker_head/pack.yml delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/equipment/flame.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/equipment/topaz.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/amethyst_standing_torch.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/amethyst_torch.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/amethyst_wall_torch.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/bench.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/candelabrum.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/candelabrum_ceiling.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/candelabrum_ground.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/candelabrum_lit_ceiling.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/candelabrum_lit_ground.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/candelabrum_lit_wall.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/candelabrum_wall.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/cap.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/chessboard_block.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/chinese_lantern.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/copper_coil.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/deepslate_topaz_ore.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/drawer_block.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/drill.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/ender_pearl_flower_seeds.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/fairy_flower.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/flame_cane.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/flame_elytra.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/flower_basket.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/flower_basket_ceiling.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/flower_basket_ground.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/flower_basket_wall.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/globe.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/globe_base.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/globe_earth.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/gui_head_size_1.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/gui_head_size_4.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/gunpowder_block.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/hami_melon.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/hami_melon_seeds.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/hami_melon_slice.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/magma_fruit.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/netherite_anvil.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_button.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_button_not_pressed.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_button_pressed.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_door.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_fence.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_fence_gate.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_fence_post.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_fence_side.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_leaves.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_log.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_planks.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_pressure_plate.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_sapling.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_slab.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_stairs.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_trapdoor.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/palm_wood.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/pebble.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/reed.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/safe_block.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/showcase.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/sleeper_sofa.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/sofa.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/sofa_inner.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/solid_gunpowder_block.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/stripped_palm_log.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/stripped_palm_wood.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/table_lamp.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/table_lamp_on.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/togglable_light_block.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/topaz.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/topaz_axe.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/topaz_boots.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/topaz_bow.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/topaz_chestplate.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/topaz_crossbow.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/topaz_helmet.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/topaz_hoe.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/topaz_leggings.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/topaz_ore.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/topaz_pickaxe.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/topaz_rod.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/topaz_shield.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/topaz_shovel.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/topaz_spear.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/topaz_sword.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/topaz_trident.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/items/wooden_chair.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/amethyst_torch.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/candelabrum.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/ender_pearl_flower_seeds.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/fairy_flower.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/flame_cane.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/flame_elytra.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/flame_elytra_broken.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/flower_basket.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/hami_melon_seeds.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/hami_melon_slice.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/magma_fruit.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/palm_door.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/palm_sapling.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/pebble.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/reed.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/togglable_light_block.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_axe.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_boots.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_boots_amethyst_trim.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_boots_copper_trim.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_boots_diamond_trim.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_boots_emerald_trim.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_boots_gold_trim.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_boots_iron_trim.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_boots_lapis_trim.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_boots_netherite_trim.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_boots_quartz_trim.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_boots_redstone_trim.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_boots_resin_trim.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_bow.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_bow_pulling_0.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_bow_pulling_1.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_bow_pulling_2.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_chestplate.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_chestplate_amethyst_trim.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_chestplate_copper_trim.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_chestplate_diamond_trim.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_chestplate_emerald_trim.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_chestplate_gold_trim.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_chestplate_iron_trim.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_chestplate_lapis_trim.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_chestplate_netherite_trim.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_chestplate_quartz_trim.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_chestplate_redstone_trim.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_chestplate_resin_trim.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_crossbow.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_crossbow_arrow.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_crossbow_firework.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_crossbow_pulling_0.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_crossbow_pulling_1.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_crossbow_pulling_2.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_helmet.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_helmet_amethyst_trim.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_helmet_copper_trim.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_helmet_diamond_trim.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_helmet_emerald_trim.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_helmet_gold_trim.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_helmet_iron_trim.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_helmet_lapis_trim.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_helmet_netherite_trim.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_helmet_quartz_trim.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_helmet_redstone_trim.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_helmet_resin_trim.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_hoe.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_leggings.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_leggings_amethyst_trim.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_leggings_copper_trim.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_leggings_diamond_trim.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_leggings_emerald_trim.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_leggings_gold_trim.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_leggings_iron_trim.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_leggings_lapis_trim.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_leggings_netherite_trim.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_leggings_quartz_trim.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_leggings_redstone_trim.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_leggings_resin_trim.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_pickaxe.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_rod.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_rod_cast.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_shovel.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_spear.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_spear_in_hand.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/default/models/item/topaz_sword.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/internal/items/cooking_info.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/internal/items/exit.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/internal/items/get_item.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/internal/items/next_page_0.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/internal/items/next_page_1.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/internal/items/previous_page_0.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/internal/items/previous_page_1.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/internal/items/return.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/blockstates/anvil.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/blockstates/brown_mushroom_block.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/blockstates/cactus.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/blockstates/cut_copper_stairs.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/blockstates/light_weighted_pressure_plate.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/blockstates/note_block.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/blockstates/oak_door.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/blockstates/oak_fence_gate.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/blockstates/oak_leaves.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/blockstates/oak_sapling.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/blockstates/oak_trapdoor.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/blockstates/petrified_oak_slab.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/blockstates/sugar_cane.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/blockstates/tripwire.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/font/default.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/font/gui.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/font/uniform.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/items/arrow.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/lang/en_us.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/lang/fr_fr.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/lang/ko_kr.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/lang/zh_cn.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/lang/zh_hk.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/lang/zh_tw.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/amethyst_torch.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/amethyst_wall_torch.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/chessboard_block.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/chinese_lantern.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/copper_coil.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/copper_coil_on.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/deepslate_topaz_ore.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/drawer_block.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/ender_pearl_flower_stage_0.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/ender_pearl_flower_stage_1.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/ender_pearl_flower_stage_2.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/fairy_flower_1.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/fairy_flower_2.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/fairy_flower_3.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/fairy_flower_4.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/fence_side.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/flame_cane_1.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/flame_cane_2.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/gunpowder_block.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/hami_melon.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/large_mushroom.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/magma_plant_stage_0.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/magma_plant_stage_1.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/magma_plant_stage_2.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/magma_plant_stage_3.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/medium_mushroom.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/netherite_anvil.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_button.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_button_not_pressed.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_button_pressed.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_door_bottom_left.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_door_bottom_left_open.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_door_bottom_right.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_door_bottom_right_open.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_door_top_left.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_door_top_left_open.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_door_top_right.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_door_top_right_open.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_fence_gate.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_fence_gate_open.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_fence_gate_wall.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_fence_gate_wall_open.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_fence_inventory.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_fence_post.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_fence_side.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_leaves.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_log.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_log_horizontal.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_planks.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_pressure_plate.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_pressure_plate_powered.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_sapling.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_slab.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_slab_top.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_stairs.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_stairs_inner.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_stairs_outer.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_trapdoor_bottom.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_trapdoor_open.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_trapdoor_top.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_wood.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/palm_wood_horizontal.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/pebble_1.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/pebble_2.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/pebble_3.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/reed.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/safe_block.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/safe_block_open.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/small_mushroom.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/solid_gunpowder_block.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/stripped_palm_log.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/stripped_palm_log_horizontal.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/stripped_palm_wood.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/stripped_palm_wood_horizontal.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/custom/topaz_ore.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/empty.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/block/template_glazed_terracotta.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/bench.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/candelabrum_ceiling.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/candelabrum_ground.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/candelabrum_lit_ceiling.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/candelabrum_lit_ground.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/candelabrum_lit_wall.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/candelabrum_wall.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/cap.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/drill.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/drill_selected.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/flower_basket_ceiling.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/flower_basket_ground.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/flower_basket_wall.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/globe.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/globe_base.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/globe_earth.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/gui/cooking_info.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/gui/exit.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/gui/get_item.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/gui/next_page_0.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/gui/next_page_1.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/gui/previous_page_0.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/gui/previous_page_1.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/gui/return.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/gui_head_size_1.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/gui_head_size_4.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/showcase.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/sleeper_sofa.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/sofa.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/sofa_inner.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/solid_gunpowder_block.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/table_lamp.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/table_lamp_on.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/topaz_shield.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/topaz_shield_blocking.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/topaz_trident.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/topaz_trident_in_hand.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/topaz_trident_throwing.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/models/item/custom/wooden_chair.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/particles/tinted_leaves.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/shaders/core/rendertype_entity_solid.fsh delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/sounds.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/sounds/internal/silence.ogg delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/amethyst_torch.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/chessboard_block.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/chinese_lantern.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/chinese_lantern.png.mcmeta delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/chinese_lantern_top.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/chinese_lantern_top.png.mcmeta delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/copper_coil.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/copper_coil_on.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/copper_coil_on_side.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/copper_coil_side.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/deepslate_topaz_ore.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/deepslate_topaz_ore.png.mcmeta delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/drawer_block_back.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/drawer_block_bottom.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/drawer_block_front.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/drawer_block_side_left.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/drawer_block_side_right.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/drawer_block_top.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/ender_pearl_flower_stage_0.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/ender_pearl_flower_stage_1.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/ender_pearl_flower_stage_2.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/fairy_flower_1.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/fairy_flower_2.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/fairy_flower_3.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/fairy_flower_4.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/flame_cane_1.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/flame_cane_2.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/gunpowder_block.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/hami_melon.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/hami_melon_bottom.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/hami_melon_top.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/magma_plant.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/magma_plant.png.mcmeta delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/mushroom.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/netherite_anvil.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/netherite_anvil_top.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/palm_door.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/palm_door_bottom.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/palm_door_top.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/palm_leaves.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/palm_log.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/palm_log_top.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/palm_planks.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/palm_sapling.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/palm_trapdoor.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/pebble.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/reed.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/safe_block_bottom.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/safe_block_front.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/safe_block_front_open.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/safe_block_side.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/safe_block_top.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/solid_gunpowder_block.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/stripped_palm_log.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/stripped_palm_log_top.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/topaz_ore.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/custom/topaz_ore.png.mcmeta delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/block/empty.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/entity/equipment/humanoid/topaz.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/entity/equipment/humanoid_leggings/topaz.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/entity/equipment/wings/flame.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/entity/shulker/shulker_white.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/font/gui/custom/blasting.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/font/gui/custom/brewing_recipe.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/font/gui/custom/campfire.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/font/gui/custom/category.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/font/gui/custom/cooking_recipe.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/font/gui/custom/crafting_recipe.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/font/gui/custom/item_browser.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/font/gui/custom/no_recipe.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/font/gui/custom/smelting.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/font/gui/custom/smithing_transform_recipe.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/font/gui/custom/smoking.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/font/gui/custom/stonecutting_recipe.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/font/image/emojis.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/font/offset/space_split.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/gui/sprites/tooltip/topaz_background.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/gui/sprites/tooltip/topaz_background.png.mcmeta delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/gui/sprites/tooltip/topaz_frame.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/gui/sprites/tooltip/topaz_frame.png.mcmeta delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/bench.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/candelabrum.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/candelabrum_2d.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/candelabrum_flame.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/candelabrum_flame.png.mcmeta delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/cap.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/drill.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/drill_selected.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/drill_selected.png.mcmeta delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/ender_pearl_flower_seeds.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/fairy_flower.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/flame_cane.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/flame_elytra.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/flame_elytra_broken.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/flower_basket.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/flower_basket_2d.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/globe.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/gui/cooking_info.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/gui/cooking_info.png.mcmeta delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/gui/exit.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/gui/get_item.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/gui/next_page_0.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/gui/next_page_1.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/gui/previous_page_0.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/gui/previous_page_1.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/gui/return.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/hami_melon_seeds.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/hami_melon_slice.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/magma_fruit.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/magma_fruit.png.mcmeta delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/pebble.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/reed.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/showcase.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/sofa.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/table_lamp.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/table_lamp_on.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz.png.mcmeta delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_axe.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_axe.png.mcmeta delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_boots.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_boots.png.mcmeta delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_bow.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_bow_pulling_0.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_bow_pulling_1.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_bow_pulling_2.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_chestplate.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_chestplate.png.mcmeta delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_crossbow.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_crossbow_arrow.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_crossbow_firework.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_crossbow_pulling_0.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_crossbow_pulling_1.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_crossbow_pulling_2.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_helmet.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_helmet.png.mcmeta delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_hoe.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_hoe.png.mcmeta delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_leggings.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_leggings.png.mcmeta delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_pickaxe.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_pickaxe.png.mcmeta delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_rod.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_rod_cast.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_shield.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_shield_blocking.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_shovel.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_shovel.png.mcmeta delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_spear.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_spear_in_hand.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_sword.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_sword.png.mcmeta delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_trident.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/topaz_trident_3d.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/item/custom/wooden_chair.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/particle/empty.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/trims/entity/humanoid/chainmail.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/assets/minecraft/textures/trims/entity/humanoid_leggings/chainmail.png delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/ce_overlay_84/assets/default/items/gui_head_size_1.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/ce_overlay_84/assets/default/items/gui_head_size_4.json delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/pack.mcmeta delete mode 100644 Plugin/src/test/resources/bedrock-folder/bedrock/pack/resource_pack_unprotected/pack.png delete mode 100644 campfire-converter/campfire.mcpack delete mode 100644 campfire-converter/campfirev2.json delete mode 100644 tools/pose-calibrator.html diff --git a/.gitignore b/.gitignore index 9512fbfc..4058b9b4 100644 --- a/.gitignore +++ b/.gitignore @@ -135,4 +135,3 @@ reflection/ concepts/ MCBE-Vanilla-RP/ Minecraft-default-assets-latest/ -/Plugin/src/test/resources/bedrock-folder/bedrock-converted/ diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/ConfigFile.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/ConfigFile.java index 4a88c465..40bcdaef 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/ConfigFile.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/ConfigFile.java @@ -5,7 +5,7 @@ /** * The configuration files the plugin ships, one per converter plus a general one. *

- * Split because a single file grew to 318 lines covering every converter at once: a Bedrock user had to scroll past + * Split because a single file grew to 318 lines covering every converter at once: a user had to scroll past * the Nexo, ItemsAdder and world-converter blocks to reach the handful of settings they came for, and every new * converter made that worse. One file per converter means a server owner opens exactly the file they mean to edit. *

@@ -17,7 +17,6 @@ public enum ConfigFile { /** General settings that belong to no single converter: debug, language, formatting, tags, progress bars. */ MAIN("config.yml"), - BEDROCK("bedrock.yml"), NEXO("nexo.yml"), ITEMS_ADDER("itemsadder.yml"), WORLD("world-converter.yml"); diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/Keys.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/Keys.java index b54b31b0..85723b3c 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/Keys.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/Keys.java @@ -1,7 +1,6 @@ package fr.robie.craftengineconverter.api.configuration; import com.google.gson.reflect.TypeToken; -import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.option.CreativeGroupRules; import fr.robie.craftengineconverter.api.configuration.loader.ConfigurationTrees; import fr.robie.craftengineconverter.api.enums.ArmorConverter; import fr.robie.craftengineconverter.api.enums.ConverterOption; @@ -17,7 +16,6 @@ import java.util.Locale; import java.util.Map; -import static fr.robie.craftengineconverter.api.configuration.ConfigFile.BEDROCK; import static fr.robie.craftengineconverter.api.configuration.ConfigFile.ITEMS_ADDER; import static fr.robie.craftengineconverter.api.configuration.ConfigFile.MAIN; import static fr.robie.craftengineconverter.api.configuration.ConfigFile.NEXO; @@ -94,57 +92,19 @@ private Keys() { public static final Key IMAGE_TAG_ENABLED = Key.bool(MAIN, "tag.itemsadder-image.enabled", true); public static final Key PLACEHOLDER_API_TAG_ENABLED = Key.bool(MAIN, "tag.placeholder-api.enabled", true); - // ------------------------------------------------------------------ bedrock.yml + // ------------------------------------------------------------------ item conversion (config.yml) - /** - * Where the Bedrock converter reads from and writes to. These six never had keys at all: they were read straight - * off a {@code bedrock:} section by {@code BedrockSettings.fromConfig}, with defaults hidden in a constructor and - * nothing written back, so the section never appeared in the shipped file and a user had to know to add it. - */ - public static final Key BEDROCK_ITEMS_FOLDER = - Key.string(BEDROCK, "folders.items", "bedrock/items").legacy("bedrock.items-folder"); - public static final Key BEDROCK_INPUT_PACK_FOLDER = - Key.string(BEDROCK, "folders.input-pack", "bedrock/pack").legacy("bedrock.input-pack-folder"); - public static final Key BEDROCK_OUTPUT_FOLDER = - Key.string(BEDROCK, "folders.output", "bedrock-converted/Geyser-Spigot").legacy("bedrock.output-folder"); - public static final Key BEDROCK_OUTPUT_PACK_NAME = - Key.string(BEDROCK, "folders.output-pack-name", "CraftEngineConverterPack") - .legacy("bedrock.output-pack-name"); - public static final Key> BEDROCK_EXTRA_ITEMS_FOLDERS = - Key.of(BEDROCK, "folders.extra-items", new TypeToken>() {}, ArrayList::new) - .legacy("bedrock.extra-items-folders"); - public static final Key> BEDROCK_EXTRA_PACK_FOLDERS = - Key.of(BEDROCK, "folders.extra-packs", new TypeToken>() {}, ArrayList::new) - .legacy("bedrock.extra-pack-folders"); - - public static final Key VANILLA_ASSETS_DOWNLOAD = Key.bool(BEDROCK, "vanilla-assets.download", true); - public static final Key VANILLA_ASSETS_VERSION = Key.string(BEDROCK, "vanilla-assets.version", "auto"); - public static final Key VANILLA_ASSETS_PATH = Key.string(BEDROCK, "vanilla-assets.path", ""); - - public static final Key RENDER_ITEM_ICONS = Key.bool(BEDROCK, "render-item-icons", true); - public static final Key ITEM_ICON_SIZE = Key.integer(BEDROCK, "item-icon-size", 64); - public static final Key SHORTEN_PACK_PATHS = Key.bool(BEDROCK, "shorten-pack-paths", true); - public static final Key ITEM_DRAW_STATES = Key.bool(BEDROCK, "item-draw-states", true) - .doc("Lets a bow or crossbow change model as it is drawn.", - "", - "Geyser cannot express draw progress - its range_dispatch predicate only knows damage, count,", - "bundle fullness and custom model data - so the swap is done inside the resource pack instead,", - "by a render controller indexing its frames from a Molang variable. Without this, a custom bow", - "keeps its idle model the whole way through the draw.", - "", - "Turn it off if a bow shows the wrong frame: Bedrock reports the use duration in units that are", - "not documented anywhere, so the timing is the one part of this taken from measurement."); - public static final Key DISABLE_DEFAULT_ITALIC = Key.bool(BEDROCK, "disable-default-italic", true); + public static final Key DISABLE_DEFAULT_ITALIC = Key.bool(MAIN, "disable-default-italic", true); public static final Key ARMOR_CONVERTER_TYPE = - Key.of(BEDROCK, "armor-converter-type", new TypeToken<>() {}, () -> ArmorConverter.COMPONENT); + Key.of(MAIN, "armor-converter-type", new TypeToken<>() {}, () -> ArmorConverter.COMPONENT); /** * Object-typed, as it was before: the value is a {@code Material} or the string {@code "auto"} depending on what * the file says. Narrowing it would change how it parses, which is a separate job. */ public static final Key DEFAULT_MATERIAL = Key.of( - BEDROCK, "default-material", new TypeToken<>() {}, () -> (Object) "auto", (o, d) -> { + MAIN, "default-material", new TypeToken<>() {}, () -> (Object) "auto", (o, d) -> { if (o instanceof Material material) return material; if (o instanceof String name) { if (name.isBlank() || name.equalsIgnoreCase("auto")) return "auto"; @@ -158,25 +118,6 @@ private Keys() { return d.get(); }); - public static final Key CREATIVE_GROUPS = Key.of( - BEDROCK, "creative-groups", new TypeToken<>() {}, () -> (Object) new LinkedHashMap(), - (o, d) -> { - if (o instanceof ConfigurationSection section) return CreativeGroupRules.parse(section); - return CreativeGroupRules.empty(); - }); - - public static final Key HELD_ITEM_ANCHORS = Key.of( - BEDROCK, "held-item-anchors", new TypeToken<>() {}, () -> (Object) new LinkedHashMap(), - (o, d) -> { - if (o instanceof ConfigurationSection section) return section; - if (o instanceof Map map) { - Map copy = new LinkedHashMap<>(); - map.forEach((key, value) -> copy.put(String.valueOf(key), value)); - return ConfigurationTrees.toSection(copy); - } - return d.get(); - }); - // ------------------------------------------------------------------ nexo.yml public static final Key NEXO_ENABLE_HOOK = diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/ItemTextureConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/ItemTextureConfiguration.java deleted file mode 100644 index c489e09a..00000000 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/ItemTextureConfiguration.java +++ /dev/null @@ -1,69 +0,0 @@ -package fr.robie.craftengineconverter.api.configuration.bedrock; - -import com.google.gson.JsonObject; -import fr.robie.craftengineconverter.api.configuration.bedrock.texture.TextureData; -import fr.robie.craftengineconverter.api.manager.FileCacheManager; -import org.jetbrains.annotations.NotNull; - -import java.nio.file.Path; -import java.util.ArrayList; -import java.util.List; - -public class ItemTextureConfiguration { - private String resourcePackName; - private String textureName; - private String fileName = "item_texture.json"; - - private final List textures = new ArrayList<>(); - - public ItemTextureConfiguration setResourcePackName(String resourcePackName) { - this.resourcePackName = resourcePackName; - return this; - } - - public ItemTextureConfiguration setTextureName(String textureName) { - this.textureName = textureName; - return this; - } - - public ItemTextureConfiguration setFileName(String fileName) { - this.fileName = fileName; - return this; - } - - public boolean isEmpty() { - return this.textures.isEmpty(); - } - - public List getTextures() { - return this.textures; - } - - public ItemTextureConfiguration addTextureData(@NotNull TextureData textureData) { - this.textures.add(textureData); - return this; - } - - public void save(@NotNull Path directory) { - JsonObject jsonObject = new JsonObject(); - - if (this.resourcePackName != null) { - jsonObject.addProperty("resource_pack_name", this.resourcePackName); - } - - if (this.textureName != null) { - jsonObject.addProperty("texture_name", this.textureName); - } - - JsonObject texturesObject = new JsonObject(); - for (TextureData textureData : this.textures) { - if (!textureData.getTextures().isEmpty()) { - texturesObject.add(textureData.getBedrockIdentifier(), textureData.serialize()); - } - } - jsonObject.add("texture_data", texturesObject); - - FileCacheManager.saveJsonToFile(directory.resolve(this.fileName), jsonObject); - } - -} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/ManifestConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/ManifestConfiguration.java deleted file mode 100644 index 98317101..00000000 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/ManifestConfiguration.java +++ /dev/null @@ -1,665 +0,0 @@ -package fr.robie.craftengineconverter.api.configuration.bedrock; - -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import fr.robie.craftengineconverter.api.manager.FileCacheManager; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -import java.nio.file.Path; -import java.util.*; - -public final class ManifestConfiguration { - public static final int[] DEFAULT_PACK_VERSION = {1, 0, 0}; - public static final int[] DEFAULT_MIN_ENGINE_VERSION = {1, 21, 0}; - public static final int FORMAT_VERSION = 2; - - // Header - final String packName; - final String packDescription; - final UUID packUUID; - final int[] packVersion; - final int[] minEngineVersion; - final int @Nullable [] baseGameVersion; - final boolean allowRandomSeed; - final boolean lockTemplateOptions; - final boolean platformLocked; - final @Nullable PackScope scope; - - // Module - final ModuleType moduleType; - final UUID moduleUUID; - final @Nullable String scriptEntry; - - // Dependencies - final List dependencies; - - // Capabilities - final Set capabilities; - - // Subpacks - final List subpacks; - - // Metadata - final List authors; - final @Nullable String license; - final @Nullable String productType; - final @Nullable String url; - final Map> generatedWith; - - private ManifestConfiguration(Builder builder) { - this.packName = builder.packName; - this.packDescription = builder.packDescription; - this.packUUID = builder.packUUID != null ? builder.packUUID : UUID.randomUUID(); - this.packVersion = builder.packVersion; - this.minEngineVersion = builder.minEngineVersion; - this.baseGameVersion = builder.baseGameVersion; - this.allowRandomSeed = builder.allowRandomSeed; - this.lockTemplateOptions = builder.lockTemplateOptions; - this.platformLocked = builder.platformLocked; - this.scope = builder.scope; - - this.moduleType = builder.moduleType; - UUID muuid = builder.moduleUUID; - if (muuid == null || muuid.equals(this.packUUID)) { - do { muuid = UUID.randomUUID(); } while (muuid.equals(this.packUUID)); - } - this.moduleUUID = muuid; - this.scriptEntry = builder.scriptEntry; - - this.dependencies = List.copyOf(builder.dependencies); - this.capabilities = Collections.unmodifiableSet(new LinkedHashSet<>(builder.capabilities)); - this.subpacks = List.copyOf(builder.subpacks); - - this.authors = List.copyOf(builder.authors); - this.license = builder.license; - this.productType = builder.productType; - this.url = builder.url; - this.generatedWith = deepCopyGeneratedWith(builder.generatedWith); - } - - /** Builder pre-configured for a resource pack ({@code type: "resources"}). */ - public static ResourcePackBuilder resourcePack(@NotNull String name) { - return new ResourcePackBuilder(name); - } - - /** Builder pre-configured for a behavior pack ({@code type: "data"}). */ - public static BehaviorPackBuilder behaviorPack(@NotNull String name) { - return new BehaviorPackBuilder(name); - } - - /** Builder pre-configured for a world template ({@code type: "world_template"}). */ - public static WorldTemplateBuilder worldTemplate(@NotNull String name) { - return new WorldTemplateBuilder(name); - } - - /** Builder pre-configured for a script pack ({@code type: "script"}). */ - public static ScriptPackBuilder scriptPack(@NotNull String name) { - return new ScriptPackBuilder(name); - } - - /** Builder pre-configured for a skin pack ({@code type: "skin_pack"}). */ - public static SkinPackBuilder skinPack(@NotNull String name) { - return new SkinPackBuilder(name); - } - - public void saveManifest(@NotNull Path directory) { - JsonObject json = new JsonObject(); - json.addProperty("format_version", FORMAT_VERSION); - - json.add("header", this.buildHeader()); - json.add("modules", this.buildModules()); - - if (!this.dependencies.isEmpty()) { - JsonArray deps = new JsonArray(); - this.dependencies.forEach(deps::add); - json.add("dependencies", deps); - } - - if (!this.capabilities.isEmpty()) { - JsonArray caps = new JsonArray(); - this.capabilities.forEach(c -> caps.add(c.key())); - json.add("capabilities", caps); - } - - if (!this.subpacks.isEmpty()) { - json.add("subpacks", this.buildSubpacks()); - } - - JsonObject metadata = this.buildMetadata(); - if (!metadata.isEmpty()) json.add("metadata", metadata); - - FileCacheManager.saveJsonToFile(directory.resolve("manifest.json"), json); - } - - private JsonObject buildHeader() { - JsonObject header = new JsonObject(); - header.addProperty("name", safeText(this.packName, "Unnamed Pack")); - header.addProperty("description", safeText(this.packDescription, "Converted pack")); - header.addProperty("uuid", this.packUUID.toString()); - header.add("version", toJsonArray(safeVersion(this.packVersion, DEFAULT_PACK_VERSION))); - header.add("min_engine_version", toJsonArray(safeVersion(this.minEngineVersion, DEFAULT_MIN_ENGINE_VERSION))); - - if (this.baseGameVersion != null) - header.add("base_game_version", toJsonArray(safeVersion(this.baseGameVersion, DEFAULT_MIN_ENGINE_VERSION))); - if (this.allowRandomSeed) - header.addProperty("allow_random_seed", true); - if (this.lockTemplateOptions) - header.addProperty("lock_template_options", true); - if (this.platformLocked) - header.addProperty("platform_locked", true); - if (this.scope != null) - header.addProperty("pack_scope", this.scope.key()); - - return header; - } - - private JsonArray buildModules() { - JsonArray modules = new JsonArray(); - JsonObject module = new JsonObject(); - - module.addProperty("type", this.moduleType.key()); - module.addProperty("description", safeText(this.packDescription, "Converted pack")); - module.addProperty("uuid", this.moduleUUID.toString()); - module.add("version", toJsonArray(safeVersion(this.packVersion, DEFAULT_PACK_VERSION))); - - if (this.moduleType == ModuleType.SCRIPT) { - module.addProperty("language", "javascript"); - if (this.scriptEntry != null) module.addProperty("entry", this.scriptEntry); - } - - modules.add(module); - return modules; - } - - private JsonArray buildSubpacks() { - JsonArray arr = new JsonArray(); - for (Subpack sp : this.subpacks) { - JsonObject obj = new JsonObject(); - obj.addProperty("folder_name", sp.folderName()); - obj.addProperty("name", sp.name()); - if (sp.memoryTier() != null) obj.addProperty("memory_tier", sp.memoryTier()); - arr.add(obj); - } - return arr; - } - - private JsonObject buildMetadata() { - JsonObject metadata = new JsonObject(); - - if (!this.authors.isEmpty()) { - JsonArray arr = new JsonArray(); - this.authors.forEach(arr::add); - metadata.add("authors", arr); - } - if (this.license != null) metadata.addProperty("license", this.license); - if (this.productType != null) metadata.addProperty("product_type", this.productType); - if (this.url != null) metadata.addProperty("url", this.url); - - if (!this.generatedWith.isEmpty()) { - JsonObject gw = new JsonObject(); - this.generatedWith.forEach((tool, versions) -> { - JsonArray vArr = new JsonArray(); - versions.forEach(vArr::add); - gw.add(tool, vArr); - }); - metadata.add("generated_with", gw); - } - - return metadata; - } - - /** - * Parses a Java Edition {@code pack.mcmeta} root object and returns a - * {@link ResourcePackBuilder} pre-populated with the extracted data. - * - *

Handled fields: - *

    - *
  • {@code pack.description} — string, array, or JSON text component
  • - *
  • {@code pack.pack_format} — mapped heuristically to {@code min_engine_version}
  • - *
- */ - public static ResourcePackBuilder fromJavaPackFormat(@NotNull JsonObject json) { - JsonObject pack = json.getAsJsonObject("pack"); - if (pack == null) - throw new IllegalArgumentException("Invalid Java pack format: missing 'pack' object"); - - String name = "Unnamed Pack"; - String description = null; - - JsonElement descEl = pack.get("description"); - if (descEl != null) { - if (descEl.isJsonArray()) { - JsonArray arr = descEl.getAsJsonArray(); - if (!arr.isEmpty()) { - name = plainText(arr.get(0)); - if (arr.size() > 1) { - StringBuilder sb = new StringBuilder(); - for (int i = 1; i < arr.size(); i++) { - if (i > 1) sb.append(' '); - sb.append(plainText(arr.get(i))); - } - description = sb.toString(); - } - } - } else if (descEl.isJsonPrimitive()) { - name = descEl.getAsString(); - } else if (descEl.isJsonObject()) { - name = plainText(descEl.getAsJsonObject()); - } - } - - ResourcePackBuilder builder = ManifestConfiguration.resourcePack(name); - if (description != null) builder.description(description); - - return builder; - } - - private static String plainText(JsonObject component) { - StringBuilder sb = new StringBuilder(); - JsonElement own = component.get("text"); - if (own != null && own.isJsonPrimitive()) sb.append(own.getAsString()); - JsonElement extra = component.get("extra"); - if (extra != null && extra.isJsonArray()) - for (JsonElement child : extra.getAsJsonArray()) sb.append(plainText(child)); - String plain = sb.toString().trim(); - return plain.isEmpty() ? "Unnamed Pack" : plain; - } - - private static String plainText(JsonElement element) { - if (element.isJsonPrimitive()) return element.getAsString(); - if (element.isJsonObject()) return plainText(element.getAsJsonObject()); - if (element.isJsonArray()) { - StringBuilder sb = new StringBuilder(); - for (JsonElement child : element.getAsJsonArray()) sb.append(plainText(child)); - return sb.toString(); - } - return ""; - } - - static int[] safeVersion(int[] version, int[] fallback) { - if (version == null || version.length != 3) return fallback; - boolean allZero = true; - for (int part : version) { - if (part < 0) return fallback; - if (part != 0) allZero = false; - } - return allZero ? fallback : version; - } - - static String safeText(String text, String fallback) { - if (text == null || text.isBlank()) return fallback; - String cleaned = text.replaceAll("\\s+", " ").trim(); - return cleaned.length() > 256 ? cleaned.substring(0, 256) : cleaned; - } - - static int[] parseVersion(String version) { - String[] parts = version.split("\\."); - return new int[]{ - parts.length > 0 ? safeParseInt(parts[0]) : 1, - parts.length > 1 ? safeParseInt(parts[1]) : 0, - parts.length > 2 ? safeParseInt(parts[2]) : 0 - }; - } - - private static int safeParseInt(String s) { - try { return Integer.parseInt(s.trim()); } catch (NumberFormatException e) { return 0; } - } - - static JsonArray toJsonArray(int[] values) { - JsonArray arr = new JsonArray(); - for (int v : values) arr.add(v); - return arr; - } - - private static Map> deepCopyGeneratedWith(Map> src) { - Map> copy = new LinkedHashMap<>(); - src.forEach((k, v) -> copy.put(k, List.copyOf(v))); - return Collections.unmodifiableMap(copy); - } - - /** - * Base builder. All common fields live here. - * - * @param the concrete builder subtype, for fluent chaining - */ - @SuppressWarnings("unchecked") - public abstract static class Builder> { - final String packName; - - // Header - String packDescription = "Generated by CraftEngineConverter"; - @Nullable UUID packUUID; - int[] packVersion = DEFAULT_PACK_VERSION.clone(); - int[] minEngineVersion = DEFAULT_MIN_ENGINE_VERSION.clone(); - int @Nullable [] baseGameVersion; - boolean allowRandomSeed = false; - boolean lockTemplateOptions = false; - boolean platformLocked = false; - @Nullable PackScope scope; - - // Module - final ModuleType moduleType; - @Nullable UUID moduleUUID; - @Nullable String scriptEntry; - - // Dependencies - final List dependencies = new ArrayList<>(); - - // Capabilities - final Set capabilities = new LinkedHashSet<>(); - - // Subpacks - final List subpacks = new ArrayList<>(); - - // Metadata - final List authors = new ArrayList<>(); - @Nullable String license; - @Nullable String productType; - @Nullable String url; - final Map> generatedWith = new LinkedHashMap<>(); - - protected Builder(@NotNull String packName, @NotNull ModuleType moduleType) { - this.packName = Objects.requireNonNull(packName, "packName"); - this.moduleType = Objects.requireNonNull(moduleType, "moduleType"); - } - - public B description(@NotNull String description) { - this.packDescription = description; - return (B) this; - } - - public B packUUID(@NotNull UUID uuid) { - this.packUUID = uuid; - return (B) this; - } - - public B packVersion(int major, int minor, int patch) { - this.packVersion = new int[]{major, minor, patch}; - return (B) this; - } - - public B packVersion(@NotNull String version) { - this.packVersion = parseVersion(version); - return (B) this; - } - - public B minEngineVersion(int major, int minor, int patch) { - this.minEngineVersion = new int[]{major, minor, patch}; - return (B) this; - } - - public B minEngineVersion(@NotNull String version) { - this.minEngineVersion = parseVersion(version); - return (B) this; - } - - public B platformLocked(boolean platformLocked) { - this.platformLocked = platformLocked; - return (B) this; - } - - public B moduleUUID(@NotNull UUID uuid) { - this.moduleUUID = uuid; - return (B) this; - } - - /** - * Adds a pack dependency by UUID and optional display name. - * Version may be passed as a triple or as a semver string. - */ - public B addDependency(@NotNull UUID uuid, @Nullable String name, int major, int minor, int patch) { - JsonObject dep = new JsonObject(); - dep.addProperty("uuid", uuid.toString()); - if (name != null && !name.isBlank()) dep.addProperty("name", name); - dep.add("version", toJsonArray(new int[]{major, minor, patch})); - this.dependencies.add(dep); - return (B) this; - } - - public B addDependency(@NotNull UUID uuid, int major, int minor, int patch) { - return this.addDependency(uuid, null, major, minor, patch); - } - - /** - * Adds a Minecraft engine module dependency (e.g. {@code @minecraft/server}). - * {@code version} must be a semver string such as {@code "1.0.0"}. - */ - public B addEngineDependency(@NotNull String moduleName, @NotNull String version) { - JsonObject dep = new JsonObject(); - dep.addProperty("module_name", moduleName); - dep.addProperty("version", version); - this.dependencies.add(dep); - return (B) this; - } - - public B addEngineDependency(@NotNull UUID uuid, @NotNull String moduleName, @NotNull String version) { - JsonObject dep = new JsonObject(); - dep.addProperty("uuid", uuid.toString()); - dep.addProperty("module_name", moduleName); - dep.addProperty("version", version); - this.dependencies.add(dep); - return (B) this; - } - - public B addCapability(@NotNull Capability capability) { - this.capabilities.add(capability); - return (B) this; - } - - public B capabilities(@NotNull Collection caps) { - this.capabilities.clear(); - this.capabilities.addAll(caps); - return (B) this; - } - - /** - * Adds a subpack entry. - * - * @param folderName the subfolder inside the pack (e.g. {@code "Low"}) - * @param name the display name shown in settings - * @param memoryTier RAM tier threshold; pass {@code null} to omit the field - */ - public B addSubpack(@NotNull String folderName, @NotNull String name, @Nullable Integer memoryTier) { - this.subpacks.add(new Subpack(folderName, name, memoryTier)); - return (B) this; - } - - - public B addAuthor(@NotNull String author) { - if (!author.isBlank()) this.authors.add(author.trim()); - return (B) this; - } - - public B authors(@NotNull List authors) { - this.authors.clear(); - this.authors.addAll(authors); - return (B) this; - } - - public B license(@NotNull String license) { - this.license = license; - return (B) this; - } - - public B productType(@NotNull String productType) { - this.productType = productType; - return (B) this; - } - - public B url(@NotNull String url) { - this.url = url; - return (B) this; - } - - /** - * Records a tool version in {@code metadata.generated_with}. - * Tool names must be ≤ 32 simple characters per the Bedrock spec. - */ - public B addGeneratedWith(@NotNull String toolName, @NotNull String version) { - if (toolName.length() > 32) - throw new IllegalArgumentException("generated_with tool name must be ≤ 32 characters"); - this.generatedWith.computeIfAbsent(toolName, k -> new ArrayList<>()).add(version); - return (B) this; - } - - public ManifestConfiguration build() { - return new ManifestConfiguration(this); - } - - public ManifestConfiguration saveManifest(@NotNull Path directory) { - ManifestConfiguration config = this.build(); - config.saveManifest(directory); - return config; - } - } - - /** - * Builder for resource packs ({@code type: "resources"}). - * Exposes {@code pack_scope} and subpack support. - */ - public static final class ResourcePackBuilder extends Builder { - - ResourcePackBuilder(@NotNull String name) { - super(name, ModuleType.RESOURCES); - } - - /** - * Sets {@code pack_scope} — at which level this resource pack can be applied. - * Defaults to {@link PackScope#ANY} when omitted. - */ - public ResourcePackBuilder scope(@NotNull PackScope scope) { - this.scope = scope; - return this; - } - } - - /** - * Builder for behavior packs ({@code type: "data"}). - */ - public static final class BehaviorPackBuilder extends Builder { - - BehaviorPackBuilder(@NotNull String name) { - super(name, ModuleType.DATA); - } - } - - /** - * Builder for world templates ({@code type: "world_template"}). - * Exposes world-template-specific header fields. - */ - public static final class WorldTemplateBuilder extends Builder { - - WorldTemplateBuilder(@NotNull String name) { - super(name, ModuleType.WORLD_TEMPLATE); - } - - /** - * Sets {@code base_game_version} — locks the world to a specific vanilla version. - */ - public WorldTemplateBuilder baseGameVersion(int major, int minor, int patch) { - this.baseGameVersion = new int[]{major, minor, patch}; - return this; - } - - /** - * Sets {@code allow_random_seed} — whether players can create the world with a random seed. - */ - public WorldTemplateBuilder allowRandomSeed(boolean allow) { - this.allowRandomSeed = allow; - return this; - } - - /** - * Sets {@code lock_template_options} — hides world settings from the player. - */ - public WorldTemplateBuilder lockTemplateOptions(boolean lock) { - this.lockTemplateOptions = lock; - return this; - } - } - - /** - * Builder for script packs ({@code type: "script"}). - * Requires a script entry point; exposes engine dependency helpers. - */ - public static final class ScriptPackBuilder extends Builder { - - ScriptPackBuilder(@NotNull String name) { - super(name, ModuleType.SCRIPT); - } - - /** - * Sets the relative path to the main script file (e.g. {@code "scripts/main.js"}). - * The {@code language} field is always {@code "javascript"} per the spec. - */ - public ScriptPackBuilder entry(@NotNull String entryPath) { - this.scriptEntry = entryPath; - return this; - } - } - - /** - * Builder for skin packs ({@code type: "skin_pack"}). - */ - public static final class SkinPackBuilder extends Builder { - - SkinPackBuilder(@NotNull String name) { - super(name, ModuleType.SKIN_PACK); - } - } - - public enum PackScope { - ANY("any"), - GLOBAL("global"), - WORLD("world"); - private final String key; - - PackScope(String key) { - this.key = key; - } - - public String key() { - return this.key; - } - } - - public enum ModuleType { - RESOURCES("resources"), - DATA("data"), - WORLD_TEMPLATE("world_template"), - SKIN_PACK("skin_pack"), - PERSONA_PIECE("persona_piece"), - SCRIPT("script"); - private final String key; - - ModuleType(String key) { - this.key = key; - } - - public String key() { - return this.key; - } - } - - public enum Capability { - CHEMISTRY("chemistry"), - EDITOR_EXTENSION("editorExtension"), - EXPERIMENTAL_CUSTOM_UI("experimental_custom_ui"), - SCRIPT_EVAL("script_eval"), - RAYTRACED("raytraced"), - PBR("pbr"); - private final String key; - - Capability(String key) { - this.key = key; - } - - public String key() { - return this.key; - } - } - - public record Subpack(@NotNull String folderName, @NotNull String name, @Nullable Integer memoryTier) {} -} \ No newline at end of file diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/MappingsConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/MappingsConfiguration.java deleted file mode 100644 index 674100eb..00000000 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/MappingsConfiguration.java +++ /dev/null @@ -1,65 +0,0 @@ -package fr.robie.craftengineconverter.api.configuration.bedrock.mapping; - -import com.google.gson.JsonArray; -import com.google.gson.JsonObject; -import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.ItemMapping; -import fr.robie.craftengineconverter.api.manager.FileCacheManager; -import org.bukkit.Material; -import org.jetbrains.annotations.NotNull; - -import java.nio.file.Path; -import java.util.*; - -public class MappingsConfiguration { - private static final int formatVersion = 2; - - private final Map> itemMappings = new TreeMap<>(Comparator.comparing(Material::name)); - - public MappingsConfiguration addItemMapping(@NotNull ItemMapping itemMapping) { - this.itemMappings.computeIfAbsent(itemMapping.getJavaMaterial(), k -> new ArrayList<>()).add(itemMapping); - return this; - } - - public List getMappings(@NotNull Material material) { - return this.itemMappings.get(material); - } - - public boolean removeItemMapping(@NotNull Material material, @NotNull ItemMapping mapping) { - List list = this.itemMappings.get(material); - return list != null && list.remove(mapping); - } - - public void replaceItemMapping(@NotNull Material material, @NotNull ItemMapping old, @NotNull ItemMapping replacement) { - List list = this.itemMappings.get(material); - if (list != null) { - int index = list.indexOf(old); - if (index >= 0) { - list.set(index, replacement); - } - } - } - - public void saveMappings(@NotNull Path directory) { - JsonObject jsonObject = new JsonObject(); - - jsonObject.addProperty("format_version", formatVersion); - - JsonObject itemsObject = new JsonObject(); - - for (var entry : this.itemMappings.entrySet()) { - Material material = entry.getKey(); - List mappings = entry.getValue(); - - JsonArray mappingsArray = new JsonArray(); - for (ItemMapping mapping : mappings) { - mappingsArray.add(mapping.serialize()); - } - itemsObject.add("minecraft:" + material.name().toLowerCase(), mappingsArray); - } - - jsonObject.add("items", itemsObject); - - Path mappingsFile = directory.resolve("geyser_item_mappings.json"); - FileCacheManager.saveJsonToFile(mappingsFile, jsonObject); - } -} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/block/BlockDefinition.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/block/BlockDefinition.java deleted file mode 100644 index 52f213bb..00000000 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/block/BlockDefinition.java +++ /dev/null @@ -1,276 +0,0 @@ -package fr.robie.craftengineconverter.api.configuration.bedrock.mapping.block; - -import com.google.gson.JsonArray; -import com.google.gson.JsonObject; -import org.jetbrains.annotations.Nullable; - -import java.util.List; -import java.util.Map; -import java.util.Optional; - -public class BlockDefinition { - private final GeometryWithMaterials geometry; - private final Optional friction; - private final int lightEmission; - private final int lightDampening; - private final boolean placeAir; - private final Transformation transformation; - private final List collisionBoxes; - private final Box selectionBox; - - public BlockDefinition( - @Nullable GeometryWithMaterials geometry, - Optional friction, int lightEmission, int lightDampening, - boolean placeAir, @Nullable Transformation transformation - ) { - this(geometry, friction, lightEmission, lightDampening, placeAir, transformation, null, null); - } - - public BlockDefinition( - @Nullable GeometryWithMaterials geometry, - Optional friction, int lightEmission, int lightDampening, - boolean placeAir, @Nullable Transformation transformation, - @Nullable List collisionBoxes, @Nullable Box selectionBox - ) { - this.collisionBoxes = collisionBoxes; - this.selectionBox = selectionBox; - this.geometry = geometry; - this.friction = friction; - this.lightEmission = lightEmission; - this.lightDampening = lightDampening; - this.placeAir = placeAir; - this.transformation = transformation; - } - - public Optional geometry() { return Optional.ofNullable(this.geometry); } - - public JsonObject serialize() { - JsonObject obj = new JsonObject(); - this.geometry().ifPresent(g -> { - obj.add("geometry", g.geometry().serialize()); - obj.add("material_instances", g.materialInstances().serialize()); - }); - this.friction.ifPresent(f -> obj.addProperty("friction", f)); - if (this.lightEmission > 0) obj.addProperty("light_emission", this.lightEmission); - if (this.lightDampening > 0) obj.addProperty("light_dampening", this.lightDampening); - if (!this.placeAir) obj.addProperty("place_air", false); - if (this.transformation != null && !this.transformation.isIdentity()) { - obj.add("transformation", this.transformation.serialize()); - } - // One box serialises as an object, several as an array. Several is the point: a stair's two parts union - // to a full cube, so a single box gives it a full-block hitbox — which is what it had. - if (this.collisionBoxes != null && !this.collisionBoxes.isEmpty()) { - if (this.collisionBoxes.size() == 1) { - obj.add("collision_box", this.collisionBoxes.getFirst().serialize()); - } else { - JsonArray boxes = new JsonArray(); - for (Box box : this.collisionBoxes) boxes.add(box.serialize()); - obj.add("collision_box", boxes); - } - } - if (this.selectionBox != null) obj.add("selection_box", this.selectionBox.serialize()); - return obj; - } - - public static class Builder { - private GeometryWithMaterials geometry; - private Optional friction = Optional.empty(); - private int lightEmission = 0; - private int lightDampening = 15; - private boolean placeAir = true; - private Transformation transformation = Transformation.IDENTITY; - private java.util.List collisionBoxes; - private Box selectionBox; - - /** - * A solid cube, shaded like any vanilla block: face dimming and ambient occlusion on, which is what a - * non-light-emitting block gets in vanilla. Both have to be stated, because Geyser defaults them to - * {@code false} and a custom block without them looks flat beside its neighbours. - */ - public Builder withFullBlockGeometry(String texture, String renderMethod) { - return this.withFullBlockGeometry(texture, renderMethod, Map.of()); - } - - /** - * A solid cube whose faces may differ. - *

- * {@code up}, {@code down}, {@code north}, {@code south}, {@code east} and {@code west} are material - * instance names Bedrock has built in, and a Java cube parent defines exactly those keys — so a log's end - * grain, a melon's top or a safe's front reach the right face directly. Without this every side wore one - * texture and a log was indistinguishable from bark-all-over wood. - * - * @param faceTextures per-face shortnames by Bedrock face name; any face left out falls back to - * {@code texture} - */ - public Builder withFullBlockGeometry(String texture, String renderMethod, Map faceTextures) { - MaterialInstances.Builder instances = new MaterialInstances.Builder() - .withInstance("*", texture, renderMethod, true, true); - for (Map.Entry face : faceTextures.entrySet()) { - if (face.getValue() == null || face.getValue().equals(texture)) continue; - instances.withInstance(face.getKey(), face.getValue(), renderMethod, true, true); - } - this.geometry = new GeometryWithMaterials( - new Geometry("minecraft:geometry.full_block"), instances.build()); - return this; - } - - /** - * The two crossed planes vanilla uses for plants. - *

- * Shading is deliberately off and the render method single-sided: {@code geometry.cross} flickers unless - * its faces are back-face culled, and shading a plane by which way it points makes one half of the cross - * darker than the other. This is the setup vanilla crops use. - */ - public Builder withCrossGeometry(String texture) { - MaterialInstances instances = new MaterialInstances.Builder() - .withInstance("*", texture, "alpha_test_single_sided", false, false) - .build(); - this.geometry = new GeometryWithMaterials(new Geometry("minecraft:geometry.cross"), instances); - return this; - } - - public Builder withCustomGeometry(String identifier, MaterialInstances instances) { - this.geometry = new GeometryWithMaterials(new Geometry(identifier), instances); - return this; - } - - /** - * A state that renders nothing at all. - *

- * This is how a pack hides the vanilla block a custom one is built on: it points that vanilla state at an - * empty model, and on Java the state draws nothing. Bedrock has no "no geometry" option, so the equivalent - * is a geometry with a bone and no cubes plus a fully transparent texture — the recipe in - * {@code bedrock-wiki/blocks/fake-blocks.md}. - *

- * Every part of this matters. Without {@code light_dampening: 0} the invisible state still darkens the - * block below it; without the zero boxes it keeps whatever collision the overridden Java block had, so the - * player walks into thin air; and the instance needs {@code alpha_test} with dimming and ambient occlusion - * off, or the transparent texture is shaded and culls its neighbours' faces. - * - * @param geometryIdentifier a cubeless geometry, shared across every invisible state - * @param transparentTexture a shortname whose PNG is fully transparent - */ - public Builder withInvisibleGeometry(String geometryIdentifier, String transparentTexture) { - MaterialInstances instances = new MaterialInstances.Builder() - .withInstance("*", transparentTexture, "alpha_test", false, false) - .build(); - this.geometry = new GeometryWithMaterials(new Geometry(geometryIdentifier), instances); - this.lightDampening = 0; - Box none = new Box(0, 0, 0, 0, 0, 0); - this.collisionBoxes = java.util.List.of(none); - this.selectionBox = none; - return this; - } - - public Builder withFriction(float f) { this.friction = Optional.of(f); return this; } - public Builder withLightEmission(int v) { this.lightEmission = v; return this; } - public Builder withLightDampening(int v) { this.lightDampening = v; return this; } - public Builder noPlaceAir() { this.placeAir = false; return this; } - public Builder withTransformation(Transformation t) { this.transformation = t; return this; } - - /** - * What the player collides with and what the outline traces. Left unset, Geyser infers both from the - * overridden Java block, which is only right when the pack's model happens to be that block's shape — - * so a stair-shaped model on a stair keeps a full cube and an anvil keeps the vanilla anvil's box. - */ - public Builder withBoxes(java.util.List collision, Box selection) { - this.collisionBoxes = collision; - this.selectionBox = selection; - return this; - } - - public BlockDefinition build() { - return new BlockDefinition(this.geometry, this.friction, this.lightEmission, this.lightDampening, - this.placeAir, this.transformation, this.collisionBoxes, this.selectionBox); - } - } - - /** - * An axis-aligned box in block space: x and z centred on the block, y from its floor. - */ - public record Box(float originX, float originY, float originZ, float sizeX, float sizeY, float sizeZ) { - public JsonObject serialize() { - JsonObject obj = new JsonObject(); - JsonArray origin = new JsonArray(); - origin.add(this.originX); origin.add(this.originY); origin.add(this.originZ); - JsonArray size = new JsonArray(); - size.add(this.sizeX); size.add(this.sizeY); size.add(this.sizeZ); - obj.add("origin", origin); - obj.add("size", size); - return obj; - } - } - - public record GeometryWithMaterials(Geometry geometry, MaterialInstances materialInstances) { - public JsonObject serialize() { - JsonObject obj = new JsonObject(); - obj.add("geometry", this.geometry.serialize()); - obj.add("material_instances", this.materialInstances.serialize()); - return obj; - } - } - - public record Geometry(String identifier, Map visibilityFilter) { - public Geometry(String identifier) { this(identifier, Map.of()); } - public JsonObject serialize() { - JsonObject obj = new JsonObject(); - obj.addProperty("identifier", this.identifier); - if (!this.visibilityFilter.isEmpty()) { - JsonObject vf = new JsonObject(); - for (Map.Entry e : this.visibilityFilter.entrySet()) { - vf.addProperty(e.getKey(), e.getValue()); - } - obj.add("bone_visibility", vf); - } - return obj; - } - } - - public record MaterialInstances(Map instances) { - public JsonObject serialize() { - JsonObject obj = new JsonObject(); - for (Map.Entry e : this.instances.entrySet()) { - obj.add(e.getKey(), e.getValue().serialize()); - } - return obj; - } - - public static class Builder { - // Insertion-ordered, and copied as such in build(): Map.copyOf would salt the order per JVM run. - private final Map instances = new java.util.LinkedHashMap<>(); - public Builder withInstance(String key, String texture, String renderMethod, boolean faceDimming, boolean ambientOcclusion) { - this.instances.put(key, new Instance(texture, renderMethod, faceDimming, ambientOcclusion)); - return this; - } - public MaterialInstances build() { - return new MaterialInstances(new java.util.LinkedHashMap<>(this.instances)); - } - } - - public record Instance(String texture, String renderMethod, boolean faceDimming, boolean ambientOcclusion) { - public JsonObject serialize() { - JsonObject obj = new JsonObject(); - if (this.texture != null) obj.addProperty("texture", this.texture); - obj.addProperty("render_method", this.renderMethod); - // Both are always written. Geyser defaults them to false, so omitting a true meant the opposite - // of what the caller asked for and left every full block unshaded. - obj.addProperty("face_dimming", this.faceDimming); - obj.addProperty("ambient_occlusion", this.ambientOcclusion); - return obj; - } - } - } - - public record Transformation(float sx, float sy, float sz, float tx, float ty, float tz, - int rx, int ry, int rz) { - public static final Transformation IDENTITY = new Transformation(1, 1, 1, 0, 0, 0, 0, 0, 0); - public boolean isIdentity() { return this.equals(IDENTITY); } - public JsonObject serialize() { - JsonObject obj = new JsonObject(); - JsonArray scale = new JsonArray(); scale.add(this.sx); scale.add(this.sy); scale.add(this.sz); obj.add("scale", scale); - JsonArray trans = new JsonArray(); trans.add(this.tx); trans.add(this.ty); trans.add(this.tz); obj.add("translation", trans); - JsonArray rot = new JsonArray(); rot.add(this.rx); rot.add(this.ry); rot.add(this.rz); obj.add("rotation", rot); - return obj; - } - } -} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/block/BlockMappingConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/block/BlockMappingConfiguration.java deleted file mode 100644 index 678ceca1..00000000 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/block/BlockMappingConfiguration.java +++ /dev/null @@ -1,120 +0,0 @@ -package fr.robie.craftengineconverter.api.configuration.bedrock.mapping.block; - -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import fr.robie.craftengineconverter.api.manager.FileCacheManager; -import org.jetbrains.annotations.NotNull; - -import java.nio.file.Path; -import java.util.LinkedHashMap; -import java.util.Map; - -public class BlockMappingConfiguration { - private final Map blocks = new LinkedHashMap<>(); - - public void mapBlock(@NotNull String javaIdentifier, @NotNull BlockEntry.Builder entry) { - this.mapBlock(javaIdentifier, entry.build()); - } - - public void mapBlock(@NotNull String javaIdentifier, @NotNull BlockEntry entry) { - this.blocks.merge(javaIdentifier, entry, (existing, incoming) -> { - if (existing.onlyOverrideStates() && incoming.onlyOverrideStates()) { - return existing.mergeStateOverrides(incoming); - } - return incoming; - }); - } - - public int size() { - return this.blocks.values().stream() - .mapToInt(e -> (e.base().isPresent() ? 1 : 0) + e.stateOverrides().size()) - .sum(); - } - - public boolean isEmpty() { return this.blocks.isEmpty(); } - - public Map entries() { return this.blocks; } - - public void save(@NotNull Path directory) { - if (this.blocks.isEmpty()) return; - - JsonObject root = new JsonObject(); - root.addProperty("format_version", 1); - - JsonObject blocksObj = new JsonObject(); - for (Map.Entry entry : this.blocks.entrySet()) { - blocksObj.add(entry.getKey(), entry.getValue().serialize()); - } - root.add("blocks", blocksObj); - - FileCacheManager.saveJsonToFile(directory.resolve("geyser_block_mappings.json"), root); - } - - public static class BlockEntry { - private final String name; - private final BlockDefinition base; - private final boolean includeInCreativeInventory; - private final boolean onlyOverrideStates; - private final Map stateOverrides; - - public BlockEntry(String name, BlockDefinition base, boolean includeInCreativeInventory, - boolean onlyOverrideStates, Map stateOverrides) { - this.name = name; - this.base = base; - this.includeInCreativeInventory = includeInCreativeInventory; - this.onlyOverrideStates = onlyOverrideStates; - this.stateOverrides = stateOverrides; - } - - public String name() { return this.name; } - public java.util.Optional base() { return java.util.Optional.ofNullable(this.base); } - public boolean onlyOverrideStates() { return this.onlyOverrideStates; } - public Map stateOverrides() { return this.stateOverrides; } - - public BlockEntry mergeStateOverrides(BlockEntry other) { - Map merged = new LinkedHashMap<>(this.stateOverrides); - merged.putAll(other.stateOverrides); - return new BlockEntry(this.name, this.base, this.includeInCreativeInventory, this.onlyOverrideStates, merged); - } - - public JsonObject serialize() { - JsonObject obj = new JsonObject(); - obj.addProperty("name", this.name); - if (this.base != null) { - // Inline base properties (geometry, material_instances, etc.) at the top level — - // Geyser has no "base" key; these fields live directly on the block entry. - for (Map.Entry e : this.base.serialize().entrySet()) { - obj.add(e.getKey(), e.getValue()); - } - } - if (this.includeInCreativeInventory) obj.addProperty("included_in_creative_inventory", true); - if (this.onlyOverrideStates) obj.addProperty("only_override_states", true); - JsonObject overrides = new JsonObject(); - for (Map.Entry e : this.stateOverrides.entrySet()) { - overrides.add(e.getKey(), e.getValue().serialize()); - } - obj.add("state_overrides", overrides); - return obj; - } - - public static class Builder { - private final String name; - private BlockDefinition base; - private boolean includeInCreativeInventory = false; - private boolean onlyOverrideStates = false; - private final Map stateOverrides = new LinkedHashMap<>(); - - public Builder(String name) { this.name = name; } - public Builder withBase(BlockDefinition base) { this.base = base; return this; } - public Builder includeInCreativeInventory() { this.includeInCreativeInventory = true; return this; } - public Builder onlyOverrideStates() { this.onlyOverrideStates = true; return this; } - public Builder withStateOverride(String state, BlockDefinition override) { - this.stateOverrides.put(state, override); return this; - } - public BlockEntry build() { - return new BlockEntry(this.name, this.base, this.includeInCreativeInventory, this.onlyOverrideStates, - new LinkedHashMap<>(this.stateOverrides)); - } - } - } -} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/GroupDefinitionMapping.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/GroupDefinitionMapping.java deleted file mode 100644 index f4185d16..00000000 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/GroupDefinitionMapping.java +++ /dev/null @@ -1,59 +0,0 @@ -package fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item; - -import com.google.gson.JsonArray; -import com.google.gson.JsonObject; -import org.bukkit.Material; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -import java.util.ArrayList; -import java.util.List; - -public class GroupDefinitionMapping extends ItemMapping { - private String model; - - private final List definitions = new ArrayList<>(); - - public GroupDefinitionMapping(@NotNull Material javaMaterial, @NotNull String bedrockIdentifier) { - super(javaMaterial, bedrockIdentifier); - } - - public String getModel() { - return this.model; - } - - public GroupDefinitionMapping setModel(@Nullable String model) { - this.model = model; - return this; - } - - public List getDefinitions() { - return this.definitions; - } - - public boolean hasDefinitions() { - return !this.definitions.isEmpty(); - } - - public GroupDefinitionMapping addDefinition(@NotNull ItemMapping definition) { - this.definitions.add(definition); - return this; - } - - @Override - public JsonObject serialize() { - JsonObject jsonObject = super.serialize(); - - if (this.model != null) { - jsonObject.addProperty("model", this.model); - } - - jsonObject.addProperty("type", "group"); - - if (!this.definitions.isEmpty()) { - jsonObject.add("definitions", this.definitions.stream().map(ItemMapping::serialize).collect(JsonArray::new, JsonArray::add, JsonArray::addAll)); - } - - return jsonObject; - } -} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/ItemMapping.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/ItemMapping.java deleted file mode 100644 index 2ba9a522..00000000 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/ItemMapping.java +++ /dev/null @@ -1,135 +0,0 @@ -package fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item; - -import com.google.gson.JsonArray; -import com.google.gson.JsonObject; -import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.component.BedrockComponent; -import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.option.BedrockOptions; -import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate.BedrockPredicate; -import fr.robie.craftengineconverter.api.configuration.bedrock.texture.TextureData; -import org.bukkit.Material; -import org.jetbrains.annotations.NotNull; - -import java.util.ArrayList; -import java.util.List; - -public abstract class ItemMapping { - private final Material javaMaterial; - - private final String bedrockIdentifier; - - private BedrockOptions bedrockOptions; - private final List bedrockPredicates = new ArrayList<>(); - - private final List bedrockComponents = new ArrayList<>(0); - - private final List texturesData = new ArrayList<>(); - - public ItemMapping(@NotNull Material javaMaterial, @NotNull String bedrockIdentifier) { - this.javaMaterial = javaMaterial; - this.bedrockIdentifier = bedrockIdentifier; - } - - /** Literal text. Kept for callers that already know the name is not a key. */ - public ItemMapping setDisplayName(String displayName) { - this.name = displayName == null ? null - : fr.robie.craftengineconverter.api.configuration.bedrock.text.ItemName.literal(displayName); - return this; - } - - /** - * The item's name, styling and all. - *

- * Geyser documents {@code display_name} as "a string, or json text component", and the difference is - * load-bearing: a translation key written as a string is shown verbatim, which is how items came to be called - * {@code item.default.flame_cane} in game. - */ - public ItemMapping setName(fr.robie.craftengineconverter.api.configuration.bedrock.text.ItemName name) { - this.name = name; - return this; - } - - public fr.robie.craftengineconverter.api.configuration.bedrock.text.ItemName getName() { - return this.name; - } - - private fr.robie.craftengineconverter.api.configuration.bedrock.text.ItemName name; - - public ItemMapping setBedrockOptions(BedrockOptions bedrockOptions) { - this.bedrockOptions = bedrockOptions; - return this; - } - - public BedrockOptions getBedrockOptions() { - return this.bedrockOptions; - } - - public ItemMapping addBedrockComponent(@NotNull BedrockComponent component) { - this.bedrockComponents.add(component); - return this; - } - - public ItemMapping addBedrockPredicate(BedrockPredicate bedrockPredicate) { - this.bedrockPredicates.add(bedrockPredicate); - return this; - } - - public ItemMapping addTextureData(TextureData textureData) { - this.texturesData.add(textureData); - return this; - } - - @NotNull - public List getTexturesData() { - return this.texturesData; - } - - public Material getJavaMaterial() { - return this.javaMaterial; - } - - public String getBedrockIdentifier() { - return this.bedrockIdentifier; - } - - public JsonObject serialize() { - JsonObject jsonObject = new JsonObject(); - jsonObject.addProperty("bedrock_identifier", this.bedrockIdentifier); - - // A string when the name is bare text, an object when it carries styling - and nothing at all for a bare - // translation key, which the pack's lang file names instead. See ItemName.isCarriedByLangFile: anything - // sent here is an explicit name and beats the client's own lookup, so sending a key Geyser cannot resolve - // is what put "item.default.flame_cane" in the inventory. - if (this.name != null && !this.name.isCarriedByLangFile()) { - jsonObject.add("display_name", this.name.toDisplayNameJson()); - } - - if (this.bedrockOptions != null) { - JsonObject serialize = this.bedrockOptions.serialize(); - if (!serialize.isEmpty()) { - jsonObject.add("bedrock_options", serialize); - } - } - - if (!this.bedrockComponents.isEmpty()) { - JsonObject componentsObject = new JsonObject(); - for (BedrockComponent component : this.bedrockComponents) { - component.applyTo(componentsObject); - } - jsonObject.add("components", componentsObject); - } - - if (!this.bedrockPredicates.isEmpty()) { - if (this.bedrockPredicates.size() == 1) { - jsonObject.add("predicate", this.bedrockPredicates.getFirst().serialize()); - } else { - JsonArray predicateArray = new JsonArray(); - for (BedrockPredicate predicate : this.bedrockPredicates) { - predicateArray.add(predicate.serialize()); - } - jsonObject.add("predicate", predicateArray); - } - } - - return jsonObject; - } -} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/ItemModelItemMapping.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/ItemModelItemMapping.java deleted file mode 100644 index 090b664e..00000000 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/ItemModelItemMapping.java +++ /dev/null @@ -1,30 +0,0 @@ -package fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item; - -import com.google.gson.JsonObject; -import org.bukkit.Material; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -public class ItemModelItemMapping extends ItemMapping { - private final String bedrockModelPath; - - public ItemModelItemMapping(@NotNull Material javaMaterial, @NotNull String bedrockIdentifier, @Nullable String bedrockModelPath) { - super(javaMaterial, bedrockIdentifier); - this.bedrockModelPath = bedrockModelPath; - } - - public String getBedrockModelPath() { - return this.bedrockModelPath; - } - - @Override - public JsonObject serialize() { - JsonObject jsonObject = super.serialize(); - jsonObject.addProperty("type", "definition"); - if (this.bedrockModelPath != null) { - jsonObject.addProperty("model", this.bedrockModelPath); - } - return jsonObject; - } - -} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/LegacyItemMapping.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/LegacyItemMapping.java deleted file mode 100644 index 5c4f720a..00000000 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/LegacyItemMapping.java +++ /dev/null @@ -1,22 +0,0 @@ -package fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item; - -import com.google.gson.JsonObject; -import org.bukkit.Material; -import org.jetbrains.annotations.NotNull; - -public class LegacyItemMapping extends ItemMapping { - private final float customModelData; - - public LegacyItemMapping(@NotNull Material javaMaterial, @NotNull String bedrockIdentifier, float customModelData) { - super(javaMaterial, bedrockIdentifier); - this.customModelData = customModelData; - } - - @Override - public JsonObject serialize() { - JsonObject jsonObject = super.serialize(); - jsonObject.addProperty("type", "legacy"); - jsonObject.addProperty("custom_model_data", this.customModelData); - return jsonObject; - } -} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/component/BedrockComponent.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/component/BedrockComponent.java deleted file mode 100644 index 9146c81a..00000000 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/component/BedrockComponent.java +++ /dev/null @@ -1,8 +0,0 @@ -package fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.component; - -import com.google.gson.JsonObject; -import org.jetbrains.annotations.NotNull; - -public interface BedrockComponent { - void applyTo(@NotNull JsonObject componentObject); -} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/component/EquippableComponent.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/component/EquippableComponent.java deleted file mode 100644 index 6afebaad..00000000 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/component/EquippableComponent.java +++ /dev/null @@ -1,42 +0,0 @@ -package fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.component; - -import com.google.gson.JsonObject; -import fr.robie.craftengineconverter.api.configuration.item.settings.EquippableConfiguration; -import net.momirealms.craftengine.core.entity.EquipmentSlot; -import org.jetbrains.annotations.NotNull; - -public class EquippableComponent extends EquippableConfiguration implements BedrockComponent { - public EquippableComponent(EquipmentSlot equipmentSlot, String equipSound, String assetId, boolean dispensable, boolean damageOnHurt, boolean equipOnInteract, boolean canBeSheared, String shearingSound) { - super(equipmentSlot, equipSound, assetId, null, dispensable, false, damageOnHurt, equipOnInteract, null, canBeSheared, shearingSound, null); - } - - @Override - public void applyTo(@NotNull JsonObject componentObject) { - JsonObject equippableObject = new JsonObject(); - if (this.equipmentSlot != null) { - equippableObject.addProperty("slot", this.equipmentSlot.name().toLowerCase()); - } - if (this.equipSound != null && !this.equipSound.isBlank() && !this.equipSound.equals("item.armor.equip_generic")) { - equippableObject.addProperty("equip_sound", this.equipSound); - } - if (this.assetId != null && !this.assetId.isBlank()) { - equippableObject.addProperty("asset_id", this.assetId); - } - if (!this.dispensable) { - equippableObject.addProperty("dispensable", false); - } - if (!this.damageOnHurt) { - equippableObject.addProperty("damage_on_hurt", false); - } - if (this.equipOnInteract) { - equippableObject.addProperty("equip_on_interact", true); - } - if (this.canBeSheared) { - equippableObject.addProperty("can_be_sheared", true); - } - if (this.shearingSound != null && !this.shearingSound.isBlank() && !this.shearingSound.equals("item.shears.snip")) { - equippableObject.addProperty("shearing_sound", this.shearingSound); - } - componentObject.add("minecraft:equippable", equippableObject); - } -} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/component/GenericBedrockComponent.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/component/GenericBedrockComponent.java deleted file mode 100644 index 5c0c0a37..00000000 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/component/GenericBedrockComponent.java +++ /dev/null @@ -1,59 +0,0 @@ -package fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.component; - -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonPrimitive; -import org.jetbrains.annotations.NotNull; - -import java.util.List; -import java.util.Map; - -public class GenericBedrockComponent implements BedrockComponent { - private final String key; - private final JsonElement value; - - public GenericBedrockComponent(String key, Object yamlValue) { - this.key = key; - this.value = toJsonElement(yamlValue); - } - - @Override - public void applyTo(@NotNull JsonObject componentObject) { - componentObject.add(this.key, this.value); - } - - static JsonElement toJsonElement(Object yamlValue) { - if (yamlValue == null) { - return new JsonObject(); - } - if (yamlValue instanceof Map map) { - JsonObject obj = new JsonObject(); - for (Map.Entry entry : map.entrySet()) { - obj.add(String.valueOf(entry.getKey()), toJsonElement(entry.getValue())); - } - return obj; - } - if (yamlValue instanceof List list) { - JsonArray arr = new JsonArray(); - for (Object item : list) { - arr.add(toJsonElement(item)); - } - return arr; - } - if (yamlValue instanceof Number n) { - if (n.doubleValue() == n.longValue()) { - return new JsonPrimitive(n.longValue()); - } - return new JsonPrimitive(n.doubleValue()); - } - if (yamlValue instanceof Boolean b) { - return new JsonPrimitive(b); - } - return new JsonPrimitive(String.valueOf(yamlValue)); - } - - public String getKey() { - return this.key; - } -} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/option/BedrockOptions.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/option/BedrockOptions.java deleted file mode 100644 index 6e1184de..00000000 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/option/BedrockOptions.java +++ /dev/null @@ -1,130 +0,0 @@ -package fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.option; - -import com.google.gson.JsonArray; -import com.google.gson.JsonObject; -import org.jetbrains.annotations.Nullable; - -import java.util.HashSet; -import java.util.Set; - -public class BedrockOptions { - private String icon; - private boolean allowOffhand = true; - private boolean displayHandheld = false; - private int protectionValue = 0; - private CreativeCategory creativeCategory = CreativeCategory.NONE; - private String creativeGroup; - private final Set tags = new HashSet<>(); - - public JsonObject serialize() { - JsonObject jsonObject = new JsonObject(); - if (this.icon != null) { - jsonObject.addProperty("icon", this.icon); - } - if (!this.allowOffhand) { - jsonObject.addProperty("allow_offhand", false); - } - if (this.displayHandheld) { - jsonObject.addProperty("display_handheld", true); - } - if (this.protectionValue != 0) { - jsonObject.addProperty("protection_value", this.protectionValue); - } - if (this.creativeCategory != CreativeCategory.NONE) { - jsonObject.addProperty("creative_category", this.creativeCategory.name().toLowerCase()); - } - if (this.creativeGroup != null && this.creativeCategory != CreativeCategory.NONE) { - jsonObject.addProperty("creative_group", this.creativeGroup); - } - if (!this.tags.isEmpty()) { - JsonArray tagsArray = new JsonArray(); - for (String tag : this.tags) { - tagsArray.add(tag); - } - jsonObject.add("tags", tagsArray); - } - return jsonObject; - } - - public BedrockOptions setCreativeGroup(String creativeGroup) { - this.creativeGroup = creativeGroup; - return this; - } - - @Nullable - public String getCreativeGroup() { - return this.creativeGroup; - } - - public BedrockOptions setIcon(String icon) { - this.icon = icon; - return this; - } - - public String getIcon() { - return this.icon; - } - - public BedrockOptions setAllowOffhand(boolean allowOffhand) { - this.allowOffhand = allowOffhand; - return this; - } - - public boolean isAllowOffhand() { - return this.allowOffhand; - } - - public BedrockOptions setDisplayHandheld(boolean displayHandheld) { - this.displayHandheld = displayHandheld; - return this; - } - - public boolean isDisplayHandheld() { - return this.displayHandheld; - } - - public BedrockOptions setProtectionValue(int protectionValue) { - this.protectionValue = protectionValue; - return this; - } - - public int getProtectionValue() { - return this.protectionValue; - } - - public BedrockOptions setCreativeCategory(CreativeCategory creativeCategory) { - this.creativeCategory = creativeCategory; - return this; - } - - public CreativeCategory getCreativeCategory() { - return this.creativeCategory; - } - - public BedrockOptions addTag(String tag) { - if (tag != null && !tag.isEmpty()) { - this.tags.add(tag); - } - return this; - } - - public BedrockOptions setTags(Set tags) { - this.tags.clear(); - if (tags != null) { - this.tags.addAll(tags); - } - return this; - } - - public Set getTags() { - return new HashSet<>(this.tags); - } - - public enum CreativeCategory { - NONE, - CONSTRUCTION, - NATURE, - EQUIPMENT, - ITEMS - } -} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/option/CreativeGroupRules.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/option/CreativeGroupRules.java deleted file mode 100644 index cff70433..00000000 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/option/CreativeGroupRules.java +++ /dev/null @@ -1,214 +0,0 @@ -package fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.option; - -import fr.robie.messageflow.logger.Logger; -import fr.robie.yamllibrary.ConfigurationSection; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -import java.util.ArrayList; -import java.util.List; -import java.util.Locale; -import java.util.regex.Pattern; -import java.util.regex.PatternSyntaxException; - -/** - * Author-declared rules assigning converted items to a creative-menu group by matching their - * CraftEngine item id. - *

- * {@link VanillaItemGroups} can only ever infer a group from the item's base material, which is often - * nothing useful: a custom ore built on {@code nether_brick} inherits no group at all, even though - * {@code itemGroup.name.ore} exists and is plainly where it belongs. The pack author is the one who knows - * their own naming convention — {@code *_ore}, {@code *_log} — so they get to state it, and matching happens - * on the id ({@code default:topaz_ore}) rather than the material. - *

- * Rules are ordered as written in the configuration and the first match wins, so a narrow rule must - * precede a broad one. A rule matches ids two ways, and may use either or both: - *

    - *
  • {@code wildcards} — {@code *_ore}, where {@code *} is any run of characters and {@code ?} is one. - * Describes the whole id, with the namespace optional, as {@code blacklisted-paths} does.
  • - *
  • {@code patterns} — Java regex applied with {@link java.util.regex.Matcher#find()}, so {@code _ore$} - * and {@code .*_ore} both work.
  • - *
- * Both are case-insensitive. They are separate keys rather than one auto-detected key because a bare - * {@code topaz} means "contains topaz" as a regex but "is exactly topaz" as a wildcard, and guessing wrong - * would quietly change what a rule matches. - *

- * Only vanilla group names work — a custom group lives in a behavior pack, which Geyser cannot send — so a - * name {@link VanillaItemGroups} does not know is warned about at load time rather than silently ignored by - * the client. - */ -public final class CreativeGroupRules { - - private static final CreativeGroupRules EMPTY = new CreativeGroupRules(List.of()); - - private final List rules; - - private CreativeGroupRules(@NotNull List rules) { - this.rules = rules; - } - - public static CreativeGroupRules empty() { - return EMPTY; - } - - /** - * Reads the rules from a {@code creative-groups} section. Every rule is validated here, once, so a typo - * is reported at startup instead of producing a silently ungrouped pack; a rule that cannot be used is - * skipped and the rest still apply. - */ - public static CreativeGroupRules parse(@Nullable ConfigurationSection section) { - if (section == null) return EMPTY; - - List parsed = new ArrayList<>(); - // getKeys(false) preserves the order the keys appear in the file, which is what makes - // "first match wins" a promise the author can rely on. - for (String name : section.getKeys(false)) { - ConfigurationSection ruleSection = section.getConfigurationSection(name); - if (ruleSection == null) { - Logger.warn("creative-groups." + name + " is not a section - ignoring it"); - continue; - } - - String group = ruleSection.getString("group"); - if (group == null || group.isBlank()) { - Logger.warn("creative-groups." + name + " has no 'group' - ignoring it"); - continue; - } - if (!VanillaItemGroups.isKnownGroup(group)) { - Logger.warn("creative-groups." + name + " uses group '" + group + "', which is not a vanilla" - + " Bedrock group - the client will ignore it, since custom groups need a behavior" - + " pack and Geyser cannot send those"); - } - - List patternStrings = ruleSection.getStringList("patterns"); - List wildcardStrings = ruleSection.getStringList("wildcards"); - if (patternStrings.isEmpty() && wildcardStrings.isEmpty()) { - Logger.warn("creative-groups." + name + " has no 'wildcards' or 'patterns' - ignoring it"); - continue; - } - - List patterns = new ArrayList<>(); - for (String wildcard : wildcardStrings) { - patterns.add(wildcardToPattern(wildcard)); - } - for (String patternString : patternStrings) { - try { - patterns.add(Pattern.compile(patternString, Pattern.CASE_INSENSITIVE)); - } catch (PatternSyntaxException e) { - // Writing "*_ore" under 'patterns' is the natural mistake, and as a regex it is simply - // invalid, so say where it belongs instead of only reporting the syntax error. - String hint = looksLikeWildcard(patternString) - ? " - it looks like a wildcard, so list it under 'wildcards' instead of 'patterns'" - : " - skipping that pattern: " + e.getDescription(); - Logger.warn("creative-groups." + name + " has an invalid regex '" + patternString + "'" + hint); - } - } - if (patterns.isEmpty()) { - Logger.warn("creative-groups." + name + " has no usable pattern - ignoring it"); - continue; - } - - parsed.add(new Rule(name, group, ruleSection.getString("category"), patterns)); - } - - return parsed.isEmpty() ? EMPTY : new CreativeGroupRules(List.copyOf(parsed)); - } - - /** - * Compiles a wildcard into the equivalent regex: {@code *} stands for any run of characters, {@code ?} for - * exactly one, and everything else is literal. - *

- * The result is anchored, so a wildcard describes the whole id rather than any part of it — which is - * what {@code *_ore} plainly means. The namespace is optional in that match, following the same convention - * as {@code blacklisted-paths}: {@code topaz_*} matches {@code default:topaz_ore} without the author - * having to spell out {@code *:topaz_*}. - *

- * A wildcard can never fail to compile, which is the main reason to keep it a separate key from - * {@code patterns} rather than guessing which of the two an author meant. - */ - static Pattern wildcardToPattern(@NotNull String wildcard) { - StringBuilder regex = new StringBuilder("^(?:[^:]*:)?"); - StringBuilder literal = new StringBuilder(); - for (char c : wildcard.toCharArray()) { - if (c != '*' && c != '?') { - literal.append(c); - continue; - } - if (!literal.isEmpty()) { - regex.append(Pattern.quote(literal.toString())); - literal.setLength(0); - } - regex.append(c == '*' ? ".*" : "."); - } - if (!literal.isEmpty()) regex.append(Pattern.quote(literal.toString())); - - return Pattern.compile(regex.append('$').toString(), Pattern.CASE_INSENSITIVE); - } - - private static boolean looksLikeWildcard(@NotNull String pattern) { - return pattern.indexOf('*') >= 0 || pattern.indexOf('?') >= 0; - } - - /** - * Normalises whatever the configuration layer holds for the {@code creative-groups} key. The key is - * typed loosely so that its written-back default stays a plain YAML mapping rather than a serialized - * Java object — see {@code Keys.CREATIVE_GROUPS}. - */ - public static CreativeGroupRules from(@Nullable Object configValue) { - if (configValue instanceof CreativeGroupRules rules) return rules; - if (configValue instanceof ConfigurationSection section) return parse(section); - return EMPTY; - } - - public boolean isEmpty() { - return this.rules.isEmpty(); - } - - public int size() { - return this.rules.size(); - } - - /** - * The first rule matching {@code itemId}, or {@code null} when none does. - * - * @param itemId a CraftEngine item id such as {@code default:topaz_ore} - */ - @Nullable - public Rule match(@Nullable String itemId) { - if (itemId == null || itemId.isBlank()) return null; - for (Rule rule : this.rules) { - for (Pattern pattern : rule.patterns()) { - if (pattern.matcher(itemId).find()) return rule; - } - } - return null; - } - - /** - * @param name the rule's key in the configuration, used only in log messages - * @param group the vanilla group name to emit, e.g. {@code itemGroup.name.ore} - * @param category an optional {@code creative_category} override; without it the material-derived - * category still applies, and the group would be dropped if that came out as none - * @param patterns every wildcard and regex of the rule, already compiled — a wildcard arrives here as the - * anchored regex it is equivalent to, so matching needs to know no difference - */ - public record Rule(@NotNull String name, @NotNull String group, @Nullable String category, - @NotNull List patterns) { - - /** - * The declared category as a {@link BedrockOptions.CreativeCategory}, or {@code null} when the rule - * declares none or names one that does not exist. - */ - @Nullable - public BedrockOptions.CreativeCategory resolvedCategory() { - if (this.category == null || this.category.isBlank()) return null; - try { - return BedrockOptions.CreativeCategory.valueOf(this.category.toUpperCase(Locale.ROOT)); - } catch (IllegalArgumentException e) { - Logger.warn("creative-groups." + this.name + " uses unknown category '" + this.category - + "' - falling back to the category derived from the item's material"); - return null; - } - } - } -} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/option/VanillaItemGroups.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/option/VanillaItemGroups.java deleted file mode 100644 index 3af24c14..00000000 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/option/VanillaItemGroups.java +++ /dev/null @@ -1,112 +0,0 @@ -package fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.option; - -import com.google.gson.JsonObject; -import com.google.gson.JsonParser; -import fr.robie.messageflow.logger.Logger; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -import java.io.InputStream; -import java.io.InputStreamReader; -import java.nio.charset.StandardCharsets; -import java.util.Collections; -import java.util.HashMap; -import java.util.Locale; -import java.util.Map; -import java.util.Set; - -/** - * Maps a vanilla Bedrock item to the creative-menu group it belongs to. - *

- * A group is the expandable stack the creative menu shows — every helmet under one - * {@code itemGroup.name.helmet} entry rather than eight separate slots — and the recipe book uses it to - * locate an item. Since every converted item is based on a vanilla item, that base item's own group is the - * natural one for it: a custom pair of boots built on {@code chainmail_boots} belongs with the boots. - *

- * Only vanilla groups are possible. Custom groups are declared in a behavior pack - * ({@code BP/item_catalog/crafting_item_catalog.json}) and Geyser cannot send behavior packs, so a made-up - * group name would simply be ignored. When a base item has no vanilla group — {@code bow}, - * {@code fishing_rod} and the like belong to no family — the key is omitted rather than invented. - *

- * The table is generated from the Bedrock wiki's vanilla-item-group data (vendored under - * {@code concepts/bedrock-wiki/public/assets/tables/items/vanilla-item-groups/}) and shipped as a resource, - * since {@code concepts/} is documentation and is not on the runtime classpath. - *

- * Group names are emitted unprefixed ({@code itemGroup.name.boots}), matching Geyser's own - * documented examples. The Bedrock wiki lists them namespaced ({@code minecraft:itemGroup.name.boots}); - * Geyser is what consumes this file, so its spelling wins. - */ -public final class VanillaItemGroups { - - private static final String RESOURCE = "/bedrock/vanilla_item_groups.json"; - private static Map groups; - private static volatile Set knownGroups; - - private VanillaItemGroups() { - throw new UnsupportedOperationException("VanillaItemGroups is a utility class and cannot be instantiated."); - } - - /** - * The creative group for a vanilla item, or {@code null} when it belongs to none. - * - * @param itemName a vanilla item name, with or without the {@code minecraft:} prefix - */ - @Nullable - public static String groupFor(@Nullable String itemName) { - if (itemName == null || itemName.isBlank()) return null; - String name = itemName.toLowerCase(Locale.ROOT); - if (name.startsWith("minecraft:")) name = name.substring("minecraft:".length()); - return load().get(name); - } - - public static int size() { - return load().size(); - } - - /** - * Whether {@code group} is a group name some vanilla item actually uses. - *

- * Used to catch a typo in author-declared rules ({@link CreativeGroupRules}) at load time: an unknown - * group is not an error the client reports, it simply has no effect, so the only chance to say anything - * useful is before the pack is written. - */ - public static boolean isKnownGroup(@Nullable String group) { - if (group == null || group.isBlank()) return false; - return knownGroups().contains(group); - } - - /** - * Every group name in use by a vanilla item. - */ - public static Set knownGroups() { - if (knownGroups == null) { - synchronized (VanillaItemGroups.class) { - if (knownGroups == null) { - knownGroups = Set.copyOf(load().values()); - } - } - } - return knownGroups; - } - - private static synchronized Map load() { - if (groups != null) return groups; - - Map loaded = new HashMap<>(); - try (InputStream in = VanillaItemGroups.class.getResourceAsStream(RESOURCE)) { - if (in == null) { - Logger.warn("Missing " + RESOURCE + " - items will have no creative group"); - } else { - JsonObject json = JsonParser.parseReader( - new InputStreamReader(in, StandardCharsets.UTF_8)).getAsJsonObject(); - for (String key : json.keySet()) { - loaded.put(key.toLowerCase(Locale.ROOT), json.get(key).getAsString()); - } - } - } catch (Exception e) { - Logger.error("Failed to read " + RESOURCE, e); - } - groups = Collections.unmodifiableMap(loaded); - return groups; - } -} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/BedrockPredicate.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/BedrockPredicate.java deleted file mode 100644 index d69eea7b..00000000 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/BedrockPredicate.java +++ /dev/null @@ -1,50 +0,0 @@ -package fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate; - -import com.google.gson.JsonObject; -import org.jetbrains.annotations.NotNull; - -public abstract class BedrockPredicate { - private Type type; - protected final boolean expected; - - protected BedrockPredicate() { - this(true); - } - - protected BedrockPredicate(boolean expected) { - this.expected = expected; - } - - public BedrockPredicate withType(Type type) { - this.type = type; - return this; - } - - public Type getType() { - return this.type; - } - - protected abstract String propertyName(); - - protected void addExtraFields(JsonObject jsonObject) { - } - - public @NotNull JsonObject serialize() { - JsonObject jsonObject = new JsonObject(); - if (this.type != null) { - jsonObject.addProperty("type", this.type.name().toLowerCase()); - } - jsonObject.addProperty("property", this.propertyName()); - if (!this.expected) { - jsonObject.addProperty("expected", false); - } - this.addExtraFields(jsonObject); - return jsonObject; - } - - public enum Type { - CONDITION, - MATCH, - RANGE_DISPATCH - } -} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/condition/BrokenPredicate.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/condition/BrokenPredicate.java deleted file mode 100644 index 457926df..00000000 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/condition/BrokenPredicate.java +++ /dev/null @@ -1,14 +0,0 @@ -package fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate.condition; - - -public class BrokenPredicate extends ConditionPredicate { - - public BrokenPredicate(boolean expected) { - super(expected); - } - - @Override - protected String propertyName() { - return "broken"; - } -} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/condition/ConditionPredicate.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/condition/ConditionPredicate.java deleted file mode 100644 index 793b8e6c..00000000 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/condition/ConditionPredicate.java +++ /dev/null @@ -1,18 +0,0 @@ -package fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate.condition; - -import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate.BedrockPredicate; - -/** - * Base for the boolean predicates Geyser groups under {@code "type": "condition"}. - *

- * Mirrors {@code RangeDispatchPredicate}, which tags its type in the constructor rather than leaving it - * to every subclass. Without the tag the serialized predicate carries only a {@code property} and - * Geyser cannot tell which predicate family it belongs to. - */ -public abstract class ConditionPredicate extends BedrockPredicate { - - protected ConditionPredicate(boolean expected) { - super(expected); - this.withType(Type.CONDITION); - } -} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/condition/CustomModelDataPredicate.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/condition/CustomModelDataPredicate.java deleted file mode 100644 index 0c5d56c0..00000000 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/condition/CustomModelDataPredicate.java +++ /dev/null @@ -1,26 +0,0 @@ -package fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate.condition; - -import com.google.gson.JsonObject; - -public class CustomModelDataPredicate extends ConditionPredicate { - private final int index; - - public CustomModelDataPredicate(int index) { - this(index, true); - } - - public CustomModelDataPredicate(int index, boolean expected) { - super(expected); - this.index = index; - } - - @Override - protected String propertyName() { - return "custom_model_data"; - } - - @Override - protected void addExtraFields(JsonObject jsonObject) { - jsonObject.addProperty("index", this.index); - } -} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/condition/DamagedPredicate.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/condition/DamagedPredicate.java deleted file mode 100644 index d186bd6c..00000000 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/condition/DamagedPredicate.java +++ /dev/null @@ -1,17 +0,0 @@ -package fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate.condition; - - -public class DamagedPredicate extends ConditionPredicate { - public DamagedPredicate() { - super(true); - } - - public DamagedPredicate(boolean expected) { - super(expected); - } - - @Override - protected String propertyName() { - return "damaged"; - } -} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/condition/FishingRodCastPredicate.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/condition/FishingRodCastPredicate.java deleted file mode 100644 index f71ba0b4..00000000 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/condition/FishingRodCastPredicate.java +++ /dev/null @@ -1,18 +0,0 @@ -package fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate.condition; - - -public class FishingRodCastPredicate extends ConditionPredicate { - - public FishingRodCastPredicate() { - super(true); - } - - public FishingRodCastPredicate(boolean expected) { - super(expected); - } - - @Override - protected String propertyName() { - return "fishing_rod_cast"; - } -} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/condition/HasComponentPredicate.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/condition/HasComponentPredicate.java deleted file mode 100644 index 6a6c762b..00000000 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/condition/HasComponentPredicate.java +++ /dev/null @@ -1,27 +0,0 @@ -package fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate.condition; - -import com.google.gson.JsonObject; - -public class HasComponentPredicate extends ConditionPredicate { - private final String component; - - public HasComponentPredicate(String component) { - super(true); - this.component = component; - } - - public HasComponentPredicate(String component, boolean expected) { - super(expected); - this.component = component; - } - - @Override - protected void addExtraFields(JsonObject jsonObject) { - jsonObject.addProperty("component", this.component); - } - - @Override - protected String propertyName() { - return "has_component"; - } -} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/match/ChargeTypePredicate.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/match/ChargeTypePredicate.java deleted file mode 100644 index 60f1c0b2..00000000 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/match/ChargeTypePredicate.java +++ /dev/null @@ -1,26 +0,0 @@ -package fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate.match; - -import com.google.gson.JsonObject; -import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate.BedrockPredicate; -import fr.robie.craftengineconverter.api.configuration.item.models.range_dispatch.ChargeType; -import org.jetbrains.annotations.NotNull; - -public class ChargeTypePredicate extends BedrockPredicate { - private final ChargeType expected; - - public ChargeTypePredicate(@NotNull ChargeType expected) { - this.expected = expected; - this.withType(Type.MATCH); - } - - @Override - protected void addExtraFields(JsonObject jsonObject) { - if (this.expected == ChargeType.NONE) return; - jsonObject.addProperty("value", this.expected.name().toLowerCase()); - } - - @Override - protected String propertyName() { - return "charge_type"; - } -} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/match/ContextDimensionPredicate.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/match/ContextDimensionPredicate.java deleted file mode 100644 index be364fb4..00000000 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/match/ContextDimensionPredicate.java +++ /dev/null @@ -1,29 +0,0 @@ -package fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate.match; - -import com.google.gson.JsonObject; -import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate.BedrockPredicate; -import org.jetbrains.annotations.NotNull; - -public class ContextDimensionPredicate extends BedrockPredicate { - private final String dimension; - - public ContextDimensionPredicate(@NotNull String dimension) { - this(dimension, true); - } - - public ContextDimensionPredicate(@NotNull String dimension, boolean expected) { - super(expected); - this.dimension = dimension; - this.withType(Type.MATCH); - } - - @Override - protected void addExtraFields(JsonObject jsonObject) { - jsonObject.addProperty("value", this.dimension); - } - - @Override - protected String propertyName() { - return "context_dimension"; - } -} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/match/CustomModelDataPredicate.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/match/CustomModelDataPredicate.java deleted file mode 100644 index 81740820..00000000 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/match/CustomModelDataPredicate.java +++ /dev/null @@ -1,31 +0,0 @@ -package fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate.match; - -import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate.BedrockPredicate; -import org.jetbrains.annotations.NotNull; - -public class CustomModelDataPredicate extends BedrockPredicate { - private final int index; - private final String value; - - public CustomModelDataPredicate(int index, @NotNull String value) { - this(index, value, true); - } - - public CustomModelDataPredicate(int index, @NotNull String value, boolean expected) { - super(expected); - this.index = index; - this.value = value; - this.withType(Type.MATCH); - } - - @Override - protected void addExtraFields(com.google.gson.JsonObject jsonObject) { - jsonObject.addProperty("index", this.index); - jsonObject.addProperty("value", this.value); - } - - @Override - protected String propertyName() { - return "custom_model_data"; - } -} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/match/TrimMaterialPredicate.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/match/TrimMaterialPredicate.java deleted file mode 100644 index a8a96a63..00000000 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/match/TrimMaterialPredicate.java +++ /dev/null @@ -1,29 +0,0 @@ -package fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate.match; - -import com.google.gson.JsonObject; -import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate.BedrockPredicate; -import org.jetbrains.annotations.NotNull; - -public class TrimMaterialPredicate extends BedrockPredicate { - private final String material; - - public TrimMaterialPredicate(@NotNull String material) { - this(material, true); - } - - public TrimMaterialPredicate(@NotNull String material, boolean expected) { - super(expected); - this.material = material; - this.withType(Type.MATCH); - } - - @Override - protected void addExtraFields(JsonObject jsonObject) { - jsonObject.addProperty("value", this.material); - } - - @Override - protected String propertyName() { - return "trim_material"; - } -} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/range_dispatch/BundleFullnessPredicate.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/range_dispatch/BundleFullnessPredicate.java deleted file mode 100644 index 750cdc5f..00000000 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/range_dispatch/BundleFullnessPredicate.java +++ /dev/null @@ -1,14 +0,0 @@ -package fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate.range_dispatch; - -public class BundleFullnessPredicate extends RangeDispatchPredicate { - - - public BundleFullnessPredicate(double threshold, Float scale) { - super(threshold, scale, null); - } - - @Override - protected String propertyName() { - return "bundle_fullness"; - } -} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/range_dispatch/CountPredicate.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/range_dispatch/CountPredicate.java deleted file mode 100644 index dccfb136..00000000 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/range_dispatch/CountPredicate.java +++ /dev/null @@ -1,13 +0,0 @@ -package fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate.range_dispatch; - -public class CountPredicate extends RangeDispatchPredicate { - - public CountPredicate(double threshold, Float scale, Boolean normalize) { - super(threshold, scale, normalize); - } - - @Override - protected String propertyName() { - return "count"; - } -} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/range_dispatch/CustomModelDataPredicate.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/range_dispatch/CustomModelDataPredicate.java deleted file mode 100644 index 3d6c83dd..00000000 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/range_dispatch/CustomModelDataPredicate.java +++ /dev/null @@ -1,13 +0,0 @@ -package fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate.range_dispatch; - -public class CustomModelDataPredicate extends RangeDispatchPredicate { - - public CustomModelDataPredicate(double threshold, Float scale) { - super(threshold, scale, null); - } - - @Override - protected String propertyName() { - return "custom_model_data"; - } -} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/range_dispatch/DamagePredicate.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/range_dispatch/DamagePredicate.java deleted file mode 100644 index f030728d..00000000 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/range_dispatch/DamagePredicate.java +++ /dev/null @@ -1,13 +0,0 @@ -package fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate.range_dispatch; - -public class DamagePredicate extends RangeDispatchPredicate { - - public DamagePredicate(double threshold, Float scale, Boolean normalize) { - super(threshold, scale, normalize); - } - - @Override - protected String propertyName() { - return "damage"; - } -} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/range_dispatch/RangeDispatchPredicate.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/range_dispatch/RangeDispatchPredicate.java deleted file mode 100644 index d7e72ff9..00000000 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/mapping/item/predicate/range_dispatch/RangeDispatchPredicate.java +++ /dev/null @@ -1,30 +0,0 @@ -package fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate.range_dispatch; - -import com.google.gson.JsonObject; -import fr.robie.craftengineconverter.api.configuration.bedrock.mapping.item.predicate.BedrockPredicate; - -public abstract class RangeDispatchPredicate extends BedrockPredicate { - private final double threshold; - private final Float scale; - private final Boolean normalize; - - public RangeDispatchPredicate(double threshold, Float scale, Boolean normalize) { - super(true); - this.threshold = threshold; - this.scale = scale; - this.normalize = normalize; - this.withType(Type.RANGE_DISPATCH); - } - - @Override - protected void addExtraFields(JsonObject jsonObject) { - jsonObject.addProperty("threshold", this.threshold); - if (this.scale != null && this.scale != 1.0f) { - jsonObject.addProperty("scale", this.scale); - } - if (this.normalize != null) { - jsonObject.addProperty("normalize", this.normalize); - } - } - -} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/molang/Molang.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/molang/Molang.java deleted file mode 100644 index b1594d97..00000000 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/molang/Molang.java +++ /dev/null @@ -1,211 +0,0 @@ -package fr.robie.craftengineconverter.api.configuration.bedrock.molang; - -import org.jetbrains.annotations.NotNull; - -import java.util.Locale; - -/** - * An expression in Molang, the language Bedrock evaluates inside render controllers, attachables, animations and - * animation controllers. - *

- * Built rather than written, because Molang fails silently: a malformed expression produces no error in any - * log, just a model that never moves. A string typo costs an evening; a method that does not exist costs a compile. - *

- * This emits Molang and does not read it. The converter has never needed to parse an expression, and a parser - * would be several times the work for nothing that exists. - *

- * Numbers always render with a decimal point. Molang is single-precision throughout, and vanilla's own files write - * {@code 0.0} rather than {@code 0} — matching that keeps generated output diffable against the vanilla pack, which - * is how several conventions in this converter were pinned down in the first place. - */ -public class Molang { - - private final String expression; - private final int precedence; - - Molang(@NotNull String expression, int precedence) { - this.expression = expression; - this.precedence = precedence; - } - - /** - * Precedence levels, ordered as {@code documentation/advanced-molang.md} lists them "from first to last - * evaluated". Only the levels this builder can produce are named; the ordering is what decides whether a - * sub-expression needs brackets. - */ - static final int ATOM = 0; - static final int UNARY = 2; - static final int PRODUCT = 3; - static final int SUM = 4; - static final int RELATION = 5; - static final int EQUALITY = 6; - static final int AND = 7; - static final int OR = 8; - static final int CONDITIONAL = 9; - static final int COALESCE = 10; - - /** A literal expression, for the rare thing this builder cannot express. Use sparingly — it is unchecked. */ - @NotNull - public static Molang raw(@NotNull String expression) { - return new Molang(expression, ATOM); - } - - /** A number, rendered the way Molang and the vanilla pack write numbers. */ - @NotNull - public static Molang number(double value) { - return new Molang(format(value), ATOM); - } - - /** A string, single-quoted as Molang requires. */ - @NotNull - public static Molang string(@NotNull String value) { - return new Molang("'" + value + "'", ATOM); - } - - /** - * A pack-defined variable, the only kind of value a pack can write to. - * - * @param name the bare name, without the {@code variable.} prefix - */ - @NotNull - public static Molang variable(@NotNull String name) { - return new Molang("variable." + name, ATOM); - } - - // ------------------------------------------------------------------ comparison - - @NotNull - public Molang eq(double value) { - return this.binary("==", number(value), EQUALITY); - } - - @NotNull - public Molang eq(@NotNull String value) { - return this.binary("==", string(value), EQUALITY); - } - - @NotNull - public Molang eq(@NotNull Molang other) { - return this.binary("==", other, EQUALITY); - } - - @NotNull - public Molang notEq(double value) { - return this.binary("!=", number(value), EQUALITY); - } - - @NotNull - public Molang greaterThan(double value) { - return this.binary(">", number(value), RELATION); - } - - @NotNull - public Molang lessThan(double value) { - return this.binary("<", number(value), RELATION); - } - - @NotNull - public Molang atLeast(double value) { - return this.binary(">=", number(value), RELATION); - } - - // ------------------------------------------------------------------ logic - - @NotNull - public Molang and(@NotNull Molang other) { - return this.binary("&&", other, AND); - } - - @NotNull - public Molang or(@NotNull Molang other) { - return this.binary("||", other, OR); - } - - @NotNull - public Molang not() { - return new Molang("!" + this.bracketedFor(UNARY), UNARY); - } - - // ------------------------------------------------------------------ arithmetic - - @NotNull - public Molang plus(@NotNull Molang other) { - return this.binary("+", other, SUM); - } - - @NotNull - public Molang minus(@NotNull Molang other) { - return this.binary("-", other, SUM); - } - - @NotNull - public Molang times(double value) { - return this.binary("*", number(value), PRODUCT); - } - - @NotNull - public Molang dividedBy(double value) { - return this.binary("/", number(value), PRODUCT); - } - - /** Division by something only the engine knows, which is how a value is normalised without a magic constant. */ - @NotNull - public Molang dividedBy(@NotNull Molang other) { - return this.binary("/", other, PRODUCT); - } - - // ------------------------------------------------------------------ conditionals - - /** - * {@code condition ? whenTrue : whenFalse}. - *

- * All three operands are bracketed one level tighter than the conditional itself, so a nested ternary — which a - * frame index over uneven thresholds is — renders with explicit brackets rather than relying on Molang's - * associativity. Nothing in the vanilla pack nests one, so there is no observed behaviour to match. - */ - @NotNull - public Molang then(@NotNull Molang whenTrue, @NotNull Molang whenFalse) { - return new Molang(this.bracketedFor(CONDITIONAL - 1) + " ? " + whenTrue.bracketedFor(CONDITIONAL - 1) - + " : " + whenFalse.bracketedFor(CONDITIONAL - 1), CONDITIONAL); - } - - /** {@code left ?? right} — the value on the right when the left is undefined. */ - @NotNull - public Molang orElse(@NotNull Molang fallback) { - return this.binary("??", fallback, COALESCE); - } - - /** The expression as it is written into the pack. */ - @Override - public String toString() { - return this.expression; - } - - // ------------------------------------------------------------------ internals - - private Molang binary(@NotNull String operator, @NotNull Molang right, int level) { - return new Molang(this.bracketedFor(level) + " " + operator + " " + right.bracketedFor(level - 1), level); - } - - /** - * This expression, bracketed only when the operator it is about to become part of binds more tightly than the - * operator that built it. - *

- * Brackets everywhere would be correct and unreadable, and would stop generated files being comparable with - * vanilla's — which is how the UV convention, the rotation signs and the display presets were all settled. - */ - private String bracketedFor(int level) { - return this.precedence <= level ? this.expression : "(" + this.expression + ")"; - } - - /** - * A whole number still gets a {@code .0}, matching Molang's single-precision model and vanilla's own files. - * Formatted in {@link Locale#ROOT} so a French server does not emit {@code 0,0}. - */ - static String format(double value) { - if (value == Math.rint(value) && !Double.isInfinite(value)) { - return String.format(Locale.ROOT, "%.1f", value); - } - return String.valueOf((float) value); - } -} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/molang/MolangMath.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/molang/MolangMath.java deleted file mode 100644 index 0dd5d77d..00000000 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/molang/MolangMath.java +++ /dev/null @@ -1,75 +0,0 @@ -package fr.robie.craftengineconverter.api.configuration.bedrock.molang; - -import org.jetbrains.annotations.NotNull; - -/** - * Molang's {@code math.} function library. - *

- * Trigonometry is in degrees, not radians — the one thing about this namespace that reliably catches people - * who assume it mirrors {@code java.lang.Math}. - */ -public final class MolangMath { - - private MolangMath() { - throw new UnsupportedOperationException("MolangMath is a function holder and cannot be instantiated."); - } - - @NotNull - public static Molang clamp(@NotNull Molang value, double min, double max) { - return call("clamp", value.toString(), Molang.format(min), Molang.format(max)); - } - - @NotNull - public static Molang floor(@NotNull Molang value) { - return call("floor", value.toString()); - } - - /** - * {@code math.lerp(from, to, t)} — linear interpolation, as vanilla's own trident uses to raise itself over - * the charge rather than snapping. - *

- * Sound for a position and not for a rotation: interpolating Euler angles takes the wrong path as soon - * as the turn is large, and a trident's throwing pose is very nearly a half turn. Vanilla makes the same - * split — its raise layers move the item and leave the rotation to change in one step. - */ - @NotNull - public static Molang lerp(double from, double to, @NotNull Molang time) { - return call("lerp", Molang.format(from), Molang.format(to), time.toString()); - } - - @NotNull - public static Molang round(@NotNull Molang value) { - return call("round", value.toString()); - } - - /** Degrees, not radians. */ - @NotNull - public static Molang sin(@NotNull Molang degrees) { - return call("sin", degrees.toString()); - } - - /** Degrees, not radians. */ - @NotNull - public static Molang cos(@NotNull Molang degrees) { - return call("cos", degrees.toString()); - } - - @NotNull - public static Molang min(@NotNull Molang value, double other) { - return call("min", value.toString(), Molang.format(other)); - } - - @NotNull - public static Molang max(@NotNull Molang value, double other) { - return call("max", value.toString(), Molang.format(other)); - } - - /** - * A call renders as an atom, so it never needs bracketing when it becomes part of a larger expression — and, - * usefully, an array subscript is legal as a function argument even though it cannot feed arithmetic. - */ - @NotNull - private static Molang call(@NotNull String name, @NotNull String... arguments) { - return Molang.raw("math." + name + "(" + String.join(", ", arguments) + ")"); - } -} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/molang/MolangQuery.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/molang/MolangQuery.java deleted file mode 100644 index aaa3e8fa..00000000 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/molang/MolangQuery.java +++ /dev/null @@ -1,148 +0,0 @@ -package fr.robie.craftengineconverter.api.configuration.bedrock.molang; - -import org.jetbrains.annotations.NotNull; - -/** - * The read-only values Bedrock supplies, under {@code query.}. - * - *

Why these are constants

- * Several of the queries a converter reaches for do not exist under the name you would guess, and Molang reports - * nothing when you use one that does not: the expression evaluates to zero and the model simply never moves. The - * names below were read out of {@code concepts/MCBE-Vanilla-RP}, which is the only place some of them appear at all - * — the Bedrock Wiki's {@code documentation/queries.md} documents none of the item use-duration queries. - * - *

The traps, recorded so they cannot be typed by accident

- *
    - *
  • {@code query.item_max_use_duration} and {@code query.item_in_use_duration} do not exist. The real - * names are {@link #MAIN_HAND_ITEM_MAX_DURATION} and {@link #ITEM_REMAINING_USE_DURATION}.
  • - *
  • {@code query.is_charged} is the Blaze entity component. The item one is {@link #ITEM_IS_CHARGED}.
  • - *
  • {@code query.get_equipped_item_name} is marked deprecated; prefer {@link #isItemNameAny}.
  • - *
  • {@code query.get_animation_frame} is deliberately absent — see the note on {@link #chargeAmount}.
  • - *
- */ -public final class MolangQuery { - - private MolangQuery() { - throw new UnsupportedOperationException("MolangQuery is a constant holder and cannot be instantiated."); - } - - @NotNull - private static Molang query(@NotNull String name) { - return Molang.raw("query." + name); - } - - /** - * How long the main-hand item has been in use, in ticks. - *

- * Its units and normalisation both changed in engine version 1.17.30 — it used to be multiplied by 20 rather - * than divided, and the normalisation was reversed. A pack targeting older engines cannot use it the same way. - */ - public static final Molang MAIN_HAND_ITEM_USE_DURATION = query("main_hand_item_use_duration"); - - /** How long the main-hand item can be used for. Pairs with {@link #MAIN_HAND_ITEM_USE_DURATION}. */ - public static final Molang MAIN_HAND_ITEM_MAX_DURATION = query("main_hand_item_max_duration"); - - /** Ticks left of the current use. Vanilla's crossbow animation controller transitions on this. */ - public static final Molang ITEM_REMAINING_USE_DURATION = query("item_remaining_use_duration"); - - /** - * Ticks left of the current use in a named slot, which is the only use query that takes one. - *

- * Everything else is {@code main_hand_item_*} and reads the main hand whatever slot the attachable is being - * drawn in — so this is the only way an off-hand item can tell whether it is the one in use. Vanilla - * calls it exactly once, in {@code animations/player_firstperson.animation.json}, as - * {@code query.item_remaining_use_duration('main_hand', 1.0)}. - * - * @param slot {@code main_hand} or {@code off_hand} - * @param normalize {@code 1.0} to get a fraction of the total rather than a tick count - */ - @NotNull - public static Molang itemRemainingUseDuration(@NotNull String slot, double normalize) { - return Molang.raw("query.item_remaining_use_duration('" + slot + "', " + Molang.format(normalize) + ")"); - } - - /** Whether a crossbow is loaded. Not {@code is_charged}, which belongs to the Blaze. */ - public static final Molang ITEM_IS_CHARGED = query("item_is_charged"); - - /** Partial-tick interpolation, so a charge value moves smoothly rather than stepping once per tick. */ - public static final Molang FRAME_ALPHA = query("frame_alpha"); - - public static final Molang IS_USING_ITEM = query("is_using_item"); - public static final Molang IS_ENCHANTED = query("is_enchanted"); - public static final Molang LIFE_TIME = query("life_time"); - public static final Molang DELTA_TIME = query("delta_time"); - - /** - * Whether the named slot holds any of the given items, without a namespace on the item names. - *

- * The replacement for the deprecated {@code get_equipped_item_name}. - */ - @NotNull - public static Molang isItemNameAny(@NotNull String slot, @NotNull String... itemNames) { - StringBuilder call = new StringBuilder("query.is_item_name_any('").append(slot).append("'"); - for (String itemName : itemNames) { - call.append(", '").append(itemName).append("'"); - } - return Molang.raw(call.append(")").toString()); - } - - /** - * How far a bow is drawn, from 0 to 1 — vanilla's own formula, verbatim from - * {@code concepts/MCBE-Vanilla-RP/attachables/bow.json}. - *

- * This is what a custom bow must use, and it is not what vanilla uses to pick the model. Vanilla selects - * its pulling frame with {@code array.bow_geo_frames[query.get_animation_frame]}, and - * {@code query.get_animation_frame} is supplied by the engine from the vanilla bow's own hardcoded pulling - * state. It appears in exactly two files in the whole vanilla pack and in no documentation, and nothing can - * write to it — so a custom item cannot use it and has to derive its frame from this value instead. - *

- * Vanilla computes it only to drive the first-person wobble at full draw, which is why the divisor is a bare - * {@code 10.0} rather than the item's own max duration. - */ - @NotNull - public static Molang chargeAmount() { - return MolangMath.clamp(elapsedUseTicks().dividedBy(10), 0, 1); - } - - /** - * How far through its use the main-hand item is, from 0 to 1, on the Java pack's own terms. - *

- * The same shape as {@link #chargeAmount()} with vanilla's hardcoded {@code / 10.0} replaced by the {@code scale} - * the Java {@code range_dispatch} declares. Java compares its thresholds against - * {@code use_duration * scale}, so reproducing the multiplication is what makes a bow with a non-vanilla draw - * time change frames at the moments its author chose. Vanilla can hardcode the divisor because it only uses the - * value for a first-person wobble, never to pick a model. - *

- * Only correct while the item is in use. Idle, {@link #MAIN_HAND_ITEM_USE_DURATION} is 0, so the - * subtraction leaves the whole max duration and the result clamps to 1 — a bow reading this ungated sits - * permanently on its last frame. Gate it on {@link #IS_USING_ITEM} or on a use duration above zero. - */ - @NotNull - public static Molang useProgress(double scale) { - return MolangMath.clamp(elapsedUseTicks().times(scale), 0, 1); - } - - /** - * How far through its use the main-hand item is, from 0 to 1, without any constant at all. - *

- * For a property Java has already normalised — {@code crossbow/pull} is the elapsed time over the - * crossbow's own charge duration — there is no scale in the pack to read, and the charge duration is not - * something a resource pack can know: Quick Charge shortens it. Dividing by the item's own max duration gives - * the same fraction without naming a number, and it is what vanilla does when it needs one: - * {@code player.entity.json} sets - * {@code variable.item_use_normalized = query.main_hand_item_use_duration / query.main_hand_item_max_duration}. - *

- * Carries the same caveat as {@link #useProgress}: only correct while the item is in use. - */ - @NotNull - public static Molang normalisedUseProgress() { - return MolangMath.clamp(elapsedUseTicks().dividedBy(MAIN_HAND_ITEM_MAX_DURATION), 0, 1); - } - - /** Ticks elapsed since the use began, interpolated within the tick so the value moves smoothly. */ - @NotNull - private static Molang elapsedUseTicks() { - Molang remaining = MAIN_HAND_ITEM_USE_DURATION.minus(FRAME_ALPHA).plus(Molang.number(1)); - return MAIN_HAND_ITEM_MAX_DURATION.minus(remaining); - } -} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/molang/MolangScript.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/molang/MolangScript.java deleted file mode 100644 index f2dff60f..00000000 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/molang/MolangScript.java +++ /dev/null @@ -1,42 +0,0 @@ -package fr.robie.craftengineconverter.api.configuration.bedrock.molang; - -import org.jetbrains.annotations.NotNull; - -import java.util.ArrayList; -import java.util.List; - -/** - * A list of Molang statements, as {@code scripts.pre_animation} and {@code scripts.parent_setup} take them. - *

- * {@link Molang} builds expressions, and an expression is not a statement: these slots hold assignments, each - * terminated by a semicolon, evaluated in order. Bedrock accepts them as a JSON array of strings, one statement per - * entry — several per entry also works, but one apiece is what vanilla writes and what a diff can read. - *

- * Only assignment to a {@code variable.} is offered. {@code temp.} exists but does not survive to the render - * controller, which is the whole point of setting anything here. - */ -public final class MolangScript { - - private final List statements = new ArrayList<>(); - - /** - * Appends {@code variable. = ;}. - * - * @param name the bare variable name, without the {@code variable.} prefix - */ - @NotNull - public MolangScript set(@NotNull String name, @NotNull Molang value) { - this.statements.add(Molang.variable(name) + " = " + value + ";"); - return this; - } - - /** The statements, in the order they were added, ready to be handed to an attachable's scripts block. */ - @NotNull - public List statements() { - return List.copyOf(this.statements); - } - - public boolean isEmpty() { - return this.statements.isEmpty(); - } -} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/text/ItemName.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/text/ItemName.java deleted file mode 100644 index b554c10a..00000000 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/text/ItemName.java +++ /dev/null @@ -1,89 +0,0 @@ -package fr.robie.craftengineconverter.api.configuration.bedrock.text; - -import com.google.gson.JsonElement; - -/** - * What a custom item is called, and everything that follows from it. - *

- * A name reaches Bedrock by two routes at once and they answer different questions: - *

    - *
  • {@code display_name} in the Geyser mapping — carries styling, and is what Geyser sends.
  • - *
  • {@code item..name} in the pack's {@code texts/*.lang} — the only route that localises, because - * the client resolves it in whatever language it is running.
  • - *
- * The second is only possible when the name is a bare translation key, so {@link #translationKey()} exists to say - * whether it is. A styled or literal name has none, and relies on {@code display_name} alone. - *

- * A type rather than a {@code String} because the string form is what went wrong: a field that was sometimes text - * and sometimes a key, with no way to tell, so a key got written where text was expected and items were called - * {@code item.default.flame_cane} in game. - */ -public final class ItemName { - - private final TextComponent component; - private final String translationKey; - - private ItemName(TextComponent component, String translationKey) { - this.component = component; - this.translationKey = translationKey; - } - - /** Plain text, exactly as written. */ - public static ItemName literal(String text) { - return new ItemName(TextComponent.literal(text), null); - } - - /** A bare translation key, which can also be localised through the pack's lang files. */ - public static ItemName translatable(String key) { - return new ItemName(TextComponent.translatable(key), key); - } - - /** - * An arbitrary component — styled text, a coloured translation, several parts. - *

- * The translation key is recovered only from a component that is nothing but a {@code translate}. Once a - * colour or a second part is involved the name cannot be expressed as a single lang entry, so it goes through - * {@code display_name} alone and loses per-language resolution. That is a real trade, and it is the pack - * author's to make: they chose the styling. - */ - public static ItemName of(TextComponent component) { - if (component == null) return null; - boolean bareTranslate = component.translate() != null - && component.text() == null - && component.extra().isEmpty() - && component.with().isEmpty() - && !component.hasStylingBeyondItalicOff(); - return new ItemName(component, bareTranslate ? component.translate() : null); - } - - /** The value for {@code display_name}: a plain string when it can be, an object when it must be. */ - public JsonElement toDisplayNameJson() { - return this.component.serialize(); - } - - /** - * Whether {@code display_name} should be left out entirely and the name left to the pack's lang file. - *

- * It has to be, for a bare key. Geyser resolves a {@code translate} component itself, against its own - * copy of the vanilla locales, and a pack's custom key is not in them — so it resolves to the key's own text and - * sends that as an explicit name, which then overrides whatever {@code item..name} says. The item - * ends up called {@code item.default.flame_cane} however correctly the component was written. Reported from a - * live server after the component form was already in place. - *

- * Sending nothing is what lets the client do the lookup, and the client is the only party that knows which - * language the player is reading. A name with styling still goes through {@code display_name}, because it - * cannot be expressed as a lang entry at all — and styling is only ever added deliberately. - */ - public boolean isCarriedByLangFile() { - return this.translationKey != null; - } - - /** The key to register under {@code item..name}, or {@code null} when there is none. */ - public String translationKey() { - return this.translationKey; - } - - public TextComponent component() { - return this.component; - } -} diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/text/MiniMessageToComponent.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/text/MiniMessageToComponent.java deleted file mode 100644 index 8cefdc22..00000000 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/bedrock/text/MiniMessageToComponent.java +++ /dev/null @@ -1,188 +0,0 @@ -package fr.robie.craftengineconverter.api.configuration.bedrock.text; - -import java.util.ArrayDeque; -import java.util.Deque; -import java.util.List; -import java.util.Locale; -import java.util.Set; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -/** - * Turns the MiniMessage string CraftEngine names an item with into a {@link TextComponent}. - *

- * What this replaces threw the formatting away: {@code input.replaceAll("<[^>]+>", "")} deleted every tag, so - * {@code Flame Cane} reached Bedrock as plain white "Flame Cane". The colour is in the - * pack because the author put it there. - *

- * {@code } is the one to understand. Java renders a custom item name in italics by default, so nearly - * every CraftEngine name opens with {@code } to turn that off. Bedrock does not italicise by default, so the - * tag looks redundant — it is not. It has to be emitted as an explicit {@code "italic": false}, because a name that - * also sets a colour becomes a component, and a component without the flag would let Java's default back in. - *

- * This parser is deliberately partial. MiniMessage is a large grammar and a half-understood tag mangles a - * name, which is worse than dropping formatting. Only the tags CraftEngine actually emits are handled; anything - * else makes {@link #parse} return {@code null} so the caller can fall back to the old strip-to-plain-text - * behaviour. Failing to the previous result is always available, so this can never be worse than what it replaces. - */ -public final class MiniMessageToComponent { - - private MiniMessageToComponent() { - throw new UnsupportedOperationException("MiniMessageToComponent is a utility class."); - } - - private static final Pattern TAG = Pattern.compile("<([^<>]+)>"); - private static final Pattern HEX = Pattern.compile("#[0-9a-fA-F]{6}"); - - /** The sixteen Java colour names, which MiniMessage and the component format spell identically. */ - private static final Set COLORS = Set.of( - "black", "dark_blue", "dark_green", "dark_aqua", "dark_red", "dark_purple", "gold", "gray", - "dark_gray", "blue", "green", "aqua", "red", "light_purple", "yellow", "white"); - - // MiniMessage's short spellings, mapped onto the component field each one sets. - private static final java.util.Map STYLES = java.util.Map.of( - "bold", "bold", "b", "bold", - "italic", "italic", "i", "italic", "em", "italic", - "underlined", "underlined", "u", "underlined", - "strikethrough", "strikethrough", "st", "strikethrough", - "obfuscated", "obfuscated"); - - /** One level of styling, as the tag stack sees it. */ - private record Style(String color, java.util.Map flags) { - - static Style empty() { - return new Style(null, java.util.Map.of()); - } - - Style withColor(String value) { - return new Style(value, this.flags); - } - - Style withFlag(String name, boolean value) { - java.util.Map next = new java.util.LinkedHashMap<>(this.flags); - next.put(name, value); - return new Style(this.color, next); - } - - void applyTo(TextComponent component) { - if (this.color != null) component.withColor(this.color); - for (var flag : this.flags.entrySet()) { - switch (flag.getKey()) { - case "bold" -> component.withBold(flag.getValue()); - case "italic" -> component.withItalic(flag.getValue()); - case "underlined" -> component.withUnderlined(flag.getValue()); - case "strikethrough" -> component.withStrikethrough(flag.getValue()); - case "obfuscated" -> component.withObfuscated(flag.getValue()); - default -> { } - } - } - } - - boolean isEmpty() { - return this.color == null && this.flags.isEmpty(); - } - } - - /** - * @return the parsed name, or {@code null} when the string uses a tag this does not understand and the caller - * should fall back - */ - public static TextComponent parse(String input) { - if (input == null) return null; - - Deque - -

-
-
Bedrock attachable · frame calibration
-

Held Item Pose Calibrator

-
-

- Left is fixed: where the Java client draws the item, from Java's own numbers. Right is what the converter emits, - and it is the only side that moves as you edit. Drag either viewport to orbit; scroll to zoom. -

-
- -
-
-
-
-
Javadisplay transform on the rig
- -
-
-
Bedrockemitted animation on the bound bone
- -
-
- -
-
-
Offset from Java's placement
- 0.00 - model units -
- Matches Java -
- ΔX 0.00 - ΔY 0.00 - ΔZ 0.00 - from fist 0.00 - gripped at - - off arm axis 0 -
-
- -

- Java item   - Bedrock item   - player rig, drawn identically in both — - it is the same body. The small cross marks Bedrock's rightItem bone. -

-
- - -
- - From 5b5523c6bda9324a4d5a8941d9a82a7f0f772234 Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Sat, 7 Nov 2026 16:39:24 +0100 Subject: [PATCH 112/116] build: update dependencies to their latest versions Gradle 9.6.1 -> 9.9.0 (wrapper, with checksum), run-paper 3.0.2 -> 3.1.0, adventure 4.26.1 -> 5.2.0, folialib 0.5.1 -> 0.5.2, itemsadder 4.0.17 -> 4.0.18-beta-10, junit 6.0.3 -> 6.1.3, nexo 1.20.1 -> 1.29.1, packetevents 2.11.2 -> 2.14.0, paperdispatch 1.0.2 -> 1.1.0, placeholderapi 2.12.2 -> 2.12.3, sarah 1.23 -> 1.27, snakeyaml 2.6 -> 2.7. Held back on purpose: - craftengine stays on 26.5-SNAPSHOT: 26.10 moved or removed the AttributeModifier and Instrument types the API module uses. - paper stays on 1.21.11: paper-api 26.3 needs Java 25, and the build targets Java 21. --- gradle/libs.versions.toml | 22 +++++++++++----------- gradle/wrapper/gradle-wrapper.properties | 4 ++-- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 4f78a3c4..bd73a654 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -16,24 +16,24 @@ minecraft = "1.21.11" craftengine = "26.5-SNAPSHOT" -adventure = "4.26.1" +adventure = "5.2.0" bstats = "3.2.1" -folialib = "0.5.1" -itemsadder = "4.0.17" -junit = "6.0.3" +folialib = "0.5.2" +itemsadder = "4.0.18-beta-10" +junit = "6.1.3" messageflow = "1.1.2" -nexo = "1.20.1" -packetevents = "2.11.2" -paperdispatch = "1.0.2" -placeholderapi = "2.12.2" +nexo = "1.29.1" +packetevents = "2.14.0" +paperdispatch = "1.1.0" +placeholderapi = "2.12.3" reflections = "0.10.2" -sarah = "1.23" -snakeyaml = "2.6" +sarah = "1.27" +snakeyaml = "2.7" yamllibrary = "-SNAPSHOT" # Build plugins paperweight = "2.0.0-beta.21" -runPaper = "3.0.2" +runPaper = "3.1.0" shadow = "9.6.1" [libraries] diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index e3ec95fa..9ed96af2 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,8 +1,8 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-9.6.1-bin.zip -distributionSha256Sum=9c0f7faeeb306cb14e4279a3e084ca6b596894089a0638e68a07c945a32c9e14 +distributionUrl=https\://services.gradle.org/distributions/gradle-9.9.0-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists +distributionSha256Sum=0b00b0ffe07c4d4789c12d4935a44a7057d55774b7540bd4a3f76f336deb177a From 641ee01eadacfdf58847de70dc5833dfbf986ba8 Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Sat, 7 Nov 2026 16:42:28 +0100 Subject: [PATCH 113/116] build: move to CraftEngine 26.10 26.10 moved the attribute types to attribute.vanilla.VanillaAttributeModifier, removed core.util.Instrument, and changed AnvilRepairItem to take ItemSelector[] targets and NumberProvider amounts. - AttributeModifier and the converters use VanillaAttributeModifier. - BlockSettings uses org.bukkit.Instrument; nothing read the CraftEngine one. - AnvilRepairItemConfiguration maps ItemSelector back to the same string form, and reads amount/percent through NumberProvider. - Nexo passes constant NumberProviders for the fixed 1 / 1.0 values. Paper stays on 1.21.11 because paper-api 26.x needs Java 25. --- .../item/behavior/block/BlockSettings.java | 2 +- .../item/data/AttributeModifier.java | 8 ++--- .../AnvilRepairItemConfiguration.java | 29 +++++++++++++----- .../itemsadder/IAItemsConverter.java | 30 +++++++++---------- .../converter/nexo/NexoItemConverter.java | 29 +++++++++--------- gradle/libs.versions.toml | 2 +- 6 files changed, 58 insertions(+), 42 deletions(-) diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/BlockSettings.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/BlockSettings.java index d1e4b11d..dc1ef4f6 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/BlockSettings.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/behavior/block/BlockSettings.java @@ -3,7 +3,7 @@ import fr.robie.craftengineconverter.api.common.TrackableSettings; import fr.robie.yamllibrary.ConfigurationSection; import net.momirealms.craftengine.core.block.setting.PushReaction; -import net.momirealms.craftengine.core.util.Instrument; +import org.bukkit.Instrument; import net.momirealms.craftengine.core.util.Tristate; import org.jetbrains.annotations.NotNull; diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/AttributeModifier.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/AttributeModifier.java index 61abab5d..0b51ce82 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/AttributeModifier.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/data/AttributeModifier.java @@ -3,11 +3,11 @@ import net.momirealms.craftengine.core.util.Key; import org.jetbrains.annotations.Nullable; -public record AttributeModifier(String type, net.momirealms.craftengine.core.attribute.AttributeModifier.Slot slot, +public record AttributeModifier(String type, net.momirealms.craftengine.core.attribute.vanilla.VanillaAttributeModifier.Slot slot, Key id, double amount, - net.momirealms.craftengine.core.attribute.AttributeModifier.Operation operation, + net.momirealms.craftengine.core.attribute.vanilla.VanillaAttributeModifier.Operation operation, @Nullable Display display) { - public AttributeModifier(String type, net.momirealms.craftengine.core.attribute.AttributeModifier.Slot slot, Key id, double amount, net.momirealms.craftengine.core.attribute.AttributeModifier.Operation operation, @Nullable Display display) { + public AttributeModifier(String type, net.momirealms.craftengine.core.attribute.vanilla.VanillaAttributeModifier.Slot slot, Key id, double amount, net.momirealms.craftengine.core.attribute.vanilla.VanillaAttributeModifier.Operation operation, @Nullable Display display) { this.amount = amount; this.display = display; this.id = id; @@ -16,6 +16,6 @@ public AttributeModifier(String type, net.momirealms.craftengine.core.attribute. this.type = type; } - public record Display(net.momirealms.craftengine.core.attribute.AttributeModifier.Display.Type type, String value) { + public record Display(net.momirealms.craftengine.core.attribute.vanilla.VanillaAttributeModifier.Display.Type type, String value) { } } diff --git a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/settings/AnvilRepairItemConfiguration.java b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/settings/AnvilRepairItemConfiguration.java index bc03bec1..1db14a34 100644 --- a/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/settings/AnvilRepairItemConfiguration.java +++ b/API/src/main/java/fr/robie/craftengineconverter/api/configuration/item/settings/AnvilRepairItemConfiguration.java @@ -3,6 +3,7 @@ import fr.robie.craftengineconverter.api.configuration.item.ItemConfigurationSerializable; import fr.robie.yamllibrary.ConfigurationSection; import fr.robie.yamllibrary.file.YamlConfiguration; +import net.momirealms.craftengine.core.item.ItemSelector; import net.momirealms.craftengine.core.item.setting.value.AnvilRepairItem; import org.jetbrains.annotations.NotNull; @@ -24,19 +25,33 @@ public void serialize(@NotNull YamlConfiguration yamlConfiguration, @NotNull Str List> repairItemsList = new ArrayList<>(); for (AnvilRepairItem repairItem : this.repairItems) { Map repairItemMap = new HashMap<>(); - if (repairItem.targets().size() == 1) { - repairItemMap.put("target", repairItem.targets().getFirst()); + List targets = new ArrayList<>(); + for (ItemSelector selector : repairItem.targets()) { + targets.add(selectorId(selector)); + } + if (targets.size() == 1) { + repairItemMap.put("target", targets.getFirst()); } else { - repairItemMap.put("target", repairItem.targets()); + repairItemMap.put("target", targets); } - if (repairItem.amount() > 0) { - repairItemMap.put("amount", repairItem.amount()); + if (repairItem.amount().getDouble() > 0) { + repairItemMap.put("amount", repairItem.amount().getInt()); } - if (repairItem.percent() > 0) { - repairItemMap.put("percent", repairItem.percent()); + if (repairItem.percent().getDouble() > 0) { + repairItemMap.put("percent", repairItem.percent().getDouble()); } repairItemsList.add(repairItemMap); } settings.set("anvil-repair-item", repairItemsList); } + + private static String selectorId(ItemSelector selector) { + if (selector instanceof ItemSelector.Tag tag) { + return "#" + tag.tag(); + } + if (selector instanceof ItemSelector.Item item) { + return item.id().toString(); + } + return selector.toString(); + } } diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/itemsadder/IAItemsConverter.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/itemsadder/IAItemsConverter.java index 7a3f84e3..f7e485a0 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/itemsadder/IAItemsConverter.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/itemsadder/IAItemsConverter.java @@ -53,7 +53,7 @@ import fr.robie.messageflow.formatter.Placeholder; import fr.robie.messageflow.logger.Logger; import fr.robie.yamllibrary.ConfigurationSection; -import net.momirealms.craftengine.core.attribute.AttributeModifier; +import net.momirealms.craftengine.core.attribute.vanilla.VanillaAttributeModifier; import net.momirealms.craftengine.core.entity.EquipmentSlot; import net.momirealms.craftengine.core.entity.display.Billboard; import org.bukkit.DyeColor; @@ -264,9 +264,9 @@ public void convertAttributeModifiers() { continue; } - net.momirealms.craftengine.core.attribute.AttributeModifier.Slot slot; + net.momirealms.craftengine.core.attribute.vanilla.VanillaAttributeModifier.Slot slot; try { - slot = net.momirealms.craftengine.core.attribute.AttributeModifier.Slot.valueOf(equipmentSlot.toUpperCase(Locale.ROOT)); + slot = net.momirealms.craftengine.core.attribute.vanilla.VanillaAttributeModifier.Slot.valueOf(equipmentSlot.toUpperCase(Locale.ROOT)); } catch (Exception e) { Logger.debug("[IAItemsConverter] Invalid equipment slot " + equipmentSlot + " for attribute modifiers for item " + this.itemId); continue; @@ -286,16 +286,16 @@ public void convertAttributeModifiers() { double value = attributeSection.getDouble("value", 0.0); String operationStr = attributeSection.getString("operation", "add_value").toUpperCase(Locale.ROOT); - net.momirealms.craftengine.core.attribute.AttributeModifier.Operation operation; + net.momirealms.craftengine.core.attribute.vanilla.VanillaAttributeModifier.Operation operation; try { if (operationStr.equalsIgnoreCase("multiply_base")) { - operation = AttributeModifier.Operation.ADD_MULTIPLIED_BASE; + operation = VanillaAttributeModifier.Operation.ADD_MULTIPLIED_BASE; } else { - operation = AttributeModifier.Operation.valueOf(operationStr); + operation = VanillaAttributeModifier.Operation.valueOf(operationStr); } } catch (Exception e) { Logger.debug("[IAItemsConverter] Invalid operation " + operationStr + " for attribute " + attributeKey + " for item " + this.itemId + ", defaulting to ADD_VALUE"); - operation = net.momirealms.craftengine.core.attribute.AttributeModifier.Operation.ADD_VALUE; + operation = net.momirealms.craftengine.core.attribute.vanilla.VanillaAttributeModifier.Operation.ADD_VALUE; } attributeModifiers.add(new fr.robie.craftengineconverter.api.configuration.item.data.AttributeModifier(attribute.name(), slot, null, value, operation, null)); } else { @@ -305,7 +305,7 @@ public void convertAttributeModifiers() { } double amount = slotSection.getDouble(attributeKey); - attributeModifiers.add(new fr.robie.craftengineconverter.api.configuration.item.data.AttributeModifier(attribute.name(), slot, null, amount, net.momirealms.craftengine.core.attribute.AttributeModifier.Operation.ADD_VALUE, null)); + attributeModifiers.add(new fr.robie.craftengineconverter.api.configuration.item.data.AttributeModifier(attribute.name(), slot, null, amount, net.momirealms.craftengine.core.attribute.vanilla.VanillaAttributeModifier.Operation.ADD_VALUE, null)); } } } @@ -555,22 +555,22 @@ private void applySlotAttributeModifiers(ConfigurationSection equipmentSection, return; } - net.momirealms.craftengine.core.attribute.AttributeModifier.Slot attributeSlot = this.toAttributeSlot(equipmentSlot); + net.momirealms.craftengine.core.attribute.vanilla.VanillaAttributeModifier.Slot attributeSlot = this.toAttributeSlot(equipmentSlot); if (attributeSlot == null) { return; } double armor = slotAttributeModifiers.getDouble("armor", 0.0); - fr.robie.craftengineconverter.api.configuration.item.data.AttributeModifier modifier = new fr.robie.craftengineconverter.api.configuration.item.data.AttributeModifier("minecraft:armor", attributeSlot, null, armor, net.momirealms.craftengine.core.attribute.AttributeModifier.Operation.ADD_VALUE, null); + fr.robie.craftengineconverter.api.configuration.item.data.AttributeModifier modifier = new fr.robie.craftengineconverter.api.configuration.item.data.AttributeModifier("minecraft:armor", attributeSlot, null, armor, net.momirealms.craftengine.core.attribute.vanilla.VanillaAttributeModifier.Operation.ADD_VALUE, null); this.craftEngineItemsConfiguration.addItemConfiguration(new AttributeModifiersConfiguration(List.of(modifier))); } - private net.momirealms.craftengine.core.attribute.AttributeModifier.Slot toAttributeSlot(EquipmentSlot equipmentSlot) { + private net.momirealms.craftengine.core.attribute.vanilla.VanillaAttributeModifier.Slot toAttributeSlot(EquipmentSlot equipmentSlot) { return switch (equipmentSlot) { - case HEAD -> net.momirealms.craftengine.core.attribute.AttributeModifier.Slot.HEAD; - case CHEST -> net.momirealms.craftengine.core.attribute.AttributeModifier.Slot.CHEST; - case LEGS -> net.momirealms.craftengine.core.attribute.AttributeModifier.Slot.LEGS; - case FEET -> net.momirealms.craftengine.core.attribute.AttributeModifier.Slot.FEET; + case HEAD -> net.momirealms.craftengine.core.attribute.vanilla.VanillaAttributeModifier.Slot.HEAD; + case CHEST -> net.momirealms.craftengine.core.attribute.vanilla.VanillaAttributeModifier.Slot.CHEST; + case LEGS -> net.momirealms.craftengine.core.attribute.vanilla.VanillaAttributeModifier.Slot.LEGS; + case FEET -> net.momirealms.craftengine.core.attribute.vanilla.VanillaAttributeModifier.Slot.FEET; default -> null; }; } diff --git a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoItemConverter.java b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoItemConverter.java index a2f4716e..abd3e043 100644 --- a/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoItemConverter.java +++ b/Plugin/src/main/java/fr/robie/craftengineconverter/converter/nexo/NexoItemConverter.java @@ -69,6 +69,7 @@ import net.momirealms.craftengine.core.entity.EquipmentSlot; import net.momirealms.craftengine.core.entity.display.Billboard; import net.momirealms.craftengine.core.item.setting.value.AnvilRepairItem; +import net.momirealms.craftengine.core.plugin.context.number.ConstantNumberProvider; import net.momirealms.craftengine.core.util.Direction; import org.bukkit.Bukkit; import org.bukkit.Material; @@ -276,17 +277,17 @@ public void convertAttributeModifiers() { } Object rawOperation = attributeModifier.get("operation"); - net.momirealms.craftengine.core.attribute.AttributeModifier.Operation operation; + net.momirealms.craftengine.core.attribute.vanilla.VanillaAttributeModifier.Operation operation; if (rawOperation instanceof String strOperation) { try { - operation = net.momirealms.craftengine.core.attribute.AttributeModifier.Operation.valueOf(strOperation.toUpperCase(Locale.ROOT)); + operation = net.momirealms.craftengine.core.attribute.vanilla.VanillaAttributeModifier.Operation.valueOf(strOperation.toUpperCase(Locale.ROOT)); } catch (Exception e) { if (strOperation.equalsIgnoreCase("ADD_NUMBER")) { - operation = net.momirealms.craftengine.core.attribute.AttributeModifier.Operation.ADD_VALUE; + operation = net.momirealms.craftengine.core.attribute.vanilla.VanillaAttributeModifier.Operation.ADD_VALUE; } else if (strOperation.equalsIgnoreCase("ADD_SCALAR")) { - operation = net.momirealms.craftengine.core.attribute.AttributeModifier.Operation.ADD_MULTIPLIED_BASE; + operation = net.momirealms.craftengine.core.attribute.vanilla.VanillaAttributeModifier.Operation.ADD_MULTIPLIED_BASE; } else if (strOperation.equalsIgnoreCase("MULTIPLY_SCALAR_1")) { - operation = net.momirealms.craftengine.core.attribute.AttributeModifier.Operation.ADD_MULTIPLIED_TOTAL; + operation = net.momirealms.craftengine.core.attribute.vanilla.VanillaAttributeModifier.Operation.ADD_MULTIPLIED_TOTAL; } else { continue; } @@ -294,11 +295,11 @@ public void convertAttributeModifiers() { } else if (rawOperation instanceof Integer intOperation) { try { operation = switch (intOperation) { - case 0 -> net.momirealms.craftengine.core.attribute.AttributeModifier.Operation.ADD_VALUE; + case 0 -> net.momirealms.craftengine.core.attribute.vanilla.VanillaAttributeModifier.Operation.ADD_VALUE; case 1 -> - net.momirealms.craftengine.core.attribute.AttributeModifier.Operation.ADD_MULTIPLIED_BASE; + net.momirealms.craftengine.core.attribute.vanilla.VanillaAttributeModifier.Operation.ADD_MULTIPLIED_BASE; case 2 -> - net.momirealms.craftengine.core.attribute.AttributeModifier.Operation.ADD_MULTIPLIED_TOTAL; + net.momirealms.craftengine.core.attribute.vanilla.VanillaAttributeModifier.Operation.ADD_MULTIPLIED_TOTAL; default -> throw new IllegalArgumentException("Invalid operation id: " + intOperation); }; } catch (Exception e) { @@ -308,13 +309,13 @@ public void convertAttributeModifiers() { continue; } - net.momirealms.craftengine.core.attribute.AttributeModifier.Slot attributeSlot = null; + net.momirealms.craftengine.core.attribute.vanilla.VanillaAttributeModifier.Slot attributeSlot = null; Object rawSlot = attributeModifier.get("slot"); if (!(rawSlot instanceof String strSlot)) { continue; } try { - attributeSlot = net.momirealms.craftengine.core.attribute.AttributeModifier.Slot.valueOf(strSlot.toUpperCase(Locale.ROOT)); + attributeSlot = net.momirealms.craftengine.core.attribute.vanilla.VanillaAttributeModifier.Slot.valueOf(strSlot.toUpperCase(Locale.ROOT)); } catch (Exception ignored) { } if (attributeSlot == null) { @@ -326,9 +327,9 @@ public void convertAttributeModifiers() { Object typeObj = displayMap.get("type"); Object textObj = displayMap.get("text"); if (typeObj instanceof String typeStr && textObj instanceof String textStr) { - net.momirealms.craftengine.core.attribute.AttributeModifier.Display.Type displayType; + net.momirealms.craftengine.core.attribute.vanilla.VanillaAttributeModifier.Display.Type displayType; try { - displayType = net.momirealms.craftengine.core.attribute.AttributeModifier.Display.Type.valueOf(typeStr.toUpperCase(Locale.ROOT)); + displayType = net.momirealms.craftengine.core.attribute.vanilla.VanillaAttributeModifier.Display.Type.valueOf(typeStr.toUpperCase(Locale.ROOT)); } catch (Exception e) { continue; } @@ -747,11 +748,11 @@ public void convertAnvilRepairable() { List anvilRepairItems = new ArrayList<>(); Object singleRepairItem = componentsSection.get("anvil_repairable.repairable"); if (singleRepairItem instanceof String singleRepairItemStr && this.isValidString(singleRepairItemStr)) { - anvilRepairItems.add(new AnvilRepairItem(List.of(singleRepairItemStr), 1, 1.0)); + anvilRepairItems.add(new AnvilRepairItem(List.of(singleRepairItemStr), ConstantNumberProvider.constant(1), ConstantNumberProvider.constant(1.0))); } else if (singleRepairItem instanceof List singleRepairItemList) { for (Object item : singleRepairItemList) { if (item instanceof String itemStr && this.isValidString(itemStr)) { - anvilRepairItems.add(new AnvilRepairItem(List.of(itemStr), 1, 1.0)); + anvilRepairItems.add(new AnvilRepairItem(List.of(itemStr), ConstantNumberProvider.constant(1), ConstantNumberProvider.constant(1.0))); } } } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index bd73a654..87d46403 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -14,7 +14,7 @@ paper = "1.21.11-R0.1-SNAPSHOT" # Plain Minecraft version, used by the `runServer` development server. minecraft = "1.21.11" -craftengine = "26.5-SNAPSHOT" +craftengine = "26.10" adventure = "5.2.0" bstats = "3.2.1" From 1ad2da39c30bd50868c5811517b5d028f98f81a0 Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Sat, 7 Nov 2026 16:56:59 +0100 Subject: [PATCH 114/116] ci: add Build, Release source and Dev build workflows develop is now the working branch; master only takes releases. Every push to develop posts a dev build as the rolling GitHub pre-release "dev". Dependabot moves from Maven to the Gradle catalog and targets develop. The version is now 0.0.3-SNAPSHOT so dev builds are numbered 0.0.3-dev.. --- .github/dependabot.yml | 11 +++- .github/workflows/build.yml | 36 ++++++++++++ .github/workflows/dev-build.yml | 88 ++++++++++++++++++++++++++++ .github/workflows/release-source.yml | 38 ++++++++++++ gradle.properties | 2 +- 5 files changed, 173 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/dev-build.yml create mode 100644 .github/workflows/release-source.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml index fe13a041..35058f5f 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,9 +1,18 @@ version: 2 updates: - - package-ecosystem: "maven" + - package-ecosystem: "gradle" directory: "/" + target-branch: "develop" schedule: interval: "weekly" open-pull-requests-limit: 10 commit-message: prefix: "deps" + + - package-ecosystem: "github-actions" + directory: "/" + target-branch: "develop" + schedule: + interval: "weekly" + commit-message: + prefix: "ci" diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..53f8bfec --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,36 @@ +name: Build + +# Every push and pull request, on any branch. The job name "Build" is a required check of the +# master ruleset (docs/BRANCHING_PLAN.md): renaming it breaks merging into master. +on: + push: + pull_request: + workflow_dispatch: + +permissions: + contents: read + +jobs: + build: + name: Build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: | + 21 + 25 + + - uses: gradle/actions/setup-gradle@v4 + + - name: Build and test + run: ./gradlew build --console=plain + + - name: Upload plugin jar + uses: actions/upload-artifact@v4 + with: + name: CraftEngineConverter + path: Plugin/build/libs/CraftEngineConverter-*.jar diff --git a/.github/workflows/dev-build.yml b/.github/workflows/dev-build.yml new file mode 100644 index 00000000..a6fffc06 --- /dev/null +++ b/.github/workflows/dev-build.yml @@ -0,0 +1,88 @@ +name: Dev build + +# Every push to develop makes a dev build (docs/BRANCHING_PLAN.md): version -dev. +# (0.0.3-dev.5, from the -SNAPSHOT version in gradle.properties), built and tested, then posted as +# the rolling GitHub pre-release "dev" (tag moved to the commit, jar replaced). It is never marked +# latest, so the newest real release stays the one GitHub shows first. +# +# A newer push cancels a build still building or testing (only the newest commit is worth +# publishing), but never a publish under way: that one finishes, and the newer publish waits. +# +# "[skip dev]" in the last commit message of a push skips the dev build (the Build workflow still +# runs); a skipped push does not cancel a build under way. "[skip ci]" skips every workflow. +on: + push: + branches: [develop] + paths-ignore: + - "docs/**" + - "**.md" + workflow_dispatch: + +permissions: + contents: read + +jobs: + build: + if: github.repository == '1robie/CraftEngineConverter' && !contains(github.event.head_commit.message, '[skip dev]') + runs-on: ubuntu-latest + concurrency: + group: dev-build-build + cancel-in-progress: true + outputs: + version: ${{ steps.version.outputs.version }} + steps: + - uses: actions/checkout@v4 + + - name: Version + id: version + run: | + base=$(grep -oP '^version\s*=\s*\K.+' gradle.properties) + echo "version=${base%-SNAPSHOT}-dev.${{ github.run_number }}" >> "$GITHUB_OUTPUT" + + - uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: | + 21 + 25 + + - uses: gradle/actions/setup-gradle@v4 + + - name: Build and test + run: ./gradlew build -Pversion="${{ steps.version.outputs.version }}" --console=plain + + publish: + needs: build + runs-on: ubuntu-latest + concurrency: + group: dev-build-publish + cancel-in-progress: false + permissions: + contents: write + env: + VERSION: ${{ needs.build.outputs.version }} + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: | + 21 + 25 + + - uses: gradle/actions/setup-gradle@v4 + + # Tested in the build job; this only assembles the same commit's jar again. + - name: Plugin jar + run: ./gradlew :Plugin:shadowJar -Pversion="$VERSION" --console=plain + + - name: GitHub pre-release "dev" + env: + GH_TOKEN: ${{ github.token }} + run: | + gh release delete dev --cleanup-tag --yes || true + gh release create dev "Plugin/build/libs/CraftEngineConverter-$VERSION.jar" \ + --target "$GITHUB_SHA" --prerelease --latest=false \ + --title "CraftEngineConverter dev build ($VERSION)" \ + --notes "Unstable build of \`develop\` at $GITHUB_SHA, replaced on every push. Releases: https://github.com/1robie/CraftEngineConverter/releases" diff --git a/.github/workflows/release-source.yml b/.github/workflows/release-source.yml new file mode 100644 index 00000000..6c0ae871 --- /dev/null +++ b/.github/workflows/release-source.yml @@ -0,0 +1,38 @@ +name: Release source + +# master only takes releases (docs/BRANCHING_PLAN.md): a pull request into it must be opened by the +# repository owner, from develop or a hotfix/* branch of this repository. Everyone else targets +# develop. The master ruleset requires this check; a ruleset cannot restrict the author or the source +# branch on its own. +on: + pull_request: + branches: [master] + types: [opened, reopened, synchronize, edited] + +permissions: {} + +jobs: + release-source: + name: Release source + runs-on: ubuntu-latest + steps: + - name: Check the source branch + env: + HEAD_REF: ${{ github.head_ref }} + HEAD_REPO: ${{ github.event.pull_request.head.repo.full_name }} + AUTHOR: ${{ github.event.pull_request.user.login }} + OWNER: ${{ github.repository_owner }} + run: | + if [ "$AUTHOR" != "$OWNER" ]; then + echo "::error::Only $OWNER opens pull requests into master (releases). Target develop instead." + exit 1 + fi + if [ "$HEAD_REPO" != "$GITHUB_REPOSITORY" ]; then + echo "::error::A pull request into master must come from this repository, not $HEAD_REPO." + exit 1 + fi + case "$HEAD_REF" in + develop|hotfix/*) echo "Source branch $HEAD_REF is allowed." ;; + *) echo "::error::A pull request into master must come from develop or hotfix/*, not $HEAD_REF. Target develop instead." + exit 1 ;; + esac diff --git a/gradle.properties b/gradle.properties index f371e3fc..bac98aac 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ group = fr.robie.craftengineconverter -version = 0.0.2 +version = 0.0.3-SNAPSHOT plugin.author = 1robie From 893bbb5cdbd56604ee75ee0c6fe669910f9cb9c0 Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Sat, 7 Nov 2026 16:56:59 +0100 Subject: [PATCH 115/116] build: make gradlew executable CI runs ./gradlew on Linux, which needs the executable bit. --- gradlew | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 gradlew diff --git a/gradlew b/gradlew old mode 100644 new mode 100755 From b088c52539178af44a5deb4e5c5f19fd893bd432 Mon Sep 17 00:00:00 2001 From: 1robie <97293924+1robie@users.noreply.github.com> Date: Sat, 7 Nov 2026 16:56:59 +0100 Subject: [PATCH 116/116] chore: stop tracking docs/ docs/ is local documentation only and is now ignored. --- .gitignore | 3 + docs/.gitbook/vars.yaml | 4 - docs/README.md | 45 ----- docs/SUMMARY.md | 27 --- docs/commands-permissions/commands.md | 45 ----- docs/commands-permissions/permissions.md | 20 -- docs/configuration/main-config.md | 227 ----------------------- docs/converters/itemsadder-converter.md | 48 ----- docs/converters/nexo-converter.md | 48 ----- docs/getting-started/quick-start.md | 45 ----- docs/getting-started/requirements.md | 40 ---- docs/support/contact.md | 18 -- docs/troubleshooting/common-issues.md | 0 docs/troubleshooting/faq.md | 0 14 files changed, 3 insertions(+), 567 deletions(-) delete mode 100644 docs/.gitbook/vars.yaml delete mode 100644 docs/README.md delete mode 100644 docs/SUMMARY.md delete mode 100644 docs/commands-permissions/commands.md delete mode 100644 docs/commands-permissions/permissions.md delete mode 100644 docs/configuration/main-config.md delete mode 100644 docs/converters/itemsadder-converter.md delete mode 100644 docs/converters/nexo-converter.md delete mode 100644 docs/getting-started/quick-start.md delete mode 100644 docs/getting-started/requirements.md delete mode 100644 docs/support/contact.md delete mode 100644 docs/troubleshooting/common-issues.md delete mode 100644 docs/troubleshooting/faq.md diff --git a/.gitignore b/.gitignore index 4058b9b4..e41fe9c2 100644 --- a/.gitignore +++ b/.gitignore @@ -135,3 +135,6 @@ reflection/ concepts/ MCBE-Vanilla-RP/ Minecraft-default-assets-latest/ + +# Local documentation, never committed +docs/ diff --git a/docs/.gitbook/vars.yaml b/docs/.gitbook/vars.yaml deleted file mode 100644 index ccf016e8..00000000 --- a/docs/.gitbook/vars.yaml +++ /dev/null @@ -1,4 +0,0 @@ -PLUGIN_VERSION: "0.0.1" -CRAFTENGINE_VERSION: "0.0.65.0" -CODE_BLOCK_TRIPLEBACKTICKS: "```" -SINGLE_BACKTICK: "`" \ No newline at end of file diff --git a/docs/README.md b/docs/README.md deleted file mode 100644 index fb948cab..00000000 --- a/docs/README.md +++ /dev/null @@ -1,45 +0,0 @@ -# 📖 Introduction - -Welcome to the complete documentation for **CraftEngineConverter**, the ultimate plugin to convert configuration files from other plugins into the CraftEngine format. - -## ⭐ Key Features - -### Conversion Support - -- **Multi-Plugin Compatibility**: Seamlessly convert configuration files from a variety of popular plugins into the CraftEngine format. Currently supporting **Nexo** and **ItemsAdder**, with more to come soon! -- **Automated Process**: Simplify your workflow with automated conversion processes that save you time and effort. - -### ⚡ Performance & Reliability - -- **Folia Compatible**: Fully supports Folia's regionized multithreading for maximum performance and stability. -- **Multi-Threaded Pack Conversion**: Leverage multi-threading capabilities to speed up the conversion process, ensuring efficient handling of large configuration files. - -## 🗺️ Quick Navigation - -### 🚀 Getting Started - -* [📋 Requirements](getting-started/requirements.md) -* [⚡ Quick Start](getting-started/quick-start.md) - Get running in 5 minutes! - -### ⚙️ Configuration - -* [🔧 Main Configuration](configuration/main-config.md) - -### 💻 Commands & Permissions - -* [⌨️ Commands](commands-permissions/commands.md) -* [🔐 Permissions](commands-permissions/permissions.md) - -### 🆘 Support - -* [❓ FAQ & Troubleshooting](troubleshooting/faq.md) -* [🐛 Common Issues](troubleshooting/common-issues.md) -* [📞 Contact & Support](support/contact.md) - -## 📄 License - -This project is licensed under the GNU License. See the [LICENSE](../LICENSE) file for details. - -*** - -**Version :** space.vars.PLUGIN_VERSION \ No newline at end of file diff --git a/docs/SUMMARY.md b/docs/SUMMARY.md deleted file mode 100644 index c00290b2..00000000 --- a/docs/SUMMARY.md +++ /dev/null @@ -1,27 +0,0 @@ -# Table of contents - -## Getting Started - -* [📖 Introduction](README.md) -* [📋 Requirements](getting-started/requirements.md) -* [⚡ Quick Start](getting-started/quick-start.md) - -## Configuration - -* [🔧 Main Configuration](configuration/main-config.md) -* [Nexo Converter](converters/nexo-converter.md) -* [ItemsAdder Converter](converters/itemsadder-converter.md) - -## Commands & Permissions - -* [⌨️ Commands](commands-permissions/commands.md) -* [🔐 Permissions](commands-permissions/permissions.md) - -## Troubleshooting & Support - -* [❓ FAQ](troubleshooting/faq.md) -* [🐛 Common Issues](troubleshooting/common-issues.md) - -## Additional Resources - -* [📞 Contact & Support](support/contact.md) \ No newline at end of file diff --git a/docs/commands-permissions/commands.md b/docs/commands-permissions/commands.md deleted file mode 100644 index a80dad77..00000000 --- a/docs/commands-permissions/commands.md +++ /dev/null @@ -1,45 +0,0 @@ -# 📝 Commands Reference - -This page provides a comprehensive reference for all commands available in **CraftEngineConverter**. Each command is detailed with its syntax, description, and required permissions. - -## Main Command - -### `/craftengineconverter` or `/cec` -- **Description**: The primary command for accessing CraftEngineConverter functionalities. -- **Permissions**: `craftengineconverter.command.use` - -#### Subcommands - -1. `reload` - - **Description**: Reloads the plugin configuration without restarting the server. - - **Usage**: `/craftengineconverter reload` or `/cec reload` - - **Permissions**: `craftengineconverter.command.reload` - -2. `convert [] [] [--dryrun] [--threads=]` - - **Description**: Initiates the conversion process for supported plugin configuration files into the CraftEngine format. - - **Usage**: - Available plugin names: - - `nexo` - - `itemsadder` - Available types: - - `ALL` Default - Converts all supported configuration files. - - `ITEMS` - Converts only item configurations. - - `EMOJIS` - Converts only emoji configurations. - - `IMAGES` - Converts only image configurations. - - `LANGUAGES` - Converts only language files. - - `SOUNDS` - Converts only sound configurations. - - `PACKS` - Converts only resource packs. - Additional flags: - - `--dryrun`: Simulates the conversion process without making any changes. - - `--threads=`: Specifies the number of threads to use for multi-threaded pack conversion. Default is 1. - - `--force`: Stops any ongoing conversion process and immediately starts a new one. Use this to override and restart conversions that are currently running. - - **Usage Example**: `/craftengineconverter convert nexo ITEMS --dryrun --threads=4` or `/cec convert nexo ITEMS --dryrun --threads=4` - - **Permissions**: `craftengineconverter.command.convert` - -3. `clearfilescache` - - **Description**: Clears the internal cache of files used during the conversion process. - - **Usage**: - Aditional flags: - - `--all`: Clears all cached files. - - **Usage Example**: `/craftengineconverter clearfilescache --all` or `/cec clearfilescache`, clears only files outdated (modified since last access). - - **Permissions**: `craftengineconverter.command.clearfilescache` \ No newline at end of file diff --git a/docs/commands-permissions/permissions.md b/docs/commands-permissions/permissions.md deleted file mode 100644 index c623da7f..00000000 --- a/docs/commands-permissions/permissions.md +++ /dev/null @@ -1,20 +0,0 @@ -# 🔑 Permissions Reference - -This page provides a comprehensive reference for all permissions available in **CraftEngineConverter**. Each permission is detailed with its description and the commands it is associated with. - -## Available Permissions - -1. `craftengineconverter.command.use` - - **Description**: Grants access to the main CraftEngineConverter command. - - **Associated Command**: `/craftengineconverter` or `/cec` - -2. `craftengineconverter.command.reload` - - **Description**: Allows the user to reload the plugin configuration without restarting the server. - - **Associated Command**: `/craftengineconverter reload` or `/cec reload` - -3. `craftengineconverter.command.convert` - - **Description**: Permits the user to initiate the conversion process for supported plugin configuration files into the CraftEngine format. - - **Associated Command**: `/craftengineconverter convert [] [] [--dryrun] [--threads=]` - ---- -For more information on how to use these permissions, please refer to the [📝 Commands Reference](commands.md) page. \ No newline at end of file diff --git a/docs/configuration/main-config.md b/docs/configuration/main-config.md deleted file mode 100644 index cd5dec6d..00000000 --- a/docs/configuration/main-config.md +++ /dev/null @@ -1,227 +0,0 @@ -# 🛠️ Main Config (`config.yml`) Guide - -This guide provides a detailed overview of the main configuration file (`config.yml`) for **CraftEngineConverter**. Here, you'll find explanations for each configurable option, allowing you to customize the plugin to suit your server's needs. - -## 📁 Configuration File Location -The `config.yml` file is located in the `plugins/CraftEngineConverter/` directory of your Minecraft server. - -## ⚙️ Configuration Options - -```yaml -enable-debug: false - -# Language settings (available languages: EN, FR) -language: "EN" - -# Each block has a usage limit for a block-state. This setting controls how those limits are enforced when multiple plugins are installed: -# - "plugin": Each plugin gets its own separate limit. Different plugins can use the same block-states independently without affecting each other. -# - "global": All plugins share the same limit. Once any plugin uses up the limit for a block-state, other plugins cannot use it (prevents conflicts and duplicates). -# -# Choose "global" to prevent multiple plugins from using the same block-states; otherwise choose "plugin" to allow each plugin its own allocation. -# -# Note: -# - Block-states can have parent-child relationships. -# - A parent's limit automatically includes the limits of all its children. -# For example, if "note-block" (a child of "solid") has a limit of 10, then "solid" will have its own limit plus 10. -# -# Available block-state groups and their capacity: -# - SOLID (1338 available): Top-level group -# - MUSHROOM (189 available): Mushroom block variants -# - RED_MUSHROOM_BLOCK (63 available) -# - BROWN_MUSHROOM_BLOCK (63 available) -# - MUSHROOM_STEM (63 available) -# - NOTE_BLOCK (1149 available) -# -# - TRIPWIRE (126 available): Tripwire variants -# - LOWER_TRIPWIRE (63 available) -# - HIGHER_TRIPWIRE (63 available) -# -# - TINTABLE_LEAVES (65 available) -# - WATERLOGGED_TINTABLE_LEAVES (65 available) -# -# - NON_TINTABLE_LEAVES (234 available) -# - WATERLOGGED_NON_TINTABLE_LEAVES (234 available) -# -# - LEAVES (143 available) -# - WATERLOGGED_LEAVES (143 available) -# -# - Independent blocks (not part of any shared group): -# - CACTUS (15), SUGAR_CANE (15) -# - WEEPING_VINE (50), TWISTING_VINE (50), CAVE_VINE (100) -# - SAPLING (8), KELP (25), CHORUS (0) -block-state-limit: - type: PLUGIN - tintable-leaves: - start-limit: 0 - waterlogged-tintable-leaves: - start-limit: 0 - non-tintable-leaves: - start-limit: 0 - waterlogged-non-tintable-leaves: - start-limit: 0 - leaves: - start-limit: 0 - waterlogged-leaves: - start-limit: 0 - lower-tripwire: - start-limit: 0 - higher-tripwire: - start-limit: 0 - tripwire: - start-limit: 0 - mushroom-stem: - start-limit: 0 - red-mushroom-block: - start-limit: 0 - brown-mushroom-block: - start-limit: 0 - mushroom: - start-limit: 0 - note-block: - start-limit: 0 - solid: - start-limit: 0 - cactus: - start-limit: 0 - sugar-cane: - start-limit: 0 - weeping-vine: - start-limit: 0 - twisting-vine: - start-limit: 0 - cave-vine: - start-limit: 0 - sapling: - start-limit: 0 - kelp: - start-limit: 0 - chorus: - start-limit: 0 - -# Auto-convert items on plugin enable -auto-convert-on-startup: false - -# Select which converters and options should be used on startup -# If empty, all options for all converters will be used -# Available options: ITEMS, EMOJIS, IMAGES, LANGUAGES, SOUNDS, RECIPES, PACKS, ALL -# auto-convert-on-startup-types: -# nexo: -# - ITEMS -# - EMOJIS -# itemsadder: -# - ITEMS -# - IMAGES - -# Default material for items -default-material: "PAPER" - -# Disable italic formatting in item lore by adding tag -disable-default-italic: true - -# Armor converter settings -# Available types: COMPONENT, TRIM , BOTH -armor-converter-type: "COMPONENT" - -blacklisted-paths: - - "shaders/*" # Blacklist all files in shaders folder - # - "shaders/rendertype_text.fsh" # Example of how to blacklist a specific file - # - "minecraft:textures/shaders/" # Example of how to blacklist the entire shaders namespace - -formatting: - packet-events: true - boss-bar: true - action-bar: true - plugin-message: true - title: true - menu-title: true - -tag: - nexo-glyph: # - enabled: true - itemsadder-image: # :old_name: - enabled: true - placeholder-api: # or - enabled: true - -allow-block-conversion-propagation: true # When enabled, if a block is converted, the surrounding blocks will also be checked for conversion -max-block-conversion-propagation-depth: 64 # Maximum number of blocks to propagate conversion in one block interaction event - -nexo: - enable-hook: true # Enable Nexo integration if Nexo is installed - # Require this permission to allow Nexo block interaction conversion : craftengineconverter.nexo.block.interact.conversion - enable-block-interaction-conversion: true # When enabled, when you interact with a nexo block, it will convert the nexo block to their CE equivalent - # Require this permission to allow Nexo furniture interaction conversion : craftengineconverter.nexo.furniture.interact.conversion - enable-furniture-interaction-conversion: true # When enabled, when you interact with a nexo furniture, it will convert the furniture to their CE equivalent - enable-chunk-load-conversion: false # When enabled, when a chunk is loaded, it will convert all Nexo blocks and furnitures to CE equivalents - -itemsadder: - enable-hook: true # Enable ItemsAdder integration if ItemsAdder is installed - img-placeholderapi-support: true # Register a placeholder %img:old_name% to get the new image - # Require this permission to allow ItemsAdder block interaction conversion : craftengineconverter.itemsadder.block.interact.conversion - enable-block-interaction-conversion: true # When enabled, when you interact with an ItemsAdder block, it will convert the block to their CE equivalent - # Require this permission to allow ItemsAdder furniture interaction conversion : craftengineconverter.itemsadder.furniture.interact.conversion - enable-furniture-interaction-conversion: true # When enabled, when you interact with an ItemsAdder furniture, it will convert the furniture to their CE equivalent - enable-chunk-load-conversion: false # When enabled, when a chunk is loaded, it will convert all ItemsAdder blocks and furnitures to CE equivalents - blacklisted-content-folders-namespaces: [] # List of content folders or namespaces to ignore during conversion - -world-converter: - enable: false # Enable world conversion feature (Requires server restart to take effect) - nexo: - enable: true # Enable Nexo world conversion without nexo plugin installed ! Just explore and let the lugin convert Nexo blocks and furnitures to CE equivalents - itemsadder: - enable: true # Enable ItemsAdder world conversion without ItemsAdder plugin installed ! Just explore and let the lugin convert ItemsAdder blocks and furnitures to CE equivalents - progress-bar-options: - progress-color: GREEN - empty-color: DARK_GRAY - percent-color: YELLOW - progress-char: █ - empty-char: ░ - bar-width: 50 - -# Available colors: -# BLACK, DARK_BLUE, DARK_GREEN, DARK_AQUA, DARK_RED, DARK_PURPLE, -# GOLD, GRAY, DARK_GRAY, BLUE, GREEN, AQUA, RED, LIGHT_PURPLE, YELLOW, WHITE -progress-bar-options: - items: - progress-color: GREEN - empty-color: DARK_GRAY - percent-color: YELLOW - progress-char: █ - empty-char: ░ - bar-width: 50 - emojis: - progress-color: AQUA - empty-color: DARK_GRAY - percent-color: YELLOW - progress-char: █ - empty-char: ░ - bar-width: 50 - images: - progress-color: GOLD - empty-color: DARK_GRAY - percent-color: YELLOW - progress-char: █ - empty-char: ░ - bar-width: 50 - languages: - progress-color: BLUE - empty-color: DARK_GRAY - percent-color: YELLOW - progress-char: █ - empty-char: ░ - bar-width: 50 - sounds: - progress-color: LIGHT_PURPLE - empty-color: DARK_GRAY - percent-color: YELLOW - progress-char: █ - empty-char: ░ - bar-width: 50 - packs: - progress-color: RED - empty-color: DARK_GRAY - percent-color: YELLOW - progress-char: █ - empty-char: ░ - bar-width: 50 -``` \ No newline at end of file diff --git a/docs/converters/itemsadder-converter.md b/docs/converters/itemsadder-converter.md deleted file mode 100644 index b533fb50..00000000 --- a/docs/converters/itemsadder-converter.md +++ /dev/null @@ -1,48 +0,0 @@ -# ItemsAdder Converter - -This section provides instructions on how to use the **ItemsAdder Converter** feature of the **CraftEngineConverter** plugin to convert configuration files from the **ItemsAdder** plugin into the **CraftEngine** format. - -## 📋 Prerequisites - -Before proceeding with the conversion, ensure that you have the following prerequisites met: -- **CraftEngineConverter** plugin installed on your Minecraft server. Refer to the [🚀 Quick Start](../getting-started/quick-start.md) guide for installation instructions. -- **ItemsAdder** plugin installed on your Minecraft server (Recommended to convert existing blocks/furniture) -- **CraftEngine** plugin installed on your Minecraft server. - -If you have **ItemsAdder** installed, it is recommended to back up your server before performing any conversions and go to the config of ItemsAdder and disable the option to generate the resouce pack on server start to avoid conflicts with the resource pack generated by CraftEngine. - -## Command - -To convert ItemsAdder configuration files, use the following command in your Minecraft server console or in-game chat (if you have the necessary permissions): - -```bash -/ceconverter convert itemsadder -``` - -This command will initiate the conversion process for ItemsAdder configuration files. - -## Converted Files Location - -After the conversion is complete, the converted files will be saved in the following directory within your server: `plugins/CraftEngineConverter/converted/ItemsAdder/` - -## Upload Converted Files to CraftEngine - -For this you need to go to `plugins/CraftEngine/converted/ItemsAdder/` and copy all the files from there to your plugin's folder. -Or you can go to `plugins/CraftEngineConverter/converted/ItemsAdder/CraftEngine/resources/craftengineconverter` and copy the `configuration` and `resourcepack` folders to your `plugins/CraftEngine/resources/xxx` folder where `xxx` is a name you choose to organize your CraftEngine resources. - -## Usage - -If you want to convert in one click ItemsAdder blocks or furniture when you interact with them in-game, make sure to enable the following options in the `config.yml` file of **CraftEngineConverter**: -```yaml -itemsadder: - enable-hook: true # Enable ItemsAdder integration if ItemsAdder is installed - # Require this permission to allow ItemsAdder block interaction conversion : craftengineconverter.itemsadder.block.interact.conversion - enable-block-interaction-conversion: true # When enabled, when you interact with an ItemsAdder block, it will convert the block to their CE equivalent - # Require this permission to allow ItemsAdder furniture interaction conversion : craftengineconverter.itemsadder.furniture.interact.conversion - enable-furniture-interaction-conversion: true # When enabled, when you interact with an ItemsAdder furniture, it will convert the furniture to their CE equivalent -``` -Make sure that **ItemsAdder** plugin is installed on your server for these features to work. - -## Additional Information - -For more details on configuring **CraftEngineConverter**, please refer to the [🔧 Main Configuration](../configuration/main-config.md) page. \ No newline at end of file diff --git a/docs/converters/nexo-converter.md b/docs/converters/nexo-converter.md deleted file mode 100644 index afa2dacb..00000000 --- a/docs/converters/nexo-converter.md +++ /dev/null @@ -1,48 +0,0 @@ -# Nexo Converter - -This section provides instructions on how to convert configuration files from the **Nexo** plugin into the **CraftEngine** format using the **CraftEngineConverter** plugin. - -## 📋 Prerequisites - -Before proceeding with the conversion, ensure that you have the following prerequisites met: -- **CraftEngineConverter** plugin installed on your Minecraft server. Refer to the [🚀 Quick Start](../getting-started/quick-start.md) guide for installation instructions. -- **Nexo** plugin installed on your Minecraft server (Recommended to convert existing blocks/furniture). -- **CraftEngine** plugin installed on your Minecraft server. - -## Command - -To convert Nexo configuration files, use the following command in your Minecraft server console or in-game chat (if you have the necessary permissions): - -```bash -/ceconverter convert nexo -``` - -This command will initiate the conversion process for Nexo configuration files. - -## Converted Files Location - -After the conversion is complete, the converted files will be saved in the following directory within your server:`plugins/CraftEngineConverter/converted/Nexo/` - -## Upload Converted Files to CraftEngine - -For this you need to go to `plugins/CraftEngine/converted/Nexo/` and copy all the files from there to your plugin's folder. -Or you can go to `plugins/CraftEngineConverter/converted/Nexo/CraftEngine/resources/craftengineconverter` and copy the `configuration` and `resourcepack` folders to your `plugins/CraftEngine/resources/xxx` folder where `xxx` is a name you choose to organize your CraftEngine resources. - -## Usage - -If you want to convert in one click nexo blocks or furniture when you interact with them in-game, make sure to enable the following options in the `config.yml` file of **CraftEngineConverter**: - -```yaml -nexo: - enable-hook: true # Enable Nexo integration if Nexo is installed - # Require this permission to allow Nexo block interaction conversion : craftengineconverter.nexo.block.interact.conversion - enable-block-interaction-conversion: true # When enabled, when you interact with a nexo block, it will convert the nexo block to their CE equivalent - # Require this permission to allow Nexo furniture interaction conversion : craftengineconverter.nexo.furniture.interact.conversion - enable-furniture-interaction-conversion: true # When enabled, when you interact with a nexo furniture, it will convert the furniture to their CE equivalent -``` - -Make sure that **Nexo** plugin is installed on your server for these features to work. - -## Additional Information - -For more details on configuring **CraftEngineConverter**, please refer to the [🔧 Main Configuration](../configuration/main-config.md) page. \ No newline at end of file diff --git a/docs/getting-started/quick-start.md b/docs/getting-started/quick-start.md deleted file mode 100644 index 434b0af3..00000000 --- a/docs/getting-started/quick-start.md +++ /dev/null @@ -1,45 +0,0 @@ -# 🚀 Quick Start - -This guide will help you get **CraftEngineConverter** up and running in just a few minutes. - -## 📋 Prerequisites - -Please check the [📋 Requirements](requirements.md) page to ensure your server meets all necessary requirements. - -## 📥 Download - -Download the latest version of **CraftEngineConverter** from one of the following sources: -- [Modrinth](https://modrinth.com/plugin/craftengineconverter) :x: -- [Polymart](https://polymart.org/product/XXXX/craftengineconverter) :x: -- [SpigotMC](https://www.spigotmc.org/resources/craftengineconverter.XXXX/) :x: -- [GitHub Releases](https://github.com/1robie/CraftEngineConverter/releases) :white_check_mark: - -:x: Note: The plugin is currently only available on GitHub Releases. Other platforms will be supported in future updates. - -## 🔧 Installation - -### Step 1: Install Plugins - -1. **Stop your Minecraft server** if it is running. -2. **Download the CraftEngineConverter.jar** file from the link above. -3. **Place the space.vars.SINGLE_BACKTICKCraftEngineConverter.space.vars.PLUGIN_VERSION.jarspace.vars.SINGLE_BACKTICK file** into your server's `plugins` directory. -4. **Ensure that the required dependency, CraftEngine**, is also installed in the `plugins` directory. -5. **Start your Minecraft server.** - -### Step 2: Verification - -After starting your server, check the console logs for messages indicating that **CraftEngineConverter** has been enabled successfully. You should see output similar to the following: -``` bash -[xx:xx:xx INFO]: [CraftEngineConverter v0.0.1] Enabling plugin ... -[xx:xx:xx INFO]: [CraftEngineConverter v0.0.1] Loading 1 commands -[xx:xx:xx INFO]: [CraftEngineConverter v0.0.1] Auto-conversion is enabled, starting conversion... -[xx:xx:xx INFO]: [CraftEngineConverter v0.0.1] Plugin enabled ! -``` - -If you see any errors, please refer to the [🐛 Common Issues](../troubleshooting/common-issues.md) page for troubleshooting tips. - -## 🎉 You're All Set! - -You have successfully installed and set up **CraftEngineConverter**! You can now start converting configuration files from supported plugins into the CraftEngine format. -All configuration files will be generated in the `plugins/CraftEngineConverter/converted/` directory. See [Nexo Converter](../converters/nexo-converter.md) or [ItemsAdder Converter](../converters/itemsadder-converter.md) for specific plugin conversion instructions. -For more information on how to use the plugin, please refer to the [🔧 Main Configuration](../configuration/main-config.md) and [⌨️ Commands](../commands-permissions/commands.md) pages. \ No newline at end of file diff --git a/docs/getting-started/requirements.md b/docs/getting-started/requirements.md deleted file mode 100644 index a04b94eb..00000000 --- a/docs/getting-started/requirements.md +++ /dev/null @@ -1,40 +0,0 @@ -# 📋 Requirements - -To ensure a smooth experience with **CraftEngineConverter**, please make sure your server meets the following requirements: - -## 🖥️ Server Requirements - -### Minecraft Server Software -CraftEngineConverter is compatible with the following server software: - -#### ✅ Fully Supported -- **Paper** - **Recommended** for best performance -- **Spigot** -- **Purpur** - -### Java Version -- **Java 21** required -- Verify your Java version with: `java -version` - -## 🔌 Required Dependencies - -These plugins **must** be installed on your server for CraftEngineConverter to function properly: - -### CraftEngine (Required) -- **Minimum Version**: space.vars.CRAFTENGINE_VERSION -- **Download**: [Modrinth](https://modrinth.com/plugin/craftengine) [Polymart](https://polymart.org/product/7624/craftengine) [SpigotMC - Free Version](https://www.spigotmc.org/resources/craftengine-free-version.128871/) - -## ⚙️ Optional Dependencies - -The following plugins are **optional** but enhance the functionality of CraftEngineConverter: - -### PlaceholderAPI (Optional) -- **Minimum Version**: 2.11.7 -- **Download**: [SpigotMC](https://www.spigotmc.org/resources/placeholderapi.6245/) - -### PacketEvents (Optional) -- **Minimum Version**: 2.11.0 -- **Download**: [Modrinth](https://modrinth.com/plugin/packetevents) - ---- -Ensure your server meets these requirements to take full advantage of CraftEngineConverter's features! \ No newline at end of file diff --git a/docs/support/contact.md b/docs/support/contact.md deleted file mode 100644 index ae8536c4..00000000 --- a/docs/support/contact.md +++ /dev/null @@ -1,18 +0,0 @@ -# 📞 Contact & Support - -If you need help, have questions, or want to report a bug or security issue, please use one of the following methods: - -## 💬 Discord (Preferred) -- **Contact:** kyubi8319 -- Please send a clear and detailed message. If your message is unclear or looks like spam, it may be ignored. -- **Security:** If you discover a critical vulnerability, do **not** open a public issue. Contact me directly and privately on Discord. - -## 🐛 GitHub Issues -- For general bugs and feature requests, you can open an issue on the [GitHub repository](https://github.com/1robie/CraftEngineConverter/issues). -- Please do **not** report security vulnerabilities publicly. - -## 📚 Documentation -- Check the [FAQ & Troubleshooting](../troubleshooting/faq.md) and [Common Issues](../troubleshooting/common-issues.md) pages for quick help. - ---- -Thank you for using CraftEngineConverter! \ No newline at end of file diff --git a/docs/troubleshooting/common-issues.md b/docs/troubleshooting/common-issues.md deleted file mode 100644 index e69de29b..00000000 diff --git a/docs/troubleshooting/faq.md b/docs/troubleshooting/faq.md deleted file mode 100644 index e69de29b..00000000