Build

Discussion in 'Spigot Plugin Development' started by patricianko, Jun 11, 2018.

  1. Hey,

    i need help with one thing i need to do specify pos1 & pos2 of island and do this if he starts build out of island he cannot so he still can build on his island.

    Green zone: he can build here
    Out of red zone: he cannot build here

    thanks for some help..

    [​IMG]
     
  2. due to the irregular shape, this would be hard to do. I would recommend making the island more square then getting the blocks would be alot easier
     
  3. Must be like this shape..
     
  4. If thats the case you are stuck making the location offsets manually. But once you do it once you shouldn't have to do it again and you can just apply it to every same shaped island and just plug in say the center location and the method would take car of the mapping.
     
  5. Because of how player's build (requiring a block to click in order to place another), you only need a circular outline of the space they are allowed to build in. I'd use a List<Map.Entry<Integer, Integer>>, but you could also use an int[][] I believe. On block place event, quickly run through the list (where the first integer is X, and the second is Z) and detect if the block's coordinates are equal to any on that list. If so, cancel the event. You could likely make a dev tool to easily mark this area using a "marker block", which is deleted on game start.
    Simply outline your island!
     
    • Creative Creative x 1