public BlockState[] getTileEntities() { int index = 0; net.minecraft.world.chunk.Chunk chunk = getHandle(); BlockState[] entities = new BlockState[chunk.chunkTileEntityMap.size()]; for (Object obj : chunk.chunkTileEntityMap.keySet().toArray()) { if (!(obj instanceof net.minecraft.world.ChunkPosition)) { continue; } net.minecraft.world.ChunkPosition position = (net.minecraft.world.ChunkPosition) obj; entities[index++] = worldServer .getWorld() .getBlockAt( position.chunkPosX + (chunk.xPosition << 4), position.chunkPosY, position.chunkPosZ + (chunk.zPosition << 4)) .getState(); } return entities; }
public World getWorld() { return worldServer.getWorld(); }