SHARE
TWEET

Untitled

a guest Sep 27th, 2018 77 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import com.wurmonline.mesh.FoliageAge;
  2. import com.wurmonline.mesh.GrassData;
  3. import com.wurmonline.mesh.Tiles.Tile;
  4. import com.wurmonline.mesh.TreeData;
  5. import com.wurmonline.wurmapi.api.MapData;
  6. import com.wurmonline.wurmapi.api.WurmAPI;
  7. import java.io.File;
  8. import java.io.IOException;
  9. import java.util.logging.Level;
  10. import java.util.logging.Logger;
  11. import java.util.Objects;
  12. import javax.imageio.ImageIO;
  13. public class dirtrock {
  14. public static void main(String[] args) {        WurmAPI api;
  15.   try {            
  16.     api = WurmAPI.open("C:\\Location\\Of\\Your\\.Map containing directory");
  17.   }
  18.   catch (IOException ex) {            
  19.     return;
  20.   }  
  21.   MapData map = api.getMapData();
  22.   for (int i = 10; i < map.getWidth()-10; i++){
  23.     for (int i2 = 10; i2 < map.getHeight()-10; i2++){
  24.       //System.out.print(map.getSurfaceTile(i, i2));
  25.       Tile tile = map.getSurfaceTile(i,i2);
  26.       if (Objects.equals(tile, Tile.TILE_ROCK)) {
  27.         //NW Corner
  28.         map.setRockHeight(i,i2, map.getSurfaceHeight(i,i2));
  29.         //NE Corner
  30.         map.setRockHeight(i + 1,i2, map.getSurfaceHeight(i + 1,i2));
  31.         //SW Corner
  32.         map.setRockHeight(i,i2 + 1, map.getSurfaceHeight(i,i2 + 1));
  33.         //SE Corner
  34.         map.setRockHeight(i + 1,i2 + 1, map.getSurfaceHeight(i + 1,i2 + 1));
  35.       }
  36.     }
  37.   }
  38.   map.saveChanges();
  39. }
  40. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top