Replace Material (Citybuild Plots)

Discussion in 'Plugin Development' started by Daze88, May 8, 2020.

Thread Status:
Not open for further replies.
  1. Offline

    Daze88

    Hi.
    I'm looking for a code to identify the inner area of a Citybuild plot to replace the dirt wirth air.
    Seems pretty easy with 1 plot, but i don't know how to do it with merges like these:
    upload_2020-5-8_8-58-57.png

    I startet by getting all corners, but now...?

    List<Location> plotCorners = plot.getAllCorners();
     

    Attached Files:

  2. Offline

    timtower Administrator Administrator Moderator

    @Daze88 How do you define a plot like that?
    The most right plot should contain 8 other plots in an internal list.
     
  3. Offline

    Daze88

    The right plot can contain 8 plots, but even 16 plots...the plugin should be able to clear any kind of merged plot.

    I thought about using
    getRoadNeighbour(location);

    but don't know exactly how to use it...
     
  4. Offline

    timtower Administrator Administrator Moderator

    Then let the merged plot contain the smaller plots.
    Then you can loop over the smaller ones and replace the dirt with air there.
     
  5. Offline

    Daze88

    sounds pretty easy when you say it :p
     
  6. Offline

    timtower Administrator Administrator Moderator

    It does depend on how you plugin is setup though.
    If you have roads in between that you want filled as well then it gets more difficult already.
     
  7. Offline

    Daze88

    if the plots are merged, there are no more roads between them. so i just have to replace the dirt on the inner area of the roads

    Looks like this if i merge plots
     

    Attached Files:

    Last edited by a moderator: May 8, 2020
  8. Offline

    timtower Administrator Administrator Moderator

    Assuming the red lines are roads, how do you plan on changing those? upload_2020-5-8_8-57-32.png
     
  9. Offline

    Daze88

    there are no roads..
    they look like this
     

    Attached Files:

  10. Offline

    timtower Administrator Administrator Moderator

    @Daze88 Aren't your roads in between the plots then?
     
  11. Offline

    Daze88

    no, they disappear when i merge them
     
  12. Offline

    timtower Administrator Administrator Moderator

    Is this issue resolved then?
     
  13. Offline

    Daze88

    no :D i don't know how to do the loop to replace all blocks from Y 1 to Y64 and within the whole area of the plot
     
  14. Offline

    timtower Administrator Administrator Moderator

    @Daze88 Could you post the inner plot class?
     
  15. Offline

    Daze88

    I have no seperate class for plots...
     
    Last edited: May 8, 2020
  16. Offline

    timtower Administrator Administrator Moderator

    @Daze88 That is not the Plot class, that is a command class which has the name "Main" which is weird to say the least.
     
Thread Status:
Not open for further replies.

Share This Page