-
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.
Sound improvements, and ported some fixes to core
- Loading branch information
Showing
16 changed files
with
530 additions
and
44 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -4,6 +4,8 @@ _*.json | |
/.vscode | ||
|
||
/Install-Packs.ps1 | ||
Deploy.ps1 | ||
*.zip | ||
|
||
# Work in Progress | ||
/Decked Out 2 Catacombs | ||
|
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
25 changes: 25 additions & 0 deletions
25
Decked Out 2 Core Datapack/Python/do2/functions/carpet_map_player.py
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,25 @@ | ||
from mcfunction import mcfunction | ||
|
||
|
||
@mcfunction(tags=["minecraft:load"]) | ||
def check_status(): | ||
yield f""" | ||
execute unless entity @e[name=TangoCam] | ||
if entity @p[name=!TangoCam] | ||
run function {summon_tangocam} | ||
""" | ||
|
||
yield """ | ||
execute if entity @e[name=TangoCam] | ||
unless entity @a[name=!TangoCam] | ||
run kill TangoCam | ||
""" | ||
|
||
yield f"schedule function {check_status} 30s replace" | ||
|
||
|
||
@mcfunction | ||
def summon_tangocam(): | ||
yield "player TangoCam spawn at -484.52 59.00 1738.19 facing 0 0" | ||
yield "execute as @p[name=TangoCam] run gamemode spectator" | ||
|
60 changes: 60 additions & 0 deletions
60
Decked Out 2 Core Datapack/Python/do2/functions/fix_card_counter.py
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,60 @@ | ||
from mcfunction import mcfunction | ||
|
||
COUNT_IN_ROW = 20 | ||
|
||
BLOCK_X = -517 | ||
BLOCK_X_STEP = 3 | ||
BLOCK_Y = 61 | ||
BLOCK_Z = [1845, 1850] | ||
|
||
X_OFFSET = [0, 1] | ||
ROW_Y = [55, 57] | ||
Z_OFFSET = [0, 2] | ||
|
||
|
||
SPECIAL_Z_OFFSET = { | ||
(1, 0): 2, | ||
(1, 1): 1, | ||
} | ||
|
||
REDSTONE = 'minecraft:redstone_wire' | ||
RAIL = 'minecraft:powered_rail[shape=north_south]' | ||
|
||
ITEM = { | ||
(1, 9): REDSTONE, | ||
(1, 10): REDSTONE, | ||
(1, 11): REDSTONE, | ||
} | ||
|
||
|
||
@mcfunction(tags=["do2:fix_dungeon"]) | ||
def _(): | ||
for row in range(2): | ||
for column in range(COUNT_IN_ROW): | ||
x1 = BLOCK_X + column * BLOCK_X_STEP | ||
y1 = BLOCK_Y | ||
z1 = BLOCK_Z[row] | ||
|
||
x2 = x1 + X_OFFSET[row] | ||
y2 = ROW_Y[row] | ||
z2 = z1 + Z_OFFSET[row] + SPECIAL_Z_OFFSET.get((row, column), 0) | ||
|
||
x3 = x1 + 1 | ||
y3 = y1 - 1 | ||
z3 = z1 - 2 | ||
|
||
item = ITEM.get((row, column), RAIL) | ||
|
||
display_block = { | ||
False: "minecraft:mushroom_stem", | ||
# False: "minecraft:light_gray_wool", | ||
True: "minecraft:white_wool", | ||
}[column % 10 < 5] | ||
|
||
yield f"fill {x1} {y1} {z1} {x3} {y3} {z3} {display_block} replace #minecraft:wool" | ||
yield f"fill {x1} {y1} {z1} {x3} {y3} {z3} {display_block} replace minecraft:mushroom_stem" | ||
|
||
# prefix = f"execute run" | ||
prefix = f"execute unless block {x1} {y1} {z1} minecraft:water run" | ||
yield f"{prefix} setblock {x2} {y2} {z2} minecraft:air" | ||
yield f"{prefix} setblock {x2} {y2} {z2} {item}" |
78 changes: 78 additions & 0 deletions
78
Decked Out 2 Core Datapack/Python/do2/functions/fix_cove_dripstone.py
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,78 @@ | ||
from mcfunction import mcfunction | ||
|
||
|
||
DRIPSTONE = [ | ||
(-554, 1961, (14, 15), (16, 17)), | ||
(-554, 1963, ..., (16, 17)), | ||
(-553, 1960, (14, 16), (17, 20)), | ||
(-553, 1962, ..., (17, 18)), | ||
(-552, 1959, (14, 15), ...), | ||
(-552, 1959, ..., (16, 17)), | ||
(-552, 1961, (14, 20), (21, 22)), | ||
(-552, 1962, ..., (16, 18)), | ||
(-552, 1963, (14, 16), (17, 18)), | ||
(-552, 1964, (14, 15), (16, 17)), | ||
(-549, 1961, (15, 17), (18, 21)), | ||
] | ||
|
||
|
||
def _fill(x, z, ys, direction, merge): | ||
if ys is Ellipsis: | ||
return | ||
|
||
y1, y2, dy = { | ||
"down": (min(ys), max(ys), 1), | ||
"up": (max(ys), min(ys), -1), | ||
}[direction] | ||
|
||
size = abs(y1 - y2) + 1 | ||
tip = "tip_merge" if merge else "tip" | ||
|
||
def dripstone(thickness): | ||
return f"""minecraft:pointed_dripstone[vertical_direction={direction},thickness={thickness}]""" | ||
|
||
if size >= 3: | ||
yield f"""setblock {x} {y2} {z} {dripstone("base")}""" | ||
|
||
if size > 4: | ||
yield f"""fill {x} {y1+2*dy} {z} {x} {y2-dy} {z} {dripstone("middle")}""" | ||
|
||
if size == 4: | ||
yield f"""setblock {x} {y1+2*dy} {z} {dripstone("middle")}""" | ||
|
||
if size >= 2: | ||
yield f"""setblock {x} {y1+dy} {z} {dripstone("frustum")}""" | ||
|
||
if size >= 1: | ||
yield f"""setblock {x} {y1} {z} {dripstone(tip)}""" | ||
|
||
|
||
|
||
@mcfunction(tags=["do2:fix_dungeon"]) | ||
def _(): | ||
ifs = [] | ||
|
||
for x, z, up, down in DRIPSTONE: | ||
if up is not Ellipsis: | ||
ifs.append(f"if block {x} {up[1]} {z} minecraft:pointed_dripstone") | ||
|
||
if down is not Ellipsis: | ||
ifs.append(f"if block {x} {down[0]} {z} minecraft:pointed_dripstone") | ||
|
||
ifs = " ".join(ifs) | ||
|
||
yield "# If tips are not broken, all other blocks must be there." | ||
|
||
yield f"execute {ifs} run return 0" | ||
|
||
yield "# Don't fix while player is close by. It looks weird, and can be really unfun to get blocked by it." | ||
|
||
yield """ | ||
execute positioned -552 15 1961 | ||
if entity @p[distance=..16] | ||
run return 0 | ||
""" | ||
|
||
for x, z, up, down in DRIPSTONE: | ||
yield from _fill(x, z, up, 'up', down is not None) | ||
yield from _fill(x, z, down, 'down', up is not None) |
36 changes: 36 additions & 0 deletions
36
Decked Out 2 Core Datapack/Python/do2/functions/fix_main_door_armor_stands.py
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,36 @@ | ||
from mcfunction import mcfunction | ||
|
||
|
||
@mcfunction(tags=["do2:fix_dungeon"]) | ||
def _(): | ||
yield "setblock -544 112 1981 minecraft:gray_shulker_box[facing=down]" | ||
|
||
yield """data merge entity 071af318-9860-4d54-b61a-1f1851265429 { | ||
Invulnerable: false, | ||
NoGravity: true, | ||
Invisible: true, | ||
DisabledSlots: 4194303, | ||
Rotation: [-90.0f, 0.0f], | ||
HandItems: [{}, {}], | ||
Pos: [-544.5d, 113.0d, 1980.5d], | ||
ArmorItems: [{}, {}, {}, { | ||
id: "minecraft:carved_pumpkin", | ||
Count: 1b, | ||
tag: {CustomModelData: 87, CustomRoleplayData: 1b} | ||
}], | ||
}""" | ||
|
||
yield """data merge entity e989ba0e-56e3-46b0-92e3-65302adf4226 { | ||
Invulnerable: false, | ||
NoGravity: true, | ||
Invisible: true, | ||
DisabledSlots: 4194303, | ||
Rotation: [-90.0f, 0.0f], | ||
HandItems: [{}, {}], | ||
Pos: [-543.5d, 113.0d, 1980.5d], | ||
ArmorItems: [{}, {}, {}, { | ||
id: "minecraft:carved_pumpkin", | ||
Count: 1b, | ||
tag: {CustomModelData: 88, CustomRoleplayData: 1b} | ||
}], | ||
}""" |
34 changes: 34 additions & 0 deletions
34
Decked Out 2 Core Datapack/Python/do2/functions/fix_redstone.py
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,34 @@ | ||
from mcfunction import mcfunction | ||
|
||
|
||
@mcfunction(tags=["do2:fix_dungeon"]) | ||
def fix_artifact_10(): | ||
"""Fix artifact #10 not connected to clank.""" | ||
yield "fill -546 35 1995 -546 35 1993 minecraft:cyan_wool" | ||
yield "fill -546 35 1993 -550 35 1993 minecraft:cyan_wool" | ||
yield "fill -550 35 1993 -550 35 1985 minecraft:cyan_wool" | ||
|
||
yield "fill -546 36 1995 -546 36 1993 minecraft:redstone_wire" | ||
yield "fill -546 36 1993 -550 36 1993 minecraft:redstone_wire" | ||
yield "fill -550 36 1993 -550 36 1985 minecraft:redstone_wire" | ||
|
||
yield "setblock -546 36 1994 minecraft:repeater[facing=south]" | ||
|
||
|
||
@mcfunction(tags=["do2:fix_dungeon"]) | ||
def fix_toots(): | ||
# https://www.reddit.com/r/HermitCraft/comments/18t3bz8 | ||
yield """ | ||
execute if block -558 63 1960 minecraft:clay | ||
run setblock -558 63 1960 minecraft:stone | ||
""" | ||
|
||
|
||
|
||
|
||
@mcfunction(tags=["do2:fix_dungeon"]) | ||
def fix_crown_converter_delay(): | ||
yield """ | ||
execute if block -644 -15 1984 minecraft:repeater[facing=south,delay=1] | ||
run setblock -644 -15 1984 minecraft:repeater[facing=south,delay=3] | ||
""" |
9 changes: 9 additions & 0 deletions
9
Decked Out 2 Core Datapack/Python/do2/functions/limit_level04_tnt.py
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,9 @@ | ||
from mcfunction import mcfunction | ||
|
||
|
||
@mcfunction(tags=["do2:fix_dungeon"]) | ||
def _(): | ||
yield """ | ||
data modify block -640 17 1904 Items | ||
set value [{Slot: 4b, id: "minecraft:tnt", Count: 1b}] | ||
""" |
25 changes: 25 additions & 0 deletions
25
Decked Out 2 Core Datapack/Python/do2/functions/modify_item_models.py
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,25 @@ | ||
from mcfunction import mcfunction | ||
|
||
|
||
def _modify_compass(dropper_idx, model, slots=["{}"]): | ||
for slot in slots: | ||
yield f"""data modify block -549 106 {1979-dropper_idx} Items[{slot}].tag.CustomModelData set value {model}""" | ||
|
||
|
||
@mcfunction(tags=["do2:fix_dungeon"]) | ||
def _(): | ||
# Modify Compasses | ||
yield from _modify_compass(0, 1) | ||
yield from _modify_compass(1, 1) | ||
yield from _modify_compass(2, 1) | ||
yield from _modify_compass(3, 2) | ||
yield from _modify_compass(4, 2) | ||
yield from _modify_compass(5, 2) | ||
yield from _modify_compass(5, 3, [6, 7]) | ||
yield from _modify_compass(6, 3) | ||
yield from _modify_compass(7, 3) | ||
yield from _modify_compass(7, 4, [6, 7]) | ||
yield from _modify_compass(8, 4) | ||
yield from _modify_compass(9, 4) | ||
|
||
# yield "data modify block -625 59 1945 Items[{}].tag.CustomModelData set value 201" |
35 changes: 35 additions & 0 deletions
35
Decked Out 2 Core Datapack/Python/do2/functions/play_sound.py
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,35 @@ | ||
from mcfunction import mcfunction | ||
import data | ||
|
||
|
||
def _create(desc): | ||
function_name = f"""do2:play_sound/{desc["id"]}""" | ||
name = desc["sound"] | ||
condition = "" | ||
at = desc["at"] | ||
distance = desc.get("range", 16) | ||
|
||
@mcfunction(function_name=function_name) | ||
def _(): | ||
command = [ | ||
"execute", | ||
condition, | ||
f"positioned {at}", | ||
f"as @a[tag=do2.cmd_sound,distance=..{distance}]", | ||
"at @s", | ||
f"run playsound do2:{name} master @s", | ||
# at, | ||
] | ||
|
||
if at is not None: | ||
command.append(at) | ||
|
||
command = " ".join(part for part in command if part) | ||
yield command | ||
|
||
|
||
systems = data.SOUNDS | ||
|
||
for desc in systems: | ||
if "delay" in desc: | ||
_create(desc) |
19 changes: 19 additions & 0 deletions
19
Decked Out 2 Core Datapack/Python/do2/functions/regrow_berry_bushes.py
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,19 @@ | ||
from mcfunction import mcfunction | ||
|
||
|
||
BUSH = "minecraft:sweet_berry_bush" | ||
AIR = "minecraft:air" | ||
GROWN = "age=3" | ||
|
||
|
||
@mcfunction(tags=["do2:fix_dungeon"]) | ||
def _(): | ||
import data | ||
for item in data.SWEET_BERRY_BUSHES: | ||
x, y, z = item["pos"] | ||
pos = f"{x} {y} {z}" | ||
|
||
yield f"# {item['description']}" | ||
yield f"fill {pos} {pos} {BUSH}[{GROWN}] replace {AIR}" | ||
yield f"fill {pos} {pos} {BUSH}[{GROWN}] replace {BUSH}" | ||
yield "" |
Oops, something went wrong.