• Recently Browsing

    No registered users viewing this page.

  • Posts

    • Utility classes can often help reduce the amount of code you need to write. For example, back on 1.12 (when we no longer had the Game Registry and had to register item models ourselves) I wrote this class: https://github.com/Draco18s/ReasonableRealism/blob/1.14.4/src/main/java/com/draco18s/hardlib/EasyRegistry.java  That's the 1.14 version, but the switch was pretty straight forward. It meant I could have my "1.7-like" register-a-block one or two line clean system: https://github.com/Draco18s/ReasonableRealism/blob/1.14.4/src/main/java/com/draco18s/harderores/HarderOres.java#L119-L131   Instead of this utter nonsense people were doing where they'd create a block, set its registry name, set its translation key, add it to a BLOCKS list, then add the blocks list to the registry, then over in the item event loop over their entire BLOCKS list, create an item (set its registry and translation keys), set a creative tab, and add it to an ITEMS list. And then realize "herp a derp, I created this giant loop that does all my blocks, how does I do more than one creative tab where some blocks are in one and others are in another? What if my block has variants that need different items?" and then end up needing nine lines per block (plus a couple lines for registering a model in the client proxy!).   The deferred registry system is what I'll be using on 1.16 because it solves the problem I was solving.
    • You can use setValidator to provide a check for which texts are valid.
    • During mod loading any event extending ParallelDispatchEvent (mostly FMLCommonSetupEvent and FMLClientSetupEvent) are run in parallel on a threadpool. If you access non-threadsafe things (e.g. BrewingRecipeRegistry) you have to use enqueueWork, which will run the given code synchronously on the main thread after the parallel dispatch.   As for client and server thread: There is mainly just the server and client main thread, although the server uses separate threads for world generation (if I remember correctly) and the client uses separate threads (sometimes) for chunk rendering - but you will rarely find problems here. 99% of Minecraft is still single threaded.
    • I derped completely and tested it with a horse. Lesson of the day: A boat is not a horse. Confirmed with a boat... Will make a fix later.
    • how long will this topic go on because i wanna close it but i am only gonne close it if i have a awnser
  • Topics

  • Who's Online (See full list)