-
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.
2. Fix edge case where the function choose the wrong ladder to break
- Loading branch information
oOBoomberOo
committed
May 7, 2020
1 parent
d7d4b94
commit 97e2bf2
Showing
14 changed files
with
38 additions
and
38 deletions.
There are no files selected for viewing
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
2 changes: 1 addition & 1 deletion
2
data/boomber/functions/rope_ladder/event/place_ladder.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 @@ | ||
scoreboard players set #bb.rl.raycast bb.success 0 | ||
scoreboard players set #raycast bb.rl.var 0 | ||
execute if predicate boomber:rope_ladder/is_sneaking at @s anchored eyes positioned ^ ^ ^0.1 anchored feet run function boomber:rope_ladder/event/place_ladder/raycast | ||
|
||
advancement revoke @s only boomber:rope_ladder/event/place_ladder |
12 changes: 6 additions & 6 deletions
12
data/boomber/functions/rope_ladder/event/place_ladder/found.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,11 +1,11 @@ | ||
execute store result score #bb.rl.ladder bb.variable run clear @s minecraft:ladder 0 | ||
execute if entity @s[gamemode=creative] run scoreboard players set #bb.rl.ladder bb.variable 2147483647 | ||
execute store result score #ladder bb.rl.var run clear @s minecraft:ladder 0 | ||
execute if entity @s[gamemode=creative] run scoreboard players set #ladder bb.rl.var 2147483647 | ||
|
||
scoreboard players set #bb.rl.iteration bb.variable 0 | ||
scoreboard players set #iteration bb.rl.var 0 | ||
function boomber:rope_ladder/ladder/rope | ||
|
||
scoreboard players operation #bb.rl.amount bb.variable = #bb.rl.iteration bb.variable | ||
scoreboard players remove #bb.rl.amount bb.variable 1 | ||
scoreboard players operation #amount bb.rl.var = #iteration bb.rl.var | ||
scoreboard players remove #amount bb.rl.var 1 | ||
execute if entity @s[gamemode=!creative] run function boomber:rope_ladder/ladder/take | ||
|
||
scoreboard players set #bb.rl.raycast bb.success 1 | ||
scoreboard players set #raycast bb.rl.var 1 |
2 changes: 1 addition & 1 deletion
2
data/boomber/functions/rope_ladder/event/place_ladder/raycast.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,3 +1,3 @@ | ||
execute align xyz positioned ~0.5 ~0.5 ~0.5 if block ~ ~ ~ minecraft:ladder if block ~ ~-1 ~ #boomber:rope_ladder/air run function boomber:rope_ladder/event/place_ladder/found | ||
|
||
execute as @s[distance=..5.5] if score #bb.rl.raycast bb.success matches 0 positioned ^ ^ ^0.1 run function boomber:rope_ladder/event/place_ladder/raycast | ||
execute as @s[distance=..5.5] if score #raycast bb.rl.var matches 0 positioned ^ ^ ^0.1 run function boomber:rope_ladder/event/place_ladder/raycast |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
function boomber:rope_ladder/ladder/place | ||
|
||
scoreboard players add #bb.rl.iteration bb.variable 1 | ||
execute positioned ~ ~-1 ~ if block ~ ~ ~ #boomber:rope_ladder/air if score #bb.rl.iteration bb.variable < #bb.rl.ladder bb.variable run function boomber:rope_ladder/ladder/rope | ||
scoreboard players add #iteration bb.rl.var 1 | ||
execute positioned ~ ~-1 ~ if block ~ ~ ~ #boomber:rope_ladder/air if score #iteration bb.rl.var < #ladder bb.rl.var run function boomber:rope_ladder/ladder/rope |
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 @@ | ||
clear @s minecraft:ladder 1 | ||
|
||
scoreboard players remove #bb.rl.amount bb.variable 1 | ||
execute if score #bb.rl.amount bb.variable matches 1.. run function boomber:rope_ladder/ladder/take | ||
scoreboard players remove #amount bb.rl.var 1 | ||
execute if score #amount bb.rl.var matches 1.. run function boomber:rope_ladder/ladder/take |
2 changes: 1 addition & 1 deletion
2
data/boomber/functions/rope_ladder/player/mine/found.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,2 +1,2 @@ | ||
kill @e[type=item, nbt={Item: {id: 'minecraft:ladder', Count: 1b}, Age: 0s}, distance=..0.8] | ||
kill @e[type=item, nbt={Item: {id: "minecraft:ladder", Count: 1b}, Age: 0s}, distance=..0.8, tag=!global.ignore, limit=1] | ||
execute align xyz positioned ~0.5 ~0.5 ~0.5 run function boomber:rope_ladder/ladder/remove |
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 @@ | ||
execute at @e[type=item, nbt={Item: {id: 'minecraft:ladder', Count: 1b}, Age: 0s}] if block ~ ~-1 ~ minecraft:ladder run function boomber:rope_ladder/player/mine/found | ||
execute at @e[type=item, nbt={Item: {id: "minecraft:ladder", Count: 1b}, Age: 0s}, tag=!global.ignore, limit=1, sort=nearest] if block ~ ~-1 ~ minecraft:ladder run function boomber:rope_ladder/player/mine/found |
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,3 +1,3 @@ | ||
scoreboard objectives add bb.variable dummy | ||
scoreboard objectives add bb.success dummy | ||
scoreboard objectives add bb.rl.var dummy | ||
scoreboard objectives add bb.rl.var dummy | ||
scoreboard objectives add bb.rl.mine minecraft.mined:minecraft.ladder |
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,18 @@ | ||
{ | ||
"display": { | ||
"title": "Boomber", | ||
"description": "", | ||
"icon": { | ||
"item": "minecraft:player_head", | ||
"nbt": "{SkullOwner: 'Boomber'}" | ||
}, | ||
"announce_to_chat": false, | ||
"show_toast": false | ||
}, | ||
"parent": "global:root", | ||
"criteria": { | ||
"trigger": { | ||
"trigger": "minecraft:tick" | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"pack": { | ||
"pack_format": 1, | ||
"pack_format": 5, | ||
"description": "Long overdue Rope Ladder datapack" | ||
} | ||
} |