Skip to content

Commit

Permalink
rx: fixed shulker bugs, updated messages
Browse files Browse the repository at this point in the history
  • Loading branch information
RitikShah committed Oct 10, 2020
1 parent 3ed921a commit 82a4b8c
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion data/rx.ec/functions/gui/icons.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#> multiple locations

replaceitem block -30000000 0 1602 container.8 minecraft:player_head{rx:{ec:{gui:1b,action:'up'}},display:{Name:'[{"text":"U","color":"#661192","italic":false},{"text":"p","color":"#6c17b6"}]',Lore:['{"text":"Shift to Jump to the Start","color":"#845f86","italic":false}']},SkullOwner:{Id:[I;921500126,-1662759197,-1515206466,-1205101373],Properties:{textures:[{Value:"eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvMzA0MGZlODM2YTZjMmZiZDJjN2E5YzhlYzZiZTUxNzRmZGRmMWFjMjBmNTVlMzY2MTU2ZmE1ZjcxMmUxMCJ9fX0="}]}}}
replaceitem block -30000000 0 1602 container.17 minecraft:player_head{rx:{ec:{gui:1b,action:'upgrade'}},display:{Name:'[{"text":"U","color":"#661192","italic":false},{"text":"p","color":"#9820b6"},{"text":"g","color":"#cb2fda"},{"text":"r","color":"light_purple"},{"text":"a","color":"#cd31e6"},{"text":"d","color":"#9c24ce"},{"text":"e","color":"#6c17b6"}]',Lore:['""','{"text":"Place these items on me:","color":"#845f86","italic":false}','{"text":"* Upgrade Items","color":"#845f86","italic":false}','{"text":"* Shulker Boxes","color":"#845f86","italic":false}','{"text":"* Books","color":"#845f86","italic":false}', '""', '{"text":"Upgrade Items List:","color":"dark_gray","italic":false}']},SkullOwner:{Id:[I;1121675190,-1647227906,-1267169239,-1050533352],Properties:{textures:[{Value:"eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYTZjYzQ4NmMyYmUxY2I5ZGZjYjJlNTNkZDlhM2U5YTg4M2JmYWRiMjdjYjk1NmYxODk2ZDYwMmI0MDY3In19fQ=="}]}}}
replaceitem block -30000000 0 1602 container.17 minecraft:player_head{rx:{ec:{gui:1b,action:'upgrade'}},display:{Name:'[{"text":"U","color":"#661192","italic":false},{"text":"p","color":"#9820b6"},{"text":"g","color":"#cb2fda"},{"text":"r","color":"light_purple"},{"text":"a","color":"#cd31e6"},{"text":"d","color":"#9c24ce"},{"text":"e","color":"#6c17b6"}]',Lore:['""','{"text":"Upgrade item list at the bottom","color":"#845f86","italic":false}','{"text":"Shulkers will collect all","color":"#845f86","italic":false}','{"text":"Books will get you a manual","color":"#845f86","italic":false}', '""', '{"text":"Items needed for upgrade:","color":"dark_gray","italic":false}']},SkullOwner:{Id:[I;1121675190,-1647227906,-1267169239,-1050533352],Properties:{textures:[{Value:"eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYTZjYzQ4NmMyYmUxY2I5ZGZjYjJlNTNkZDlhM2U5YTg4M2JmYWRiMjdjYjk1NmYxODk2ZDYwMmI0MDY3In19fQ=="}]}}}
replaceitem block -30000000 0 1602 container.26 minecraft:player_head{rx:{ec:{gui:1b,action:'down'}},display:{Name:'[{"text":"D","color":"#661192","italic":false},{"text":"o","color":"#cb2fda"},{"text":"w","color":"#cd31e6"},{"text":"n","color":"#6c17b6"}]',Lore:['{"text":"Shift to Jump to the End","color":"#845f86","italic":false}']},SkullOwner:{Id:[I;1554395052,-795589818,-2090737185,-577305081],Properties:{textures:[{Value:"eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNzQzNzM0NmQ4YmRhNzhkNTI1ZDE5ZjU0MGE5NWU0ZTc5ZGFlZGE3OTVjYmM1YTEzMjU2MjM2MzEyY2YifX19"}]}}}

