SPIGOT-7214: Add CraftChunk and CraftChunkSnapshot contains biome method
By: md_5 <git@md-5.net>
This commit is contained in:
@@ -81,6 +81,20 @@ public class CraftChunkSnapshot implements ChunkSnapshot {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean contains(Biome biome) {
|
||||
Preconditions.checkArgument(biome != null, "Biome cannot be null");
|
||||
|
||||
Predicate<Holder<BiomeBase>> nms = Predicates.equalTo(CraftBlock.biomeToBiomeBase(this.biomeRegistry, biome));
|
||||
for (PalettedContainerRO<Holder<BiomeBase>> palette : this.biome) {
|
||||
if (palette.maybeHas(nms)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Material getBlockType(int x, int y, int z) {
|
||||
validateChunkCoordinates(x, y, z);
|
||||
|
||||
Reference in New Issue
Block a user