forum Forumsplay_arrow Minecraft fiber_manual_record Mods

1

How is world data stored in Minecraft?

1 emerald3 replies292 views
created 02/25/2013 1:49 pm by fiendfan1
last reply 03/02/2013 3:13 pm
I'm trying to make a game (Not a minecraft clone) using LWJGL, and I am having problems storing the world data.

I have been using a 3D array of a custom class (like the Block class), but obviously this is really expensive memory-wise and I keep running out of Java heap space.

Heres the code:
Click to reveal
GameObject data[][][];

public World()
{
data = new GameObject[1000][1000][1000];
}


Can anyone refence me to some files that show how the data of each block is saved / stored / retrieved?
Posted by avatar
fiendfan1
Level 20 : Expert Dragonborn
16

3 replies

1
03/02/2013 3:13 pm
Level 65 : High Grandmaster Cyborg
Teotoo
avatar
It writes the 16x16 chunks (individually) to the NBT. Things saved are the x and z coords of the chunk, last update time, etc. It then goes through the chunk, saving the data of each block, its ycoord, metadata, etc.

The class you're actually looking for is AnvilChunkLoader.
1
02/27/2013 10:07 pm
Level 31 : Artisan Modder
MCE626
avatar
TheBoohandled in World.java, and is saved in level.dat
1
02/25/2013 3:38 pm
Level 60 : High Grandmaster Modder
ehdfawq3er
avatar
The only thing I know is that it's probably handled in World.java, and is saved in level.dat. Sorry I couldn't be of more assistance

Planet Minecraft

Browse

Site

© 2010 - 2019
planetminecraft.com

Welcome