Architectury API (Fabric/Forge/NeoForge)

Architectury API (Fabric/Forge/NeoForge)

170M Downloads

MenuRegistry in 1.21 NeoForge

gigabit101 opened this issue ยท 6 comments

commented

MenuRegistry.registerScreenFactory() does not seem to be working in NeoForge 1.21 however using NeoForge's RegisterMenuScreensEvent is working fine.

This only effects NeoForge and the MenuRegistry works fine in Fabric

commented

Had the same issue on 1.20.6; I assume it doesn't even get to call impl, since there were no errors when attempting to register the same screen twice...

commented

Same here, happens on 1.20.6 neoforge. It calls the registration but failed to register it in HandledScreens.PROVIDERS

commented

Also one thing I noticed that, MenuRegistry does work in fabric, but there are about 50/50 chance it fails to register.

commented

Any fixes yet?

commented

It's supposed to work:

public static <H extends AbstractContainerMenu, S extends Screen & MenuAccess<H>> void registerScreenFactory(MenuType<? extends H> type, ScreenFactory<H, S> factory) {
EventBusesHooks.whenAvailable(ArchitecturyConstants.MOD_ID, bus -> {
bus.addListener(RegisterMenuScreensEvent.class, event -> event.register(type, factory::create));
});
}
but there might be an oversight here

commented

Do you have a reproducible testmod/log files?