Skip to content

Commit 0c8d1f7

Browse files
committed
✨ Add Texture Slots
- faces assigned to a slot can switch between the slot's textures - 1.21.4+ can switch each slot on its own via texture_slots functions - variants pick a texture per slot instead of mapping textures - default variant can now be renamed - 1.11.0 blueprint upgrade migrates old texture maps - plugin JSON format v3 replaces texture_palettes with texture_slots
1 parent 94490c3 commit 0c8d1f7

50 files changed

Lines changed: 2767 additions & 594 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎schemas/example-plugin-blueprint.json‎

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "./plugin-blueprint.schema.json",
3-
"format_version": 2,
3+
"format_version": 3,
44
"settings": {
55
"id": "animated_java:blueprint"
66
},
@@ -19,13 +19,10 @@
1919
"resource_location": "minecraft:block/stone"
2020
}
2121
},
22-
"texture_palettes": {
23-
"default_palette": {
24-
"active_state": "default",
25-
"states": {
26-
"default": { "texture": "custom_texture" },
27-
"alternative": { "texture": "reference_texture" }
28-
}
22+
"texture_slots": {
23+
"body": {
24+
"default_texture": "custom_texture",
25+
"textures": ["custom_texture", "reference_texture"]
2926
}
3027
},
3128
"nodes": {
@@ -90,8 +87,8 @@
9087
"down": {
9188
"uv": [0, 0, 16, 16],
9289
"texture_provider": {
93-
"type": "texture_palette",
94-
"texture_palette": "default_palette"
90+
"type": "texture_slot",
91+
"texture_slot": "body"
9592
}
9693
}
9794
},
@@ -138,8 +135,8 @@
138135
"down": {
139136
"uv": [0, 0, 16, 16],
140137
"texture_provider": {
141-
"type": "texture_palette",
142-
"texture_palette": "default_palette"
138+
"type": "texture_slot",
139+
"texture_slot": "body"
143140
}
144141
}
145142
},
@@ -180,8 +177,8 @@
180177
"down": {
181178
"uv": [0, 0, 16, 16],
182179
"texture_provider": {
183-
"type": "texture_palette",
184-
"texture_palette": "default_palette"
180+
"type": "texture_slot",
181+
"texture_slot": "body"
185182
}
186183
}
187184
},
@@ -260,9 +257,9 @@
260257
"start_delay": "0.0",
261258
"length": 3.0,
262259
"global_keyframes": {
263-
"texture": {
264-
"0.0": { "default_palette": "default" },
265-
"1.5": { "default_palette": "alternative" }
260+
"texture_slot": {
261+
"0.0": { "body": "custom_texture" },
262+
"1.5": { "body": "reference_texture" }
266263
},
267264
"event": {
268265
"1.5": { "events": ["event_1", "event_2"] },

‎schemas/plugin-blueprint.schema.json‎

Lines changed: 23 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@
2727
}
2828
}
2929
},
30-
"texture_palettes": {
30+
"texture_slots": {
3131
"type": "object",
3232
"default": {},
3333
"patternProperties": {
3434
"^[a-z0-9_]+$": {
35-
"$ref": "#/definitions/texture_palette"
35+
"$ref": "#/definitions/texture_slot"
3636
}
3737
}
3838
},
@@ -128,31 +128,23 @@
128128
}
129129
]
130130
},
131-
"texture_palette": {
131+
"texture_slot": {
132132
"type": "object",
133-
"required": ["active_state", "states"],
133+
"description": "A group of faces that can be switched to any of the slot's textures.",
134+
"required": ["default_texture", "textures"],
134135
"properties": {
135-
"active_state": {
136+
"default_texture": {
136137
"type": "string",
137-
"description": "The name of the currently active state. This value must match one of the keys defined in the 'states' map.",
138+
"description": "The key of the texture the slot starts with. Must be one of 'textures'.",
138139
"pattern": "^[a-z0-9_]+$"
139140
},
140-
"states": {
141-
"type": "object",
142-
"description": "A map that links state names to objects representing individual states.",
143-
"minProperties": 1,
144-
"patternProperties": {
145-
"^[a-z0-9_]+$": {
146-
"type": "object",
147-
"required": ["texture"],
148-
"properties": {
149-
"texture": {
150-
"type": "string",
151-
"description": "The key of the texture used for this state, referencing an entry from the 'textures' section.",
152-
"pattern": "^[a-z0-9_]+$"
153-
}
154-
}
155-
}
141+
"textures": {
142+
"type": "array",
143+
"description": "Keys of the textures the slot can switch to, from the 'textures' section.",
144+
"minItems": 1,
145+
"items": {
146+
"type": "string",
147+
"pattern": "^[a-z0-9_]+$"
156148
}
157149
}
158150
}
@@ -438,14 +430,14 @@
438430
}
439431
},
440432
{
441-
"required": ["type", "texture_palette"],
433+
"required": ["type", "texture_slot"],
442434
"properties": {
443435
"type": {
444-
"const": "texture_palette"
436+
"const": "texture_slot"
445437
},
446-
"texture_palette": {
438+
"texture_slot": {
447439
"type": "string",
448-
"description": "A valid key from the 'texture_palettes' section."
440+
"description": "A valid key from the 'texture_slots' section."
449441
}
450442
}
451443
}
@@ -683,13 +675,13 @@
683675
"type": "object",
684676
"default": {},
685677
"properties": {
686-
"texture": {
678+
"texture_slot": {
687679
"type": "object",
688680
"default": {},
689-
"description": "A collection of texture keyframes, identified by a floating-point timestamp.",
681+
"description": "A collection of texture slot keyframes, identified by a floating-point timestamp.",
690682
"patternProperties": {
691683
"^\\d+\\.\\d+$": {
692-
"$ref": "#/definitions/texture_keyframe"
684+
"$ref": "#/definitions/texture_slot_keyframe"
693685
}
694686
}
695687
},
@@ -759,10 +751,10 @@
759751
"minItems": 3,
760752
"maxItems": 3
761753
},
762-
"texture_keyframe": {
754+
"texture_slot_keyframe": {
763755
"type": "object",
764756
"default": {},
765-
"description": "Maps texture palettes to active states. Each key corresponds to a valid texture palette key from the 'texture_palette' section, and the value defines its active state.",
757+
"description": "Maps keys from the 'texture_slots' section to the texture each slot switches to. Slots not listed are unchanged.",
766758
"patternProperties": {
767759
"^[a-z0-9_]+$": {
768760
"type": "string",

0 commit comments

Comments
 (0)