Jump to content

sieg

Members
  • Posts

    6
  • Joined

  • Last visited

Everything posted by sieg

  1. Why is the ChunkEvent.load event called around 2,000 times when I join the game? There seriously can't be that many chunks, right?
  2. Hey guys. When a chunk loads, I'm trying to save information about that chunk to a file. However, the event I'm listening to is the ChunkEvent.load event. When my code is executed upon handling the event, I believe the chunk data has not been initialized yet? So it caused the NullPointerException. At least this is my theory. Is there any way to execute my code directly after the chunk has finished loading? What I have now public class MapEvents { @SubscribeEvent public void Load(ChunkEvent event) { .... for(int i = 0; i < 1; i++){ ExtendedBlockStorage section = chunkStorage[0]; //causes NullPointerException, presumably because chunk data has not been fully loaded System.out.print(section.getYLocation()); } } }
  3. What I am trying to accomplish is similar to how VoxelMap stores map data. A chunk is loaded or re-loaded on the client. Simply put, my mod catches the event and finds all 16x16x256 blocks in the chunk, storing an array of data for each individual block into a text file called chunk_x_y. block 0: blockID,blockState,timestamp block 1: blockID,blockState,timestamp block 2: blockID,blockState,timestamp block 3 ... (of course it won't be stored in that format, but it's effectively how the data will be stored)
  4. Hey guys! Brand new to this, finally got everything setup and working. I tried googling and searching through the events I need, but there's just so much information it's very overwelhming. I'm trying to create a mod that stores the most up-to-date chunk information. So when a chunk is loaded on the client, I want to be able to access that chunk data and save it to file (surface to sky, and the first four layers down into the ground). Anyways, what event am I looking for, and what event bus is it a part of? I would be grateful is someone could point me in the correct direction. Thanks!
×
×
  • Create New...

Important Information

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