-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Removed explicit occurences of hat items
- Loading branch information
1 parent
9e01394
commit af6c71f
Showing
23 changed files
with
78 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
datapack/data/oran9eutan/functions/hats/event/player_dropped_hat_item.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
datapack/data/oran9eutan/functions/hats/event/player_interacted_with_armor_stand.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# Replace leather helmet hats on armor stands nearby with stick hats | ||
# Replace #hat_inventory hats on armor stands nearby with #hat_head hats | ||
execute as @e[type=minecraft:armor_stand,distance=0..8,tag=!global.ignore] if predicate oran9eutan:hats/entity/wears_inventory_hat run function oran9eutan:hats/hat_mechanism/equip_armorstand_with_correct_hat | ||
|
||
advancement revoke @s only oran9eutan:hats/event/player_interacted_with_armor_stand |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
...data/oran9eutan/functions/hats/hat_mechanism/equip_armorstand_with_correct_hat.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
######################################################################## | ||
# as: ArmorStand # | ||
# Descr: Replace the #hat on the ArmorStands head with an #hat_on_head # | ||
# Descr: Replace the #hat on the ArmorStands head with an #hat_on_head # | ||
######################################################################## | ||
|
||
# Since #hat and #hat_on_head items have the same nbt, only change the item id | ||
data modify entity @s ArmorItems[3] merge value {id:"minecraft:stick"} | ||
# Since #hat_inventory and #hat_head items have the same nbt, only change the item id | ||
data modify entity @s ArmorItems[3] merge value {id:"{{ hats.default_item_head }}"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
...ata/oran9eutan/functions/hats/hat_mechanism/fix_players_head_hats_if_necessary.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Determines if the Player has any #hat_head items in their inventory and then fixes them | ||
# @s: Player whose #hat_head hats are going to be fixed | ||
|
||
# Store the Players inventory | ||
data modify storage hats buffer.inv set from entity @s Inventory | ||
# #hat_head hats on the Players head shold not get fixed | ||
data remove storage minecraft:hats buffer.inv[{Slot:103b}] | ||
|
||
execute if data storage minecraft:hats buffer.inv[{id:"{{ hats.default_item_head }}", tag:{Tags:["hats.hat"]}}] run function oran9eutan:hats/hat_mechanism/fix_players_head_hats | ||
|
||
# Clean up | ||
data remove storage minecraft:hats buffer |
16 changes: 16 additions & 0 deletions
16
...k/data/oran9eutan/functions/hats/hat_mechanism/fix_players_head_hats_in_hotbar.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Fixes all #hat_head hats in a players hotbar slots | ||
# @s: Player whos inventory is getting fixed | ||
# requirements: | ||
# - storage buffer.hotbar has to be populated | ||
# - at least one #hat_head hat has to exist in buffer.hotbar | ||
|
||
# Replace all #hat_head hats with helmet hats | ||
data modify storage minecraft:hats buffer.hotbar[{id:"{{ hats.default_item_head }}", tag:{Tags:["hats.hat"]}}].id set value "{{ hats.default_item_inventory }}" | ||
|
||
# Replaced Players hotbar with modified hotbar | ||
setblock ~ 0 ~ minecraft:yellow_shulker_box | ||
data modify block ~ 0 ~ Items set from storage minecraft:hats buffer.hotbar | ||
loot replace entity @s hotbar.0 9 mine ~ 0 ~ minecraft:air{drop_contents:1b} | ||
|
||
# Clean up | ||
setblock ~ 0 ~ minecraft:air |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 0 additions & 12 deletions
12
...ta/oran9eutan/functions/hats/hat_mechanism/fix_players_stick_hats_if_necessary.mcfunction
This file was deleted.
Oops, something went wrong.
16 changes: 0 additions & 16 deletions
16
.../data/oran9eutan/functions/hats/hat_mechanism/fix_players_stick_hats_in_hotbar.mcfunction
This file was deleted.
Oops, something went wrong.
6 changes: 6 additions & 0 deletions
6
...pack/data/oran9eutan/functions/hats/proxies/fix_players_head_hats_if_necessary.mcfunction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# This function is scheduled as a proxy, so that another function call can be scheduled with a desired context | ||
# @s: World | ||
|
||
# Execute proxied function as Players that received a #hat_head hat | ||
execute as @a[tag=!global.ignore,tag=hats.tmp.received_head_hat] run function oran9eutan:hats/hat_mechanism/fix_players_head_hats_if_necessary | ||
tag @a remove hats.tmp.received_head_hat |
6 changes: 0 additions & 6 deletions
6
...ack/data/oran9eutan/functions/hats/proxies/fix_players_stick_hats_if_necessary.mcfunction
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"values":["minecraft:stick"]} | ||
{"values":["{{ hats.default_item_head }}"]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"values":["minecraft:leather_helmet"]} | ||
{"values":["{{ hats.default_item_inventory }}"]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters