mirror of
https://github.com/boy0001/FastAsyncWorldedit.git
synced 2024-12-29 12:37:53 +01:00
Fix forge set air section
This commit is contained in:
parent
a8e18b885f
commit
8c94489e91
@ -267,8 +267,12 @@ public class ForgeChunk_All extends CharFaweChunk<Chunk, ForgeQueue_All> {
|
||||
if (array == null) {
|
||||
continue;
|
||||
}
|
||||
int countAir = this.getAir(j);
|
||||
ExtendedBlockStorage section = sections[j];
|
||||
if (section == null) {
|
||||
if (count == countAir) {
|
||||
continue;
|
||||
}
|
||||
if (this.sectionPalettes != null && this.sectionPalettes[j] != null) {
|
||||
section = sections[j] = new ExtendedBlockStorage(j << 4, flag);
|
||||
getParent().setPalette(section, this.sectionPalettes[j]);
|
||||
@ -278,6 +282,10 @@ public class ForgeChunk_All extends CharFaweChunk<Chunk, ForgeQueue_All> {
|
||||
sections[j] = section = new ExtendedBlockStorage(j << 4, flag);
|
||||
}
|
||||
} else if (count >= 4096) {
|
||||
if (count == countAir) {
|
||||
sections[j] = null;
|
||||
continue;
|
||||
}
|
||||
if (this.sectionPalettes != null && this.sectionPalettes[j] != null) {
|
||||
getParent().setPalette(section, this.sectionPalettes[j]);
|
||||
getParent().setCount(0, count - this.getAir(j), section);
|
||||
|
@ -233,20 +233,33 @@ public class ForgeChunk_All extends CharFaweChunk<Chunk, ForgeQueue_All> {
|
||||
}
|
||||
// Efficiently merge sections
|
||||
for (int j = 0; j < sections.length; j++) {
|
||||
if (this.getCount(j) == 0) {
|
||||
int count = this.getCount(j);
|
||||
if (count == 0) {
|
||||
continue;
|
||||
}
|
||||
byte[] newIdArray = this.getByteIdArray(j);
|
||||
if (newIdArray == null) {
|
||||
continue;
|
||||
}
|
||||
int countAir = this.getAir(j);
|
||||
NibbleArray newDataArray = this.getDataArray(j);
|
||||
ExtendedBlockStorage section = sections[j];
|
||||
if ((section == null) || (this.getCount(j) >= 4096)) {
|
||||
if ((section == null)) {
|
||||
if (count == countAir) {
|
||||
continue;
|
||||
}
|
||||
sections[j] = section = new ExtendedBlockStorage(j << 4, !getParent().getWorld().provider.hasNoSky);
|
||||
section.setBlockLSBArray(newIdArray);
|
||||
section.setBlockMetadataArray(newDataArray);
|
||||
continue;
|
||||
} else if (count >= 4096) {
|
||||
if (count == countAir) {
|
||||
sections[j] = null;
|
||||
continue;
|
||||
}
|
||||
section.setBlockLSBArray(newIdArray);
|
||||
section.setBlockMetadataArray(newDataArray);
|
||||
continue;
|
||||
}
|
||||
byte[] currentIdArray = section.getBlockLSBArray();
|
||||
NibbleArray currentDataArray = section.getMetadataArray();
|
||||
|
@ -184,14 +184,21 @@ public class ForgeChunk_All extends CharFaweChunk<Chunk, ForgeQueue_All> {
|
||||
if (newArray == null) {
|
||||
continue;
|
||||
}
|
||||
int countAir = this.getAir(j);
|
||||
ExtendedBlockStorage section = sections[j];
|
||||
|
||||
if ((section == null)) {
|
||||
if (count == countAir) {
|
||||
continue;
|
||||
}
|
||||
section = new ExtendedBlockStorage(j << 4, flag);
|
||||
section.setData(newArray);
|
||||
sections[j] = section;
|
||||
continue;
|
||||
} else if (count >= 4096){
|
||||
if (count == countAir) {
|
||||
sections[j] = null;
|
||||
continue;
|
||||
}
|
||||
section.setData(newArray);
|
||||
getParent().setCount(0, count - this.getAir(j), section);
|
||||
continue;
|
||||
|
@ -265,8 +265,12 @@ public class ForgeChunk_All extends CharFaweChunk<Chunk, ForgeQueue_All> {
|
||||
if (array == null) {
|
||||
continue;
|
||||
}
|
||||
int countAir = this.getAir(j);
|
||||
ExtendedBlockStorage section = sections[j];
|
||||
if (section == null) {
|
||||
if (count == countAir) {
|
||||
continue;
|
||||
}
|
||||
if (this.sectionPalettes != null && this.sectionPalettes[j] != null) {
|
||||
section = sections[j] = new ExtendedBlockStorage(j << 4, flag);
|
||||
getParent().setPalette(section, this.sectionPalettes[j]);
|
||||
@ -276,6 +280,10 @@ public class ForgeChunk_All extends CharFaweChunk<Chunk, ForgeQueue_All> {
|
||||
sections[j] = section = new ExtendedBlockStorage(j << 4, flag);
|
||||
}
|
||||
} else if (count >= 4096) {
|
||||
if (count == countAir) {
|
||||
sections[j] = null;
|
||||
continue;
|
||||
}
|
||||
if (this.sectionPalettes != null && this.sectionPalettes[j] != null) {
|
||||
getParent().setPalette(section, this.sectionPalettes[j]);
|
||||
getParent().setCount(0, count - this.getAir(j), section);
|
||||
|
Loading…
Reference in New Issue
Block a user