mirror of
https://github.com/boy0001/FastAsyncWorldedit.git
synced 2024-10-05 02:17:55 +02:00
minor reflection fix
This commit is contained in:
parent
c599e75fa6
commit
7d9043da51
@ -85,6 +85,19 @@ public class BukkitChunk_1_9 extends CharFaweChunk<Chunk> {
|
|||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public DataPaletteBlock newDataPaletteBlock() {
|
||||||
|
try {
|
||||||
|
return new DataPaletteBlock();
|
||||||
|
} catch (Throwable e) {
|
||||||
|
try {
|
||||||
|
Constructor<DataPaletteBlock> constructor = DataPaletteBlock.class.getDeclaredConstructor(IBlockData[].class);
|
||||||
|
return constructor.newInstance((Object) null);
|
||||||
|
} catch (Throwable e2) {
|
||||||
|
throw new RuntimeException(e2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void optimize() {
|
public void optimize() {
|
||||||
if (sectionPalettes != null) {
|
if (sectionPalettes != null) {
|
||||||
return;
|
return;
|
||||||
@ -97,17 +110,7 @@ public class BukkitChunk_1_9 extends CharFaweChunk<Chunk> {
|
|||||||
if (sectionPalettes == null) {
|
if (sectionPalettes == null) {
|
||||||
sectionPalettes = new DataPaletteBlock[16];
|
sectionPalettes = new DataPaletteBlock[16];
|
||||||
}
|
}
|
||||||
DataPaletteBlock palette;
|
DataPaletteBlock palette = newDataPaletteBlock();
|
||||||
try {
|
|
||||||
palette = sectionPalettes[layer] = new DataPaletteBlock();
|
|
||||||
} catch (Throwable e) {
|
|
||||||
try {
|
|
||||||
Constructor<DataPaletteBlock> constructor = DataPaletteBlock.class.getDeclaredConstructor(IBlockData[].class);
|
|
||||||
palette = sectionPalettes[layer] = constructor.newInstance(null);
|
|
||||||
} catch (Throwable e2) {
|
|
||||||
throw new RuntimeException(e2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
char[] blocks = getIdArray(layer);
|
char[] blocks = getIdArray(layer);
|
||||||
for (int y = 0; y < 16; y++) {
|
for (int y = 0; y < 16; y++) {
|
||||||
for (int z = 0; z < 16; z++) {
|
for (int z = 0; z < 16; z++) {
|
||||||
|
@ -236,10 +236,10 @@ public class BukkitQueue_1_9_R1 extends BukkitQueue_0<Chunk, ChunkSection[], Dat
|
|||||||
try {
|
try {
|
||||||
if (array == null) {
|
if (array == null) {
|
||||||
Constructor<ChunkSection> constructor = ChunkSection.class.getDeclaredConstructor(int.class, boolean.class, IBlockData[].class);
|
Constructor<ChunkSection> constructor = ChunkSection.class.getDeclaredConstructor(int.class, boolean.class, IBlockData[].class);
|
||||||
return constructor.newInstance(y2, flag, null);
|
return constructor.newInstance(y2, flag, (IBlockData[]) null);
|
||||||
} else {
|
} else {
|
||||||
Constructor<ChunkSection> constructor = ChunkSection.class.getDeclaredConstructor(int.class, boolean.class, char[].class, IBlockData[].class);
|
Constructor<ChunkSection> constructor = ChunkSection.class.getDeclaredConstructor(int.class, boolean.class, char[].class, IBlockData[].class);
|
||||||
return constructor.newInstance(y2, flag, array, null);
|
return constructor.newInstance(y2, flag, array, (IBlockData[]) null);
|
||||||
}
|
}
|
||||||
} catch (Throwable e2) {
|
} catch (Throwable e2) {
|
||||||
throw new RuntimeException(e2);
|
throw new RuntimeException(e2);
|
||||||
@ -311,7 +311,7 @@ public class BukkitQueue_1_9_R1 extends BukkitQueue_0<Chunk, ChunkSection[], Dat
|
|||||||
ChunkSection section = sections[j];
|
ChunkSection section = sections[j];
|
||||||
if (section == null) {
|
if (section == null) {
|
||||||
if (fs.sectionPalettes != null && fs.sectionPalettes[j] != null) {
|
if (fs.sectionPalettes != null && fs.sectionPalettes[j] != null) {
|
||||||
section = sections[j] = new ChunkSection(j << 4, flag);
|
section = sections[j] = newChunkSection(j << 4, flag, null);
|
||||||
setPalette(section, fs.sectionPalettes[j]);
|
setPalette(section, fs.sectionPalettes[j]);
|
||||||
setCount(0, count - fs.getAir(j), section);
|
setCount(0, count - fs.getAir(j), section);
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
Reference in New Issue
Block a user