Fix missing setFlatBlock

This commit is contained in:
creeper123123321 2018-03-24 16:39:48 -03:00
parent 5801cd1e0f
commit 7eab459195
2 changed files with 14 additions and 2 deletions

View File

@ -47,7 +47,13 @@ public class ChunkSection1_9_1_2 implements ChunkSection {
@Override
public void setFlatBlock(int x, int y, int z, int type) {
throw new UnsupportedOperationException();
int index = palette.indexOf(type);
if (index == -1) {
index = palette.size();
palette.add(type);
}
blocks[index(x, y, z)] = index;
}
public int getBlockId(int x, int y, int z) {

View File

@ -48,7 +48,13 @@ public class ChunkSection1_9to1_8 implements ChunkSection {
@Override
public void setFlatBlock(int x, int y, int z, int type) {
throw new UnsupportedOperationException();
int index = palette.indexOf(type);
if (index == -1) {
index = palette.size();
palette.add(type);
}
blocks[index(x, y, z)] = index;
}
public int getBlockId(int x, int y, int z) {