Skip to content

Commit

Permalink
Merge pull request #166 from ICY105/mech-1.19
Browse files Browse the repository at this point in the history
Mech 1.19 update
  • Loading branch information
ICY105 committed Aug 1, 2022
2 parents 376c80d + 5888b59 commit 42050ba
Show file tree
Hide file tree
Showing 2,577 changed files with 52,314 additions and 18,206 deletions.
7 changes: 7 additions & 0 deletions data/block_utils/functions/v1.1/enumerate.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

scoreboard players add #block_utils.major load.status 0
scoreboard players add #block_utils.minor load.status 0

execute if score #block_utils.major load.status matches ..0 run scoreboard players set #block_utils.minor load.status 1
execute if score #block_utils.major load.status matches ..0 run scoreboard players set #block_utils.major load.status 1
execute if score #block_utils.major load.status matches 1 if score #block_utils.minor load.status matches ..1 run scoreboard players set #block_utils.minor load.status 1
2 changes: 2 additions & 0 deletions data/block_utils/functions/v1.1/init.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

scoreboard objectives add block_utils.data dummy
44 changes: 44 additions & 0 deletions data/block_utils/functions/v1.1/redstone/is_active.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@

scoreboard players set #temp block_utils.data 0

#self powered
function block_utils:v1.1/redstone/is_powered
execute if score #out block_utils.data matches 1 run scoreboard players set #temp block_utils.data 1

#other powered
execute if score #temp block_utils.data matches 0 positioned ~ ~1 ~ unless block ~ ~ ~ #block_utils:v1.1/transparent run function block_utils:v1.1/redstone/is_powered
execute if score #temp block_utils.data matches 0 if score #out block_utils.data matches 1 run scoreboard players set #temp block_utils.data 1

execute if score #temp block_utils.data matches 0 positioned ~ ~-1 ~ unless block ~ ~ ~ #block_utils:v1.1/transparent run function block_utils:v1.1/redstone/is_powered
execute if score #temp block_utils.data matches 0 if score #out block_utils.data matches 1 run scoreboard players set #temp block_utils.data 1

execute if score #temp block_utils.data matches 0 positioned ~1 ~ ~ unless block ~ ~ ~ #block_utils:v1.1/transparent run function block_utils:v1.1/redstone/is_powered
execute if score #temp block_utils.data matches 0 if score #out block_utils.data matches 1 run scoreboard players set #temp block_utils.data 1

execute if score #temp block_utils.data matches 0 positioned ~-1 ~ ~ unless block ~ ~ ~ #block_utils:v1.1/transparent run function block_utils:v1.1/redstone/is_powered
execute if score #temp block_utils.data matches 0 if score #out block_utils.data matches 1 run scoreboard players set #temp block_utils.data 1

execute if score #temp block_utils.data matches 0 positioned ~ ~ ~1 unless block ~ ~ ~ #block_utils:v1.1/transparent run function block_utils:v1.1/redstone/is_powered
execute if score #temp block_utils.data matches 0 if score #out block_utils.data matches 1 run scoreboard players set #temp block_utils.data 1

execute if score #temp block_utils.data matches 0 positioned ~ ~ ~-1 unless block ~ ~ ~ #block_utils:v1.1/transparent run function block_utils:v1.1/redstone/is_powered
execute if score #temp block_utils.data matches 0 if score #out block_utils.data matches 1 run scoreboard players set #temp block_utils.data 1

### Self Active

#dynamic
execute if score #temp block_utils.data matches 0 positioned ~ ~01 ~ if block ~ ~ ~ #block_utils:v1.1/weak_power_top if predicate block_utils:v1.1/is_emitting_signal unless block ~ ~ ~ minecraft:redstone_torch run scoreboard players set #temp block_utils.data 1
execute if score #temp block_utils.data matches 0 positioned ~ ~-1 ~ if block ~ ~ ~ #block_utils:v1.1/weak_power_bottom if predicate block_utils:v1.1/is_emitting_signal run scoreboard players set #temp block_utils.data 1
execute if score #temp block_utils.data matches 0 positioned ~01 ~ ~ if block ~ ~ ~ #block_utils:v1.1/weak_power_side if predicate block_utils:v1.1/is_emitting_signal run scoreboard players set #temp block_utils.data 1
execute if score #temp block_utils.data matches 0 positioned ~-1 ~ ~ if block ~ ~ ~ #block_utils:v1.1/weak_power_side if predicate block_utils:v1.1/is_emitting_signal run scoreboard players set #temp block_utils.data 1
execute if score #temp block_utils.data matches 0 positioned ~ ~ ~01 if block ~ ~ ~ #block_utils:v1.1/weak_power_side if predicate block_utils:v1.1/is_emitting_signal run scoreboard players set #temp block_utils.data 1
execute if score #temp block_utils.data matches 0 positioned ~ ~ ~-1 if block ~ ~ ~ #block_utils:v1.1/weak_power_side if predicate block_utils:v1.1/is_emitting_signal run scoreboard players set #temp block_utils.data 1

