Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def selectTileEntities(box: AxisAlignedBB)(predicate: TileEntity => Boolean) = {
- val cube = BlockCuboid(box).toChunkSpace
- import scala.collection.JavaConverters._
- for {
- p <- cube
- if world.getChunkProvider.chunkExists(p.x, p.z)
- chunk = world.getChunkFromChunkCoords(p.x, p.z)
- if !chunk.isEmpty
- tile <- chunk.getTileEntityMap.values.asScala.asInstanceOf[Iterable[TileEntity]]
- if box.minY <= tile.getPos.getY && box.maxY >= tile.getPos.getY && predicate(tile)
- } yield tile
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement