Posted November 26, 2018 Hello everyone, I need access to the map data for my new mod. Especially I need the information if a tile (only have the coordinates) is on deed and the type (grass, dirt, rock). I have looked at the "paint terrain" action, as it does also modify the terrain, but my code only produces Java NullPointer exceptions. I hope somebody can tell me what I do wrong. Below is an example code snippet: Random random = new Random(); TilePos tilePos = TilePos.fromXY(random.nextInt(mapsize + 1), random.nextInt(mapsize + 1)); MeshIO meshIO = Server.surfaceMesh; int tile = meshIO.getTile(tilePos); logger.log(Level.INFO, "TilePos: " + tilePos.toString() + " MeshIO.Tile: " + tile); I should retrieve an integer corresponding to the tile type. Theoretically... Share this post Link to post Share on other sites
Posted November 27, 2018 I don't see anything wrong with the code... how are you calling it? and where does the NPE happen? Share this post Link to post Share on other sites
Posted November 27, 2018 Well, tried it again and now it works. Don't know what I made wrong last time. But I didn't get the data I had hoped for. Message in server console with code from above. TilePos: tilePos: 1464, 260 MeshIO: 83951273 Somebody know how to get a reference to a Tile in the world? This isn't what I am looking for. Share this post Link to post Share on other sites
Posted December 11, 2018 To get the tile type call Tiles.decodeType on the value returned from getTile To get the village you can call Villages.getVillage (the TilePos or the x/y version) Share this post Link to post Share on other sites