Fix some issues with java 9 / reflection

This commit is contained in:
Jesse Boyd
2018-08-16 19:56:31 +10:00
parent 8de1fff263
commit 2172ebba83
12 changed files with 357 additions and 170 deletions

View File

@ -231,9 +231,8 @@ public class BukkitChunk_All extends IntFaweChunk<Chunk, BukkitQueue_All> {
int xx = bx + x;
BlockTypes type = BlockTypes.getFromStateId(combined);
if (type == BlockTypes.__RESERVED__) continue;
switch (type) {
case __RESERVED__:
continue;
case AIR:
case CAVE_AIR:
case VOID_AIR:
@ -280,9 +279,8 @@ public class BukkitChunk_All extends IntFaweChunk<Chunk, BukkitQueue_All> {
int j = place ? index : 4095 - index;
int combined = newArray[j];
BlockTypes type = BlockTypes.getFromStateId(combined);
if (type == BlockTypes.__RESERVED__) continue;
switch (type) {
case __RESERVED__:
continue;
case AIR:
case CAVE_AIR:
case VOID_AIR:

View File

@ -130,6 +130,19 @@ public class AsyncChunk implements Chunk {
});
}
@Override
public BlockState[] getTileEntities(boolean b) {
if (!isLoaded()) {
return new BlockState[0];
}
return TaskManager.IMP.sync(new RunnableVal<BlockState[]>() {
@Override
public void run(BlockState[] value) {
this.value = world.getChunkAt(x, z).getTileEntities(b);
}
});
}
@Override
public boolean isLoaded() {
return world.isChunkLoaded(x, z);