mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-27 23:10:16 +01:00
SPIGOT-5250: Add ChunkSnapshot.contains
This commit is contained in:
parent
aa492e552e
commit
b79a86edeb
1 changed files with 14 additions and 0 deletions
|
@ -58,6 +58,20 @@ public class CraftChunkSnapshot implements ChunkSnapshot {
|
||||||
return worldname;
|
return worldname;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean contains(BlockData block) {
|
||||||
|
Preconditions.checkArgument(block != null, "Block cannot be null");
|
||||||
|
|
||||||
|
IBlockData nms = ((CraftBlockData) block).getState();
|
||||||
|
for (DataPaletteBlock<IBlockData> palette : blockids) {
|
||||||
|
if (palette.a(nms)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Material getBlockType(int x, int y, int z) {
|
public Material getBlockType(int x, int y, int z) {
|
||||||
CraftChunk.validateChunkCoordinates(x, y, z);
|
CraftChunk.validateChunkCoordinates(x, y, z);
|
||||||
|
|
Loading…
Reference in a new issue