1
0
mirror of https://github.com/GeyserMC/GeyserOptionalPack.git synced 2025-12-19 14:59:14 +00:00

Merge pull request #2 from Kas-tle/master

Fix Head Pivot, Support Proper Armor Movement, & Add Iron Golem Cracking
This commit is contained in:
Camotoy
2021-03-03 15:02:16 -05:00
committed by GitHub
26 changed files with 595 additions and 9 deletions

View File

@@ -0,0 +1,24 @@
{
"format_version": "1.10.0",
"minecraft:attachable": {
"description": {
"identifier": "minecraft:chainmail_chestplate.armor_stand",
"item": { "minecraft:chainmail_chestplate": "query.owner_identifier == 'minecraft:armor_stand'" },
"materials": {
"default": "armor",
"enchanted": "armor_enchanted"
},
"textures": {
"default": "textures/models/armor/chain_1",
"enchanted": "textures/misc/enchanted_item_glint"
},
"geometry": {
"default": "geometry.armor_stand.armor.chestplate"
},
"scripts": {
"parent_setup": "variable.chest_layer_visible = 0.0;"
},
"render_controllers": [ "controller.render.armor" ]
}
}
}

View File

@@ -0,0 +1,24 @@
{
"format_version": "1.10.0",
"minecraft:attachable": {
"description": {
"identifier": "minecraft:chainmail_leggings.armor_stand",
"item": { "minecraft:chainmail_leggings": "query.owner_identifier == 'minecraft:armor_stand'" },
"materials": {
"default": "armor",
"enchanted": "armor_enchanted"
},
"textures": {
"default": "textures/models/armor/chain_2",
"enchanted": "textures/misc/enchanted_item_glint"
},
"geometry": {
"default": "geometry.armor_stand.armor.leggings"
},
"scripts": {
"parent_setup": "variable.leg_layer_visible = 0.0;"
},
"render_controllers": [ "controller.render.armor" ]
}
}
}

View File

@@ -0,0 +1,24 @@
{
"format_version": "1.10.0",
"minecraft:attachable": {
"description": {
"identifier": "minecraft:diamond_chestplate.armor_stand",
"item": { "minecraft:diamond_chestplate": "query.owner_identifier == 'minecraft:armor_stand'" },
"materials": {
"default": "armor",
"enchanted": "armor_enchanted"
},
"textures": {
"default": "textures/models/armor/diamond_1",
"enchanted": "textures/misc/enchanted_item_glint"
},
"geometry": {
"default": "geometry.armor_stand.armor.chestplate"
},
"scripts": {
"parent_setup": "variable.chest_layer_visible = 0.0;"
},
"render_controllers": [ "controller.render.armor" ]
}
}
}

View File

@@ -0,0 +1,24 @@
{
"format_version": "1.10.0",
"minecraft:attachable": {
"description": {
"identifier": "minecraft:diamond_leggings.armor_stand",
"item": { "minecraft:diamond_leggings": "query.owner_identifier == 'minecraft:armor_stand'" },
"materials": {
"default": "armor",
"enchanted": "armor_enchanted"
},
"textures": {
"default": "textures/models/armor/diamond_2",
"enchanted": "textures/misc/enchanted_item_glint"
},
"geometry": {
"default": "geometry.armor_stand.armor.leggings"
},
"scripts": {
"parent_setup": "variable.leg_layer_visible = 0.0;"
},
"render_controllers": [ "controller.render.armor" ]
}
}
}

View File

@@ -0,0 +1,35 @@
{
"format_version": "1.10.0",
"minecraft:attachable": {
"description": {
"identifier": "minecraft:elytra.armor_stand",
"item": { "minecraft:elytra": "query.owner_identifier == 'minecraft:armor_stand'" },
"materials": {
"default": "elytra",
"enchanted": "elytra_glint"
},
"textures": {
"default": "textures/models/armor/elytra",
"enchanted": "textures/misc/enchanted_item_glint"
},
"geometry": {
"default": "geometry.armor_stand.elytra"
},
"animations": {
"default_controller": "controller.animation.elytra.default",
"default": "animation.elytra.default",
"gliding": "animation.elytra.gliding",
"sneaking": "animation.elytra.sneaking",
"sleeping": "animation.elytra.sleeping",
"swimming": "animation.elytra.swimming"
},
"scripts": {
"parent_setup": "variable.chest_layer_visible = 0.0;",
"animate": [
"default_controller"
]
},
"render_controllers": [ "controller.render.armor" ]
}
}
}

View File