#redstone torch
execute if block ~ ~1 ~ minecraft:redstone_wall_torch[lit=true] run scoreboard players set #temp block_utils.data 1
execute if block ~1 ~ ~ #block_utils:v1.1/redstone_torch[lit=true] run scoreboard players set #temp block_utils.data 1
execute if block ~-1 ~ ~ #block_utils:v1.1/redstone_torch[lit=true] run scoreboard players set #temp block_utils.data 1
execute if block ~ ~ ~1 #block_utils:v1.1/redstone_torch[lit=true] run scoreboard players set #temp block_utils.data 1
execute if block ~ ~ ~-1 #block_utils:v1.1/redstone_torch[lit=true] run scoreboard players set #temp block_utils.data 1

scoreboard players operation #out block_utils.data = #temp block_utils.data
23 changes: 23 additions & 0 deletions data/block_utils/functions/v1.1/redstone/is_powered.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@

scoreboard players set #out block_utils.data 0

#generic: static
execute if block ~ ~1 ~ #block_utils:v1.1/strong_power_top unless block ~ ~1 ~ #block_utils:v1.1/strong_power_top[power=0] unless block ~ ~1 ~ #block_utils:v1.1/strong_power_top[powered=false] run scoreboard players set #out block_utils.data 1
execute if block ~ ~-1 ~ #block_utils:v1.1/strong_power_bottom[powered=true,face=ceiling] run scoreboard players set #out block_utils.data 1
execute if block ~1 ~ ~ #block_utils:v1.1/strong_power_side[powered=true,facing=east] run scoreboard players set #out block_utils.data 1
execute if block ~-1 ~ ~ #block_utils:v1.1/strong_power_side[powered=true,facing=west] run scoreboard players set #out block_utils.data 1
execute if block ~ ~ ~1 #block_utils:v1.1/strong_power_side[powered=true,facing=south] run scoreboard players set #out block_utils.data 1
execute if block ~ ~ ~-1 #block_utils:v1.1/strong_power_side[powered=true,facing=north] run scoreboard players set #out block_utils.data 1

#redstone torch
execute if block ~ ~-1 ~ minecraft:redstone_torch[lit=true] run scoreboard players set #out block_utils.data 1

#redstone dust
execute positioned ~ ~1 ~ if block ~ ~ ~ minecraft:redstone_wire unless block ~ ~ ~ minecraft:redstone_wire[power=0] run scoreboard players set #out block_utils.data 1
execute positioned ~1 ~ ~ if block ~ ~ ~ minecraft:redstone_wire[west=side] unless block ~ ~ ~ minecraft:redstone_wire[power=0] run scoreboard players set #out block_utils.data 1
execute positioned ~-1 ~ ~ if block ~ ~ ~ minecraft:redstone_wire[east=side] unless block ~ ~ ~ minecraft:redstone_wire[power=0] run scoreboard players set #out block_utils.data 1
execute positioned ~ ~ ~1 if block ~ ~ ~ minecraft:redstone_wire[north=side] unless block ~ ~ ~ minecraft:redstone_wire[power=0] run scoreboard players set #out block_utils.data 1
execute positioned ~ ~ ~-1 if block ~ ~ ~ minecraft:redstone_wire[south=side] unless block ~ ~ ~ minecraft:redstone_wire[power=0] run scoreboard players set #out block_utils.data 1

