summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data/minecraft/tags/function/load.json (renamed from data/minecraft/tags/functions/load.json)0
-rw-r--r--data/minecraft/tags/functions/tick.json5
-rw-r--r--data/onechunk/function/initialize.mcfunction (renamed from data/onechunk/functions/initialize.mcfunction)23
-rw-r--r--data/onechunk/function/load.mcfunction3
-rw-r--r--data/onechunk/functions/load.mcfunction3
-rw-r--r--data/onechunk/functions/tick.mcfunction0
-rw-r--r--pack.mcmeta2
7 files changed, 14 insertions, 22 deletions
diff --git a/data/minecraft/tags/functions/load.json b/data/minecraft/tags/function/load.json
index d72a399..d72a399 100644
--- a/data/minecraft/tags/functions/load.json
+++ b/data/minecraft/tags/function/load.json
diff --git a/data/minecraft/tags/functions/tick.json b/data/minecraft/tags/functions/tick.json
deleted file mode 100644
index dc8ca50..0000000
--- a/data/minecraft/tags/functions/tick.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "values": [
- "onechunk:tick"
- ]
-}
diff --git a/data/onechunk/functions/initialize.mcfunction b/data/onechunk/function/initialize.mcfunction
index 5d6766c..4d545a0 100644
--- a/data/onechunk/functions/initialize.mcfunction
+++ b/data/onechunk/function/initialize.mcfunction
@@ -26,18 +26,15 @@ execute store result score $chunkCenterZ onechunk_data run scoreboard players ge
scoreboard players set $tmp onechunk_data 8
scoreboard players operation $chunkCenterZ onechunk_data += $tmp onechunk_data
-summon armor_stand ~ ~ ~ {NoGravity:1,Invulnerable:1,Invisible:1,Tags:["teleport_target"]}
-execute store result entity @e[tag=teleport_target,limit=1] Pos[0] double 1 run scoreboard players get $chunkCenterX onechunk_data
-execute store result entity @e[tag=teleport_target,limit=1] Pos[2] double 1 run scoreboard players get $chunkCenterZ onechunk_data
-execute store result entity @e[tag=teleport_target,limit=1] Pos[1] double 1 run data get entity @p Pos[1]
-
-tp @p @e[tag=teleport_target,limit=1]
-kill @e[tag=teleport_target]
-execute as @p run worldborder center ~ ~
+summon armor_stand ~ ~ ~ {NoGravity:1,Invulnerable:1,Invisible:1,Tags:["onechunk_chunk_center"]}
+execute store result entity @e[tag=onechunk_chunk_center,limit=1] Pos[0] double 1 run scoreboard players get $chunkCenterX onechunk_data
+execute store result entity @e[tag=onechunk_chunk_center,limit=1] Pos[2] double 1 run scoreboard players get $chunkCenterZ onechunk_data
+execute store result entity @e[tag=onechunk_chunk_center,limit=1] Pos[1] double 1 run data get entity @p Pos[1]
+
+execute at @e[tag=onechunk_chunk_center,limit=1] run worldborder center ~ ~
+kill @e[tag=onechunk_chunk_center]
+
+# TODO: how to set to score?
worldborder set 16
-#fill
-#X-1 -64 Z-1 X+15+1 319 Z-1
-#X-1 -64 Z-1 X-1 219 Z+15+1
-#X+15+1 -64 Z-1 X+15+1 219 Z+15+1
-#X-1 -64 Z+15+1 X+15+1 219 Z+15+1
+scoreboard players set $initialized onechunk_data 1
diff --git a/data/onechunk/function/load.mcfunction b/data/onechunk/function/load.mcfunction
new file mode 100644
index 0000000..bda726f
--- /dev/null
+++ b/data/onechunk/function/load.mcfunction
@@ -0,0 +1,3 @@
+scoreboard objectives add onechunk_data dummy
+
+execute unless score $initialized onechunk_data matches 1 run function onechunk:initialize
diff --git a/data/onechunk/functions/load.mcfunction b/data/onechunk/functions/load.mcfunction
deleted file mode 100644
index 336a971..0000000
--- a/data/onechunk/functions/load.mcfunction
+++ /dev/null
@@ -1,3 +0,0 @@
-scoreboard objectives add onechunk_data dummy
-
-#function onechunk:initialize
diff --git a/data/onechunk/functions/tick.mcfunction b/data/onechunk/functions/tick.mcfunction
deleted file mode 100644
index e69de29..0000000
--- a/data/onechunk/functions/tick.mcfunction
+++ /dev/null
diff --git a/pack.mcmeta b/pack.mcmeta
index e51dbaf..5f18a96 100644
--- a/pack.mcmeta
+++ b/pack.mcmeta
@@ -1,6 +1,6 @@
{
"pack": {
- "pack_format": 41,
+ "pack_format": 48,
"description": "ワンチャンキ"
}
}