Posted August 6, 20232 yr I want to initialize things to DeferredRegisters, but not statically. public static final RegistryObject<Block> bonzanium_casing=register.register(BonzaniumCasing.class.getAnnotation(Register.class).id(),()->new BonzaniumCasing()); ↑ This is what I don't want I want something like this ↓ public static final RegistryObject<Block> bonzanium_casing=register(new BonzaniumCasing()); protected static final RegistryObject<Block> register(Block block){ if(block.getClass().isAnnotationPresent(Register.class)){ Register reg = block.getClass().getAnnotation(Register.class); String id=reg.id(); return register.register(id,()->block); }else { Internal.LOGGER.warn("Block {} has no @Register annotation",block.getClass().getName()); return null; } } Whenever I try to do something like that i get the following error? Caused by: java.lang.IllegalStateException: Registry is already frozen Why does that happen? When do the registries freeze? Edited August 16, 20232 yr by Gogo1234
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.