mirror of
https://github.com/GeyserMC/GeyserOptionalPack.git
synced 2025-12-19 14:59:14 +00:00
Add skin visibility support
This commit is contained in:
@@ -12,6 +12,7 @@
|
|||||||
* [Offhand Animation](#Offhand-animation)
|
* [Offhand Animation](#Offhand-animation)
|
||||||
* [Particles](#Particles)
|
* [Particles](#Particles)
|
||||||
* [Sweep Attack](#Sweep-attack)
|
* [Sweep Attack](#Sweep-attack)
|
||||||
|
* [Player skin parts](#Player-skin-parts)
|
||||||
* [Shulkers](#Shulkers)
|
* [Shulkers](#Shulkers)
|
||||||
* [Spectral arrow entities](#Spectral-arrow-entities)
|
* [Spectral arrow entities](#Spectral-arrow-entities)
|
||||||
<!--te-->
|
<!--te-->
|
||||||
@@ -200,6 +201,18 @@ convert -append extracted/assets/minecraft/textures/particle/sweep_*.png -define
|
|||||||
|
|
||||||
The `-append` flag is used to join the input images which match the defined globular expression (`.../sweep_*.png`). The image format is defined for safety as by default Imagemagick will attempt to change the color mode of the image to grayscale, which Minecraft will not interpret correctly. The image is then placed in the pack at the defined path.
|
The `-append` flag is used to join the input images which match the defined globular expression (`.../sweep_*.png`). The image format is defined for safety as by default Imagemagick will attempt to change the color mode of the image to grayscale, which Minecraft will not interpret correctly. The image is then placed in the pack at the defined path.
|
||||||
|
|
||||||
|
### Player skin parts
|
||||||
|
|
||||||
|
On Java Edition, you are able to toggle your cape and second skin layers. Bedrock Edition does not share this property. We're able to solve this by applying Java's player skin parts mask to the `q.mark_variant` query and checking the visibility with this formula in the player render controller and cape render controller:
|
||||||
|
|
||||||
|
```
|
||||||
|
math.mod(math.floor(q.mark_variant / 32), 2) != 1
|
||||||
|
```
|
||||||
|
|
||||||
|
Do note that Geyser does invert the bits - that way, on other servers without the GeyserOptionalPack, `q.mark_variant` being 0 means that all parts should be shown. Java interprets 0 to mean all parts are invisible.
|
||||||
|
|
||||||
|
Also note that capes are technically possible to implement without the OptionalPack, but this requires re-sending the skin data to Bedrock Edition which would be costly on performance and network usage.
|
||||||
|
|
||||||
### Shulkers
|
### Shulkers
|
||||||
|
|
||||||
See https://github.com/GeyserMC/Geyser/issues/1412 for more context.
|
See https://github.com/GeyserMC/Geyser/issues/1412 for more context.
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
"description": "Optional Bedrock resource pack to extend Geyser functionality",
|
"description": "Optional Bedrock resource pack to extend Geyser functionality",
|
||||||
"name": "GeyserOptionalPack",
|
"name": "GeyserOptionalPack",
|
||||||
"uuid": "e5f5c938-a701-11eb-b2a3-047d7bb283ba",
|
"uuid": "e5f5c938-a701-11eb-b2a3-047d7bb283ba",
|
||||||
"version": [1, 0, 1],
|
"version": [1, 0, 2],
|
||||||
"min_engine_version": [ 1, 16, 0 ]
|
"min_engine_version": [ 1, 16, 0 ]
|
||||||
},
|
},
|
||||||
"modules": [
|
"modules": [
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
"description": "GeyserOptionalPack",
|
"description": "GeyserOptionalPack",
|
||||||
"type": "resources",
|
"type": "resources",
|
||||||
"uuid": "eebb4ea8-a701-11eb-95ba-047d7bb283ba",
|
"uuid": "eebb4ea8-a701-11eb-95ba-047d7bb283ba",
|
||||||
"version": [1, 0, 1]
|
"version": [1, 0, 2]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
14
render_controllers/cape.render_controllers.json
Normal file
14
render_controllers/cape.render_controllers.json
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"format_version": "1.8.0",
|
||||||
|
"render_controllers": {
|
||||||
|
"controller.render.player.cape": {
|
||||||
|
"rebuild_animation_matrices": true,
|
||||||
|
"geometry": "Geometry.cape",
|
||||||
|
"materials": [ { "*": "Material.cape" } ],
|
||||||
|
"textures": [ "Texture.cape" ],
|
||||||
|
"part_visibility": [
|
||||||
|
{ "cape": "(query.armor_texture_slot(1) != 5) && (!variable.is_first_person || variable.is_paperdoll) && (!variable.map_face_icon) && (math.mod(q.mark_variant, 2) != 1)" }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
53
render_controllers/player.render_controllers.json
Normal file
53
render_controllers/player.render_controllers.json
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
{
|
||||||
|
"format_version": "1.8.0",
|
||||||
|
"render_controllers": {
|
||||||
|
"controller.render.player.first_person": {
|
||||||
|
"geometry": "Geometry.default",
|
||||||
|
"materials": [ { "*": "Material.default" } ],
|
||||||
|
"textures": [ "Texture.default" ],
|
||||||
|
"part_visibility": [
|
||||||
|
{ "*": false },
|
||||||
|
{ "rightArm": "query.get_equipped_item_name(0, 1) == '' || query.get_equipped_item_name(0, 1) == 'map'" },
|
||||||
|
{ "rightSleeve": "query.get_equipped_item_name(0, 1) == '' || query.get_equipped_item_name(0, 1) == 'map'" },
|
||||||
|
{ "leftArm": "(query.get_equipped_item_name(0, 1) == 'map' && query.get_equipped_item_name('off_hand') != 'shield') || (query.get_equipped_item_name('off_hand') == 'map' && !query.item_is_charged) || (!query.item_is_charged && (variable.item_use_normalized > 0 && variable.item_use_normalized < 1.0))" },
|
||||||
|
{ "leftSleeve": "(query.get_equipped_item_name(0, 1) == 'map' && query.get_equipped_item_name('off_hand') != 'shield') || (query.get_equipped_item_name('off_hand') == 'map' && !query.item_is_charged) || (!query.item_is_charged && (variable.item_use_normalized > 0 && variable.item_use_normalized < 1.0))" }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"controller.render.player.third_person": {
|
||||||
|
"geometry": "Geometry.default",
|
||||||
|
"materials": [ { "*": "Material.default" } ],
|
||||||
|
"textures": [ "Texture.default" ],
|
||||||
|
"part_visibility": [
|
||||||
|
{ "*": true },
|
||||||
|
{ "helmet": "variable.helmet_layer_visible" },
|
||||||
|
{ "leftLegging": "variable.leg_layer_visible" },
|
||||||
|
{ "rightLegging": "variable.leg_layer_visible" },
|
||||||
|
{ "leftBoot": "variable.boot_layer_visible" },
|
||||||
|
{ "rightBoot": "variable.boot_layer_visible" },
|
||||||
|
{ "leftSock": "variable.boot_layer_visible && variable.leg_layer_visible" },
|
||||||
|
{ "rightSock": "variable.boot_layer_visible && variable.leg_layer_visible" },
|
||||||
|
{ "bodyArmor": "variable.chest_layer_visible && !query.has_cape" },
|
||||||
|
{ "leftArmArmor": "variable.chest_layer_visible && !query.has_cape" },
|
||||||
|
{ "rightArmArmor": "variable.chest_layer_visible && !query.has_cape" },
|
||||||
|
{ "belt": "variable.chest_layer_visible && variable.leg_layer_visible" },
|
||||||
|
{ "hat": "math.mod(math.floor(q.mark_variant / 64), 2) != 1" },
|
||||||
|
{ "leftSleeve": "math.mod(math.floor(q.mark_variant / 4), 2) != 1" },
|
||||||
|
{ "rightSleeve": "math.mod(math.floor(q.mark_variant / 8), 2) != 1" },
|
||||||
|
{ "jacket": "math.mod(math.floor(q.mark_variant / 2), 2) != 1" },
|
||||||
|
{ "leftPants": "math.mod(math.floor(q.mark_variant / 16), 2) != 1" },
|
||||||
|
{ "rightPants": "math.mod(math.floor(q.mark_variant / 32), 2) != 1" }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"controller.render.player.map": {
|
||||||
|
"geometry": "Geometry.default",
|
||||||
|
"materials": [ { "*": "Material.default" } ],
|
||||||
|
"textures": [ "Texture.default" ],
|
||||||
|
"part_visibility": [
|
||||||
|
{ "*": false },
|
||||||
|
{ "head": true },
|
||||||
|
{ "hat": true },
|
||||||
|
{ "helmet": true }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user