mirror of
https://github.com/GTNewHorizons/Postea.git
synced 2026-11-20 04:09:43 +00:00
Saving world data
This commit is contained in:
1 parent
f693ca75b9
commit
06350f82ac
4 files changed
+151
-4
No files matched your search
@@ -5,6 +5,7 @@ import java.util.List;
|
||||
import java.util.function.BiFunction;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.colen.postea.checker.PosteaProcessedChunksWorldSavedData;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
@@ -17,12 +18,19 @@ import akka.japi.Pair;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
public class ChunkFixerUtility {
|
||||
|
||||
public static void processChunkNBT(NBTTagCompound compound, World world) {
|
||||
transformTileEntities(compound, world);
|
||||
transformNormalBlocks(compound, world);
|
||||
NBTTagCompound level = compound.getCompoundTag("Level");
|
||||
int x = level.getInteger("xPos");
|
||||
int z = level.getInteger("zPos");
|
||||
|
||||
if (PosteaProcessedChunksWorldSavedData.addChunk(x, z)) {
|
||||
transformTileEntities(compound, world);
|
||||
transformNormalBlocks(compound, world);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
private static void transformNormalBlocks(NBTTagCompound compound, World world) {
|
||||
NBTTagCompound level = compound.getCompoundTag("Level");
|
||||
NBTTagList sections = level.getTagList("Sections", 10);
|
||||
@@ -171,6 +179,8 @@ public class ChunkFixerUtility {
|
||||
} // Otherwise they are removed, therefore not appended.
|
||||
|
||||
conversionInfo.add(new ConversionInfo(x, y, z, blockInfo));
|
||||
} else {
|
||||
tileEntitiesCopy.appendTag(tileEntity);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user