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" } }