add data cloning API

This commit is contained in:
FalsePattern committed 2023-12-13 16:34:22 +01:00
1 parent f57883bfcf
commit 9858bb5e99
13 files changed
+241 -4

No files matched your search

@@ -8,6 +8,7 @@
package com.falsepattern.chunk.internal.vanilla;
import com.falsepattern.chunk.api.ChunkDataManager;
import com.falsepattern.chunk.api.ArrayUtil;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.chunk.Chunk;
@@ -39,4 +40,9 @@ public class BlocklightManager extends NibbleManager implements ChunkDataManager
public void readSectionFromNBT(Chunk chunk, ExtendedBlockStorage ebs, NBTTagCompound section) {
ebs.setBlocklightArray(new NibbleArray(section.getByteArray("BlockLight"), 4));
}
@Override
public void cloneSection(Chunk fromChunk, ExtendedBlockStorage from, ExtendedBlockStorage to) {
from.setBlocklightArray(ArrayUtil.copyArray(from.getBlocklightArray(), to.getBlocklightArray()));
}
}