@@ -0,0 +1,24 @@
{
"format_version": "1.10.0",
"minecraft:attachable": {
"description": {
"identifier": "minecraft:golden_chestplate.armor_stand",
"item": { "minecraft:golden_chestplate": "query.owner_identifier == 'minecraft:armor_stand'" },
"materials": {
"default": "armor",
"enchanted": "armor_enchanted"
},
"textures": {
"default": "textures/models/armor/gold_1",
"enchanted": "textures/misc/enchanted_item_glint"
},
"geometry": {
"default": "geometry.armor_stand.armor.chestplate"
},
"scripts": {
"parent_setup": "variable.chest_layer_visible = 0.0;"
},
"render_controllers": [ "controller.render.armor" ]
}
}
}

View File

@@ -0,0 +1,24 @@
{
"format_version": "1.10.0",
"minecraft:attachable": {
"description": {
"identifier": "minecraft:golden_leggings.armor_stand",
"item": { "minecraft:golden_leggings": "query.owner_identifier == 'minecraft:armor_stand'" },
"materials": {
"default": "armor",
"enchanted": "armor_enchanted"
},
"textures": {
"default": "textures/models/armor/gold_2",
"enchanted": "textures/misc/enchanted_item_glint"
},
"geometry": {
"default": "geometry.armor_stand.armor.leggings"
},
"scripts": {
"parent_setup": "variable.leg_layer_visible = 0.0;"
},
"render_controllers": [ "controller.render.armor" ]
}
}
}

View File

@@ -0,0 +1,24 @@
{
"format_version": "1.10.0",
"minecraft:attachable": {
"description": {
"identifier": "minecraft:iron_chestplate.armor_stand",
"item": { "minecraft:iron_chestplate": "query.owner_identifier == 'minecraft:armor_stand'" },
"materials": {
"default": "armor",
"enchanted": "armor_enchanted"
},
"textures": {
"default": "textures/models/armor/iron_1",
"enchanted": "textures/misc/enchanted_item_glint"
},
"geometry": {
"default": "geometry.armor_stand.armor.chestplate"
},
"scripts": {
"parent_setup": "variable.chest_layer_visible = 0.0;"
},
"render_controllers": [ "controller.render.armor" ]
}
}
}

View File

@@ -0,0 +1,24 @@
{
"format_version": "1.10.0",
"minecraft:attachable": {
"description": {
"identifier": "minecraft:iron_leggings.armor_stand",
"item": { "minecraft:iron_leggings": "query.owner_identifier == 'minecraft:armor_stand'" },
"materials": {
"default": "armor",
"enchanted": "armor_enchanted"
},
"textures": {
"default": "textures/models/armor/iron_2",
"enchanted": "textures/misc/enchanted_item_glint"
},
"geometry": {
"default": "geometry.armor_stand.armor.leggings"
},
"scripts": {
"parent_setup": "variable.leg_layer_visible = 0.0;"
},
"render_controllers": [ "controller.render.armor" ]
}
}
}

View File

@@ -0,0 +1,24 @@
{
"format_version": "1.10.0",
"minecraft:attachable": {
"description": {
"identifier": "minecraft:leather_chestplate.armor_stand",
"item": { "minecraft:leather_chestplate": "query.owner_identifier == 'minecraft:armor_stand'" },
"materials": {
"default": "armor_leather",
"enchanted": "armor_leather_enchanted"
},
"textures": {
"default": "textures/models/armor/leather_1",
"enchanted": "textures/misc/enchanted_item_glint"
},
"geometry": {
"default": "geometry.armor_stand.armor.chestplate"
},
"scripts": {
"parent_setup": "variable.chest_layer_visible = 0.0;"
},
"render_controllers": [ "controller.render.armor" ]
}
}
}

View File

@@ -0,0 +1,24 @@
{
"format_version": "1.10.0",
"minecraft:attachable": {
"description": {
"identifier": "minecraft:leather_leggings.armor_stand",
"item": { "minecraft:leather_leggings": "query.owner_identifier == 'minecraft:armor_stand'" },
"materials": {
"default": "armor_leather",
"enchanted": "armor_leather_enchanted"
},
"textures": {
"default": "textures/models/armor/leather_2",
"enchanted": "textures/misc/enchanted_item_glint"
},
"geometry": {
"default": "geometry.armor_stand.armor.leggings"
},
"scripts": {
"parent_setup": "variable.leg_layer_visible = 0.0;"
},
"render_controllers": [ "controller.render.armor" ]
}
}
}

View File

