diff --git a/README.md b/README.md index 7cbb123..4cdc73c 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,8 @@ Bedrock resource pack to extend Geyser functionality. Learn more on its [wiki pa - 2x2 crafting grid while in creative mode - Tick-delay and rename fields in the command block menu - Structure block options that do not exist on Java +- 1, 2, 4 and 5 row chests, removing the need for the filler item +- Proper attack cooldowns Download: [GeyserIntegratedPack.mcpack](https://download.geysermc.org/v2/projects/geyserintegratedpack/versions/latest/builds/latest/downloads/geyserintegratedpack) @@ -31,6 +33,11 @@ Download: [GeyserIntegratedPack.mcpack](https://download.geysermc.org/v2/project 2. Run `gradlew run`. 3. When it finishes compiling, it will output the `GeyserIntegratedPack.mcpack`. +### Credits + +- [Sweep 'N Slash](https://github.com/AnotherSeawhite/sweepnslash) + - Amazing thanks to Sweep 'N Slash's developers and contributors for giving us explict permission to use their UI files, attack cooldowns wouldn't be possible without them :) + ### Legal This repository is not endorsed nor affiliated with Mojang, Minecraft, or Microsoft. diff --git a/src/main/resources/integratedpack/animation_controllers/player.animation_controllers.json b/src/main/resources/integratedpack/animation_controllers/player.animation_controllers.json index 338718f..fb8ed93 100644 --- a/src/main/resources/integratedpack/animation_controllers/player.animation_controllers.json +++ b/src/main/resources/integratedpack/animation_controllers/player.animation_controllers.json @@ -103,7 +103,7 @@ "sneaking" : "query.is_sneaking && !query.is_sleeping" }, { - "bob": "!variable.is_holding_spyglass && !(q.is_item_name_any('slot.weapon.offhand', 0, 'minecraft:spyglass') && q.is_emerging)" + "bob": "!variable.is_holding_spyglass && !variable.is_tooting_goat_horn && !variable.is_using_brush !(q.is_item_name_any('slot.weapon.offhand', 0, 'minecraft:spyglass') && q.is_emerging)" }, { "damage_nearby_mobs" : "variable.damage_nearby_mobs" @@ -112,10 +112,22 @@ "swimming" : "variable.swim_amount > 0.0" }, { + "swimming.no_right_arm": "variable.swim_amount > 0.0 && variable.melee_spear_equipped" + }, + { "swimming.legs" : "variable.swim_amount > 0.0" }, { - "use_item_progress" : "( variable.use_item_interval_progress > 0.0 ) || ( variable.use_item_startup_progress > 0.0 ) && !variable.is_brandishing_spear && !variable.is_holding_spyglass && !(q.is_item_name_any('slot.weapon.offhand', 0, 'minecraft:spyglass') && q.is_emerging)" + "crawling": "query.is_crawling && !variable.melee_spear_equipped" + }, + { + "crawling.no_right_arm": "query.is_crawling && variable.melee_spear_equipped" + }, + { + "crawling.legs": "query.is_crawling" + }, + { + "use_item_progress" : "( variable.use_item_interval_progress > 0.0 ) || ( variable.use_item_startup_progress > 0.0 ) && !variable.is_brandishing_spear && !variable.is_holding_spyglass && !variable.is_tooting_goat_horn && !variable.is_using_brush && !query.is_item_name_any('slot.weapon.mainhand', 'minecraft:bow') && !(q.is_item_name_any('slot.weapon.offhand', 0, 'minecraft:spyglass') && q.is_emerging)" }, { "sleeping" : "query.is_sleeping && query.is_alive" @@ -137,7 +149,22 @@ }, { "third_person_bow_equipped" : "query.get_equipped_item_name == 'bow' && (variable.item_use_normalized > 0 && variable.item_use_normalized < 1.0)" - } + }, + { + "tooting_goat_horn": "variable.is_tooting_goat_horn" + }, + { + "holding_brush": "query.get_equipped_item_name == 'brush'" + }, + { + "brushing": "variable.is_using_brush" + }, + { + "holding_heavy_core": "query.is_item_name_any('slot.weapon.mainhand', 'minecraft:heavy_core')" + }, + { + "third_person_melee_spear_controller": "variable.melee_spear_equipped" + } ], "transitions" : [ { diff --git a/src/main/resources/integratedpack/manifest.json b/src/main/resources/integratedpack/manifest.json index dc67bd1..4e2b5e2 100644 --- a/src/main/resources/integratedpack/manifest.json +++ b/src/main/resources/integratedpack/manifest.json @@ -4,7 +4,7 @@ "description": "Bedrock resource pack to extend Geyser functionality", "name": "GeyserIntegratedPack", "uuid": "2254393d-8430-45b0-838a-bd397828c765", - "version": [1, 0, 3], + "version": [1, 1, 0], "min_engine_version": [ 1, 16, 0 ] }, "modules": [ @@ -12,7 +12,7 @@ "description": "GeyserIntegratedPack", "type": "resources", "uuid": "4d60881b-e4ed-466f-925c-8abc873151ba", - "version": [1, 0, 3] + "version": [1, 1, 0] } ] } diff --git a/src/main/resources/integratedpack/ui/_ui_defs.json b/src/main/resources/integratedpack/ui/_ui_defs.json new file mode 100644 index 0000000..201ffc2 --- /dev/null +++ b/src/main/resources/integratedpack/ui/_ui_defs.json @@ -0,0 +1,3 @@ +{ + "ui_defs": ["ui/attack_indicator/ui.json"] +} \ No newline at end of file diff --git a/src/main/resources/integratedpack/ui/attack_indicator/ui.json b/src/main/resources/integratedpack/ui/attack_indicator/ui.json new file mode 100644 index 0000000..b8f1ae2 --- /dev/null +++ b/src/main/resources/integratedpack/ui/attack_indicator/ui.json @@ -0,0 +1,182 @@ +// Adapted from https://github.com/AnotherSeawhite/sweepnslash/blob/main/packs/RP/ui/sweepnslash/cooldown.json + +{ + "namespace": "attack_indicator", + "cooldown_layout": { + "type": "image", + "layer": 2, + "$clip_max": 16.0, + "clips_children": false, + "clip_pixelperfect": true, + "bindings": [ + { + "binding_type": "view", + "source_control_name": "data_control", + "resolve_sibling_scope": true, + "source_property_name": "(#preserved_text - $update_string)", + "target_property_name": "#texto" + }, + { + "binding_type": "view", + "source_property_name": "(#texto - ('%.4s' * #texto))", + "target_property_name": "#texttonumber" + }, + { + "binding_type": "view", + "source_property_name": "(#texttonumber * 1)", + "target_property_name": "#ratio" + }, + { + "binding_type": "view", + "source_property_name": "(($clip_max - #ratio) / $clip_max)", + "target_property_name": "#clip_ratio" + }, + { + "binding_type": "view", + "source_property_name": "(('%.3s' * #texto) = $prefix_string)", + "target_property_name": "#visible" + } + ] + }, +// "cooldown_ready": { +// "type": "image", +// "layer": 3, +// "allow_clipping": false, +// "bindings": [ +// { +// "binding_type": "view", +// "source_control_name": "data_control", +// "resolve_sibling_scope": true, +// "source_property_name": "(#preserved_text - $update_string)", +// "target_property_name": "#texto" +// }, +// { +// "binding_type": "view", +// "source_property_name": "( (('%.1s' * (#texto - ('%.4s' * #texto))) = 't') and (('%.3s' * #texto) = $prefix_string) )", +// "target_property_name": "#visible" +// } +// ] +// }, + "cooldown_crosshair": { + "type": "panel", + "size": [ + 16, + 4 + ], + "anchor_from": "bottom_middle", + "anchor_to": "top_middle", + "$prefix_string": "crs", + "controls": [ + { + "data_control@attack_indicator.data_control": {} + }, + { + "cooldown_crosshair_layout@attack_indicator.cooldown_layout": { + "texture": "textures/geyser/ui/crosshair_attack_indicator_progress", + "alpha": 0.5, + "clip_direction": "left", + "controls": [ + { + "bar_bg": { + "type": "image", + "texture": "textures/geyser/ui/crosshair_attack_indicator_background", + "alpha": 0.5, + "layer": -1 + } + } + ] + } + } +// { +// "cooldown_ready_crosshair@attack_indicator.cooldown_ready": { +// "texture": "textures/cooldown_crosshair_ready", +// "alpha": 0.6, +// "controls": [ +// { +// "full_layout_with_alpha": { +// "type": "image", +// "texture": "textures/cooldown_crosshair_full", +// "alpha": 0.2 +// } +// } +// ] +// } +// } + ] + }, + "cooldown_hotbar": { + "type": "panel", + "size": [ + 18, + 18 + ], + "offset": [ + 4, + 0 + ], + "anchor_from": "right_middle", + "anchor_to": "left_middle", + "$prefix_string": "htb", + "controls": [ + { + "data_control@attack_indicator.data_control": {} + }, + { + "cooldown_hotbar_layout@attack_indicator.cooldown_layout": { + "texture": "textures/geyser/ui/hotbar_attack_indicator_progress", + "clip_direction": "down", + "controls": [ + { + "bar_bg": { + "type": "image", + "texture": "textures/geyser/ui/hotbar_attack_indicator_background", + "layer": -1 + } + } + ] + } + } +// { +// "cooldown_ready_hotbar@attack_indicator.cooldown_ready": { +// "texture": "textures/cooldown_hotbar_full" +// } +// } + ] + }, + "cooldown_ui": { + "type": "panel", + "$update_string": "geyseropt:cooldown:", + "size": [ + "100%", + "100%" + ], + "controls": [ + { + "cooldown_crosshair@attack_indicator.cooldown_crosshair": {} + } + ] + }, + "data_control": { + "type": "panel", + "size": [ + 0, + 0 + ], + "bindings": [ + { + "binding_name": "#tip_text", + "binding_condition": "always" + }, + { + "binding_name": "#tip_text", + "binding_name_override": "#preserved_text", + "binding_condition": "visibility_changed" + }, + { + "binding_type": "view", + "source_property_name": "(not (#tip_text = #preserved_text) and not ((#tip_text - $update_string) = #tip_text))", + "target_property_name": "#visible" + } + ] + } +} \ No newline at end of file diff --git a/src/main/resources/integratedpack/ui/chest_screen.json b/src/main/resources/integratedpack/ui/chest_screen.json new file mode 100644 index 0000000..4f69704 --- /dev/null +++ b/src/main/resources/integratedpack/ui/chest_screen.json @@ -0,0 +1,99 @@ +{ + "small_chest_grid": { + "grid_dimensions": "$grid_dimensions", + "size": "$size", + + "$grid_dimensions|default": [9, 3], + "$size|default": [162, 54], + "$container_title_copy": "$container_title", + + "variables": [ + { + "requires": "(not (($container_title_copy - '§z§1§r') = $container_title_copy))", + "$grid_dimensions": [9, 1], + "$size": [162, 18] + }, + { + "requires": "(not (($container_title_copy - '§z§2§r') = $container_title_copy))", + "$grid_dimensions": [9, 2], + "$size": [162, 36] + }, + { + "requires": "(not (($container_title_copy - '§z§3§r') = $container_title_copy))", + "$grid_dimensions": [9, 3], + "$size": [162, 54] + } + ] + }, + "large_chest_grid": { + "grid_dimensions": "$grid_dimensions", + "size": "$size", + + "$grid_dimensions|default": [9, 6], + "$size|default": [162, 108], + "$container_title_copy": "$container_title", + + "variables": [ + { + "requires": "(not (($container_title_copy - '§z§4§r') = $container_title_copy))", + "$grid_dimensions": [9, 4], + "$size": [162, 72] + }, + { + "requires": "(not (($container_title_copy - '§z§5§r') = $container_title_copy))", + "$grid_dimensions": [9, 5], + "$size": [162, 90] + }, + { + "requires": "(not (($container_title_copy - '§z§6§r') = $container_title_copy))", + "$grid_dimensions": [9, 6], + "$size": [162, 108] + } + ] + }, + + "small_chest_panel/root_panel": { + "size": "$size", + + "$size|default": [176, 166], + "$container_title_copy": "$container_title", + + "variables": [ + { + "requires": "(not (($container_title_copy - '§z§1§r') = $container_title_copy))", + "$size": [176, 130] + }, + { + "requires": "(not (($container_title_copy - '§z§2§r') = $container_title_copy))", + "$size": [176, 148] + }, + { + "requires": "(not (($container_title_copy - '§z§3§r') = $container_title_copy))", + "$size": [176, 166] + } + ] + }, + + "large_chest_panel/root_panel": { + "$size|default": [176, 220], + + "size": "$size", + + "$container_title_copy": "$container_title", + + "variables": [ + { + "requires": "(not (($container_title_copy - '§z§4§r') = $container_title_copy))", + "$size": [176, 184] + }, + { + "requires": "(not (($container_title_copy - '§z§5§r') = $container_title_copy))", + "$size": [176, 202] + }, + { + "requires": "(not (($container_title_copy - '§z§6§r') = $container_title_copy))", + "$size": [176, 220] + } + ] + } +} \ No newline at end of file diff --git a/src/main/resources/integratedpack/ui/hud_screen.json b/src/main/resources/integratedpack/ui/hud_screen.json index be1dc5a..59aef57 100644 --- a/src/main/resources/integratedpack/ui/hud_screen.json +++ b/src/main/resources/integratedpack/ui/hud_screen.json @@ -1,31 +1,38 @@ { - "hud_title_text/title_frame/title_background": { - "bindings": [ - { - "binding_name": "#hud_title_text_string", - "binding_name_override": "#text", - "binding_type": "global" - }, - { - "binding_type": "view", - "source_property_name": "((not (('%.1s' * #text) = #text)) or ((#text - ' ') = #text))", - "target_property_name": "#visible" - } - ] - } - , - "hud_title_text/subtitle_frame/subtitle_background": { - "bindings": [ - { - "binding_name": "#hud_subtitle_text_string", - "binding_name_override": "#text", - "binding_type": "global" - }, - { - "binding_type": "view", - "source_property_name": "((#text - '˙') = #text)", - "target_property_name": "#visible" - } - ] - } + "namespace": "hud", + "root_panel/hud_tip_text_factory": { + "ignored": true + }, + "hotbar_end_cap": { + "modifications": [ + { + "array_name": "controls", + "operation": "insert_back", + "value": [ + { + "cooldown_hotbar@attack_indicator.cooldown_hotbar": { + "$update_string": "geyseropt:cooldown:" + } + } + ] + } + ] + }, + "root_panel": { + "modifications": [ + { + "array_name": "controls", + "operation": "insert_back", + "value": [ + { + "cooldown_bar_element_on_crosshair": { + "type": "panel", + "size": ["16px", "16px"], + "controls": [{ "cooldown_ui@attack_indicator.cooldown_ui": {} }] + } + } + ] + } + ] + } } \ No newline at end of file diff --git a/src/main/resources/required_files.txt b/src/main/resources/required_files.txt index c221c99..f5a8252 100644 --- a/src/main/resources/required_files.txt +++ b/src/main/resources/required_files.txt @@ -3,4 +3,8 @@ assets/minecraft/textures/entity/rabbit/caerbannog.png textures/geyser/entity/ra assets/minecraft/textures/particle/damage.png textures/geyser/particle/ assets/minecraft/textures/particle/flash.png textures/geyser/particle/ assets/minecraft/textures/particle/nautilus.png textures/geyser/particle/ -assets/minecraft/textures/entity/illager/illusioner.png textures/geyser/entity/illager/ \ No newline at end of file +assets/minecraft/textures/entity/illager/illusioner.png textures/geyser/entity/illager/ +assets/minecraft/textures/gui/sprites/hud/crosshair_attack_indicator_progress.png textures/geyser/ui/ +assets/minecraft/textures/gui/sprites/hud/crosshair_attack_indicator_background.png textures/geyser/ui/ +assets/minecraft/textures/gui/sprites/hud/hotbar_attack_indicator_progress.png textures/geyser/ui/ +assets/minecraft/textures/gui/sprites/hud/hotbar_attack_indicator_background.png textures/geyser/ui/ \ No newline at end of file