Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FluidTypes are not registered #739

Open
digitalseraphim opened this issue Nov 13, 2023 · 0 comments
Open

FluidTypes are not registered #739

digitalseraphim opened this issue Nov 13, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@digitalseraphim
Copy link

Minecraft Version

1.19.2

KubeJS Version

1902.6.2-build.39 (all since Fluid API was added)

Rhino Version

1902.2.2-build.280

Architectury Version

6.5.85

Forge/Fabric Version

Forge 43.2.23

Describe your issue

I have also discussed this in a ticket on the discord: https://discord.com/channels/303440391124942858/1173402337507811359

The FluidTypes that are generated by the Architectury API for the Fluids created are not registered with the Forge FluidType registry. There is an Architectury bug that I have submitted a ticket for that creates multiple FluidTypes when only one should be generated. (architectury/architectury-api#447)

In the KubeJS addon I'm making, I am currently registering the fluid types like this:

    public KubeFluidInteraction() {
        var bus = FMLJavaModLoadingContext.get().getModEventBus();
        bus.addListener(KubeFluidInteraction::registerFluidTypes);
    }

    public static void registerFluidTypes(RegisterEvent event) {
        // we do a bunch of work below, so only do it if it's the right RegisterEvent
        if (event.getRegistryKey() != ForgeRegistries.Keys.FLUID_TYPES) {
            return;
        }
        for (var builder : RegistryInfo.FLUID) {
            if (builder instanceof FluidBuilder b) {
                Fluid f = ForgeRegistries.FLUIDS.getValue(b.id);
                event.register(ForgeRegistries.Keys.FLUID_TYPES, b.id, () -> f.getFluidType());
            }
        }
    }

Crash report/logs

No response

@digitalseraphim digitalseraphim added the bug Something isn't working label Nov 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant