From c4195baf85665b8c371aec0e2928e3590a88e9e8 Mon Sep 17 00:00:00 2001 From: vlw Date: Fri, 13 Mar 2026 20:02:31 +0100 Subject: [PATCH] refactor: bundle mcfstd as a datapack (#1) So it turns out it will be much harder to create namespaced instances of this datapack like we initially thought. It might be worth considering in the future, but we would not be able to use any functions that we add with this library by the library itself, since the namespace change will make all internal function calls point to an undefined target. So we will bundle this as a datapack for now. Reviewed-on: https://codeberg.org/vlw/mcfstd/pulls/1 Co-authored-by: vlw Co-committed-by: vlw --- README.md | 22 +++++-------------- {comp => data/comp}/function/eq.mcfunction | 0 {comp => data/comp}/function/gt.mcfunction | 0 {comp => data/comp}/function/gteq.mcfunction | 0 {comp => data/comp}/function/lt.mcfunction | 0 {math => data/math}/function/add.mcfunction | 0 {math => data/math}/function/div.mcfunction | 0 {math => data/math}/function/mod.mcfunction | 0 {math => data/math}/function/mul.mcfunction | 0 {math => data/math}/function/sub.mcfunction | 0 {std => data/std}/function/out.mcfunction | 0 {var => data/var}/function/dec.mcfunction | 0 {var => data/var}/function/inc.mcfunction | 0 {var => data/var}/function/mv.mcfunction | 0 {var => data/var}/function/put.mcfunction | 0 {var => data/var}/function/set.mcfunction | 0 {var => data/var}/function/unset.mcfunction | 0 {z_ => data/z_}/function/_debug.mcfunction | 0 {z_ => data/z_}/function/construct.mcfunction | 0 .../debug/display/interval.mcfunction | 0 .../z_}/function/debug/display/reg.mcfunction | 0 .../z_}/function/debug/display/var.mcfunction | 0 {z_ => data/z_}/function/destruct.mcfunction | 0 .../z_}/function/reg/_debug.mcfunction | 0 {z_ => data/z_}/function/reg/a.mcfunction | 0 {z_ => data/z_}/function/reg/b.mcfunction | 0 {z_ => data/z_}/function/stdin.mcfunction | 0 {z_ => data/z_}/function/stdout.mcfunction | 0 pack.mcmeta | 9 ++++++++ 29 files changed, 14 insertions(+), 17 deletions(-) rename {comp => data/comp}/function/eq.mcfunction (100%) rename {comp => data/comp}/function/gt.mcfunction (100%) rename {comp => data/comp}/function/gteq.mcfunction (100%) rename {comp => data/comp}/function/lt.mcfunction (100%) rename {math => data/math}/function/add.mcfunction (100%) rename {math => data/math}/function/div.mcfunction (100%) rename {math => data/math}/function/mod.mcfunction (100%) rename {math => data/math}/function/mul.mcfunction (100%) rename {math => data/math}/function/sub.mcfunction (100%) rename {std => data/std}/function/out.mcfunction (100%) rename {var => data/var}/function/dec.mcfunction (100%) rename {var => data/var}/function/inc.mcfunction (100%) rename {var => data/var}/function/mv.mcfunction (100%) rename {var => data/var}/function/put.mcfunction (100%) rename {var => data/var}/function/set.mcfunction (100%) rename {var => data/var}/function/unset.mcfunction (100%) rename {z_ => data/z_}/function/_debug.mcfunction (100%) rename {z_ => data/z_}/function/construct.mcfunction (100%) rename {z_ => data/z_}/function/debug/display/interval.mcfunction (100%) rename {z_ => data/z_}/function/debug/display/reg.mcfunction (100%) rename {z_ => data/z_}/function/debug/display/var.mcfunction (100%) rename {z_ => data/z_}/function/destruct.mcfunction (100%) rename {z_ => data/z_}/function/reg/_debug.mcfunction (100%) rename {z_ => data/z_}/function/reg/a.mcfunction (100%) rename {z_ => data/z_}/function/reg/b.mcfunction (100%) rename {z_ => data/z_}/function/stdin.mcfunction (100%) rename {z_ => data/z_}/function/stdout.mcfunction (100%) create mode 100644 pack.mcmeta diff --git a/README.md b/README.md index 716a49d..2921e11 100644 --- a/README.md +++ b/README.md @@ -24,26 +24,14 @@ execute unless std:out run return fail **See the [function reference](#functions) for a full list of available functions** # Installation -This is not a stand-alone datapack but is instead intended to be placed inside the `data/` directory of your own datapack. Clone this repository into the `data/` directory of your datapack. +Download the datapack as a zip from [the releases page](/vlw/mcfstd/releases) for the version that you require. Place the zip file directly into the `datapacks/` directory of your Minecraft world save directory. -``` -git clonne http://codeberg.org/vlw/mcfstd -``` +Enable this library in Minecraft by typing the following two commands +```mcfunction +reload -It is highly recommended that you rename the directory that contains this library after you clone it. This will prevent other datapacks that use this library from interfering with yours, and it also prevents your datapacks from interfering with theirs. This is important since other datapacks might use a version of this library that is not compatible with yours. - -For example +datapack enable "file/mcfstd-X-X-X.zip" # Where X-X-X would be the version of the datapack ``` -data/ - mcfstd/ -``` -would become: -``` -data/ - std_my_datapack/ -``` - -One that is done, reload your plugins with `/reload` and you should have access to mcfstd functions # The standard output This library contains a standard output that is used as an intermediary for arithmetic and comparison operations. diff --git a/comp/function/eq.mcfunction b/data/comp/function/eq.mcfunction similarity index 100% rename from comp/function/eq.mcfunction rename to data/comp/function/eq.mcfunction diff --git a/comp/function/gt.mcfunction b/data/comp/function/gt.mcfunction similarity index 100% rename from comp/function/gt.mcfunction rename to data/comp/function/gt.mcfunction diff --git a/comp/function/gteq.mcfunction b/data/comp/function/gteq.mcfunction similarity index 100% rename from comp/function/gteq.mcfunction rename to data/comp/function/gteq.mcfunction diff --git a/comp/function/lt.mcfunction b/data/comp/function/lt.mcfunction similarity index 100% rename from comp/function/lt.mcfunction rename to data/comp/function/lt.mcfunction diff --git a/math/function/add.mcfunction b/data/math/function/add.mcfunction similarity index 100% rename from math/function/add.mcfunction rename to data/math/function/add.mcfunction diff --git a/math/function/div.mcfunction b/data/math/function/div.mcfunction similarity index 100% rename from math/function/div.mcfunction rename to data/math/function/div.mcfunction diff --git a/math/function/mod.mcfunction b/data/math/function/mod.mcfunction similarity index 100% rename from math/function/mod.mcfunction rename to data/math/function/mod.mcfunction diff --git a/math/function/mul.mcfunction b/data/math/function/mul.mcfunction similarity index 100% rename from math/function/mul.mcfunction rename to data/math/function/mul.mcfunction diff --git a/math/function/sub.mcfunction b/data/math/function/sub.mcfunction similarity index 100% rename from math/function/sub.mcfunction rename to data/math/function/sub.mcfunction diff --git a/std/function/out.mcfunction b/data/std/function/out.mcfunction similarity index 100% rename from std/function/out.mcfunction rename to data/std/function/out.mcfunction diff --git a/var/function/dec.mcfunction b/data/var/function/dec.mcfunction similarity index 100% rename from var/function/dec.mcfunction rename to data/var/function/dec.mcfunction diff --git a/var/function/inc.mcfunction b/data/var/function/inc.mcfunction similarity index 100% rename from var/function/inc.mcfunction rename to data/var/function/inc.mcfunction diff --git a/var/function/mv.mcfunction b/data/var/function/mv.mcfunction similarity index 100% rename from var/function/mv.mcfunction rename to data/var/function/mv.mcfunction diff --git a/var/function/put.mcfunction b/data/var/function/put.mcfunction similarity index 100% rename from var/function/put.mcfunction rename to data/var/function/put.mcfunction diff --git a/var/function/set.mcfunction b/data/var/function/set.mcfunction similarity index 100% rename from var/function/set.mcfunction rename to data/var/function/set.mcfunction diff --git a/var/function/unset.mcfunction b/data/var/function/unset.mcfunction similarity index 100% rename from var/function/unset.mcfunction rename to data/var/function/unset.mcfunction diff --git a/z_/function/_debug.mcfunction b/data/z_/function/_debug.mcfunction similarity index 100% rename from z_/function/_debug.mcfunction rename to data/z_/function/_debug.mcfunction diff --git a/z_/function/construct.mcfunction b/data/z_/function/construct.mcfunction similarity index 100% rename from z_/function/construct.mcfunction rename to data/z_/function/construct.mcfunction diff --git a/z_/function/debug/display/interval.mcfunction b/data/z_/function/debug/display/interval.mcfunction similarity index 100% rename from z_/function/debug/display/interval.mcfunction rename to data/z_/function/debug/display/interval.mcfunction diff --git a/z_/function/debug/display/reg.mcfunction b/data/z_/function/debug/display/reg.mcfunction similarity index 100% rename from z_/function/debug/display/reg.mcfunction rename to data/z_/function/debug/display/reg.mcfunction diff --git a/z_/function/debug/display/var.mcfunction b/data/z_/function/debug/display/var.mcfunction similarity index 100% rename from z_/function/debug/display/var.mcfunction rename to data/z_/function/debug/display/var.mcfunction diff --git a/z_/function/destruct.mcfunction b/data/z_/function/destruct.mcfunction similarity index 100% rename from z_/function/destruct.mcfunction rename to data/z_/function/destruct.mcfunction diff --git a/z_/function/reg/_debug.mcfunction b/data/z_/function/reg/_debug.mcfunction similarity index 100% rename from z_/function/reg/_debug.mcfunction rename to data/z_/function/reg/_debug.mcfunction diff --git a/z_/function/reg/a.mcfunction b/data/z_/function/reg/a.mcfunction similarity index 100% rename from z_/function/reg/a.mcfunction rename to data/z_/function/reg/a.mcfunction diff --git a/z_/function/reg/b.mcfunction b/data/z_/function/reg/b.mcfunction similarity index 100% rename from z_/function/reg/b.mcfunction rename to data/z_/function/reg/b.mcfunction diff --git a/z_/function/stdin.mcfunction b/data/z_/function/stdin.mcfunction similarity index 100% rename from z_/function/stdin.mcfunction rename to data/z_/function/stdin.mcfunction diff --git a/z_/function/stdout.mcfunction b/data/z_/function/stdout.mcfunction similarity index 100% rename from z_/function/stdout.mcfunction rename to data/z_/function/stdout.mcfunction diff --git a/pack.mcmeta b/pack.mcmeta new file mode 100644 index 0000000..942d926 --- /dev/null +++ b/pack.mcmeta @@ -0,0 +1,9 @@ +{ + "pack": { + "description": { + "translate": "A standard library that adds variables, arithmetic, and relational operators to mcfunction" + }, + "min_format": [88, 0], + "max_format": [88, 0] + } +}