mirror of
https://github.com/LegacyModdingMC/ChunkAPI.git
synced 2026-11-16 02:04:54 +00:00
Implement AnvilChunkLoader coupling
This commit is contained in:
13 files changed
+477
-92
No files matched your search
@@ -1,9 +1,13 @@
|
||||
package com.falsepattern.chunk.internal.vanilla;
|
||||
|
||||
import com.falsepattern.chunk.api.ChunkDataManager;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
import net.minecraft.world.chunk.NibbleArray;
|
||||
import net.minecraft.world.chunk.storage.ExtendedBlockStorage;
|
||||
|
||||
public class BlocklightManager extends NibbleManager {
|
||||
public class BlocklightManager extends NibbleManager implements ChunkDataManager.SectionNBTDataManager {
|
||||
@Override
|
||||
protected NibbleArray getNibbleArray(ExtendedBlockStorage ebs) {
|
||||
return ebs.getBlocklightArray();
|
||||
@@ -13,4 +17,19 @@ public class BlocklightManager extends NibbleManager {
|
||||
public String id() {
|
||||
return "blocklight";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean sectionPrivilegedAccess() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeSectionToNBT(Chunk chunk, ExtendedBlockStorage ebs, NBTTagCompound section) {
|
||||
section.setByteArray("BlockLight", ebs.getBlocklightArray().data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readSectionFromNBT(Chunk chunk, ExtendedBlockStorage ebs, NBTTagCompound section) {
|
||||
ebs.setBlocklightArray(new NibbleArray(section.getByteArray("BlockLight"), 4));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user