dmulloy2 / ProtocolLib

Provides read and write access to the Minecraft protocol with Bukkit.
GNU General Public License v2.0
982 stars 259 forks source link

DimensionRegistry returns null #3018

Open ineanto opened 1 week ago

ineanto commented 1 week ago

Describe the bug Invoking WrappedRegistry#getDimensionRegistry throws a null pointer exception.

To Reproduce

  1. Download build 790
  2. Run the provided code snippet on server

Expected behavior This should not happen.

Version Info ProtocolLib dump

Additional context I was trying to access the Holder<DimensionManager> variable in the CommonPlayerSpawnInfo class. The code looks like this:

final StructureModifier<World> worldHolder = commonPlayerSpawnInfoStructure.getHolders(
                    MinecraftReflection.getDimensionManager(),
                    Converters.holder(BukkitConverters.getDimensionConverter(),
                            WrappedRegistry.getDimensionRegistry())
            );

Doing this results in ProtocolLib throwing out this error: No registry found for class net.minecraft.world.level.dimension.DimensionType. This is weird considering that there's a method called getDimensionRegistry inside the WrappedRegistry class... Any clues of why? Thank you!

Edit: clarified some things