From 8a56f3b35c193b42c1c689eced2f19c23e234f05 Mon Sep 17 00:00:00 2001 From: rarula <74240663+rarula@users.noreply.github.com> Date: Sat, 27 May 2023 20:39:35 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=96=202.0.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/sketch/functions/core/load.mcfunction | 13 +++++++++++-- .../functions/core/migration/1.0.1/_.mcfunction | 5 +++++ .../2.0.0/_.mcfunction} | 6 +----- .../functions/core/migration/2.0.1/_.mcfunction | 5 +++++ .../functions/core/migration/2.0.2/_.mcfunction | 8 ++++++++ pack.mcmeta | 2 +- 6 files changed, 31 insertions(+), 8 deletions(-) create mode 100644 data/sketch/functions/core/migration/1.0.1/_.mcfunction rename data/sketch/functions/core/{load_once.mcfunction => migration/2.0.0/_.mcfunction} (89%) create mode 100644 data/sketch/functions/core/migration/2.0.1/_.mcfunction create mode 100644 data/sketch/functions/core/migration/2.0.2/_.mcfunction diff --git a/data/sketch/functions/core/load.mcfunction b/data/sketch/functions/core/load.mcfunction index be80586..f8875d3 100644 --- a/data/sketch/functions/core/load.mcfunction +++ b/data/sketch/functions/core/load.mcfunction @@ -4,5 +4,14 @@ # # @within tag/function minecraft:load -# 初回ロード時実行 - execute unless data storage sketch: {Version:"2.0.0"} run function sketch:core/load_once +# バージョン初期化 + execute unless data storage sketch: Version run data modify storage sketch: Version set value "1.0.0" + +# マイグレーション +## 1.0.x + execute if data storage sketch: {Version:"1.0.0"} run function sketch:core/migration/1.0.1/_ + +## 2.0.x + execute if data storage sketch: {Version:"1.0.1"} run function sketch:core/migration/2.0.0/_ + execute if data storage sketch: {Version:"2.0.0"} run function sketch:core/migration/2.0.1/_ + execute if data storage sketch: {Version:"2.0.1"} run function sketch:core/migration/2.0.2/_ diff --git a/data/sketch/functions/core/migration/1.0.1/_.mcfunction b/data/sketch/functions/core/migration/1.0.1/_.mcfunction new file mode 100644 index 0000000..2af471f --- /dev/null +++ b/data/sketch/functions/core/migration/1.0.1/_.mcfunction @@ -0,0 +1,5 @@ +#> sketch:core/migration/1.0.1/_ +# @within function sketch:core/load + +# バージョン設定 + data modify storage sketch: Version set value "1.0.1" diff --git a/data/sketch/functions/core/load_once.mcfunction b/data/sketch/functions/core/migration/2.0.0/_.mcfunction similarity index 89% rename from data/sketch/functions/core/load_once.mcfunction rename to data/sketch/functions/core/migration/2.0.0/_.mcfunction index 3c80b6b..24325d8 100644 --- a/data/sketch/functions/core/load_once.mcfunction +++ b/data/sketch/functions/core/migration/2.0.0/_.mcfunction @@ -1,7 +1,4 @@ -#> sketch:core/load_once -# -# 初回ロード時に実行される -# +#> sketch:core/migration/2.0.0/_ # @within function sketch:core/load # バージョン設定 @@ -11,7 +8,6 @@ # ストレージ設定 data modify storage sketch:core GlobalItemInfoMap set value [] - # スコアボード設定 scoreboard objectives add Sketch dummy scoreboard objectives add Sketch.Id dummy diff --git a/data/sketch/functions/core/migration/2.0.1/_.mcfunction b/data/sketch/functions/core/migration/2.0.1/_.mcfunction new file mode 100644 index 0000000..f598962 --- /dev/null +++ b/data/sketch/functions/core/migration/2.0.1/_.mcfunction @@ -0,0 +1,5 @@ +#> sketch:core/migration/2.0.1/_ +# @within function sketch:core/load + +# バージョン設定 + data modify storage sketch: Version set value "2.0.1" diff --git a/data/sketch/functions/core/migration/2.0.2/_.mcfunction b/data/sketch/functions/core/migration/2.0.2/_.mcfunction new file mode 100644 index 0000000..039b8b7 --- /dev/null +++ b/data/sketch/functions/core/migration/2.0.2/_.mcfunction @@ -0,0 +1,8 @@ +#> sketch:core/migration/2.0.2/_ +# @within function sketch:core/load + +# バージョン設定 + data modify storage sketch: Version set value "2.0.2" + +# sketch:util/map/delete の引数が消去されない問題を修正 (#8) + data remove storage sketch:util in diff --git a/pack.mcmeta b/pack.mcmeta index b0f37a7..55d8721 100644 --- a/pack.mcmeta +++ b/pack.mcmeta @@ -1,6 +1,6 @@ { "pack": { "pack_format": 12, - "description": "Sketch 2.0.0" + "description": "Sketch 2.0.2" } }