{"action":"opened","issue":{"url":"https://api.github.com/repos/aidancbrady/Mekanism/issues/4949","repository_url":"https://api.github.com/repos/aidancbrady/Mekanism","labels_url":"https://api.github.com/repos/aidancbrady/Mekanism/issues/4949/labels{/name}","comments_url":"https://api.github.com/repos/aidancbrady/Mekanism/issues/4949/comments","events_url":"https://api.github.com/repos/aidancbrady/Mekanism/issues/4949/events","html_url":"https://github.com/aidancbrady/Mekanism/issues/4949","id":298057984,"number":4949,"title":"You're registering stuff at the wrong time","user":{"login":"jaredlll08","id":5553605,"avatar_url":"https://avatars3.githubusercontent.com/u/5553605?v=4","gravatar_id":"","url":"https://api.github.com/users/jaredlll08","html_url":"https://github.com/jaredlll08","followers_url":"https://api.github.com/users/jaredlll08/followers","following_url":"https://api.github.com/users/jaredlll08/following{/other_user}","gists_url":"https://api.github.com/users/jaredlll08/gists{/gist_id}","starred_url":"https://api.github.com/users/jaredlll08/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaredlll08/subscriptions","organizations_url":"https://api.github.com/users/jaredlll08/orgs","repos_url":"https://api.github.com/users/jaredlll08/repos","events_url":"https://api.github.com/users/jaredlll08/events{/privacy}","received_events_url":"https://api.github.com/users/jaredlll08/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-18T04:26:16Z","updated_at":"2018-02-18T04:26:16Z","closed_at":null,"author_association":"NONE","body":"#### Issue description:\r\nYou're registering the following at the wrong time:\r\nRebuilding a cache too late:\r\nhttps://github.com/aidancbrady/Mekanism/blob/1.12/src/main/java/mekanism/common/Mekanism.java#L657-L663\r\n that cache should be built in postinit, it is the last stage that recipes can be changed for them to still appear in JEI, and is used in many mods as a \"well now that everything is done, lets do stuff to the registered things\", maybe just build the cache during that stage instead of rebuilding it?\r\n\r\n\r\nThis is just a thought:\r\nShouldn't this code be in FMLServerStoppedEvent?\r\nhttps://github.com/aidancbrady/Mekanism/blob/1.12/src/main/java/mekanism/common/Mekanism.java#L669-L691\r\nDoing it this way, if a mod is using FMLServerStopping properly, and taking long to do so, it may cause issues if those lists are still in use or something? Just seems a tiny bit risky to clear them when the server is still technically running.\r\n\r\nnot really an issue, but just naming pls\r\nhttps://github.com/aidancbrady/Mekanism/blob/1.12/src/main/java/mekanism/common/Mekanism.java#L694\r\n\r\nthat method name is completely wrong.\r\n\r\nEvents should be done in preinit\r\nhttps://github.com/aidancbrady/Mekanism/blob/1.12/src/main/java/mekanism/common/Mekanism.java#L759-L760\r\nhttps://github.com/aidancbrady/Mekanism/blob/1.12/src/main/java/mekanism/common/Mekanism.java#L772\r\nhttps://github.com/aidancbrady/Mekanism/blob/1.12/src/main/java/mekanism/common/Mekanism.java#L840\r\n\r\nEntities should be registered via the event:\r\nhttps://github.com/aidancbrady/Mekanism/blob/1.12/src/main/java/mekanism/common/Mekanism.java#L800\r\n\r\n\r\nAccording to forge docs, this should be done in Preinit, but that seems stupid, I personally would move this to the Register<Item> event or init\r\nhttps://github.com/aidancbrady/Mekanism/blob/1.12/src/main/java/mekanism/common/Mekanism.java#L837\r\n\r\nLex has mentioned that TileEntities should be registered with blocks in the Register<Block> event\r\nhttps://github.com/aidancbrady/Mekanism/blob/1.12/src/main/java/mekanism/common/Mekanism.java#L617-L642\r\n\r\n\r\nNot *too* big, but the mod isn't fully loaded at this state\r\nhttps://github.com/aidancbrady/Mekanism/blob/1.12/src/main/java/mekanism/common/Mekanism.java#L829\r\n\r\n\r\nThis stuff should happen later, right now this gets called as soon as the Mekanism class is loaded, so FMLConstructingEvent essentially, I would change it to at least preinit, maybe init.\r\n\r\nhttps://github.com/aidancbrady/Mekanism/blob/1.12/src/main/java/mekanism/common/MekanismFluids.java#L54-L55\r\n\r\n#### Version (make sure you are on the latest version before reporting):\r\n**Forge:** NA \r\n**Mekanism:** 1.12 branch\r\n**Other relevant version:** "}}
{"actor":{"display_login":"jaredlll08"}}