@@ -0,0 +1,24 @@
{
"format_version": "1.10.0",
"minecraft:attachable": {
"description": {
"identifier": "minecraft:netherite_chestplate.armor_stand",
"item": { "minecraft:netherite_chestplate": "query.owner_identifier == 'minecraft:armor_stand'" },
"materials": {
"default": "armor",
"enchanted": "armor_enchanted"
},
"textures": {
"default": "textures/models/armor/netherite_1",
"enchanted": "textures/misc/enchanted_item_glint"
},
"geometry": {
"default": "geometry.armor_stand.armor.chestplate"
},
"scripts": {
"parent_setup": "variable.chest_layer_visible = 0.0;"
},
"render_controllers": [ "controller.render.armor" ]
}
}
}

View File

@@ -0,0 +1,24 @@
{
"format_version": "1.10.0",
"minecraft:attachable": {
"description": {
"identifier": "minecraft:netherite_leggings.armor_stand",
"item": { "minecraft:netherite_leggings": "query.owner_identifier == 'minecraft:armor_stand'" },
"materials": {
"default": "armor",
"enchanted": "armor_enchanted"
},
"textures": {
"default": "textures/models/armor/netherite_2",
"enchanted": "textures/misc/enchanted_item_glint"
},
"geometry": {
"default": "geometry.armor_stand.armor.leggings"
},
"scripts": {
"parent_setup": "variable.leg_layer_visible = 0.0;"
},
"render_controllers": [ "controller.render.armor" ]
}
}
}

View File

@@ -1,22 +1,46 @@
### Armor stands
#### Part visibility and rotation encoding
Entity data and entity flags (known as queries in Molang) are pieces of metadata that store various pieces of information about an entity on the Bedrock Edition of Minecraft. You have a query for an entity's health, for example (a number query, or an entity data), and you have a query for is an entity is angry (an entity flag, which is either 1.0 or 0.0 in Molang). Not all entities use every query, but every entity has access to most queries, though Bedrock by default ignores these. We use this to our advantage in this resource pack.
Two flags are designated for toggling an armor stand baseplate and arms. If `query.is_angry` is set to true, the render controller will not render arms on an armor stand. If `query.is_admiring` is set to true, then the armor stand will not render its baseplate. Bedrock without resource packs does not care about these values, so any setup without this resource pack will not break.
In order to easily compress and send over rotation values over the network, we cut off the float rotation values in favor of integer values. The original implementation for each rotation of a limb was set up like the following:
```
```c
query.example = XXXYYYZZZ
```
The first three digits were designated for the X, the second three for Y, and the final three for Z. Each one went from 0 to 360 - allowing a full rotation on each axis. Unfortunately, Bedrock has some unknown integer limit that cuts off such a large number, so a new system was designed. The final product is as follows:
```
query.example = BXXYYZZ
```c
query.example = BXXYYZZ;
query.example_flag_one = 1.0;
query.example_flag_two = 1.0;
query.example_flag_three = 0.0;
```
B (the first digit of the number) is set up like binary - if 4 is added, then the X rotation should be added by 100; same for Y (2) and Z (1). The following numbers have the remaining value, up to 180 degrees, and are added on top of whatever B determines for that rotation. In order to compensate for the lack of range, three flags are set aside for each rotation to determine if a number is negative. If the corresponding flag of each axis is true, then the number is toggled as negative. This could also have been implemented as binary in the number, but was not implemented due to precision concerns.
#### Geometry and attachables
Bedrock entity animations and entity geometry are data driven. The geometry of the armor stand from Java to Bedrock varies. The pivot of the head is placed differently, which has been corrected for in the included armor stand geometry. Additionally, the Bedrock geometry of the armor stand is not structured to support independent animation of the chestplate area. This is due to the lack of a separate bone for the chestplate, which is also added to the armor stand geometry by this pack.
Bedrock armor is defined via attachables, which contain geometry that utilize the bone structure of the entity to which the attachable attaches. Resultantly, items placed and rendered on the armor stand via attachables do not support rotation of the chestplate either, as attachable structure depends on the geometry of the entity to which the attachable is attached. Therefore, any attachables utilizing the newly added chestplate slot must be redefined. This includes all chestplates, leggings (which place their uppermost portion on the chestplate group), and the elytra. To ensure the redefined attachable is only used in the case of armor stands, `minecraft:attachable.description.item` is set as follows:
```json
{ "minecraft:chainmail_chestplate": "query.owner_identifier == 'minecraft:armor_stand'" }
```
Above, `query.owner_identifier` returns the identifier of the entity to which the attachable is applied, and thus this attachble will only be applied when the owner identifier is `minecraft:armor_stand`.
### Iron golems
Iron golems in Java edition experience "cracking" as health decreases. Cracking overlays a texture that contains cracks on the base iron golem texture. This occurs in four ranges, in which health values of 100-76 experience no cracking, 75-51 experience low cracking, 50-26 experience medium cracking, and 25-1 experience high cracking. The material of most bedrock vanilla entities does not allow for type of texture overlay switching. However, the material of the tropical fish, "tropicalfish", allows for this manner of texture overlay switching. Using this material, a render controller can be utilized to select textures defined in the entity definition file from an array. A position in the texture array is then determined by the following Molang expression:
```c
q.health > 99 ? 3 : math.floor(q.health / 25)
```
The trinary operator ensures that even if `max_health`, defined at 100, is overflowed, the expression will never produce a value outside the range of 0-3. As all data is derived resource pack side, this addition requires no modification by the server. Currently, the textures provided by the array are blank due to copyright concerns. Eventually, some method of obtaining these assets will be added.