data modify block -30000000 0 1602 Items[{Slot:17b}].tag.display.Lore append from storage rx:io playerdb.player.data.rx.ec.upgrade.items[].lore
Expand Down
2 changes: 1 addition & 1 deletion data/rx.ec/functions/gui/root.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,6 @@ execute if data storage rx:temp ec.items[] run loot give @s mine -30000000 0 160
# audiovisual
execute if score @s rx.ec.currPage > $old.page rx.temp at @s run playsound minecraft:entity.item.pickup master @s ~ ~ ~ 1 1.5
execute if score @s rx.ec.currPage < $old.page rx.temp at @s run playsound minecraft:entity.item.pickup master @s ~ ~ ~ 1 0.7
execute if score @s rx.ec.currPage = $old.page rx.temp if score $success rx.temp matches 0 if score $shulker rx.temp matches 0 at @s run playsound minecraft:item.shield.block master @s ~ ~ ~ 0.7 2
execute if score @s rx.ec.currPage = $old.page rx.temp if score $success rx.temp matches 0 if score $shulker rx.temp matches ..0 at @s run playsound minecraft:item.shield.block master @s ~ ~ ~ 0.7 2
execute if score @s rx.ec.currPage = $old.page rx.temp if score $shulker rx.temp matches 1.. at @s run playsound minecraft:block.barrel.close master @s ~ ~ ~ 0.75 1.5
execute if score @s rx.ec.currPage = $old.page rx.temp if score $shulker rx.temp matches 1.. at @s run playsound minecraft:block.barrel.open master @s ~ ~ ~ 0.6 2
2 changes: 1 addition & 1 deletion data/rx.ec/functions/upgrade/_iter_test.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ execute if score $match rx.temp matches ..0 if data storage rx:temp ec.test{comp

# fully matched!
execute if score $match rx.temp matches ..0 run data modify storage rx:io playerdb.player.data.rx.ec.upgrade.items[0].completed set value 1b
execute if score $match rx.temp matches ..0 run data modify block -30000000 0 1603 Text1 set value '{"storage": "rx:io", "nbt": "playerdb.player.data.rx.ec.upgrade.items[0].lore", "color": "green", "strikethrough": true, "interpret": true, "italic": true}'
execute if score $match rx.temp matches ..0 run data modify block -30000000 0 1603 Text1 set value '{"storage": "rx:io", "nbt": "playerdb.player.data.rx.ec.upgrade.items[0].lore", "color": "#9820b6", "strikethrough": true, "interpret": true, "italic": true}'
execute if score $match rx.temp matches ..0 run data modify storage rx:io playerdb.player.data.rx.ec.upgrade.items[0].lore set from block -30000000 0 1603 Text1

# deduct resource count
Expand Down
4 changes: 2 additions & 2 deletions data/rx.ec/functions/upgrade/add_item.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ data remove storage rx:io playerdb.player.data.rx.ec.upgrade.items[-1].item.Slot
execute store result score $count rx.temp run data get storage rx:io playerdb.player.data.rx.ec.upgrade.items[-1].item.Count
# tellraw rx97 [{"score":{"name":"$count","objective":"rx.temp"},"color":"gold"}, " ", {"selector": "@s"}]
# construct lore + save
execute at @s unless data storage rx:io playerdb.player.data.rx.ec.upgrade.items[-1].item.tag.display run data modify block -30000000 0 1603 Text1 set value '[{"score":{"name":"$count","objective":"rx.temp"},"color":"gold"}, " ", {"selector": "@e[type=item,tag=rx.ec.spawned,limit=1,sort=nearest]"}]'
execute if data storage rx:io playerdb.player.data.rx.ec.upgrade.items[-1].item.tag.display run data modify block -30000000 0 1603 Text1 set value '[{"score":{"name":"$count","objective":"rx.temp"},"color":"gold"}, " ", {"nbt": "playerdb.player.data.rx.ec.upgrade.items[-1].item.tag.display.Name", "storage": "rx:io", "interpret": true, "italic": true}]'
execute at @s unless data storage rx:io playerdb.player.data.rx.ec.upgrade.items[-1].item.tag.display run data modify block -30000000 0 1603 Text1 set value '[{"score":{"name":"$count","objective":"rx.temp"},"color":"#cd31e6"}, " ", {"selector": "@e[type=item,tag=rx.ec.spawned,limit=1,sort=nearest]", "italic": true}]'
execute if data storage rx:io playerdb.player.data.rx.ec.upgrade.items[-1].item.tag.display run data modify block -30000000 0 1603 Text1 set value '[{"score":{"name":"$count","objective":"rx.temp"},"color":"#cd31e6"}, " ", {"nbt": "playerdb.player.data.rx.ec.upgrade.items[-1].item.tag.display.Name", "storage": "rx:io", "interpret": true, "italic": true}]'
data modify storage rx:io playerdb.player.data.rx.ec.upgrade.items[-1].lore set from block -30000000 0 1603 Text1

# remove display
Expand Down
10 changes: 9 additions & 1 deletion data/rx.ec/functions/upgrade/root.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ scoreboard players set $shulker rx.temp 1
execute store success score $book rx.temp if data storage rx:temp ec.upgrade{id:"minecraft:book"}
execute unless data storage rx:temp ec.upgrade{id:"minecraft:white_shulker_box"} unless data storage rx:temp ec.upgrade{id:"minecraft:orange_shulker_box"} unless data storage rx:temp ec.upgrade{id:"minecraft:magenta_shulker_box"} unless data storage rx:temp ec.upgrade{id:"minecraft:light_blue_shulker_box"} unless data storage rx:temp ec.upgrade{id:"minecraft:yellow_shulker_box"} unless data storage rx:temp ec.upgrade{id:"minecraft:lime_shulker_box"} unless data storage rx:temp ec.upgrade{id:"minecraft:pink_shulker_box"} unless data storage rx:temp ec.upgrade{id:"minecraft:gray_shulker_box"} unless data storage rx:temp ec.upgrade{id:"minecraft:light_gray_shulker_box"} unless data storage rx:temp ec.upgrade{id:"minecraft:cyan_shulker_box"} unless data storage rx:temp ec.upgrade{id:"minecraft:purple_shulker_box"} unless data storage rx:temp ec.upgrade{id:"minecraft:blue_shulker_box"} unless data storage rx:temp ec.upgrade{id:"minecraft:brown_shulker_box"} unless data storage rx:temp ec.upgrade{id:"minecraft:green_shulker_box"} unless data storage rx:temp ec.upgrade{id:"minecraft:red_shulker_box"} unless data storage rx:temp ec.upgrade{id:"minecraft:black_shulker_box"} unless data storage rx:temp ec.upgrade{id:"minecraft:shulker_box"} run scoreboard players set $shulker rx.temp 0

#> cancel shulker if shulkers inside current page
execute if score $shulker rx.temp matches 1.. run scoreboard players set $shulker rx.temp -1
execute if score $shulker rx.temp matches ..-1 unless data storage rx:temp ec.player.EnderItems[{id:"minecraft:white_shulker_box"}] unless data storage rx:temp ec.player.EnderItems[{id:"minecraft:orange_shulker_box"}] unless data storage rx:temp ec.player.EnderItems[{id:"minecraft:magenta_shulker_box"}] unless data storage rx:temp ec.player.EnderItems[{id:"minecraft:light_blue_shulker_box"}] unless data storage rx:temp ec.player.EnderItems[{id:"minecraft:yellow_shulker_box"}] unless data storage rx:temp ec.player.EnderItems[{id:"minecraft:lime_shulker_box"}] unless data storage rx:temp ec.player.EnderItems[{id:"minecraft:pink_shulker_box"}] unless data storage rx:temp ec.player.EnderItems[{id:"minecraft:gray_shulker_box"}] unless data storage rx:temp ec.player.EnderItems[{id:"minecraft:light_gray_shulker_box"}] unless data storage rx:temp ec.player.EnderItems[{id:"minecraft:cyan_shulker_box"}] unless data storage rx:temp ec.player.EnderItems[{id:"minecraft:purple_shulker_box"}] unless data storage rx:temp ec.player.EnderItems[{id:"minecraft:blue_shulker_box"}] unless data storage rx:temp ec.player.EnderItems[{id:"minecraft:brown_shulker_box"}] unless data storage rx:temp ec.player.EnderItems[{id:"minecraft:green_shulker_box"}] unless data storage rx:temp ec.player.EnderItems[{id:"minecraft:red_shulker_box"}] unless data storage rx:temp ec.player.EnderItems[{id:"minecraft:black_shulker_box"}] unless data storage rx:temp ec.player.EnderItems[{id:"minecraft:shulker_box"}] run scoreboard players set $shulker rx.temp 1
execute if score $shulker rx.temp matches ..-1 run tellraw @s [{"text":"","color":"red"},{"text":"E","color":"#661192"},{"text":"n","color":"#79169f"},{"text":"d","color":"#8c1cad"},{"text":"e","color":"#9f22ba"},{"text":"r","color":"#b228c8"},{"text":"C","color":"#c52dd5"},{"text":"h","color":"#d833e3"},{"text":"e","color":"#eb39f0"},{"text":"s","color":"light_purple"},{"text":"t","color":"#eb3af5"},{"text":"+","color":"#d935ec"}, {"text":": ","color":"gray"}, "Sorry, you cannot store shulker boxes inside shulker boxes."]

#> if shulker is fresh, prep it
execute if score $shulker rx.temp matches 1.. unless data storage rx:temp ec.upgrade.tag.BlockEntityTag.Items[] run data modify storage rx:temp ec.upgrade.tag.BlockEntityTag.Items set value []

#> if shulker, swap contents w/ current page, overflow items back to inv
# these items overlap w/ GUI, lets give them back to the player !!!
execute if score $shulker rx.temp matches 1.. run data modify storage rx:temp ec.items append from storage rx:temp ec.upgrade.tag.BlockEntityTag.Items[{Slot:8b}]
Expand All @@ -39,6 +47,6 @@ execute if score $book rx.temp matches ..0 run data modify storage rx:temp ec.it
execute if score $book rx.temp matches ..0 run data remove storage rx:temp ec.upgrade.tag.display

#> Test for upgrade items
execute if score $shulker rx.temp matches ..0 if score $book rx.temp matches ..0 run function rx.ec:upgrade/test
execute if score $shulker rx.temp matches 0 if score $book rx.temp matches ..0 run function rx.ec:upgrade/test

function rx.playerdb:api/save_self

0 comments on commit 82a4b8c

Please sign in to comment.