Need some advice, making a parkour plugin!

Discussion in 'Plugin Development' started by xXRobbie21Xx, Aug 23, 2014.

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


    So i decided to make a parkour plugin just for the fun of it and i was wondering what would be the most efficient way of getting/saving checkpoints.

    I understand you could save there cords to a config file then when the player requests to go back, simply grab them and teleport him/her to it, but would that be inefficient?
    I would imagine creating a section in a config file then constantly reaching it when ever a player sets a check point and goes back to it would be resource intensive.
    If i'm wrong please let me know, and if someone knows of an easier way to do it, it would make my day if you could enlighten me!

    Thanks in advance!
  2. Offline


    xXRobbie21Xx No, it isn't resource intensive, unless you are like setting a hundred locations a tick, I think one everytime a player requests it is fine.
  3. Offline


    Gerov Allright man, thanks.
  4. Offline


    xXRobbie21Xx you could put them in a hashmap and then save the hashmap to a file onDisable if you needed them to save thru reload then load them back into the hashmap onEnable. i think geting values from hashmaps is more efficient than a config file
  5. Offline


    GeorgeeeHD hmm okay, just to make sure, its possible to use a Location for the key to return? In this case a player uuid
  6. Offline


    xXRobbie21Xx yea you can use anything as the key. HashMap<Location, UUID> or HashMap<UUID, Location> which ever one fits bests
  7. Offline


    GeorgeeeHD Sweet, thanks again.
    Really means alot!

    Edit: Looks like i checked bukkit at the perfect time :p
Thread Status:
Not open for further replies.

Share This Page