From 8f3c947679d9c0487eb05fbf9da6fb1f34f651ba Mon Sep 17 00:00:00 2001 From: Eclipse Date: Tue, 1 Jul 2025 11:51:41 +0000 Subject: [PATCH] Should probably save attachables to JSON files --- .../pack/attachable/BedrockAttachable.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/geysermc/packgenerator/pack/attachable/BedrockAttachable.java b/src/main/java/org/geysermc/packgenerator/pack/attachable/BedrockAttachable.java index 93169a3..68e1b65 100644 --- a/src/main/java/org/geysermc/packgenerator/pack/attachable/BedrockAttachable.java +++ b/src/main/java/org/geysermc/packgenerator/pack/attachable/BedrockAttachable.java @@ -33,19 +33,27 @@ public record BedrockAttachable(BedrockVersion formatVersion, AttachableInfo inf } public static BedrockAttachable equipment(ResourceLocation identifier, EquipmentSlot slot, String texture) { + String script = switch (slot) { + case HEAD -> "v.helmet_layer_visible = 0.0;"; + case CHEST -> "v.chest_layer_visible = 0.0;"; + case LEGS -> "v.leg_layer_visible = 0.0;"; + case FEET -> "v.boot_layer_visible = 0.0;"; + default -> ""; + }; return builder(identifier) .withMaterial(DisplaySlot.DEFAULT, "armor") .withMaterial(DisplaySlot.ENCHANTED, "armor_enchanted") .withTexture(DisplaySlot.DEFAULT, texture) .withTexture(DisplaySlot.ENCHANTED, VanillaTextures.ENCHANTED_ACTOR_GLINT) .withGeometry(DisplaySlot.DEFAULT, VanillaGeometries.fromEquipmentSlot(slot)) + .withScript("parent_setup", script) .withRenderController(VanillaRenderControllers.ARMOR) .build(); } public void save(Path attachablesPath) throws IOException { // Get a save attachable path by using Geyser's way of getting icons - CodecUtil.trySaveJson(CODEC, this, attachablesPath.resolve(GeyserMapping.iconFromResourceLocation(info.identifier))); + CodecUtil.trySaveJson(CODEC, this, attachablesPath.resolve(GeyserMapping.iconFromResourceLocation(info.identifier) + ".json")); } public static class Builder {