Skip to content

Commit

Permalink
rx: dimension fix
Browse files Browse the repository at this point in the history
  • Loading branch information
RitikShah committed Oct 12, 2020
1 parent 796f658 commit fc81187
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 17 deletions.
3 changes: 0 additions & 3 deletions data/rx.ec/functions/init.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
#
#> Creates Objs. Called from Lantern Load

# load
scoreboard players set EnderChest+ load 1

# objectives
scoreboard objectives add rx.ec.headDrop minecraft.dropped:minecraft.player_head
scoreboard objectives add rx.ec.openChest minecraft.custom:open_enderchest
Expand Down
4 changes: 2 additions & 2 deletions data/rx.ec/functions/reroll.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

function rx.playerdb:api/get_self
scoreboard players set $loop rx.temp 0
function rx.ec:upgrade/gen
function rx.ec:gui/fix
execute in minecraft:overworld run function rx.ec:upgrade/gen
execute in minecraft:overworld run function rx.ec:gui/fix
function rx.playerdb:api/save_self

# audiovisual
Expand Down
2 changes: 1 addition & 1 deletion data/rx.ec/functions/tick.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#> schedule tick loop

#> player tick
execute as @a run function rx.ec:player
execute in minecraft:overworld as @a run function rx.ec:player

#> kill thrown GUI items
kill @e[type=item,nbt={Item:{tag:{rx:{ec:{gui:1b}}}}}]
Expand Down
7 changes: 5 additions & 2 deletions data/rx.ec/functions/upgrade/add_item.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#> @s: item from rx.ec:upgrade loot table
#> add item (called rx.ec:upgrade/gen)

tag @s add rx.ec.spawned

# store and strip
data modify storage rx:io playerdb.player.data.rx.ec.upgrade.items append value {item: {}, completed:0b}
data modify storage rx:io playerdb.player.data.rx.ec.upgrade.items[-1].item set from entity @s Item
Expand All @@ -13,12 +15,13 @@ 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":"#cd31e6"}, " ", {"selector": "@e[type=item,tag=rx.ec.spawned,limit=1,sort=nearest]", "italic": true}]'
execute 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]", "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
# remove display/skullowner
data remove storage rx:io playerdb.player.data.rx.ec.upgrade.items[-1].item.tag.display
data remove storage rx:io playerdb.player.data.rx.ec.upgrade.items[-1].item.tag.SkullOwner

# delete item
kill @s
5 changes: 2 additions & 3 deletions data/rx.ec/functions/upgrade/gen.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@ data modify entity af-0-0-0-1 HandItems[0] set value {id:"minecraft:stick",Count
scoreboard players operation $temp rx.temp = @s rx.ec.maxPage
execute as af-0-0-0-1 run scoreboard players operation @s rx.ec.maxPage = $temp rx.temp
execute as af-0-0-0-1 store result entity @s HandItems[0].tag.Enchantments[{id:"minecraft:aqua_affinity"}].lvl short 1 run scoreboard players get @s rx.ec.maxPage
execute at @s as af-0-0-0-1 run loot spawn -30000000 60 1602 fish rx.ec:upgrade ~ ~ ~ mainhand
execute as af-0-0-0-1 run loot spawn -30000000 60 1602 fish rx.ec:upgrade 1000 0 1000 mainhand
# say @e[type=item]
execute as @e[type=item,nbt={Item:{tag:{rx:{ec:{spawned:1b}}}}}] run tag @s add rx.ec.spawned
execute as @e[type=item,tag=rx.ec.spawned] run function rx.ec:upgrade/add_item
execute as @e[type=item,nbt={Item:{tag:{rx:{ec:{spawned:1b}}}}}] run function rx.ec:upgrade/add_item

# kill af-0-0-0-1

Expand Down
2 changes: 1 addition & 1 deletion data/rx.ec/functions/upgrade/root.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ execute if score $shulker rx.temp matches 1.. run data modify storage rx:temp ec
execute if score $shulker rx.temp matches 1.. run data remove storage rx:temp ec.upgrade.tag.BlockEntityTag.Items[{tag:{rx:{ec:{}}}}]
execute if score $shulker rx.temp matches 1.. run loot replace entity @s enderchest.0 mine -30000000 0 1602 air{drop_contents:1b}


#> Transform into manual
execute if score $book rx.temp matches 1.. run function rx.ec:manual

#> Return items unless book
execute if score $book rx.temp matches ..0 run data modify storage rx:temp ec.items append from storage rx:temp ec.upgrade
execute if score $book rx.temp matches ..0 run data remove storage rx:temp ec.upgrade.tag.display
execute if score $book rx.temp matches ..0 run data remove storage rx:temp ec.upgrade.tag.SkullOwner

#> 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
Expand Down
5 changes: 0 additions & 5 deletions data/rx.ec/tags/items/upgrade/base.json

This file was deleted.

0 comments on commit fc81187

Please sign in to comment.