Skip to content

Commit

Permalink
2.3.1a
Browse files Browse the repository at this point in the history
  • Loading branch information
ICY105 committed Sep 3, 2020
1 parent ac1ccc2 commit e24ab86
Show file tree
Hide file tree
Showing 18 changed files with 95 additions and 35 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,2 @@

execute in minecraft:overworld run data modify storage du:temp object set from block -29999999 0 1601 Items
data modify block -29999999 0 1601 Items set from storage du:temp object

execute if score @s mech_data matches 0 positioned ~01 ~ ~ run loot insert ~ ~ ~ mine -29999999 0 1601 minecraft:air{drop_contents:true}
execute if score @s mech_data matches 1 positioned ~ ~ ~-1 run loot insert ~ ~ ~ mine -29999999 0 1601 minecraft:air{drop_contents:true}
execute if score @s mech_data matches 2 positioned ~-1 ~ ~ run loot insert ~ ~ ~ mine -29999999 0 1601 minecraft:air{drop_contents:true}
execute if score @s mech_data matches 3 positioned ~ ~ ~01 run loot insert ~ ~ ~ mine -29999999 0 1601 minecraft:air{drop_contents:true}
execute if score @s mech_data matches 4 positioned ~ ~-1 ~ run loot insert ~ ~ ~ mine -29999999 0 1601 minecraft:air{drop_contents:true}
execute if score @s mech_data matches 5 positioned ~ ~01 ~ run loot insert ~ ~ ~ mine -29999999 0 1601 minecraft:air{drop_contents:true}

scoreboard players set temp_0 mech_data 0
scoreboard players set temp_1 mech_data -1
execute if score temp_1 mech_data matches 1.. run function mechanization:assembly/machines/item_transmitter/insert_item_2
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

execute in minecraft:overworld run data modify storage du:temp object set from block -29999999 0 1601 Items
data modify block -29999999 0 1601 Items set from storage du:temp object

execute if score @s mech_data matches 0 positioned ~01 ~ ~ run loot insert ~ ~ ~ mine -29999999 0 1601 minecraft:air{drop_contents:true}
execute if score @s mech_data matches 1 positioned ~ ~ ~-1 run loot insert ~ ~ ~ mine -29999999 0 1601 minecraft:air{drop_contents:true}
execute if score @s mech_data matches 2 positioned ~-1 ~ ~ run loot insert ~ ~ ~ mine -29999999 0 1601 minecraft:air{drop_contents:true}
execute if score @s mech_data matches 3 positioned ~ ~ ~01 run loot insert ~ ~ ~ mine -29999999 0 1601 minecraft:air{drop_contents:true}
execute if score @s mech_data matches 4 positioned ~ ~-1 ~ run loot insert ~ ~ ~ mine -29999999 0 1601 minecraft:air{drop_contents:true}
execute if score @s mech_data matches 5 positioned ~ ~01 ~ run loot insert ~ ~ ~ mine -29999999 0 1601 minecraft:air{drop_contents:true}

scoreboard players set temp_0 mech_data 0
scoreboard players set temp_1 mech_data -1
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ execute in minecraft:overworld run data modify block -29999999 0 1601 Items appe
#send item
scoreboard players set temp_1 mech_data 0
execute in minecraft:overworld unless data block -29999999 0 1601 Items[{tag:{du_gui:1b}}] store result score temp_1 mech_data run loot insert -29999999 1 1601 mine -29999999 0 1601 minecraft:air{drop_contents:true}
execute unless data entity @s HandItems[0].tag.Enchantments[{id:"mech:filter"}] run scoreboard players set temp_1 mech_data 1

