mirror of
https://github.com/Minestom/Minestom.git
synced 2024-12-28 12:07:42 +01:00
Move getBlock to Instance only
This commit is contained in:
parent
564d549f81
commit
ded8a4b4f8
@ -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.
|
||||
*
|
||||
|
@ -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);
|
||||
|
@ -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));
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user