Skip to content

Commit

Permalink
Sound improvements, and ported some fixes to core
Browse files Browse the repository at this point in the history
  • Loading branch information
Noxitu committed Jan 16, 2024
1 parent df82c77 commit 31b4b3b
Show file tree
Hide file tree
Showing 16 changed files with 530 additions and 44 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ _*.json
/.vscode

/Install-Packs.ps1
Deploy.ps1
*.zip

# Work in Progress
/Decked Out 2 Catacombs
Expand Down
20 changes: 10 additions & 10 deletions Decked Out 2 Audio Resource Pack/Copy-Sounds.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,13 +156,13 @@
"events.recycle.6": "1473a3ea-45ec-47ca-b8c4-f93254467be4", # DO_Card_Recycle_6 BY Del Chupenebray/Joel Bickford
"events.recycle.7": "40356557-dcc1-4ef5-a830-089493d7fbab", # DO_Card_Recycle_7 BY Del Chupenebray/Joel Bickford
"events.recycle.8": "773c56cd-e551-4a11-a050-f17310678f86", # DO_Card_Recycle_8 BY Del Chupenebray/Joel Bickford
"holloween.enterance.1": "cda7ec93-5454-4f64-a6c6-5b431a29b63f", # DO_Holloween_EntranceTune_1 BY Del Chupenebray/Joel Bickford
"holloween.enterance.2": "602f6a24-2e3b-4e13-a211-c814f452c390", # DO_Holloween_EntranceTune_2 BY Del Chupenebray/Joel Bickford
"holloween.enterance.3": "5bf4c518-2e69-47d4-9559-5756cc5e2343", # DO_Holloween_EntranceTune_3 BY Del Chupenebray/Joel Bickford
"holloween.failure.1": "32e5657f-9d7b-494e-b38d-aaca1f522d2a", # DO_Holloween_Failure_1 BY Del Chupenebray/Joel Bickford
"holloween.failure.2": "edd55cdd-45a7-41ce-bbfd-ec3f9c59c02a", # DO_Holloween_Failure_2 BY Del Chupenebray/Joel Bickford
"holloween.failure.3": "f204d832-bdd9-489e-a6aa-b8c11128949b", # DO_Holloween_Failure_3 BY Del Chupenebray/Joel Bickford
"holloween.success": "3477400c-a6c4-4be1-9248-8c54533f2a42", # DO_Holloween_Success_1 BY Del Chupenebray/Joel Bickford
"halloween.enterance.1": "cda7ec93-5454-4f64-a6c6-5b431a29b63f", # DO_Holloween_EntranceTune_1 BY Del Chupenebray/Joel Bickford
"halloween.enterance.2": "602f6a24-2e3b-4e13-a211-c814f452c390", # DO_Holloween_EntranceTune_2 BY Del Chupenebray/Joel Bickford
"halloween.enterance.3": "5bf4c518-2e69-47d4-9559-5756cc5e2343", # DO_Holloween_EntranceTune_3 BY Del Chupenebray/Joel Bickford
"halloween.failure.1": "32e5657f-9d7b-494e-b38d-aaca1f522d2a", # DO_Holloween_Failure_1 BY Del Chupenebray/Joel Bickford
"halloween.failure.2": "edd55cdd-45a7-41ce-bbfd-ec3f9c59c02a", # DO_Holloween_Failure_2 BY Del Chupenebray/Joel Bickford
"halloween.failure.3": "f204d832-bdd9-489e-a6aa-b8c11128949b", # DO_Holloween_Failure_3 BY Del Chupenebray/Joel Bickford
"halloween.success": "3477400c-a6c4-4be1-9248-8c54533f2a42", # DO_Holloween_Success_1 BY Del Chupenebray/Joel Bickford
"interactions.crown_conversion.1": "002ca7c8-4c26-47f2-9323-a50889979936", # DO_Currency_CrownConversion_Se BY Del Chupenebray/Joel Bickford
"interactions.crown_conversion.2": "093c7b0e-f806-4ce9-9760-d1e9f4e700c0", # DO_Currency_CrownConversion_Se BY Del Chupenebray/Joel Bickford
"interactions.crown_conversion.3": "0f4d4df2-9e0f-446e-940b-cc3c1b712255", # DO_Currency_CrownConversion_Se BY Del Chupenebray/Joel Bickford
Expand Down Expand Up @@ -341,10 +341,10 @@
"events.hazard_blocked": ...,
"events.hazard": ...,
"events.recycle": ...,
"holloween.enterance": ...,
"holloween.failure": ...,
"halloween.enterance": ...,
"halloween.failure": ...,
"interactions.crown_conversion": ...,
"interactions.frost_purchase": ...,
"interactions.purchase": ...,
"ambient.warden_roar_with_cleo": ["ambient.warden_roar"]* 7 + ["ambient.hi_cleo"]
}

Expand Down
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"

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}"
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)
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 Decked Out 2 Core Datapack/Python/do2/functions/fix_redstone.py
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]
"""
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}]
"""
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 Decked Out 2 Core Datapack/Python/do2/functions/play_sound.py
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)
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 ""
Loading

0 comments on commit 31b4b3b

Please sign in to comment.