How do I identify Plots?

Discussion in 'Plugin Development' started by Didi1150, Sep 28, 2020.

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

    Didi1150

    I am currently working on a plot plugin. so basically, I got the generator, but I rly dont have any clue how to identify plots. Like, plotaquared identifies them with PlotIds, but how do they assign the ids to the plots, with the given x and y coords. i would rly appreciate any theory or sth like that
     
  2. Offline

    CraftCreeper6

    @Didi1150
    The only thing it needs to be is unique, x and y are good because plots wont overlap one another. (I'm assuming). The players UUID can also be used but would need to be in tandem with another value if a player can have more than 1 plot. Having a counter works too, counting up from 0 to max int. Though limited, it's unlikely to fill up, and in the unlikely case it would be easy to swap to a different data type to increase the limit.

    There's really any number of ways and whichever you choose will be sufficient.
     
  3. Offline

    Didi1150

    hmm, what if I want to merge the plots?

    Like, how do PlotMe and PlotSquared do it? I still can't understand they're code
     
  4. Offline

    CraftCreeper6

    @Didi1150
    I don't know what you mean by merge, but what's stopping you from simply combining the names?
     
  5. Offline

    Didi1150

    Merging means to put to plots into one plot. The border dissappears, and it creates a bigger plot
     
  6. Offline

    timtower Administrator Administrator Moderator

    You check if it is between two plots by the same owner.
     
  7. Offline

    Didi1150

    But that doesnt help me identify the plots. i dont want to identify the plots with x and y coords, I want to give them ids
     
  8. Offline

    timtower Administrator Administrator Moderator

    But you still need to know where they are.
    So you need position and ID combined.
    I made a plot plugin as well, my ID's were just the X and Y pos on the grid.
     
  9. Offline

    Didi1150

    Wait, so ur ids were the four corners?
     
  10. Offline

    timtower Administrator Administrator Moderator

    @Didi1150 No, I am using a fixed size grid.
    My paths are straight.
    My plots always the same size (can change them when you make a new world)

    So I had a basic X-Y system.
     
  11. Offline

    Didi1150

    Do u mean u have a fixed amount of plots
     
  12. Offline

    timtower Administrator Administrator Moderator

    No, I have a fixed starting position from where I am counting my plots.
    Nw corner of plot 0,0 is at 0,0.
    After that every nw corner is plotsize+roadsize away
     
Thread Status:
Not open for further replies.

Share This Page