diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5bc4497 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +data/ +data/* +.DS_Store diff --git a/build.sh b/build.sh new file mode 100644 index 0000000..b6d8693 --- /dev/null +++ b/build.sh @@ -0,0 +1,2 @@ +pip3 install git+https://github.com/WingedSeal/jmc.git#subdirectory=src +jmc compile diff --git a/data/ferdinland/function/command/init.mcfunction b/data/ferdinland/function/command/init.mcfunction deleted file mode 100644 index 13a39cf..0000000 --- a/data/ferdinland/function/command/init.mcfunction +++ /dev/null @@ -1,3 +0,0 @@ -scoreboard objectives add transportCreative trigger -scoreboard objectives add transportSMP trigger -scoreboard objectives add menu trigger diff --git a/data/ferdinland/function/command/menu_open.mcfunction b/data/ferdinland/function/command/menu_open.mcfunction deleted file mode 100644 index a30c26e..0000000 --- a/data/ferdinland/function/command/menu_open.mcfunction +++ /dev/null @@ -1 +0,0 @@ -guis open menu diff --git a/data/ferdinland/function/command/transport_creative.mcfunction b/data/ferdinland/function/command/transport_creative.mcfunction deleted file mode 100644 index f59d45e..0000000 --- a/data/ferdinland/function/command/transport_creative.mcfunction +++ /dev/null @@ -1 +0,0 @@ -transfer 10.0.0.13 25566 @s diff --git a/data/ferdinland/function/command/transport_smp.mcfunction b/data/ferdinland/function/command/transport_smp.mcfunction deleted file mode 100644 index f8e4965..0000000 --- a/data/ferdinland/function/command/transport_smp.mcfunction +++ /dev/null @@ -1 +0,0 @@ -transfer 10.0.0.13 25565 @s diff --git a/data/ferdinland/function/command/trigger.mcfunction b/data/ferdinland/function/command/trigger.mcfunction deleted file mode 100644 index 393aa0a..0000000 --- a/data/ferdinland/function/command/trigger.mcfunction +++ /dev/null @@ -1,11 +0,0 @@ -scoreboard players enable @a transportCreative -execute as @a[scores={transportCreative=1..}] run function ferdinland:command/transport_creative -scoreboard players set @a transportCreative 0 - -scoreboard players enable @a transportSMP -execute as @a[scores={transportSMP=1..}] run function ferdinland:command/transport_smp -scoreboard players set @a transportSMP 0 - -scoreboard players enable @a menu -execute as @a[scores={menu=1..}] run function ferdinland:command/menu_open -scoreboard players set @a menu 0 diff --git a/data/ferdinland/function/load.mcfunction b/data/ferdinland/function/load.mcfunction deleted file mode 100644 index 5a88561..0000000 --- a/data/ferdinland/function/load.mcfunction +++ /dev/null @@ -1,3 +0,0 @@ -# load function -say This load function -function ferdinland:command/init diff --git a/data/ferdinland/function/tick.mcfunction b/data/ferdinland/function/tick.mcfunction deleted file mode 100644 index 6ef7b11..0000000 --- a/data/ferdinland/function/tick.mcfunction +++ /dev/null @@ -1,4 +0,0 @@ -# tick function -# - -function ferdinland:command/trigger diff --git a/data/minecraft/tags/function/load.json b/data/minecraft/tags/function/load.json deleted file mode 100644 index b8a28d7..0000000 --- a/data/minecraft/tags/function/load.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "values": [ - "ferdinland:load" - ] -} diff --git a/data/minecraft/tags/function/tick.json b/data/minecraft/tags/function/tick.json deleted file mode 100644 index cd8c738..0000000 --- a/data/minecraft/tags/function/tick.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "values": [ - "ferdinland:tick" - ] -} diff --git a/jmc_config.json b/jmc_config.json new file mode 100644 index 0000000..fd19024 --- /dev/null +++ b/jmc_config.json @@ -0,0 +1,7 @@ +{ + "namespace": "ferdinland", + "description": "Custom datapack for the Ferdinland Minecraft Server", + "pack_format": "48", + "target": "main.jmc", + "output": "." +} \ No newline at end of file diff --git a/main.hjmc b/main.hjmc new file mode 100644 index 0000000..b6a7a47 --- /dev/null +++ b/main.hjmc @@ -0,0 +1,5 @@ +#define createObjTrigger(x) scoreboard objectives add x trigger +#define createObjDummy(x) scoreboard objectives add x dummy + +#command guis +#command transfer diff --git a/main.jmc b/main.jmc new file mode 100644 index 0000000..4044763 --- /dev/null +++ b/main.jmc @@ -0,0 +1,3 @@ +import "src/*"; + +function __tick__() {} diff --git a/pack.mcmeta b/pack.mcmeta index 22fda89..cb3d578 100644 --- a/pack.mcmeta +++ b/pack.mcmeta @@ -1,10 +1,6 @@ { - "__comment": "The datapack is assembled by Datapack Assembler", - "__link": "https://far.ddns.me", - "__patreon": "Thank you to Someone, NatNATTO, Andrew and CadeMade for the support on https://patreon.com/GalSergey", - "pack": { - "description": "Custom datapack for the Ferdinland Minecraft Server", - "pack_format": 48 + "pack_format": 48, + "description": "Custom datapack for the Ferdinland Minecraft Server" } -} +} \ No newline at end of file diff --git a/src/commands.jmc b/src/commands.jmc new file mode 100644 index 0000000..aff832e --- /dev/null +++ b/src/commands.jmc @@ -0,0 +1,34 @@ +@lazy +function triggerCommand(objective, function) { + scoreboard players enable @a $objective; + execute as @a[scores={$objective=1..}] run $function; + scoreboard players set @a $objective 0; +} + + function command.transport_creative() { + transfer 10.0.0.13 25566; + } + + function command.transport_SMP() { + transfer 10.0.0.13 25565; + } + + function command.open_menu() { + guis open menu; + } + +class command { + @add(__load__) + function commandsLoad() { + createObjTrigger(transportCreative); + createObjTrigger(transportSMP); + createObjTrigger(menu); + } + + @add(__tick__) + function commandsTick() { + triggerCommand(transportCreative, command.transport_creative()); + triggerCommand(transportSMP, command.transport_SMP()); + triggerCommand(menu, command.open_menu()); + } +}