41
entity/iron_golem.entity.json Executable file
View File

@@ -0,0 +1,41 @@
{
"format_version": "1.10.0",
"minecraft:client_entity": {
"description": {
"identifier": "minecraft:iron_golem",
"materials": { "default": "tropicalfish" },
"textures": {
"crackiness_none": "textures/entity/iron_golem/iron_golem_crackiness_none",
"crackiness_low": "textures/entity/iron_golem/iron_golem_crackiness_low",
"crackiness_medium": "textures/entity/iron_golem/iron_golem_crackiness_medium",
"crackiness_high": "textures/entity/iron_golem/iron_golem_crackiness_high",
"bottom_layer": "textures/entity/iron_golem"
},
"geometry": {
"default": "geometry.irongolem"
},
"animations": {
"walk": "animation.iron_golem.walk",
"move": "animation.iron_golem.move",
"walk_to_target": "animation.iron_golem.walk_to_target",
"move_to_target": "animation.iron_golem.move_to_target",
"attack": "animation.iron_golem.attack",
"flower": "animation.iron_golem.flower",
"look_at_target": "animation.common.look_at_target",
"move_controller": "controller.animation.iron_golem.move",
"arm_controller": "controller.animation.iron_golem.arm_movement"
},
"scripts": {
"pre_animation": [
"variable.modified_tcos0 = Math.clamp(((Math.cos(query.modified_distance_moved * 13.5) * Math.min(query.modified_move_speed, 0.6) / variable.gliding_speed_value) * 25.0), -12.5, 12.5);"
],
"animate": [
"look_at_target",
"move_controller",
"arm_controller"
]
},
"render_controllers": [ "controller.render.iron_golem" ]
}
}
}

View File

@@ -4,7 +4,7 @@
"description": "Geyser Vanilla Assets",
"name": "Geyser Vanilla Assets",
"uuid": "5d8f8e98-7a2a-11eb-9439-0242ac130002",
"version": [1, 0, 50],
"version": [1, 0, 60],
"min_engine_version": [ 1, 16, 0 ]
},
"modules": [
@@ -12,7 +12,7 @@
"description": "Geyser Vanilla Assets",
"type": "resources",
"uuid": "72e9b0ca-7a2a-11eb-9439-0242ac130002",
"version": [1, 0, 50]
"version": [1, 0, 60]
}
]
}

View File

