Move getBlock to Instance only

This commit is contained in:
iamceph 2021-01-26 09:51:19 +01:00
parent 564d549f81
commit ded8a4b4f8
3 changed files with 1 additions and 20 deletions

View File

@ -132,16 +132,6 @@ public abstract class Chunk implements Viewable, DataContainer {
*/
public abstract void tick(long time, @NotNull Instance instance);
/**
* Gets Block type from given coordinates.
*
* @param x x coordinate
* @param y y coordinate
* @param z z coordinate
* @return Block at given position.
*/
public abstract Block getBlock(int x, int y, int z);
/**
* Gets the block state id at a position.
*

View File

@ -156,11 +156,6 @@ public class DynamicChunk extends Chunk {
}
}
@Override
public Block getBlock(int x, int y, int z) {
return Block.fromStateId(getBlockStateId(x, y, z));
}
@Override
public short getBlockStateId(int x, int y, int z) {
return getBlockAt(blockPalette, x, y, z);

View File

@ -626,11 +626,7 @@ public abstract class Instance implements BlockModifier, EventHandler, DataConta
* @return Block at given position.
*/
public Block getBlock(int x, int y, int z) {
final Chunk chunk = getChunkAt(x, z);
Check.notNull(chunk, "The chunk at " + x + ":" + z + " is not loaded");
synchronized (chunk) {
return chunk.getBlock(x, y, z);
}
return Block.fromStateId(getBlockStateId(x, y, z));
}
/**