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

IClientFluidTypeExtension for Neo #551

Open
Soaryn opened this issue Aug 23, 2024 · 1 comment
Open

IClientFluidTypeExtension for Neo #551

Soaryn opened this issue Aug 23, 2024 · 1 comment

Comments

@Soaryn
Copy link

Soaryn commented Aug 23, 2024

I don't actively use Architectury, so determining to whom would need to be handling this scenario is more of a mystery. However assuming it is the side of the registry API, it seems IClientFluidTypeExtension is not initialized for fluids created with Architectury when using Neo from my best guess. It is registered via an event now RegisterClientExtensionsEvent. The way I handle it for all of my fluids is via a ContentMap that just has reference to all of the fluids I register, instead of me specifying one at a time, but for other systems I have opt-in and opt-out since it is what I need.

    @SubscribeEvent
    private static void initializeClient(RegisterClientExtensionsEvent event) {
        for (XyFluidType fluid : ContentMap.getFluids()) {
            event.registerFluidType(new IClientFluidTypeExtensions() {
                @Override
                public @NotNull ResourceLocation getStillTexture() {
                    return fluid.StillResource;
                }

                @Override
                public @NotNull ResourceLocation getFlowingTexture() {
                    return fluid.FlowingResource;
                }
            }, fluid);
        }
    }

As I mentioned, I don't use Architectury, so how it is implemented isn't much of a pain point for me, but there are quite a few mods that seemingly add a fluid with it, that break due to the texture being null incorrectly. If it is up to the modder to register these extensions, you may want to put in some safe guards to inform a dev that they are missing at the very least to try to mitigate the number that slip through.

Example of a mod that has recently come by my issue tracker: st0x0ef/stellaris#17

@MaxNeedsSnacks
Copy link
Member

I haven't worked on Architectury in a hot minute, but from a cursory glance I found out that the mod doesn't seem to actually register fluid types? This should probably additionally be looked at for this issue, since there is a possibility RegisterClientExtensionsEvent needs them to be registered (and they should be! I'm not sure why they aren't tbh)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants