Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ protected <T extends Future<T>> T internalCall(
}

if (createCopy) {
char[] tmpLoad = loadPrivately(layerNo);
char[] tmpLoad = load(layerNo);
char[] copyArr = new char[4096];
System.arraycopy(tmpLoad, 0, copyArr, 0, 4096);
copy.storeSection(getSectionIndex, copyArr);
Expand Down Expand Up @@ -535,7 +535,7 @@ protected <T extends Future<T>> T internalCall(
} else if (existingSection != getSections(false)[getSectionIndex]) {
this.sections[getSectionIndex] = existingSection;
this.reset();
} else if (!Arrays.equals(update(getSectionIndex, new char[4096], true), loadPrivately(layerNo))) {
} else if (!Arrays.equals(update(getSectionIndex, new char[4096], true), load(layerNo))) {
this.reset(layerNo);
/*} else if (lock.isModified()) {
this.reset(layerNo);*/
Expand All @@ -552,7 +552,7 @@ protected <T extends Future<T>> T internalCall(

newSection = PaperweightPlatformAdapter.newChunkSection(
layerNo,
this::loadPrivately,
this::load,
setArr,
adapter,
biomeRegistry,
Expand Down Expand Up @@ -1016,7 +1016,7 @@ public synchronized boolean trim(boolean aggressive) {
} else {
for (int i = getMinSectionPosition(); i <= getMaxSectionPosition(); i++) {
int layer = i - getMinSectionPosition();
if (!hasSection(i) || !super.sections[layer].isFull()) {
if (!hasSection(i) || super.blocks[layer] == null) {
continue;
}
LevelChunkSection existing = getSections(true)[layer];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ protected <T extends Future<T>> T internalCall(
}

if (createCopy) {
char[] tmpLoad = loadPrivately(layerNo);
char[] tmpLoad = load(layerNo);
char[] copyArr = new char[4096];
System.arraycopy(tmpLoad, 0, copyArr, 0, 4096);
copy.storeSection(getSectionIndex, copyArr);
Expand Down Expand Up @@ -535,7 +535,7 @@ protected <T extends Future<T>> T internalCall(
} else if (existingSection != getSections(false)[getSectionIndex]) {
this.sections[getSectionIndex] = existingSection;
this.reset();
} else if (!Arrays.equals(update(getSectionIndex, new char[4096], true), loadPrivately(layerNo))) {
} else if (!Arrays.equals(update(getSectionIndex, new char[4096], true), load(layerNo))) {
this.reset(layerNo);
/*} else if (lock.isModified()) {
this.reset(layerNo);*/
Expand All @@ -552,7 +552,7 @@ protected <T extends Future<T>> T internalCall(

newSection = PaperweightPlatformAdapter.newChunkSection(
layerNo,
this::loadPrivately,
this::load,
setArr,
adapter,
biomeRegistry,
Expand Down Expand Up @@ -1017,7 +1017,7 @@ public synchronized boolean trim(boolean aggressive) {
} else {
for (int i = getMinSectionPosition(); i <= getMaxSectionPosition(); i++) {
int layer = i - getMinSectionPosition();
if (!hasSection(i) || !super.sections[layer].isFull()) {
if (!hasSection(i) || super.blocks[layer] == null) {
continue;
}
LevelChunkSection existing = getSections(true)[layer];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ protected <T extends Future<T>> T internalCall(
}

if (createCopy) {
char[] tmpLoad = loadPrivately(layerNo);
char[] tmpLoad = load(layerNo);
char[] copyArr = new char[4096];
System.arraycopy(tmpLoad, 0, copyArr, 0, 4096);
copy.storeSection(getSectionIndex, copyArr);
Expand Down Expand Up @@ -536,7 +536,7 @@ protected <T extends Future<T>> T internalCall(
} else if (existingSection != getSections(false)[getSectionIndex]) {
this.sections[getSectionIndex] = existingSection;
this.reset();
} else if (!Arrays.equals(update(getSectionIndex, new char[4096], true), loadPrivately(layerNo))) {
} else if (!Arrays.equals(update(getSectionIndex, new char[4096], true), load(layerNo))) {
this.reset(layerNo);
/*} else if (lock.isModified()) {
this.reset(layerNo);*/
Expand All @@ -553,7 +553,7 @@ protected <T extends Future<T>> T internalCall(

newSection = PaperweightPlatformAdapter.newChunkSection(
layerNo,
this::loadPrivately,
this::load,
setArr,
adapter,
biomeRegistry,
Expand Down Expand Up @@ -1018,7 +1018,7 @@ public synchronized boolean trim(boolean aggressive) {
} else {
for (int i = getMinSectionPosition(); i <= getMaxSectionPosition(); i++) {
int layer = i - getMinSectionPosition();
if (!hasSection(i) || !super.sections[layer].isFull()) {
if (!hasSection(i) || super.blocks[layer] == null) {
continue;
}
LevelChunkSection existing = getSections(true)[layer];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ protected <T extends Future<T>> T internalCall(
}

if (createCopy) {
char[] tmpLoad = loadPrivately(layerNo);
char[] tmpLoad = load(layerNo);
char[] copyArr = new char[4096];
System.arraycopy(tmpLoad, 0, copyArr, 0, 4096);
copy.storeSection(getSectionIndex, copyArr);
Expand Down Expand Up @@ -534,7 +534,7 @@ protected <T extends Future<T>> T internalCall(
} else if (existingSection != getSections(false)[getSectionIndex]) {
this.sections[getSectionIndex] = existingSection;
this.reset();
} else if (!Arrays.equals(update(getSectionIndex, new char[4096], true), loadPrivately(layerNo))) {
} else if (!Arrays.equals(update(getSectionIndex, new char[4096], true), load(layerNo))) {
this.reset(layerNo);
/*} else if (lock.isModified()) {
this.reset(layerNo);*/
Expand All @@ -551,7 +551,7 @@ protected <T extends Future<T>> T internalCall(

newSection = PaperweightPlatformAdapter.newChunkSection(
layerNo,
this::loadPrivately,
this::load,
setArr,
adapter,
biomeRegistry,
Expand Down Expand Up @@ -1052,7 +1052,7 @@ public synchronized boolean trim(boolean aggressive) {
} else {
for (int i = getMinSectionPosition(); i <= getMaxSectionPosition(); i++) {
int layer = i - getMinSectionPosition();
if (!hasSection(i) || !super.sections[layer].isFull()) {
if (!hasSection(i) || super.blocks[layer] == null) {
continue;
}
LevelChunkSection existing = getSections(true)[layer];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,7 @@
import org.enginehub.linbus.tree.LinStringTag;
import org.enginehub.linbus.tree.LinTagType;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.AbstractCollection;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
Expand Down Expand Up @@ -468,7 +466,7 @@ protected <T extends Future<T>> T internalCall(
}

if (createCopy) {
char[] tmpLoad = loadPrivately(layerNo);
char[] tmpLoad = load(layerNo);
char[] copyArr = new char[4096];
System.arraycopy(tmpLoad, 0, copyArr, 0, 4096);
copy.storeSection(getSectionIndex, copyArr);
Expand Down Expand Up @@ -530,7 +528,7 @@ protected <T extends Future<T>> T internalCall(
this.reset();
} else if (!Arrays.equals(
update(getSectionIndex, new char[4096], true),
loadPrivately(layerNo)
load(layerNo)
)) {
this.reset(layerNo);
/*} else if (lock.isModified()) {
Expand All @@ -548,7 +546,7 @@ protected <T extends Future<T>> T internalCall(

newSection = PaperweightPlatformAdapter.newChunkSection(
layerNo,
this::loadPrivately,
this::load,
setArr,
adapter,
biomeRegistry,
Expand Down Expand Up @@ -1013,7 +1011,7 @@ public synchronized boolean trim(boolean aggressive) {
} else {
for (int i = getMinSectionPosition(); i <= getMaxSectionPosition(); i++) {
int layer = i - getMinSectionPosition();
if (!hasSection(i) || !super.sections[layer].isFull()) {
if (!hasSection(i) || super.blocks[layer] == null) {
continue;
}
LevelChunkSection existing = getSections(true)[layer];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -354,8 +354,7 @@ public final BlockState getBlockBelow() {
}
if (layer > minLayer) {
final int newLayer = layer - 1;
final CharGetBlocks chunk = this.get;
return states[chunk.sections[newLayer].get(chunk, newLayer, index + 3840)];
return states[get.get(newLayer, index + 3840)];
}
return BlockTypes.__RESERVED__.getDefaultState();
}
Expand All @@ -367,8 +366,7 @@ public final BlockState getBlockAbove() {
}
if (layer < maxLayer) {
final int newLayer = layer + 1;
final CharGetBlocks chunk = this.get;
return states[chunk.sections[newLayer].get(chunk, newLayer, index - 3840)];
return states[get.get(newLayer, index - 3840)];
}
return BlockTypes.__RESERVED__.getDefaultState();
}
Expand All @@ -382,7 +380,7 @@ public final BlockState getBlockRelativeY(int y) {
} else if ((layerAdd > 0 && layerAdd < (maxLayer - layer)) || (layerAdd < 0 && layerAdd < (minLayer - layer))) {
final int newLayer = layer + layerAdd;
final int index = (this.index + ((y & 15) << 8)) & 4095;
return states[get.sections[newLayer].get(get, newLayer, index)];
return states[get.get(newLayer, index)];
}
return BlockTypes.__RESERVED__.getDefaultState();
}
Expand Down
Loading
Loading