Map that works fine on vanilla/paper server does not work properly on folia #180

Closed
opened 2024-01-07 05:39:15 +01:00 by rat233 · 1 comment
rat233 commented 2024-01-07 05:39:15 +01:00 (Migrated from github.com)

Expected behavior

I got a map with datapacks (bingo) and expect it to work on folia server.

Observed/Actual behavior

The map get loaded but it doesn't work fine on folia server. The server failed to load mcfunctions like this in the logfile:
[11:51:13] [ServerMain/ERROR]: Failed to load function flytre:full_init java.util.concurrent.CompletionException: java.lang.IllegalArgumentException: Whilst parsing command on line 1: Unknown or incomplete command, see below for error at position 0: <--[HERE] at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315) ~[?:?] at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320) ~[?:?] at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1770) ~[?:?] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[?:?] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[?:?] at java.lang.Thread.run(Thread.java:1623) ~[?:?] Caused by: java.lang.IllegalArgumentException: Whilst parsing command on line 1: Unknown or incomplete command, see below for error at position 0: <--[HERE] at net.minecraft.commands.functions.CommandFunction.fromLines(CommandFunction.java:73) ~[folia-1.20.4.jar:git-Folia-"6928284"] at net.minecraft.server.ServerFunctionLibrary.lambda$reload$2(ServerFunctionLibrary.java:80) ~[?:?] at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768) ~[?:?] ... 3 more
there are a lot of errors like this, but the full log is too long so I paste a part of it.

Steps/models to reproduce

maps I use: (bingo)
Download the map and unzip it into world folder
start scripts:
@echo off java -Dfile.encoding=GB8030 -Xms3G -Xmx16G -jar folia-paperclip-1.20.4-R0.1-SNAPSHOT-reobf.jar -nogui pause
java version: jdk 17
start the server with this script

Plugin and Datapack List

No plugin is installed.
I failed to run /datapack list
Server response Unknown command

Folia version

[12:31:01] [Region Scheduler Thread #0/INFO]: Checking version, please wait... [12:31:02] [Thread-8/INFO]: This server is running Folia version git-Folia-"6928284" (MC: 1.20.4) (Implementing API version 1.20.4-R0.1-SNAPSHOT) (Git: 6928284 on dev/1.20.4) Error obtaining version information Previous version: git-Purpur-2110 (MC: 1.20.4)

Other

No response

### Expected behavior I got a map with datapacks [(bingo)](https://www.curseforge.com/minecraft/customization/mc-bingo) and expect it to work on folia server. ### Observed/Actual behavior The map get loaded but it doesn't work fine on folia server. The server failed to load mcfunctions like this in the logfile: ` [11:51:13] [ServerMain/ERROR]: Failed to load function flytre:full_init java.util.concurrent.CompletionException: java.lang.IllegalArgumentException: Whilst parsing command on line 1: Unknown or incomplete command, see below for error at position 0: <--[HERE] at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315) ~[?:?] at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320) ~[?:?] at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1770) ~[?:?] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[?:?] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[?:?] at java.lang.Thread.run(Thread.java:1623) ~[?:?] Caused by: java.lang.IllegalArgumentException: Whilst parsing command on line 1: Unknown or incomplete command, see below for error at position 0: <--[HERE] at net.minecraft.commands.functions.CommandFunction.fromLines(CommandFunction.java:73) ~[folia-1.20.4.jar:git-Folia-"6928284"] at net.minecraft.server.ServerFunctionLibrary.lambda$reload$2(ServerFunctionLibrary.java:80) ~[?:?] at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768) ~[?:?] ... 3 more ` there are a lot of errors like this, but the full log is too long so I paste a part of it. ### Steps/models to reproduce maps I use: [(bingo)](https://www.curseforge.com/minecraft/customization/mc-bingo) Download the map and unzip it into world folder start scripts: ` @echo off java -Dfile.encoding=GB8030 -Xms3G -Xmx16G -jar folia-paperclip-1.20.4-R0.1-SNAPSHOT-reobf.jar -nogui pause ` java version: jdk 17 start the server with this script ### Plugin and Datapack List No plugin is installed. I failed to run /datapack list Server response Unknown command ### Folia version ` [12:31:01] [Region Scheduler Thread #0/INFO]: Checking version, please wait... [12:31:02] [Thread-8/INFO]: This server is running Folia version git-Folia-"6928284" (MC: 1.20.4) (Implementing API version 1.20.4-R0.1-SNAPSHOT) (Git: 6928284 on dev/1.20.4) Error obtaining version information Previous version: git-Purpur-2110 (MC: 1.20.4) ` ### Other _No response_
Malfrador commented 2024-01-07 05:45:56 +01:00 (Migrated from github.com)

Folia does not support all vanilla commands. The disabled commands include the /datapack, /schedule and /function commands. Your datapack looks like its using those and other disabled commands as well as command functions which also do not work on Folia.

As such, this is expected behaviour and not a bug

Vanilla commands expect to be run within a global context, not a limited one like Folia. Its unlikely that command functions will ever work on Folia. They can be replaced using plugins which also offer much better performance and have proper ways of dealing with the different tick threads and scheduling that Folia has.

Folia does not support all vanilla commands. The [disabled commands](https://docs.papermc.io/folia/faq#what-commands-does-folia-disable) include the /datapack, /schedule and /function commands. Your datapack looks like its using those and other disabled commands as well as command functions which also do not work on Folia. As such, this is expected behaviour and not a bug Vanilla commands expect to be run within a global context, not a limited one like Folia. Its unlikely that command functions will ever work on Folia. They can be replaced using plugins which also offer much better performance and have proper ways of dealing with the different tick threads and scheduling that Folia has.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Minecraft/Folia#180
No description provided.