Including markers using `include "XYZ"` doesn't work
rjp opened this issue ยท 4 comments
What i did / Steps to reproduce
marker-sets: {
test-waypoints: {
label: "test waypoints"
toggleable: true
default-hidden: true
sorting: 0
markers: {
include "/data/minecraft/2024.poi.ov"
}
}
}
Where /data/minecraft/2024.poi.ov
is:
poi-14253890001387550694: {
type: "poi"
position: { x: 815, y: 77, z: -3 }
label: "P1"
detail: "Portal 1"
icon: "assets/poi.svg"
anchor: { x: 25, y: 45 }
sorting: 0
listed: true
classes: []
min-distance: 10
max-distance: 10000000
}
Including the contents of the /data/minecraft/2024.poi.ov
file directly does, of course, work fine and show me the relevant P1 marker.
Expected result
The marker set to appear in Bluemap with a marker P1 as if I'd included the contents of /data/minecraft/2024.poi.ov
directly into the config file.
Actual result
The marker set name appears in the marker list without any child markers (ie P1 is missing) as if the include
was being silently ignored.
Context
BlueMap Version: 3.20-fabric-1.20
Linux Arch server running zulu18.30.11-ca-jdk18.0.1-linux_x64
.
pyhocon
correctly handles the include which suggests my understanding of the HOCON format is correct.
I am converting waypoints from Xaero's minimap mod to markers on Bluemap - haven't found anything which suggests there's a way to link Xaero's mod to Bluemap's dynamic marker API hence the file inclusion.
BlueMap uses the latest version of the Configurate-HOCON library to load the configs.
An already known bug with include
is that relative paths are relative to the working-directory of the java-application instead of relative to the including file.
However, your path seems to be absolute.
Have you made sure, that the java-process actually has access-rights to the file you are trying to include?
If you don't want it to fail silently, you will need to add required(..)
around the path, e.g.:
include required("/data/minecraft/2024.poi.ov")
.
Can you please add that required(..)
and see if it then throws an error with more information about the problem? :)
Alright, perfect, the file()
part made it work, thanks.
I did try putting the include file next to the parent (what I'd consider "adjacent to" but I guess there's a different meaning in the linked documentation.)
Aha, yes, should have thought of that. Adding that gives the error of java.io.IOException: resource not found on classpath: data/minecraft/20 24.poi.ov.conf
. Moving the file to various places near the Minecraft server jar and changing the path to relative also gives the same error.
Using jinfo
on the process gives me java.class.path=fabric-server-mc.1.20-loader.0.15.3-launcher.1.0.0.jar
. I've restarted the server with various -cp
, -classpath
, CLASSPATH=
variants but it doesn't seem to get picked up.
As for access, it definitely has rights because it's running as me.
(Apologies, my Java knowledge is minimal, hence the floundering)
Okay, it looks like it's trying to read the file from the classpath-resources instead of the file-system.
As described here it does that as a fallback.
To make sure it is searching for a file on the file-system please try using include required(file("/data/minecraft/2024.poi.ov"))
and see if that also gives you an error.
Also, if this gives you an error again, please include the full error + stacktrace :)