mirror of
https://github.com/LegacyModdingMC/ChunkAPI.git
synced 2026-11-16 02:04:54 +00:00
The Great Naming Scheme Cleanup. Breaking change.
- Replaced "EBS" with "subchunk" - Replaced "section" with "subchunk" - Removed the Chunk* prefix from most classes - Data manager names much more descriptive and less verbose Yes, this contradicts the backwards compatibility requirements set forth in the FalsePatternLib StableAPI interface, however, we're still in beta, and only our mods use this library as far as I'm aware, so it's fine to make changes like this for now.
This commit is contained in:
19 files changed
+250
-265
No files matched your search
@@ -7,7 +7,7 @@
|
||||
|
||||
package com.falsepattern.chunk.internal.vanilla;
|
||||
|
||||
import com.falsepattern.chunk.api.ChunkDataManager;
|
||||
import com.falsepattern.chunk.api.DataManager;
|
||||
import com.falsepattern.chunk.api.ArrayUtil;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
@@ -15,10 +15,10 @@ import net.minecraft.world.chunk.Chunk;
|
||||
import net.minecraft.world.chunk.NibbleArray;
|
||||
import net.minecraft.world.chunk.storage.ExtendedBlockStorage;
|
||||
|
||||
public class BlocklightManager extends NibbleManager implements ChunkDataManager.SectionNBTDataManager {
|
||||
public class BlocklightManager extends NibbleManager implements DataManager.SubchunkDataManager {
|
||||
@Override
|
||||
protected NibbleArray getNibbleArray(ExtendedBlockStorage ebs) {
|
||||
return ebs.getBlocklightArray();
|
||||
protected NibbleArray getNibbleArray(ExtendedBlockStorage subchunk) {
|
||||
return subchunk.getBlocklightArray();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -27,22 +27,22 @@ public class BlocklightManager extends NibbleManager implements ChunkDataManager
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean sectionPrivilegedAccess() {
|
||||
public boolean subchunkPrivilegedAccess() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeSectionToNBT(Chunk chunk, ExtendedBlockStorage ebs, NBTTagCompound section) {
|
||||
section.setByteArray("BlockLight", ebs.getBlocklightArray().data);
|
||||
public void writeSubchunkToNBT(Chunk chunk, ExtendedBlockStorage subchunk, NBTTagCompound nbt) {
|
||||
nbt.setByteArray("BlockLight", subchunk.getBlocklightArray().data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readSectionFromNBT(Chunk chunk, ExtendedBlockStorage ebs, NBTTagCompound section) {
|
||||
ebs.setBlocklightArray(new NibbleArray(section.getByteArray("BlockLight"), 4));
|
||||
public void readSubchunkFromNBT(Chunk chunk, ExtendedBlockStorage subchunk, NBTTagCompound nbt) {
|
||||
subchunk.setBlocklightArray(new NibbleArray(nbt.getByteArray("BlockLight"), 4));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void cloneSection(Chunk fromChunk, ExtendedBlockStorage from, ExtendedBlockStorage to) {
|
||||
public void cloneSubchunk(Chunk fromChunk, ExtendedBlockStorage from, ExtendedBlockStorage to) {
|
||||
from.setBlocklightArray(ArrayUtil.copyArray(from.getBlocklightArray(), to.getBlocklightArray()));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user