Jump to content

Gogo1234

Members
  • Posts

    1
  • Joined

  • Last visited

Gogo1234's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. 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?
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.