#check opaque
execute if block ~ ~ ~ #block_utils:v1.1/transparent run scoreboard players set #out block_utils.data 0
2 changes: 2 additions & 0 deletions data/block_utils/functions/v1.1/resolve.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

execute if score #block_utils.major load.status matches 1 if score #block_utils.minor load.status matches 1 run function block_utils:v1.1/init
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

execute if score #block_utils.major load.status matches 1 if score #block_utils.minor load.status matches 1 run function block_utils:v1.1/redstone/is_active
2 changes: 2 additions & 0 deletions data/block_utils/functions/v1/api/is_active.mcfunction
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

function #block_utils:v1/internal/is_active
96 changes: 96 additions & 0 deletions data/block_utils/predicates/v1.1/is_emitting_signal.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
{
"condition": "minecraft:alternative",
"terms": [
{
"condition": "minecraft:location_check",
"predicate": {
"block": {
"state": {
"powered": "true"
}
}
}
},
{
"condition": "minecraft:location_check",
"predicate": {
"block": {
"tag": "block_utils:v1.1/redstone_torch",
"state": {
"lit": "true"
}
}
}
},
{
"condition": "minecraft:location_check",
"predicate": {
"block": {
"blocks": [
"minecraft:redstone_block"
]
}
}
},
{
"condition": "minecraft:location_check",
"predicate": { "block": { "state": { "power": "1" } } }
},
{
"condition": "minecraft:location_check",
"predicate": { "block": { "state": { "power": "2" } } }
},
{
"condition": "minecraft:location_check",
"predicate": { "block": { "state": { "power": "3" } } }
},
{
"condition": "minecraft:location_check",
"predicate": { "block": { "state": { "power": "4" } } }
},
{
"condition": "minecraft:location_check",
"predicate": { "block": { "state": { "power": "5" } } }
},
{
"condition": "minecraft:location_check",
"predicate": { "block": { "state": { "power": "6" } } }
},
{
"condition": "minecraft:location_check",
"predicate": { "block": { "state": { "power": "7" } } }
},
{
"condition": "minecraft:location_check",
"predicate": { "block": { "state": { "power": "8" } } }
},
{
"condition": "minecraft:location_check",
"predicate": { "block": { "state": { "power": "9" } } }
},
{
"condition": "minecraft:location_check",
"predicate": { "block": { "state": { "power": "10" } } }
},
{
"condition": "minecraft:location_check",
"predicate": { "block": { "state": { "power": "11" } } }
},
{
"condition": "minecraft:location_check",
"predicate": { "block": { "state": { "power": "12" } } }
},
{
"condition": "minecraft:location_check",
"predicate": { "block": { "state": { "power": "13" } } }
},
{
"condition": "minecraft:location_check",
"predicate": { "block": { "state": { "power": "14" } } }
},
{
"condition": "minecraft:location_check",
"predicate": { "block": { "state": { "power": "15" } } }
}
]
}
8 changes: 8 additions & 0 deletions data/block_utils/tags/blocks/v1.1/pressure_plates.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"values":[
"#minecraft:wooden_pressure_plates",
"minecraft:stone_pressure_plate",
"minecraft:light_weighted_pressure_plate",
"minecraft:heavy_weighted_pressure_plate"
]
}
6 changes: 6 additions & 0 deletions data/block_utils/tags/blocks/v1.1/redstone_torch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"values":[
"minecraft:redstone_torch",
"minecraft:redstone_wall_torch"
]
}
7 changes: 7 additions & 0 deletions data/block_utils/tags/blocks/v1.1/strong_power_bottom.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"values":[
"#minecraft:buttons",
"minecraft:lever",
"minecraft:redstone_torch"
]
}
9 changes: 9 additions & 0 deletions data/block_utils/tags/blocks/v1.1/strong_power_side.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"values":[
"#minecraft:buttons",
"minecraft:lever",
"minecraft:repeater",
"minecraft:comparator",
"minecraft:tripwire_hook"
]
}
9 changes: 9 additions & 0 deletions data/block_utils/tags/blocks/v1.1/strong_power_top.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"values":[
"#minecraft:buttons",
"#block_utils:v1.1/pressure_plates",
"minecraft:lever",
"minecraft:detector_rail",
"minecraft:redstone_wire"
]
}
Loading

0 comments on commit 42050ba

Please sign in to comment.