execute if entity @s[tag=!mech_upgraded] if score temp_1 mech_data matches 1.. as @e[tag=mech_item_receiver,tag=mech_active,sort=nearest,distance=..16] if score @s mech_gridid = temp_2 mech_data at @s if score temp_1 mech_data matches 1.. run function mechanization:assembly/machines/item_transmitter/insert_item
execute if entity @s[tag=mech_upgraded,tag=!mech_upgrade_nether,tag=!mech_upgrade_ender] if score temp_1 mech_data matches 1.. as @e[tag=mech_item_receiver,tag=mech_active,sort=nearest,distance=0.1..] if score @s mech_gridid = temp_2 mech_data at @s if score temp_1 mech_data matches 1.. run function mechanization:assembly/machines/item_transmitter/insert_item
execute if entity @s[tag=mech_upgrade_nether] if score temp_1 mech_data matches 1.. as @e[tag=mech_item_receiver,tag=mech_active,sort=nearest] if score @s mech_gridid = temp_2 mech_data at @s if score temp_1 mech_data matches 1.. run function mechanization:assembly/machines/item_transmitter/insert_item
execute if entity @s[tag=mech_upgrade_ender] if score temp_1 mech_data matches 1.. as @e[tag=mech_item_receiver,tag=mech_active,sort=nearest] if score @s mech_gridid = temp_2 mech_data at @s if score temp_1 mech_data matches 1.. run function mechanization:assembly/machines/item_transmitter/insert_item
execute if score temp_1 mech_data matches 1.. if entity @s[tag=!mech_upgraded] as @e[tag=mech_item_receiver,tag=mech_active,sort=nearest,distance=..16] if score @s mech_gridid = temp_2 mech_data at @s run function mechanization:assembly/machines/item_transmitter/insert_item
execute if score temp_1 mech_data matches 1.. if entity @s[tag=mech_upgraded,tag=!mech_upgrade_nether,tag=!mech_upgrade_ender] as @e[tag=mech_item_receiver,tag=mech_active,sort=nearest,distance=0.1..] if score @s mech_gridid = temp_2 mech_data at @s run function mechanization:assembly/machines/item_transmitter/insert_item
execute if score temp_1 mech_data matches 1.. if entity @s[tag=mech_upgrade_nether] as @e[tag=mech_item_receiver,tag=mech_active,sort=nearest] if score @s mech_gridid = temp_2 mech_data at @s run function mechanization:assembly/machines/item_transmitter/insert_item
execute if score temp_1 mech_data matches 1.. if entity @s[tag=mech_upgrade_ender] as @e[tag=mech_item_receiver,tag=mech_active,sort=nearest] if score @s mech_gridid = temp_2 mech_data at @s run function mechanization:assembly/machines/item_transmitter/insert_item

