• Recently Browsing

    No registered users viewing this page.

  • Posts

    • All my libraries are inside the jar now, but Minecraft does not recognize it as a mod anymore...
    • If you only copied over the relevant files from a different project, then those source folders won't exist normally. You will need to create them manually and then rerun your gradle commands to tell everything that "hey, I exist now".
    • The basic idea is right, yes. There are some intricacies you need to take into consideration (such as crossing chunk borders and what happens at world load), etc.   I have an implementation for ComputerCraft turtles here (though written in Kotlin). The basic idea is that it checks every tick if the position changed and if it did, it will compute which chunks to load (which is just the current chunk or also the next chunk over if it is at the edge of a chunk). Then it will check if the set of chunks to load has changed since the last tick and if so, unforce resp. force the new chunks. Then there is also a WorldSavedData, which keeps track of which chunks are loaded by which turtle and ensures the chunks are loaded again on world load.
    • This is the first time i try to mess with minecraft chunk loading, and i'd just like to get a little feedback on this problem (not asking for code examples 😁). I am implementing an entity that can spawn anywhere in the world (maybe in a certain radius around the player), it will have a relatively short life span and a fixed direction vector. However i need it to always be processed, from when it spawns to when it leaves the world, no matter where the player is relatively to the entity. Also the entity can interact with the world, destroying the blocks it finds in its path until it reaches its destination and damaging living entities it collides with. After diving a bit into the code that manages chunks the first and simpler solution that came to my mind was simply to force load the chunk the entity is in and the next chunk it will traverse based on its direction (to avoid the entity entering an unloaded chunk and thus stop being updated). Then when the entity dies i just force unload only the chunks that were loaded by the entity, because there may be chunks that were already loaded by something else for whatever reason. The chunk loading and storing should be implemented in the form of a world capability i guess, and internally would just replicate what the /forceload command does. So the question is: would this be the the best or most efficient way to achieve something like that? And is there something else i should take into account to not create issues when force loading/unloading chunks?
  • Topics

  • Who's Online (See full list)