From 2b61af28a8778a217681bdba34ac8c3b8c05f13c Mon Sep 17 00:00:00 2001 From: "Claude (owner)" Date: Wed, 13 May 2026 15:45:35 +0900 Subject: [PATCH] =?UTF-8?q?music=5Fquiz:=20=EB=AC=B4=EB=8C=80=20=EC=9D=98?= =?UTF-8?q?=EC=A1=B4=20=EC=A0=9C=EA=B1=B0=20+=20=EC=A0=95=EC=A0=81=20?= =?UTF-8?q?=EB=8D=B0=EC=9D=B4=ED=84=B0=20=EC=8A=A4=ED=86=A0=EB=A6=AC?= =?UTF-8?q?=EC=A7=80=ED=99=94=20+=20=EB=A7=A4=20=ED=8B=B1=20=EA=B2=8C?= =?UTF-8?q?=EC=9D=B4=ED=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 무대 한정 코드 제거: repeat/map/ (트리/조명), images/image_custom (파이브가이즈), load.mcfunction의 map 스코어보드·fill·counter 초기화 - 매 틱 디스패치를 init 상태로 게이팅: · timer는 init>=2, check_answer는 init in {5,6}에서만 호출 · idle(init=0) 틱의 함수 호출 8개 → 4개 - 곡 50개를 매크로 체인(250+ 명령/회) → 스토리지 리스트 O(1) 룩업으로 전환 mq:init/songs가 mq:main.songs를 적재, setanswer는 index-1로 인덱스 룩업 - 버튼/트리거 정의를 mq:init/buttons / mq:init/triggers로 분리해 mq:main.button_defs · trigger_defs 스토리지 리스트로 관리 - repeat/triggers/trigger.mcfunction: 투표 후처리 산술 블록 중 변하지 않는 max_player·rest_player 재계산 제거, $(n)_player 갱신만 1라인 - 작가용 메모 수정.txt 제거 - README.md: 변경 사항·새 구조·스토리지 스키마 반영 566 lines -, 154 lines +. Co-Authored-By: Claude Opus 4.7 --- README.md | 195 +++++++---- .../function/images/image_custom.mcfunction | 6 - .../data/mq/function/init/buttons.mcfunction | 7 + .../data/mq/function/init/songs.mcfunction | 51 +++ .../data/mq/function/init/triggers.mcfunction | 5 + music_quiz/data/mq/function/load.mcfunction | 10 +- .../function/quiz/macro/setanswer.mcfunction | 9 +- .../mq/function/quiz/setanswer.mcfunction | 304 +----------------- .../repeat/buttons/handler.mcfunction | 54 +--- .../mq/function/repeat/map/lamp1.mcfunction | 22 -- .../repeat/map/macro/lamp1.mcfunction | 4 - .../mq/function/repeat/map/tree.mcfunction | 60 ---- .../repeat/triggers/handler.mcfunction | 24 +- .../repeat/triggers/trigger.mcfunction | 5 - music_quiz/data/mq/function/tick.mcfunction | 8 +- music_quiz/data/mq/수정.txt | 9 - 16 files changed, 212 insertions(+), 561 deletions(-) delete mode 100644 music_quiz/data/mq/function/images/image_custom.mcfunction create mode 100644 music_quiz/data/mq/function/init/buttons.mcfunction create mode 100644 music_quiz/data/mq/function/init/songs.mcfunction create mode 100644 music_quiz/data/mq/function/init/triggers.mcfunction delete mode 100644 music_quiz/data/mq/function/repeat/map/lamp1.mcfunction delete mode 100644 music_quiz/data/mq/function/repeat/map/macro/lamp1.mcfunction delete mode 100644 music_quiz/data/mq/function/repeat/map/tree.mcfunction delete mode 100644 music_quiz/data/mq/수정.txt diff --git a/README.md b/README.md index c052491..3385286 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ ### 호환 버전 -- **Minecraft 26.1.2** (pack_format `75`) 기준으로 작성되어 있다. +- **Minecraft 26.1.2** (pack_format `75`) 기준. - 1.21.6에서 도입된 `dialog` 시스템, 1.21+의 단수형 `function/` 태그 폴더, 매크로 함수(`function ... with storage`) 기능을 사용한다. - 텍스트 컴포넌트는 JSON 표기로 작성돼 있으며, 1.21.5 이후의 SNBT 파서와도 @@ -42,12 +42,14 @@ | `0` | 정지/대기 (기본 상태) | | `1` | 게임 시작 — page1 대화창에서 `ready` 트리거 대기 | | `2` | 카운트다운 (3·2·1) | +| `4` | 곡 셋업 (한 틱 사이) | | `5` | 곡 재생 + 정답 입력 단계 | | `6` | 정답 공개·점수 부여 | | `10` | 엔딩 시퀀스 | -`status` 스코어보드의 `timer`는 매 틱 증가하는 카운터로, -`mq:repeat/timer`가 이를 보고 상태 전이를 처리한다. +`main` 스코어보드의 `timer`는 활성 상태에서만 증가하는 카운터로, +`mq:repeat/timer`가 이를 보고 상태 전이를 처리한다. 매 틱 디스패치는 +`init` 값에 따라 게이팅된다. ### 트리거 명령 @@ -58,17 +60,18 @@ - `trigger cancel` — 시작 취소 - `trigger stop` — 다수결 종료 - `trigger skip` — 다수결 스킵 (현재 곡 패스) -- `trigger hint` — 다수결 힌트 요청 +- `trigger hint` — 다수결 힌트 요청 (자음 절반 가리기 — `func:hint`) - `trigger replay` — 다수결 다시 듣기 스킵/힌트/리플레이는 `mq:repeat/triggers/trigger` 매크로 안에서 -`max_player = ceil(전체/2)` 다수결 계산을 거친 뒤 실행된다. +`max_player = ceil(전체/2)` 다수결 계산을 거친 뒤 실행된다. 트리거 +정의 자체는 `mq:init/triggers`에서 storage 리스트로 관리된다. ### 입력 버튼 -관리자가 사용하는 6개의 물리 스톤 버튼이 좌표 `144 62 -225` 근처 -오크 통나무 위에 배치된다. `mq:repeat/buttons/handler`가 매 틱 상태를 -점검하고, 각 버튼에 대응하는 `mq:commands/*`를 호출한다. +관리자가 사용하는 6개의 물리 스톤 버튼. 좌표·표면 방향·실행 명령은 +`mq:init/buttons`에서 storage 리스트(`mq:main button_defs`)로 관리되며, +`mq:repeat/buttons/handler`가 매 틱 storage 인덱스로 `btn` 매크로를 호출한다. - `start` / `stop` / `skip` / `hint` / `replay` / `test` @@ -84,59 +87,68 @@ music_quiz/ ├── minecraft/tags/function/ │ ├── load.json # → mq:load │ └── tick.json # → mq:tick - ├── func/function/ # 공용 유틸 (text_list / half / shuffle 등) + ├── func/function/ # 공용 헬퍼 (length/half/shuffle/text_list/join…) + │ ─ mq:commands/hint에서 사용 └── mq/ ├── function/ - │ ├── load.mcfunction # 스코어보드·storage 초기화 - │ ├── tick.mcfunction # 매 틱 서브함수 디스패치 - │ ├── tellraw.mcfunction # 매크로 prefix 메시지 헬퍼 + │ ├── load.mcfunction # 스코어보드·storage 초기화, init/* 호출 + │ ├── tick.mcfunction # 매 틱 서브함수 디스패치 (init 게이팅) + │ ├── tellraw.mcfunction # 매크로 prefix 메시지 헬퍼 + │ ├── init/ # 정적 데이터를 storage 로 적재 + │ │ ├── songs.mcfunction # mq:main songs 리스트 + │ │ ├── buttons.mcfunction # mq:main button_defs 리스트 + │ │ └── triggers.mcfunction # mq:main trigger_defs 리스트 │ ├── check/server.mcfunction # YP / TS 설치 확인 │ ├── commands/ # start·stop·skip·hint·replay·test - │ ├── quiz/ # 게임 진행 로직 (start·select·play·correct·end·setanswer) - │ │ └── macro/ # 매크로 진입점 (summon·setanswer·command_block …) + │ ├── quiz/ # 게임 진행 로직 + │ │ ├── start·select·play·correct·end·setanswer.mcfunction + │ │ └── macro/ # 매크로 진입점 (summon·setanswer·command_block) │ ├── repeat/ # tick에서 호출되는 매 틱 처리 - │ │ ├── players.mcfunction - │ │ ├── check_answer.mcfunction - │ │ ├── timer.mcfunction - │ │ ├── check_server.mcfunction + │ │ ├── players·check_answer·timer·check_server.mcfunction │ │ ├── buttons/{handler,btn}.mcfunction - │ │ ├── triggers/{handler,trigger}.mcfunction - │ │ └── map/{tree,lamp1,…} # 무대 조명 애니메이션 - │ ├── players/login.mcfunction # 접속 처리 (어드밴스먼트 보상으로 호출) - │ └── images/ # 이미지 표시 (TS 플러그인 호출) - ├── dialog/page{1,2,3}.json # confirmation 다이얼로그 - └── advancement/player/login.json # 접속 트리거 + │ │ └── triggers/{handler,trigger}.mcfunction + │ ├── players/login.mcfunction + │ └── images/{image,image_set,image_delete}.mcfunction + ├── dialog/page{1,2,3}.json + └── advancement/player/login.json ``` ### 사용 스코어보드 / 스토리지 -- `main` — 게임 핵심 상태 (`init`, `index`, `max_index`, `timer`, `score`) +스코어보드: + +- `main` — 게임 핵심 상태 (`init`, `index`, `max_index`, `timer`, `score`, `song_idx`) - `status` — 외부 의존(YP·TS·Skript) 및 글로벌 타이머 - `buttons` — 물리 버튼 상태 머신 - `answer` — 플레이어별 정답 입력값 (`1`=정답, `2`=오답) -- `map` — 무대 조명/장식 애니메이션 카운터 -- `func.temp` — 산술용 임시 상수(`two=2` 등) +- `func.temp` — 산술용 임시 상수 (`two=2` 등) - `leave_game` — `custom:leave_game` 통계 (재접속 감지) - `score` — 사이드바 표시용 점수 - `ready` / `cancel` / `stop` / `skip` / `hint` / `replay` — 플레이어 트리거 스토리지: -- `mq:main` — 게임 전역 설정 (`title`, `max_index`, `answer`, - `command_block`(좌표·볼륨), `spawn`) -- `func:temp` — 유틸 함수용 임시 NBT +- `mq:main` — 게임 전역 데이터 + - `title`, `max_index`, `spawn` — 설정 + - `answer` = `{title, author, alias}` — 현재 곡 정답 + - `command_block` — 명령 블록 좌표/볼륨, 이미지 표시 영역, 작업용 alias 사본 + - `songs` — 곡 목록 (`mq:init/songs` 가 채움) + - `button_defs` — 버튼 정의 (`mq:init/buttons` 가 채움) + - `trigger_defs` — 트리거 정의 (`mq:init/triggers` 가 채움) +- `mq:tmp` — setanswer 룩업용 임시 인덱스 +- `func:temp` — `func:` 헬퍼 함수용 임시 NBT ### 곡 목록 수정 -곡은 `data/mq/function/quiz/setanswer.mcfunction`에 50곡이 -하드코딩돼 있다. 형식: +곡은 `data/mq/function/init/songs.mcfunction` 한 파일에 정의된다. +한 줄에 한 곡씩, 리스트로 append 한다: ``` -function mq:quiz/macro/setanswer { index: , title: "<제목>", author: "<가수>", alias: ["<별칭1>","<별칭2>"] } +data modify storage mq:main songs append value {title:"...", author:"...", alias:["...","..."]} ``` -`alias` 배열에 적은 문자열은 정답 판정에서 동의어로 인식된다. -곡을 늘리거나 줄이면 `mq:function/load.mcfunction`의 +곡 순서가 게임 내 순서이며, `alias` 배열에 적은 문자열은 정답 판정에서 +동의어로 인식된다. 곡 수를 늘리거나 줄이면 `mq:function/load.mcfunction`의 `max_index` 기본값(50)도 함께 맞추는 것이 좋다. ### 설치 @@ -144,55 +156,96 @@ function mq:quiz/macro/setanswer { index: , title: "<제목>", author: "<가 1. 서버 월드 폴더 `datapacks/`에 `music_quiz/` 디렉터리째 복사. 2. YP, TS 플러그인 설치 확인. 3. 서버 `/reload` — 리로드 성공 메시지가 채팅에 표시되면 정상. -4. 좌표 `144, 62, -225` 부근에 6개 버튼 영역과 무대 구조물(트리 램프 등)이 - 자동 생성된다. +4. 좌표 `144, 62, -225` 부근에 6개 버튼이 자동 배치된다. 5. `start` 버튼을 눌러 게임 시작. ### 좌표 의존성 (주의) -다음 좌표가 데이터팩 안에 직접 박혀 있어, 다른 월드에서 그대로 -사용하려면 코드를 수정해야 한다: +다음 좌표가 데이터팩 안에 박혀 있어, 다른 월드에서 그대로 사용하려면 +값을 바꿔야 한다: -- 명령 블록: `144 59 -219` -- 플레이어 스폰: `144 61 -219` (`yaw 180`) -- 무대 조명 (`map/tree`): `142, 66/70/74/78/81`, z `-186..-196` -- 무대 조명 (`map/lamp1`): y `78`, z `-279`, x `94..194` -- 이미지 표시 영역: `131 77 -262` ~ `157 91 -262` -- 버튼/장식 영역: `144 62 -225` 부근 +- 명령 블록: `144 59 -219` — `mq:load` 의 `command_block` 초기값 +- 플레이어 스폰: `144 61 -219` (`yaw 180`) — `mq:load` 의 `spawn` 초기값 +- 버튼 좌표: `140..148, 62, -225` / `144, 62, -213` — `mq:init/buttons` +- 이미지 표시 영역: `131 77 -262` ~ `157 91 -262` — `mq:load` 의 `command_block.x1..z2` --- -## 26.1.2 호환을 위해 적용한 변경 +## 변경 이력 -이전 푸시본(`6841b7a 이전퀴즈 데이터팩`)을 26.1.2 기준으로 정비하면서 -다음을 적용했다: +### 2026-05-13 — 26.1.2 호환 + 1차 정리 (`b1babad`) -1. **`pack_format` 69 → 75** - `music_quiz/pack.mcmeta`를 26.1.2(=1.21.11 계열)에 맞게 갱신했다. -2. **사문화된 디버그 출력 제거** - - `mq:load`, `mq:players/login`, `mq:commands/start`, `mq:commands/stop`, - `mq:quiz/start`, `mq:quiz/end`에 남아 있던 `# say ...` 주석 라인 제거. - - `mq:repeat/buttons/btn`에서 매 틱 모든 버튼마다 평가되던 - `# $execute ... say "$(n) 눌러짐"` 주석 라인 제거. - - `mq:quiz/end`의 `# stopsound @a weather` 주석 라인 제거. -3. **호환성 점검 — 코드 변경 없이 26.1.2에서도 동작하는 항목** - - `dialog show @a mq:page` 호출 및 `dialog clear @a` (1.21.6+) - - `function ... with storage` 매크로 (1.20.2+, 26.1.x에서도 그대로 동작) - - `function/` 단수형 태그 디렉터리 (1.21+ 표준) - - `tellraw`/`title`/`bossbar`/`scoreboard` JSON 텍스트 컴포넌트 - (1.21.5의 SNBT 전환에서 JSON 문법이 SNBT의 부분집합이므로 그대로 유효) - - `minecraft:interaction` 엔티티의 `attack`/`response` 데이터 접근 - - `custom:leave_game` 통계 — 명칭/네임스페이스 변경 없음 +이전 푸시본(`6841b7a 이전퀴즈 데이터팩`)을 26.1.2 기준으로 정비. -### 다듬지 않고 남겨둔 부분 +- `pack_format` 69 → 75 (MC 26.1.2 / 1.21.11) +- `mq:load`, `mq:players/login`, `mq:commands/start`, `mq:commands/stop`, + `mq:quiz/start`, `mq:quiz/end`, `mq:repeat/buttons/btn` 등에 남아 있던 + `# say ...` / `# stopsound` 사문화 디버그 주석 제거 -리뷰 중 다음 항목은 **의도된 동작**으로 판단해 손대지 않았다. +### 2026-05-13 — 무대 의존 제거 + 최적화 (이번 커밋) -- `mq:repeat/triggers/trigger`의 산술 블록이 두 번 등장하는 구조 — - 중간에 투표 점수가 갱신되므로 재계산이 필요하며, 묶어버리면 - `max_player = ceil(N/2)` 다수결 판정이 한 틱 뒤로 밀린다. -- `mq:commands/test`의 3중 `playsound` 호출 — 음량 강조를 위한 의도. -- `mq:quiz/play`의 `auto 1b` → `0b` 토글 두 줄 — 명령 블록 강제 재발화 패턴. +특정 맵 좌표에만 동작하던 장식 로직을 들어내고, 매 틱 부하와 정적 +데이터 관리를 정비했다. + +#### 삭제 (특정 맵 한정) + +- `repeat/map/` 디렉터리 통째 — 무대 트리/조명 애니메이션 (`tree`, `lamp1`) +- `images/image_custom.mcfunction` — 파이브가이즈 간판 (호출자 없음) +- `data/mq/수정.txt` — 작가용 TODO 메모 +- `load.mcfunction`의 `map` 스코어보드 초기화, `tree map -1`, `lamp1 map -1`, + `fill 94 78 -279 194 78 -279 minecraft:red_wool` +- `tick.mcfunction`의 `function mq:repeat/map/tree`, `function mq:repeat/map/lamp1` + +#### 매 틱 부하 감소 + +- `tick.mcfunction` 디스패치를 `init` 상태로 게이팅: + - `repeat/timer` 는 `init >= 2` 일 때만 + - `repeat/check_answer` 는 `init in {5, 6}` 일 때만 + - `check_server` / `players` / `buttons/handler` / `triggers/handler` 는 + 항상 호출 (게임 비활성 상태에서도 시작 버튼·로그인 처리 필요) +- idle 틱(`init=0`)에서 함수 호출 8개 → 4개. 정답 스캔과 카운트다운 reset + 로직이 빠진다. + +#### 곡 관리 단순화 + +기존: `quiz/setanswer.mcfunction` 안에 50곡의 `function mq:quiz/macro/setanswer { index:N, title:..., author:..., alias:... }` 가 +나열돼 있어, 매번 50개 매크로 호출 × 5라인 (`if score index matches N` +가드 포함) = 약 250 명령이 평가됐다. + +변경: + +- 곡 데이터를 `mq:init/songs` 에서 `mq:main.songs` 리스트로 한 번 적재 +- `quiz/setanswer.mcfunction` 은 `index - 1` 을 계산해 `mq:tmp.idx` 에 저장 +- `quiz/macro/setanswer.mcfunction` 은 매크로 한 줄로 룩업: + `data modify storage mq:main answer set from storage mq:main songs[$(idx)]` +- 호출당 3 라인의 storage 복사로 끝남 (50× → O(1)) + +#### 버튼/트리거 정의 분리 + +- 버튼 6개의 좌표·실행 명령을 `mq:init/buttons` 에서 `mq:main.button_defs` + 리스트로 적재. `repeat/buttons/handler` 는 인덱스로 매크로 호출만 한다. +- 트리거 4개(stop/skip/hint/replay)도 동일하게 `mq:init/triggers` → + `mq:main.trigger_defs` 로 분리. +- 버튼/트리거를 추가·제거할 때 `repeat/*/handler` 가 아닌 `init/*` 만 + 편집하면 된다. + +#### 다수결 산술 dedup + +`repeat/triggers/trigger.mcfunction` 에서 투표 갱신 전후로 `real_max_player`, +`rest_player`, `max_player` 를 두 번 계산했다. 이 값들은 (참가자 수에만 +의존하므로) 한 틱 안에서 바뀌지 않는다. 갱신되는 것은 `$(n)_player` +(투표 수)뿐이라 — 후처리 블록은 `$(n)_player` 재계산 한 줄로 축약. +트리거당 5 라인 절감 × 4 트리거. + +#### 다듬지 않은 부분 (의도된 동작) + +- `mq:commands/test` 및 `mq:repeat/timer` 의 3중 `playsound` — 음량 강조용 + 스택 호출. +- `mq:quiz/play` 의 `auto 1b` → `0b` 토글 두 줄 — 명령 블록 강제 재발화 + 패턴. +- `mq:repeat/buttons/btn` 내부 상태머신 — 상태 -2/-1/0/1/2 전이 의미가 + 엮여 있어 라인 단축 시 디바운스가 깨질 위험이 있어 유지. +- `func:` 헬퍼는 `mq:commands/hint` 가 사용 중이므로 유지. --- diff --git a/music_quiz/data/mq/function/images/image_custom.mcfunction b/music_quiz/data/mq/function/images/image_custom.mcfunction deleted file mode 100644 index c125c3e..0000000 --- a/music_quiz/data/mq/function/images/image_custom.mcfunction +++ /dev/null @@ -1,6 +0,0 @@ -# r = EAST | NORTH | SOUTH | WEST - -# 파이브가이즈 간판 -data modify storage mq:main command_block.image set value "ts placeloc fiveguys1.png world EAST 90 72 -168 90 73 -170 1 솔리드스킵" - -function mq:images/image_set with storage mq:main command_block diff --git a/music_quiz/data/mq/function/init/buttons.mcfunction b/music_quiz/data/mq/function/init/buttons.mcfunction new file mode 100644 index 0000000..5b7f752 --- /dev/null +++ b/music_quiz/data/mq/function/init/buttons.mcfunction @@ -0,0 +1,7 @@ +data modify storage mq:main button_defs set value [] +data modify storage mq:main button_defs append value {n:"start", x:140, y:62, z:-225, f:"south", c:"function mq:commands/start with storage mq:main"} +data modify storage mq:main button_defs append value {n:"stop", x:142, y:62, z:-225, f:"south", c:"function mq:commands/stop with storage mq:main"} +data modify storage mq:main button_defs append value {n:"skip", x:144, y:62, z:-225, f:"south", c:"function mq:commands/skip"} +data modify storage mq:main button_defs append value {n:"hint", x:146, y:62, z:-225, f:"south", c:"function mq:commands/hint"} +data modify storage mq:main button_defs append value {n:"replay", x:148, y:62, z:-225, f:"south", c:"function mq:commands/replay"} +data modify storage mq:main button_defs append value {n:"test", x:144, y:62, z:-213, f:"north", c:"function mq:commands/test"} diff --git a/music_quiz/data/mq/function/init/songs.mcfunction b/music_quiz/data/mq/function/init/songs.mcfunction new file mode 100644 index 0000000..a0851fb --- /dev/null +++ b/music_quiz/data/mq/function/init/songs.mcfunction @@ -0,0 +1,51 @@ +data modify storage mq:main songs set value [] +data modify storage mq:main songs append value {title:"Lose My Mind", author:"Don Toliver", alias:["루즈 마이 마인드","루스 마이 마인드","ㅣㅐㄴㄷ ㅡㅛ ㅡㅑㅜㅇ"]} +data modify storage mq:main songs append value {title:"The Chase", author:"Hearts2Hearts", alias:["더 체이즈","더 체이스","솓 촘ㄴㄷ"]} +data modify storage mq:main songs append value {title:"HOT SAUCE", author:"BABYMONSTER", alias:["핫 소스","ㅙㅅ ㄴ면ㄷ"]} +data modify storage mq:main songs append value {title:"Golden", author:"HUNTR/X", alias:["골든"," 해ㅣㅇ두"]} +data modify storage mq:main songs append value {title:"돌림판", author:"머쉬베놈", alias:["Spin the wheel"]} +data modify storage mq:main songs append value {title:"OVERDRIVE", author:"TWS", alias:["오버드라이브","ㅐㅍㄷㄱㅇ걒ㄷ"]} +data modify storage mq:main songs append value {title:"눈물참기", author:"QWER", alias:[]} +data modify storage mq:main songs append value {title:"깨어", author:"tripleS", alias:[]} +data modify storage mq:main songs append value {title:"like JENNIE", author:"제니", alias:["라이크 제니","라익 제니","라잌 제니","ㅣㅑㅏㄷ ㅓ두ㅜㅑㄷ"]} +data modify storage mq:main songs append value {title:"Rich Man", author:"aespa", alias:["리치 맨","갸초 ㅡ무"]} +data modify storage mq:main songs append value {title:"I DO ME", author:"KiiiKiii", alias:["아이 두 미","아 두 미","ㅑ 애 ㅡㄷ"]} +data modify storage mq:main songs append value {title:"SIGN", author:"izna", alias:["사인","냐후"]} +data modify storage mq:main songs append value {title:"WICKED", author:"ALLDAY PROJECT", alias:["위키드","쟈찯ㅇ"]} +data modify storage mq:main songs append value {title:"Good Thing", author:"i-dle", alias:["굿 띵","굳 띵","해ㅐㅇ 소ㅑㅜㅎ"]} +data modify storage mq:main songs append value {title:"0+0", author:"한로로", alias:[]} +data modify storage mq:main songs append value {title:"HANDS UP", author:"MEOVV", alias:["핸즈 업","핸스 업","ㅗ뭉ㄴ ㅕㅔ"]} +data modify storage mq:main songs append value {title:"Blue Valentine", author:"NMIXX", alias:["블루 발렌타인","ㅠㅣㅕㄷ ㅍ미두샤ㅜㄷ"]} +data modify storage mq:main songs append value {title:"Flower", author:"오반", alias:["플라워","리ㅐㅈㄷㄱ"]} +data modify storage mq:main songs append value {title:"Soda Pop", author:"Saja Boys", alias:["소다 팝","냉ㅁ ㅔㅐㅔ"]} +data modify storage mq:main songs append value {title:"REBEL HEART", author:"IVE", alias:["레블 하트","ㄱ듀디 ㅗㄷㅁㄳ"]} +data modify storage mq:main songs append value {title:"GO!", author:"CORTIS", alias:["고","고!","GO","해","해!"]} +data modify storage mq:main songs append value {title:"BEEP", author:"izna", alias:["빕","삡","ㅠㄷ데"]} +data modify storage mq:main songs append value {title:"Pookie", author:"FIFTY FIFTY", alias:["푸키","ㅔㅐㅐㅏㅑㄷ"]} +data modify storage mq:main songs append value {title:"DAISIES", author:"Justin Bieber", alias:["데이지즈","데이지스","ㅇ먀냗ㄴ"]} +data modify storage mq:main songs append value {title:"빌려온 고양이", author:"ILLIT", alias:[]} +data modify storage mq:main songs append value {title:"TOO BAD", author:"OfficialGDRAGON", alias:["투 배드","투 밷","새ㅐ ㅠㅁㅇ"]} +data modify storage mq:main songs append value {title:"시작의 아이", author:"마크툽", alias:[]} +data modify storage mq:main songs append value {title:"STYLE", author:"Hearts2Hearts", alias:["스타일","ㄴ쇼ㅣㄷ"]} +data modify storage mq:main songs append value {title:"Good Goodbye", author:"화사", alias:["굿 굿바이","굳 굳바이","해ㅐㅇ 해ㅐ유ㅛㄷ"]} +data modify storage mq:main songs append value {title:"너에게 닿기를", author:"10CM", alias:[]} +data modify storage mq:main songs append value {title:"IRIS OUT", author:"Kenshi Yonezu", alias:["아이리스 아웃","이리스 아웃","ㅑ갼 ㅐㅕㅅ"]} +data modify storage mq:main songs append value {title:"Sugar On My Tongue", author:"Tyler, The Creator", alias:["슈가 온 마이 텅","슈가 온 마 텅","녛ㅁㄱ ㅐㅜ ㅡㅛ 새ㅜ혇"]} +data modify storage mq:main songs append value {title:"Hollywood Action", author:"BOYNEXTDOOR", alias:["할리우드 액션","ㅙㅣㅣㅛ재ㅐㅇ ㅁㅊ샤ㅐㅜ"]} +data modify storage mq:main songs append value {title:"SPAGHETTI", author:"LE SSERAFIM", alias:["스파게티","넴혿ㅅ시"]} +data modify storage mq:main songs append value {title:"Gabriela", author:"KATSEYE", alias:["가브리엘라","ㅎ뮤갸딤"]} +data modify storage mq:main songs append value {title:"LIKE YOU BETTER", author:"프로미스나인", alias:["라이크 유 베터","라이크 유 베럴","라잌 유 베터","라잌 유 베럴","ㅣㅑㅏㄷ ㅛㅐㅕ ㅠㄷㅅㅅㄷㄱ"]} +data modify storage mq:main songs append value {title:"뛰어", author:"BLACKPINK", alias:["jump"]} +data modify storage mq:main songs append value {title:"CHANEL", author:"Tyla", alias:["샤넬","초무디"]} +data modify storage mq:main songs append value {title:"오늘만 I LOVE YOU", author:"BOYNEXTDOOR", alias:["오늘만 아이 러브 유","오늘만 ㅑ ㅣㅐㅍㄷ ㅛㅐㅕ"]} +data modify storage mq:main songs append value {title:"earthquake", author:"지수", alias:["어스퀘이크","얼스퀘이크","ㄷㅁㄱ소벼맏","보만다 지진"]} +data modify storage mq:main songs append value {title:"윽!", author:"염따", alias:["윽"]} +data modify storage mq:main songs append value {title:"Abracadabra", author:"Lady Gaga", alias:["아브라카다브라","뮥ㅁㅊㅁㅇ뮥ㅁ"]} +data modify storage mq:main songs append value {title:"멸종위기사랑", author:"이찬혁", alias:[]} +data modify storage mq:main songs append value {title:"Dirty Work", author:"aespa", alias:["더티 워크","덜티 워크","더티 월크","덜티 월크","약쇼 재가"]} +data modify storage mq:main songs append value {title:"HOT", author:"LE SSERAFIM", alias:["핫","ㅙㅅ"]} +data modify storage mq:main songs append value {title:"FAMOUS", author:"ALLDAY PROJECT", alias:["페이머스","ㄹ므ㅐㅕㄴ"]} +data modify storage mq:main songs append value {title:"XOXZ", author:"IVE", alias:["엑스 오 엑스 지","엑스 오 엑스 제트","탵ㅋ"]} +data modify storage mq:main songs append value {title:"여름이었다", author:"H1-KEY", alias:[]} +data modify storage mq:main songs append value {title:"LOV3", author:"식케이", alias:["럽3","ㅣㅐㅍ3"]} +data modify storage mq:main songs append value {title:"Drive", author:"Ed Sheeran", alias:["드라이브","ㅇ걒ㄷ"]} diff --git a/music_quiz/data/mq/function/init/triggers.mcfunction b/music_quiz/data/mq/function/init/triggers.mcfunction new file mode 100644 index 0000000..788b27e --- /dev/null +++ b/music_quiz/data/mq/function/init/triggers.mcfunction @@ -0,0 +1,5 @@ +data modify storage mq:main trigger_defs set value [] +data modify storage mq:main trigger_defs append value {n:"stop", n2:"중지", c:"function mq:commands/stop with storage mq:main"} +data modify storage mq:main trigger_defs append value {n:"skip", n2:"스킵", c:"function mq:commands/skip"} +data modify storage mq:main trigger_defs append value {n:"hint", n2:"힌트", c:"function mq:commands/hint"} +data modify storage mq:main trigger_defs append value {n:"replay", n2:"다시재생", c:"function mq:commands/replay"} diff --git a/music_quiz/data/mq/function/load.mcfunction b/music_quiz/data/mq/function/load.mcfunction index f0ba0d3..41b3888 100644 --- a/music_quiz/data/mq/function/load.mcfunction +++ b/music_quiz/data/mq/function/load.mcfunction @@ -30,11 +30,15 @@ data merge storage mq:main { \ } \ } data merge storage func:temp {} +data merge storage mq:tmp {} + +function mq:init/songs +function mq:init/buttons +function mq:init/triggers scoreboard objectives remove func.temp scoreboard objectives remove status scoreboard objectives remove main -scoreboard objectives remove map scoreboard objectives remove buttons scoreboard objectives remove answer scoreboard objectives remove leave_game @@ -42,7 +46,6 @@ scoreboard objectives remove leave_game scoreboard objectives add func.temp dummy scoreboard objectives add status dummy scoreboard objectives add main dummy -scoreboard objectives add map dummy scoreboard objectives add buttons dummy scoreboard objectives add answer dummy scoreboard objectives add leave_game custom:leave_game @@ -53,9 +56,6 @@ scoreboard players set yp status 0 scoreboard players set ts status 0 scoreboard players set two func.temp 2 -scoreboard players set tree map -1 -fill 94 78 -279 194 78 -279 minecraft:red_wool -scoreboard players set lamp1 map -1 bossbar add mq:process [{"text":"진행도: ","color": "yellow","bold": true},{"text":"0","color": "yellow","bold": true},{"text":"/","color": "yellow","bold": true},{"text":"0","color": "yellow","bold": true}] diff --git a/music_quiz/data/mq/function/quiz/macro/setanswer.mcfunction b/music_quiz/data/mq/function/quiz/macro/setanswer.mcfunction index f7feac4..11c1bc2 100644 --- a/music_quiz/data/mq/function/quiz/macro/setanswer.mcfunction +++ b/music_quiz/data/mq/function/quiz/macro/setanswer.mcfunction @@ -1,6 +1,3 @@ -$execute if score index main matches $(index) run data modify storage mq:main answer.author set value "$(author)" -$execute if score index main matches $(index) run data modify storage mq:main command_block.name set value "$(title)" -$execute if score index main matches $(index) run data modify storage mq:main command_block.alias set value $(alias) - -data modify storage mq:main answer.title set from storage mq:main command_block.name -data modify storage mq:main answer.alias set from storage mq:main command_block.alias +$data modify storage mq:main answer set from storage mq:main songs[$(idx)] +$data modify storage mq:main command_block.name set from storage mq:main songs[$(idx)].title +$data modify storage mq:main command_block.alias set from storage mq:main songs[$(idx)].alias diff --git a/music_quiz/data/mq/function/quiz/setanswer.mcfunction b/music_quiz/data/mq/function/quiz/setanswer.mcfunction index 175de8a..e51148d 100644 --- a/music_quiz/data/mq/function/quiz/setanswer.mcfunction +++ b/music_quiz/data/mq/function/quiz/setanswer.mcfunction @@ -1,304 +1,8 @@ -function mq:quiz/macro/setanswer { \ - index: 1, \ - title: "Lose My Mind", \ - author: "Don Toliver", \ - alias: ["루즈 마이 마인드","루스 마이 마인드", "ㅣㅐㄴㄷ ㅡㅛ ㅡㅑㅜㅇ"] \ -} -function mq:quiz/macro/setanswer { \ - index: 2, \ - title: "The Chase", \ - author: "Hearts2Hearts", \ - alias: ["더 체이즈", "더 체이스", "솓 촘ㄴㄷ"] \ -} -function mq:quiz/macro/setanswer { \ - index: 3, \ - title: "HOT SAUCE", \ - author: "BABYMONSTER", \ - alias: ["핫 소스", "ㅙㅅ ㄴ면ㄷ"] \ -} -function mq:quiz/macro/setanswer { \ - index: 4, \ - title: "Golden", \ - author: "HUNTR/X", \ - alias: ["골든"," 해ㅣㅇ두"] \ -} -function mq:quiz/macro/setanswer { \ - index: 5, \ - title: "돌림판", \ - author: "머쉬베놈", \ - alias: ["Spin the wheel"] \ -} -function mq:quiz/macro/setanswer { \ - index: 6, \ - title: "OVERDRIVE", \ - author: "TWS", \ - alias: ["오버드라이브", "ㅐㅍㄷㄱㅇ걒ㄷ"] \ -} -function mq:quiz/macro/setanswer { \ - index: 7, \ - title: "눈물참기", \ - author: "QWER", \ - alias: [] \ -} -function mq:quiz/macro/setanswer { \ - index: 8, \ - title: "깨어", \ - author: "tripleS", \ - alias: [] \ -} -function mq:quiz/macro/setanswer { \ - index: 9, \ - title: "like JENNIE", \ - author: "제니", \ - alias: ["라이크 제니", "라익 제니", "라잌 제니", "ㅣㅑㅏㄷ ㅓ두ㅜㅑㄷ"] \ -} -function mq:quiz/macro/setanswer { \ - index: 10, \ - title: "Rich Man", \ - author: "aespa", \ - alias: ["리치 맨", "갸초 ㅡ무"] \ -} -function mq:quiz/macro/setanswer { \ - index: 11, \ - title: "I DO ME", \ - author: "KiiiKiii", \ - alias: ["아이 두 미", "아 두 미", "ㅑ 애 ㅡㄷ"] \ -} -function mq:quiz/macro/setanswer { \ - index: 12, \ - title: "SIGN", \ - author: "izna", \ - alias: ["사인", "냐후"] \ -} -function mq:quiz/macro/setanswer { \ - index: 13, \ - title: "WICKED", \ - author: "ALLDAY PROJECT", \ - alias: ["위키드", "쟈찯ㅇ"] \ -} -function mq:quiz/macro/setanswer { \ - index: 14, \ - title: "Good Thing", \ - author: "i-dle", \ - alias: ["굿 띵", "굳 띵", "해ㅐㅇ 소ㅑㅜㅎ"] \ -} -function mq:quiz/macro/setanswer { \ - index: 15, \ - title: "0+0", \ - author: "한로로", \ - alias: [] \ -} -function mq:quiz/macro/setanswer { \ - index: 16, \ - title: "HANDS UP", \ - author: "MEOVV", \ - alias: ["핸즈 업", "핸스 업", "ㅗ뭉ㄴ ㅕㅔ"] \ -} -function mq:quiz/macro/setanswer { \ - index: 17, \ - title: "Blue Valentine", \ - author: "NMIXX", \ - alias: ["블루 발렌타인", "ㅠㅣㅕㄷ ㅍ미두샤ㅜㄷ"] \ -} -function mq:quiz/macro/setanswer { \ - index: 18, \ - title: "Flower", \ - author: "오반", \ - alias: ["플라워", "리ㅐㅈㄷㄱ"] \ -} -function mq:quiz/macro/setanswer { \ - index: 19, \ - title: "Soda Pop", \ - author: "Saja Boys", \ - alias: ["소다 팝", "냉ㅁ ㅔㅐㅔ"] \ -} -function mq:quiz/macro/setanswer { \ - index: 20, \ - title: "REBEL HEART", \ - author: "IVE", \ - alias: ["레블 하트", "ㄱ듀디 ㅗㄷㅁㄳ"] \ -} -function mq:quiz/macro/setanswer { \ - index: 21, \ - title: "GO!", \ - author: "CORTIS", \ - alias: ["고", "고!", "GO", "해", "해!"] \ -} -function mq:quiz/macro/setanswer { \ - index: 22, \ - title: "BEEP", \ - author: "izna", \ - alias: ["빕", "삡", "ㅠㄷ데"] \ -} -function mq:quiz/macro/setanswer { \ - index: 23, \ - title: "Pookie", \ - author: "FIFTY FIFTY", \ - alias: ["푸키", "ㅔㅐㅐㅏㅑㄷ"] \ -} -function mq:quiz/macro/setanswer { \ - index: 24, \ - title: "DAISIES", \ - author: "Justin Bieber", \ - alias: ["데이지즈", "데이지스", "ㅇ먀냗ㄴ"] \ -} -function mq:quiz/macro/setanswer { \ - index: 25, \ - title: "빌려온 고양이", \ - author: "ILLIT", \ - alias: [] \ -} -function mq:quiz/macro/setanswer { \ - index: 26, \ - title: "TOO BAD", \ - author: "OfficialGDRAGON", \ - alias: ["투 배드", "투 밷", "새ㅐ ㅠㅁㅇ"] \ -} -function mq:quiz/macro/setanswer { \ - index: 27, \ - title: "시작의 아이", \ - author: "마크툽", \ - alias: [] \ -} -function mq:quiz/macro/setanswer { \ - index: 28, \ - title: "STYLE", \ - author: "Hearts2Hearts", \ - alias: ["스타일", "ㄴ쇼ㅣㄷ"] \ -} -function mq:quiz/macro/setanswer { \ - index: 29, \ - title: "Good Goodbye", \ - author: "화사", \ - alias: ["굿 굿바이", "굳 굳바이", "해ㅐㅇ 해ㅐ유ㅛㄷ"] \ -} -function mq:quiz/macro/setanswer { \ - index: 30, \ - title: "너에게 닿기를", \ - author: "10CM", \ - alias: [] \ -} -function mq:quiz/macro/setanswer { \ - index: 31, \ - title: "IRIS OUT", \ - author: "Kenshi Yonezu", \ - alias: ["아이리스 아웃", "이리스 아웃", "ㅑ갼 ㅐㅕㅅ"] \ -} -function mq:quiz/macro/setanswer { \ - index: 32, \ - title: "Sugar On My Tongue", \ - author: "Tyler, The Creator", \ - alias: ["슈가 온 마이 텅", "슈가 온 마 텅", "녛ㅁㄱ ㅐㅜ ㅡㅛ 새ㅜ혇"] \ -} -function mq:quiz/macro/setanswer { \ - index: 33, \ - title: "Hollywood Action", \ - author: "BOYNEXTDOOR", \ - alias: ["할리우드 액션", "ㅙㅣㅣㅛ재ㅐㅇ ㅁㅊ샤ㅐㅜ"] \ -} -function mq:quiz/macro/setanswer { \ - index: 34, \ - title: "SPAGHETTI", \ - author: "LE SSERAFIM", \ - alias: ["스파게티", "넴혿ㅅ시"] \ -} -function mq:quiz/macro/setanswer { \ - index: 35, \ - title: "Gabriela", \ - author: "KATSEYE", \ - alias: ["가브리엘라", "ㅎ뮤갸딤"] \ -} -function mq:quiz/macro/setanswer { \ - index: 36, \ - title: "LIKE YOU BETTER", \ - author: "프로미스나인", \ - alias: ["라이크 유 베터", "라이크 유 베럴", "라잌 유 베터", "라잌 유 베럴", "ㅣㅑㅏㄷ ㅛㅐㅕ ㅠㄷㅅㅅㄷㄱ"] \ -} -function mq:quiz/macro/setanswer { \ - index: 37, \ - title: "뛰어", \ - author: "BLACKPINK", \ - alias: ["jump"] \ -} -function mq:quiz/macro/setanswer { \ - index: 38, \ - title: "CHANEL", \ - author: "Tyla", \ - alias: ["샤넬", "초무디"] \ -} -function mq:quiz/macro/setanswer { \ - index: 39, \ - title: "오늘만 I LOVE YOU", \ - author: "BOYNEXTDOOR", \ - alias: ["오늘만 아이 러브 유", "오늘만 ㅑ ㅣㅐㅍㄷ ㅛㅐㅕ"] \ -} -function mq:quiz/macro/setanswer { \ - index: 40, \ - title: "earthquake", \ - author: "지수", \ - alias: ["어스퀘이크", "얼스퀘이크", "ㄷㅁㄱ소벼맏","보만다 지진"] \ -} -function mq:quiz/macro/setanswer { \ - index: 41, \ - title: "윽!", \ - author: "염따", \ - alias: ["윽"] \ -} -function mq:quiz/macro/setanswer { \ - index: 42, \ - title: "Abracadabra", \ - author: "Lady Gaga", \ - alias: ["아브라카다브라", "뮥ㅁㅊㅁㅇ뮥ㅁ"] \ -} -function mq:quiz/macro/setanswer { \ - index: 43, \ - title: "멸종위기사랑", \ - author: "이찬혁", \ - alias: [] \ -} -function mq:quiz/macro/setanswer { \ - index: 44, \ - title: "Dirty Work", \ - author: "aespa", \ - alias: ["더티 워크", "덜티 워크", "더티 월크", "덜티 월크", "약쇼 재가"] \ -} -function mq:quiz/macro/setanswer { \ - index: 45, \ - title: "HOT", \ - author: "LE SSERAFIM", \ - alias: ["핫", "ㅙㅅ"] \ -} -function mq:quiz/macro/setanswer { \ - index: 46, \ - title: "FAMOUS", \ - author: "ALLDAY PROJECT", \ - alias: ["페이머스", "ㄹ므ㅐㅕㄴ"] \ -} -function mq:quiz/macro/setanswer { \ - index: 47, \ - title: "XOXZ", \ - author: "IVE", \ - alias: ["엑스 오 엑스 지", "엑스 오 엑스 제트", "탵ㅋ"] \ -} -function mq:quiz/macro/setanswer { \ - index: 48, \ - title: "여름이었다", \ - author: "H1-KEY", \ - alias: [] \ -} -function mq:quiz/macro/setanswer { \ - index: 49, \ - title: "LOV3", \ - author: "식케이", \ - alias: ["럽3", "ㅣㅐㅍ3"] \ -} -function mq:quiz/macro/setanswer { \ - index: 50, \ - title: "Drive", \ - author: "Ed Sheeran", \ - alias: ["드라이브", "ㅇ걒ㄷ"] \ -} +scoreboard players operation song_idx func.temp = index main +scoreboard players remove song_idx func.temp 1 +execute store result storage mq:tmp idx int 1 run scoreboard players get song_idx func.temp +function mq:quiz/macro/setanswer with storage mq:tmp scoreboard players set stop buttons -1 scoreboard players set skip buttons -1 diff --git a/music_quiz/data/mq/function/repeat/buttons/handler.mcfunction b/music_quiz/data/mq/function/repeat/buttons/handler.mcfunction index 0587a48..a3db64a 100644 --- a/music_quiz/data/mq/function/repeat/buttons/handler.mcfunction +++ b/music_quiz/data/mq/function/repeat/buttons/handler.mcfunction @@ -1,48 +1,6 @@ -function mq:repeat/buttons/btn { \ - n: "start", \ - x: 140, \ - y: 62, \ - z: -225, \ - f: "south", \ - c: "function mq:commands/start with storage mq:main" \ -} -function mq:repeat/buttons/btn { \ - n: "stop", \ - x: 142, \ - y: 62, \ - z: -225, \ - f: "south", \ - c: "function mq:commands/stop with storage mq:main" \ -} -function mq:repeat/buttons/btn { \ - n: "skip", \ - x: 144, \ - y: 62, \ - z: -225, \ - f: "south", \ - c: "function mq:commands/skip" \ -} -function mq:repeat/buttons/btn { \ - n: "hint", \ - x: 146, \ - y: 62, \ - z: -225, \ - f: "south", \ - c: "function mq:commands/hint" \ -} -function mq:repeat/buttons/btn { \ - n: "replay", \ - x: 148, \ - y: 62, \ - z: -225, \ - f: "south", \ - c: "function mq:commands/replay" \ -} -function mq:repeat/buttons/btn { \ - n: "test", \ - x: 144, \ - y: 62, \ - z: -213, \ - f: "north", \ - c: "function mq:commands/test" \ -} \ No newline at end of file +function mq:repeat/buttons/btn with storage mq:main button_defs[0] +function mq:repeat/buttons/btn with storage mq:main button_defs[1] +function mq:repeat/buttons/btn with storage mq:main button_defs[2] +function mq:repeat/buttons/btn with storage mq:main button_defs[3] +function mq:repeat/buttons/btn with storage mq:main button_defs[4] +function mq:repeat/buttons/btn with storage mq:main button_defs[5] diff --git a/music_quiz/data/mq/function/repeat/map/lamp1.mcfunction b/music_quiz/data/mq/function/repeat/map/lamp1.mcfunction deleted file mode 100644 index e7c470b..0000000 --- a/music_quiz/data/mq/function/repeat/map/lamp1.mcfunction +++ /dev/null @@ -1,22 +0,0 @@ -execute unless score lamp1 map matches 0.. run scoreboard players set lamp1 map 1 -execute unless score lamp1.on map matches 0.. run scoreboard players set lamp1.on map 94 -execute unless score lamp1.off map matches 0.. run scoreboard players set lamp1.off map 85 -execute unless score lamp1.on2 map matches 0.. run scoreboard players set lamp1.on2 map 44 -execute unless score lamp1.off2 map matches 0.. run scoreboard players set lamp1.off2 map 35 - -execute if score lamp1 map matches 1.. run scoreboard players add lamp1 map 1 - -execute if score lamp1 map matches 3 if score lamp1.on map matches 195.. run scoreboard players set lamp1.on map 94 -execute if score lamp1 map matches 3 if score lamp1.off map matches 195.. run scoreboard players set lamp1.off map 94 -execute if score lamp1 map matches 3 if score lamp1.on2 map matches 195.. run scoreboard players set lamp1.on2 map 94 -execute if score lamp1 map matches 3 if score lamp1.off2 map matches 195.. run scoreboard players set lamp1.off2 map 94 -execute if score lamp1 map matches 3 run execute store result storage mq:main map.lamp1.on int 1 run scoreboard players get lamp1.on map -execute if score lamp1 map matches 3 run execute store result storage mq:main map.lamp1.off int 1 run scoreboard players get lamp1.off map -execute if score lamp1 map matches 3 run execute store result storage mq:main map.lamp1.on2 int 1 run scoreboard players get lamp1.on2 map -execute if score lamp1 map matches 3 run execute store result storage mq:main map.lamp1.off2 int 1 run scoreboard players get lamp1.off2 map -execute if score lamp1 map matches 3 run function mq:repeat/map/macro/lamp1 with storage mq:main map.lamp1 -execute if score lamp1 map matches 3 run scoreboard players add lamp1.on map 1 -execute if score lamp1 map matches 3 run scoreboard players add lamp1.off map 1 -execute if score lamp1 map matches 3 run scoreboard players add lamp1.on2 map 1 -execute if score lamp1 map matches 3 run scoreboard players add lamp1.off2 map 1 -execute if score lamp1 map matches 3.. run scoreboard players set lamp1 map 1 diff --git a/music_quiz/data/mq/function/repeat/map/macro/lamp1.mcfunction b/music_quiz/data/mq/function/repeat/map/macro/lamp1.mcfunction deleted file mode 100644 index 3055d4d..0000000 --- a/music_quiz/data/mq/function/repeat/map/macro/lamp1.mcfunction +++ /dev/null @@ -1,4 +0,0 @@ -$execute if score lamp1.on map matches 94..194 positioned $(on) 78 -279 if block ~ ~ ~1 minecraft:redstone_lamp run setblock ~ ~ ~ minecraft:redstone_block -$execute if score lamp1.off map matches 94..194 positioned $(off) 78 -279 if block ~ ~ ~1 minecraft:redstone_lamp run setblock ~ ~ ~ minecraft:red_wool -$execute if score lamp1.on2 map matches 94..194 positioned $(on2) 78 -279 if block ~ ~ ~1 minecraft:redstone_lamp run setblock ~ ~ ~ minecraft:redstone_block -$execute if score lamp1.off2 map matches 94..194 positioned $(off2) 78 -279 if block ~ ~ ~1 minecraft:redstone_lamp run setblock ~ ~ ~ minecraft:red_wool diff --git a/music_quiz/data/mq/function/repeat/map/tree.mcfunction b/music_quiz/data/mq/function/repeat/map/tree.mcfunction deleted file mode 100644 index 4238934..0000000 --- a/music_quiz/data/mq/function/repeat/map/tree.mcfunction +++ /dev/null @@ -1,60 +0,0 @@ -execute unless score tree map matches 0.. run scoreboard players set tree map 1 - -execute if score tree map matches 1.. run scoreboard players add tree map 1 - -# 1층 시작 -execute if score tree map matches 6 run setblock 142 66 -186 minecraft:redstone_lamp[lit=true] -execute if score tree map matches 6 run setblock 147 66 -191 minecraft:redstone_lamp[lit=true] -execute if score tree map matches 6 run setblock 142 66 -196 minecraft:redstone_lamp[lit=true] -execute if score tree map matches 6 run setblock 137 66 -191 minecraft:redstone_lamp[lit=true] - -# 1층 끝 -execute if score tree map matches 16 run setblock 142 66 -186 minecraft:redstone_lamp[lit=false] -execute if score tree map matches 16 run setblock 147 66 -191 minecraft:redstone_lamp[lit=false] -execute if score tree map matches 16 run setblock 142 66 -196 minecraft:redstone_lamp[lit=false] -execute if score tree map matches 16 run setblock 137 66 -191 minecraft:redstone_lamp[lit=false] - -# 2층 시작 -execute if score tree map matches 16 run setblock 142 70 -195 minecraft:redstone_lamp[lit=true] -execute if score tree map matches 16 run setblock 138 70 -191 minecraft:redstone_lamp[lit=true] -execute if score tree map matches 16 run setblock 142 70 -187 minecraft:redstone_lamp[lit=true] -execute if score tree map matches 16 run setblock 146 70 -191 minecraft:redstone_lamp[lit=true] - -# 2층 끝 -execute if score tree map matches 26 run setblock 142 70 -195 minecraft:redstone_lamp[lit=false] -execute if score tree map matches 26 run setblock 138 70 -191 minecraft:redstone_lamp[lit=false] -execute if score tree map matches 26 run setblock 142 70 -187 minecraft:redstone_lamp[lit=false] -execute if score tree map matches 26 run setblock 146 70 -191 minecraft:redstone_lamp[lit=false] - -# 3층 시작 -execute if score tree map matches 26 run setblock 142 74 -194 minecraft:redstone_lamp[lit=true] -execute if score tree map matches 26 run setblock 139 74 -191 minecraft:redstone_lamp[lit=true] -execute if score tree map matches 26 run setblock 142 74 -188 minecraft:redstone_lamp[lit=true] -execute if score tree map matches 26 run setblock 145 74 -191 minecraft:redstone_lamp[lit=true] - -# 3층 끝 -execute if score tree map matches 36 run setblock 142 74 -194 minecraft:redstone_lamp[lit=false] -execute if score tree map matches 36 run setblock 139 74 -191 minecraft:redstone_lamp[lit=false] -execute if score tree map matches 36 run setblock 142 74 -188 minecraft:redstone_lamp[lit=false] -execute if score tree map matches 36 run setblock 145 74 -191 minecraft:redstone_lamp[lit=false] - -# 4층 시작 -execute if score tree map matches 36 run setblock 142 78 -193 minecraft:redstone_lamp[lit=true] -execute if score tree map matches 36 run setblock 140 78 -191 minecraft:redstone_lamp[lit=true] -execute if score tree map matches 36 run setblock 142 78 -189 minecraft:redstone_lamp[lit=true] -execute if score tree map matches 36 run setblock 144 78 -191 minecraft:redstone_lamp[lit=true] - -# 4층 끝 -execute if score tree map matches 46 run setblock 142 78 -193 minecraft:redstone_lamp[lit=false] -execute if score tree map matches 46 run setblock 140 78 -191 minecraft:redstone_lamp[lit=false] -execute if score tree map matches 46 run setblock 142 78 -189 minecraft:redstone_lamp[lit=false] -execute if score tree map matches 46 run setblock 144 78 -191 minecraft:redstone_lamp[lit=false] - -# TOP 시작 -execute if score tree map matches 46 run setblock 142 81 -191 minecraft:redstone_lamp[lit=true] - -# TOP 끝 -execute if score tree map matches 56 run setblock 142 81 -191 minecraft:redstone_lamp[lit=false] - - -execute if score tree map matches 61.. run scoreboard players set tree map 1 diff --git a/music_quiz/data/mq/function/repeat/triggers/handler.mcfunction b/music_quiz/data/mq/function/repeat/triggers/handler.mcfunction index bcf4469..1889239 100644 --- a/music_quiz/data/mq/function/repeat/triggers/handler.mcfunction +++ b/music_quiz/data/mq/function/repeat/triggers/handler.mcfunction @@ -18,23 +18,7 @@ execute if score init main matches 0..1 \ run function mq:quiz/start with storage mq:main -function mq:repeat/triggers/trigger { \ - n:"stop", \ - n2:"중지", \ - c:"function mq:commands/stop with storage mq:main" \ -} -function mq:repeat/triggers/trigger { \ - n:"skip", \ - n2:"스킵", \ - c:"function mq:commands/skip" \ -} -function mq:repeat/triggers/trigger { \ - n:"hint", \ - n2:"힌트", \ - c:"function mq:commands/hint" \ -} -function mq:repeat/triggers/trigger { \ - n:"replay", \ - n2:"다시재생", \ - c:"function mq:commands/replay" \ -} \ No newline at end of file +function mq:repeat/triggers/trigger with storage mq:main trigger_defs[0] +function mq:repeat/triggers/trigger with storage mq:main trigger_defs[1] +function mq:repeat/triggers/trigger with storage mq:main trigger_defs[2] +function mq:repeat/triggers/trigger with storage mq:main trigger_defs[3] diff --git a/music_quiz/data/mq/function/repeat/triggers/trigger.mcfunction b/music_quiz/data/mq/function/repeat/triggers/trigger.mcfunction index d563785..08a10dd 100644 --- a/music_quiz/data/mq/function/repeat/triggers/trigger.mcfunction +++ b/music_quiz/data/mq/function/repeat/triggers/trigger.mcfunction @@ -20,11 +20,6 @@ $execute as @a if score @s $(n) matches 1 run scoreboard players set @s $(n) 2 $execute as @a if score @s $(n) matches 3 run function mq:tellraw {"text":"","color":"black",msg:[{"selector":"@s","color": "yellow","bold": true}," : ",{"text":"이미 $(n2)투표를 하셨습니다.","color": "red"}]} $execute as @a if score @s $(n) matches 3 run scoreboard players set @s $(n) 2 -$execute store result score rest_player $(n) if entity @a -$execute unless score rest_player $(n) matches 0 run scoreboard players operation rest_player $(n) %= two func.temp -$execute store result score max_player $(n) if entity @a -$execute unless score real_max_player $(n) matches 0 run scoreboard players operation max_player $(n) /= two func.temp -$execute unless score real_max_player $(n) matches 0 run scoreboard players operation max_player $(n) += rest_player $(n) $execute store result score $(n)_player $(n) if entity @a[scores={$(n)=2..}] $execute unless score real_max_player $(n) matches 0 \ diff --git a/music_quiz/data/mq/function/tick.mcfunction b/music_quiz/data/mq/function/tick.mcfunction index 714e75c..37a4666 100644 --- a/music_quiz/data/mq/function/tick.mcfunction +++ b/music_quiz/data/mq/function/tick.mcfunction @@ -1,9 +1,7 @@ +function mq:repeat/check_server function mq:repeat/players -function mq:repeat/check_answer -function mq:repeat/timer function mq:repeat/buttons/handler function mq:repeat/triggers/handler -function mq:repeat/check_server -function mq:repeat/map/tree -function mq:repeat/map/lamp1 +execute if score init main matches 2.. run function mq:repeat/timer +execute if score init main matches 5..6 run function mq:repeat/check_answer diff --git a/music_quiz/data/mq/수정.txt b/music_quiz/data/mq/수정.txt deleted file mode 100644 index 489f7bf..0000000 --- a/music_quiz/data/mq/수정.txt +++ /dev/null @@ -1,9 +0,0 @@ -- function/ - - load.mcfunction - - buttons/ - - handler.mcfunction - - quiz/ - - setanswer.mcfunction - - -# 이미지 명령어 추가