#loop/remove data
execute if score temp_1 mech_data matches 0.. run data modify storage du:temp list append from storage du:temp list[0]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ execute store result score temp_1 mech_data if data block ~ ~ ~ Items[{tag:{OreD
scoreboard players operation temp_0 mech_data += temp_1 mech_data
execute store result block ~ ~ ~ Items[{Slot:10b}].tag.AttributeModifiers[{Name:"generic.movement_speed"}].Amount double 0.1 run scoreboard players get temp_0 mech_data

execute if block ~ ~ ~ barrel{Items:[ {tag:{OreDict:["upgradeKnockResist"]}} ]} store success block ~ ~ ~ Items[{Slot:10b}].tag.AttributeModifiers[{Name:"generic.knockbackResistance"}].Amount double 0.5 if entity @s
execute if block ~ ~ ~ barrel{Items:[ {tag:{OreDict:["upgradeHealth"]}} ]} store success block ~ ~ ~ Items[{Slot:10b}].tag.AttributeModifiers[{Name:"generic.maxHealth"}].Amount double 5 if entity @s
execute if block ~ ~ ~ barrel{Items:[ {tag:{OreDict:["upgradeKnockResist"]}} ]} store success block ~ ~ ~ Items[{Slot:10b}].tag.AttributeModifiers[{Name:"generic.knockback_resistance"}].Amount double 0.5 if entity @s
execute if block ~ ~ ~ barrel{Items:[ {tag:{OreDict:["upgradeHealth"]}} ]} store success block ~ ~ ~ Items[{Slot:10b}].tag.AttributeModifiers[{Name:"generic.max_health"}].Amount double 5 if entity @s



Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

execute if block ~ ~ ~ barrel{Items:[ {tag:{OreDict:["upgradeAutoSmelt"]}} ]} run data modify block ~ ~ ~ Items[{Slot:17b}].tag.du_auto_smelt set value 1b
execute if block ~ ~ ~ barrel{Items:[ {tag:{OreDict:["upgradeTrash"]}} ]} run data modify block ~ ~ ~ Items[{Slot:17b}].tag.du_trash set value 1b
execute if block ~ ~ ~ barrel{Items:[ {tag:{OreDict:["upgradeAutoSmelt"]}} ]} run data modify block ~ ~ ~ Items[{Slot:10b}].tag.du_auto_smelt set value 1b
execute if block ~ ~ ~ barrel{Items:[ {tag:{OreDict:["upgradeTrash"]}} ]} run data modify block ~ ~ ~ Items[{Slot:10b}].tag.du_trash set value 1b

execute store result score temp_0 mech_data run data get block ~ ~ ~ Items[{Slot:10b}].tag.AttributeModifiers[{Name:"generic.attack_damage"}].Amount 10
execute store result score temp_1 mech_data if data block ~ ~ ~ Items[{tag:{OreDict:["upgradeDamage"]}}]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ scoreboard players operation temp_5 mech_data += @s mech_usesword
scoreboard players operation temp_5 mech_data += @s mech_usetrident

#run upgrades
#execute if score t$base.imer_20 du_data matches 10 if entity @s[tag=mech_upgrade_empower_1] run function mechanization:gadgets/upgrades/tools/empowered_1
execute if score $base.timer_20 du_data matches 10 if entity @s[tag=mech_upgrade_empower] run function mechanization:gadgets/upgrades/tools/empowered_2
execute if score $base.timer_20 du_data matches 10 if entity @s[tag=mech_upgrade_empower_1] run function mechanization:gadgets/upgrades/tools/empowered_1
execute if score $base.timer_20 du_data matches 10 if entity @s[tag=mech_upgrade_empower_2] run function mechanization:gadgets/upgrades/tools/empowered_2
execute unless predicate du:entity/is_sneaking if entity @s[tag=mech_upgrade_smash] at @s as @e[type=item,sort=nearest,limit=1,nbt={Item:{Count:1b},Age:0s},distance=..8] at @s run function mechanization:gadgets/upgrades/tools/smash
execute if score temp_4 mech_data matches 1.. if entity @s[tag=mech_upgrade_magnetic] at @s run function mechanization:gadgets/upgrades/tools/magnetic

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
tag @s remove mech_upgrade_empower
#tag @s remove mech_upgrade_empower_2
tag @s remove mech_upgrade_empower_1
tag @s remove mech_upgrade_empower_2
tag @s remove mech_upgrade_autosmelt
tag @s remove mech_upgrade_magnetic
tag @s remove mech_upgrade_trash
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
function mechanization:gadgets/upgrades/remove_upgrades_tools

tag @s[nbt={SelectedItem:{ tag:{mech_modifiers:[{tag:{OreDict:["upgradeEmpowered"]}}]}}}] add mech_upgrade_empower
execute store success score temp_0 mech_data run data get entity @s SelectedItem.tag.mech_modifiers[{tag:{OreDict:["upgradeEmpowered"]}}]
execute if data entity @s SelectedItem.tag.mech_modifiers[].tag{OreDict:["upgradeEmpowered"]} if score temp_0 mech_data matches 1 run tag @s add mech_upgrade_empower_1
execute if data entity @s SelectedItem.tag.mech_modifiers[].tag{OreDict:["upgradeEmpowered"]} if score temp_0 mech_data matches 0 run tag @s add mech_upgrade_empower_2

tag @s[nbt={SelectedItem:{ tag:{mech_modifiers:[{tag:{OreDict:["upgradeMagnetic"]}}]}}}] add mech_upgrade_magnetic
tag @s[nbt={SelectedItem:{ tag:{mech_modifiers:[{tag:{OreDict:["upgradeTrash"]}}]}}}] add mech_upgrade_trash
tag @s[nbt={SelectedItem:{ tag:{mech_modifiers:[{tag:{OreDict:["upgradeSmash"]}}]}}}] add mech_upgrade_smash
8 changes: 4 additions & 4 deletions data/mechanization/functions/install.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ scoreboard players set $install mech_data 1

#check for 1.16.2
execute unless score $minecraft.ver du_data matches 162 run scoreboard players set $install mech_data 0
execute unless score $minecraft.ver du_data matches 162 run tellraw @a [{"text":"Error: Mechanization v2.3.1 requires Minecraft +1.16.2. Click [here] to download alternate versions.\n","color":"red","clickEvent":{"action":"open_url","value":"https://github.com/ImCoolYeah105/Mechanization/releases"}}]
execute unless score $minecraft.ver du_data matches 162 run tellraw @a [{"text":"Error: Mechanization v2.3.1a requires Minecraft +1.16.2. Click [here] to download alternate versions.\n","color":"red","clickEvent":{"action":"open_url","value":"https://github.com/ImCoolYeah105/Mechanization/releases"}}]

#check DU
execute unless score $du.ver load matches 2020100.. run scoreboard players set $install mech_data 0
execute unless score $du.ver load matches 2020100.. run tellraw @a [{"text":"Error: Mechanization requires Datapack Utilities version +2.2.1. You can download that [here].\n","color":"red","clickEvent":{"action":"open_url","value":"https://github.com/ImCoolYeah105/Datapack-Utilities/releases"}}]
execute unless score $du.ver load matches 2020103.. run scoreboard players set $install mech_data 0
execute unless score $du.ver load matches 2020103.. run tellraw @a [{"text":"Error: Mechanization requires Datapack Utilities version +2.2.1c. You can download that [here].\n","color":"red","clickEvent":{"action":"open_url","value":"https://github.com/ImCoolYeah105/Datapack-Utilities/releases"}}]

#print install message
execute if score $install mech_data matches 1 run tellraw @a [{"text":"[Loaded Mechanization v2.3.1]","color":"dark_green"}]
execute if score $install mech_data matches 1 run tellraw @a [{"text":"[Loaded Mechanization v2.3.1a]","color":"dark_green"}]

#resourcepack
tellraw @a [{"translate":"Looks like you don't have the resourcepack for Mechanization. You can download that [here].","color":"red","clickEvent":{"action":"open_url","value":"https://github.com/ImCoolYeah105/Mechanization/releases"}}]
2 changes: 1 addition & 1 deletion data/mechanization/functions/load.mcfunction
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ scoreboard objectives add mech_usesword minecraft.used:minecraft.diamond_sword
scoreboard objectives add mech_usetrident minecraft.used:minecraft.trident

#mark version
scoreboard players set $mech.ver load 2030001
scoreboard players set $mech.ver load 2030101

#configure storage
execute unless data storage mechanization:networks quantum run data merge storage mechanization:networks {quantum:[]}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ execute unless data block ~ ~ ~ Items[{Slot:5b}] run replaceitem block ~ ~ ~ con
execute unless data block ~ ~ ~ Items[{Slot:6b}] run replaceitem block ~ ~ ~ container.6 minecraft:structure_block{CustomModelData:6421200,du_gui:1b,HideFlags:63,display:{Name:"\"\""}}
execute unless data block ~ ~ ~ Items[{Slot:8b}] run replaceitem block ~ ~ ~ container.8 minecraft:structure_block{CustomModelData:6421200,du_gui:1b,HideFlags:63,display:{Name:"\"\""}}

#errored
execute if entity @s[tag=!mech_errored] run data modify block ~ ~ ~ CustomName set value '[{"translate":"mech.block.alloy_furnace","color":"dark_aqua"}]'

#function
scoreboard players set @s[tag=!mech_active] mech_timer 0
scoreboard players add @s[tag=mech_active] mech_timer 1
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

playsound minecraft:block.note_block.bit block @a ~ ~ ~ 1 2
execute if entity @s[tag=!mech_errored] run clone ~ ~ ~ ~ ~ ~ ~ ~ ~ replace force
execute if entity @s[tag=!mech_errored] run data merge block ~ ~ ~ {CustomName:'[{"text":"Error: Missing ","color":"red"},{"translate":"mech.item.machine_upgrade"}]'}
scoreboard players set temp_3 mech_data 1
tag @s add mech_errored
Loading

0 comments on commit e24ab86

Please sign in to comment.