@@ -47,17 +47,17 @@
{
"name": "head",
"parent": "body",
"pivot": [0, 24, 0],
"pivot": [0, 23, 0],
"cubes": [
{"origin": [-1, 24, -1], "size": [2, 7, 2], "uv": [0, 0]}
{"origin": [-1, 23, -1], "size": [2, 7, 2], "uv": [0, 0]}
]
},
{
"name": "hat",
"parent": "head",
"pivot": [0, 24, 0],
"pivot": [0, 23, 0],
"cubes": [
{"origin": [-4, 24, -4], "size": [8, 8, 8], "uv": [32, 0]}
{"origin": [-4, 23, -4], "size": [8, 8, 8], "uv": [32, 0]}
]
},
{

View File

@@ -0,0 +1,66 @@
{
"format_version": "1.12.0",
"minecraft:geometry": [
{
"description": {
"identifier": "geometry.armor_stand.armor.chestplate",
"texture_width": 64,
"texture_height": 32,
"visible_bounds_width": 3,
"visible_bounds_height": 3.5,
"visible_bounds_offset": [0, 1.25, 0]
},
"bones": [
{
"name": "baseplate",
"pivot": [0, 0, 0]
},
{
"name": "waist",
"parent": "baseplate",
"pivot": [0, 12, 0]
},
{
"name": "body",
"parent": "waist",
"pivot": [0, 24, 0]
},
{
"name": "geyser_chest",
"parent": "body",
"pivot": [0, 24, 0],
"cubes": [
{"origin": [-4, 12, -2], "size": [8, 12, 4], "inflate": 1.01, "uv": [16, 16]}
]
},
{
"name": "leftarm",
"parent": "body",
"pivot": [5, 22, 0],
"mirror": true
},
{
"name": "geyser_leftarm",
"parent": "leftarm",
"pivot": [5, 22, 0],
"cubes": [
{"origin": [4, 12, -2], "size": [4, 12, 4], "inflate": 1, "uv": [40, 16], "mirror": true}
]
},
{
"name": "rightarm",
"parent": "body",
"pivot": [-5, 22, 0]
},
{
"name": "geyser_rightarm",
"parent": "rightarm",
"pivot": [-5, 22, 0],
"cubes": [
{"origin": [-8, 12, -2], "size": [4, 12, 4], "inflate": 1, "uv": [40, 16]}
]
}
]
}
]
}

View File

@@ -0,0 +1,53 @@
{
"format_version": "1.12.0",
"minecraft:geometry": [
{
"description": {
"identifier": "geometry.armor_stand.elytra",
"texture_width": 64,
"texture_height": 32,
"visible_bounds_width": 3,
"visible_bounds_height": 2.5,
"visible_bounds_offset": [0, 0.75, 0]
},
"bones": [
{
"name": "baseplate",
"pivot": [0, 0, 0]
},
{
"name": "waist",
"parent": "baseplate",
"pivot": [0, 12, 0]
},
{
"name": "body",
"parent": "waist",
"pivot": [0, 24, 0]
},
{
"name": "geyser_chest",
"parent": "body",
"pivot": [0, 24, 0]
},
{
"name": "left_wing",
"parent": "geyser_chest",
"pivot": [0, 24, 0],
"cubes": [
{"origin": [-10, 0, 0], "size": [10, 20, 2], "uv": [22, 0]}
]
},
{
"name": "right_wing",
"parent": "geyser_chest",
"pivot": [0, 24, 0],
"mirror": true,
"cubes": [
{"origin": [0, 0, 0], "size": [10, 20, 2], "uv": [22, 0]}
]
}
]
}
]
}

View File

@@ -0,0 +1,56 @@
{
"format_version": "1.12.0",
"minecraft:geometry": [
{
"description": {
"identifier": "geometry.armor_stand.armor.leggings",
"texture_width": 64,
"texture_height": 32,
"visible_bounds_width": 2,
"visible_bounds_height": 3.5,
"visible_bounds_offset": [0, 1.25, 0]
},
"bones": [
{
"name": "baseplate",
"pivot": [0, 0, 0]
},
{
"name": "waist",
"parent": "baseplate",
"pivot": [0, 12, 0]
},
{
"name": "body",
"parent": "waist",
"pivot": [0, 24, 0]
},
{
"name": "geyser_chest",
"parent": "body",
"pivot": [0, 24, 0],
"cubes": [
{"origin": [-4, 12, -2], "size": [8, 12, 4], "inflate": 0.6, "uv": [16, 16]}
]
},
{
"name": "leftleg",
"parent": "body",
"pivot": [1.9, 12, 0],
"mirror": true,
"cubes": [
{"origin": [-0.1, 0, -2], "size": [4, 12, 4], "inflate": 0.55, "uv": [0, 16]}
]
},
{
"name": "rightleg",
"parent": "body",
"pivot": [-1.9, 12, 0],
"cubes": [
{"origin": [-3.9, 0, -2], "size": [4, 12, 4], "inflate": 0.55, "uv": [0, 16]}
]
}
]
}
]
}

BIN
pack_icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

View File

@@ -0,0 +1,23 @@
{
"format_version": "1.8.0",
"render_controllers": {
"controller.render.iron_golem": {
"arrays": {
"textures": {
"Array.top": [
"Texture.crackiness_high",
"Texture.crackiness_medium",
"Texture.crackiness_low",
"Texture.crackiness_none"
]
}
},
"geometry": "Geometry.default",
"materials": [ { "*": "Material.default" } ],
"textures": [
"Texture.bottom_layer",
"Array.top[q.health > 99 ? 3 : math.floor(q.health / 25)]"
]
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB