aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/makamys/lodmod/renderer/LODChunk.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/makamys/lodmod/renderer/LODChunk.java')
-rw-r--r--src/main/java/makamys/lodmod/renderer/LODChunk.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/main/java/makamys/lodmod/renderer/LODChunk.java b/src/main/java/makamys/lodmod/renderer/LODChunk.java
index e1582b1..96c0261 100644
--- a/src/main/java/makamys/lodmod/renderer/LODChunk.java
+++ b/src/main/java/makamys/lodmod/renderer/LODChunk.java
@@ -4,6 +4,9 @@ import java.util.List;
import makamys.lodmod.LODMod;
import net.minecraft.entity.Entity;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.nbt.NBTTagEnd;
+import net.minecraft.nbt.NBTTagList;
import net.minecraft.world.chunk.Chunk;
public class LODChunk {
@@ -67,4 +70,18 @@ public class LODChunk {
}
}
+ public NBTTagCompound saveToNBT() {
+ NBTTagCompound nbt = new NBTTagCompound();
+ nbt.setInteger("x", x);
+ nbt.setInteger("z", z);
+ NBTTagCompound chunkMeshesCompound = new NBTTagCompound();
+ for(int i = 0; i < chunkMeshes.length; i++) {
+ if(chunkMeshes[i] != null) {
+ chunkMeshesCompound.setTag(String.valueOf(i), chunkMeshes[i].nbtData);
+ }
+ }
+ nbt.setTag("chunkMeshes", chunkMeshesCompound);
+ return nbt;
+ }
+
}