Minestom
Minestom copied to clipboard
Minestom unusable as module dependency
The issue
When using minestom as an automatic module dependency in a java 9 module, a bunch of errors appear during compilation:
error: the unnamed module reads package net.kyori.adventure.nbt from both net.kyori.adventure.nbt and net.minestom.server
error: module net.kyori.adventure.text.serializer.plain reads package net.kyori.adventure.nbt from both net.minestom.server and net.kyori.adventure.nbt
error: module net.kyori.adventure.text.serializer.gson reads package net.kyori.adventure.nbt from both net.minestom.server and net.kyori.adventure.nbt
error: module net.kyori.adventure.text.serializer.json reads package net.kyori.adventure.nbt from both net.minestom.server and net.kyori.adventure.nbt
error: module net.kyori.adventure reads package net.kyori.adventure.nbt from both net.minestom.server and net.kyori.adventure.nbt
error: module net.kyori.adventure.nbt reads package net.kyori.adventure.nbt from both net.minestom.server and net.kyori.adventure.nbt
error: module net.kyori.adventure.key reads package net.kyori.adventure.nbt from both net.minestom.server and net.kyori.adventure.nbt
error: module net.kyori.adventure.text.logger.slf4j reads package net.kyori.adventure.nbt from both net.minestom.server and net.kyori.adventure.nbt
error: module it.unimi.dsi.fastutil reads package net.kyori.adventure.nbt from both net.minestom.server and net.kyori.adventure.nbt
error: module com.google.auto.service reads package net.kyori.adventure.nbt from both net.minestom.server and net.kyori.adventure.nbt
error: module net.kyori.adventure.text.serializer.legacy reads package net.kyori.adventure.nbt from both net.minestom.server and net.kyori.adventure.nbt
error: module net.minestom.server reads package net.kyori.adventure.nbt from both net.kyori.adventure.nbt and net.minestom.server
I think the reason for this is because of the net.kyori.adventure.nbt.TagStringIOExt class, which causes minestom to export the net.kyori.adventure.nbt package twice.
How to reproduce
- Clone this repository which reproduces the problem.
- Try to compile it.
Can indeed reproduce; Why do you need a module-info.java? It fixed it for me when I deleted this.
Can indeed reproduce; Why do you need a module-info.java? It fixed it for me when I deleted this.
There are some advenateges when using java modules. For example you can implement or extend sealed intefaces/classes outside a package of the class that is being implemented. I've used that too for a while, but most Minecraft libraries don't even support it.
I see. I didn't know that, +1 Braincell.
Fixed in #2781, works with 2025.07.30-1.21.8