LastLocation

Discussion in 'Plugin Requests' started by kechufonzo, Dec 31, 2019.

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

    kechufonzo

    Minecraft version: 1.13.2

    Suggested name: LastLocation

    Features:

    ~ Save the last location of players when:
    *They Log out/quit
    *They change to another group of worlds, like when toy return to lobby and change modality
    ~ Can set in config a group of worlds that save only 1 last location to all that group of worlds.
    * There are some plugins like this but with bugs like multiverse-inventory that allow to make a groups of worlds using the same yml that they use for the inventories, but just save location on world change and not on log out, or others like stayput dont allow to make a group of worlds they save lastlocation for every world.

    So in resume, a plugin that save you lastlocation in a group of worlds, like if a groups would be a different server from another group of worlds.

    groups.yml Idea:

    groups:
    group-name:
    - world
    - world_nether
    group-name2:
    - prision_spawn
    - prison_Plots

    An example in game:
    Worlds: world, world_nether, prison_spawn, prison_plots.
    Players: player1 in world, player2 in world_nether, player3 in prison_spawn, player4 in prison_plots.

    Player1 is in world on his base and then log out, then when he log in he would appear on the hub/lobby and when he select the modality survival he would appear on world in his base wich is the place where he logout. The same would happen if he instead of logout do /lobby then select prison and return to lobby and go again to survival

    Dont need commands or permission, could be basics like /ll help or /ll reload and a permission like lastlocation.bypass, but isnt really necessary.
     
    Last edited by a moderator: Dec 31, 2019
  2. Offline

    KarimAKL

    @kechufonzo What is the point of the groups? From what i understand, you only want the players to spawn in the location they last left from.
    Also, what are you using to make a hub etc? We can't really detect when the player presses what without an API.
     
  3. Offline

    kechufonzo

    Hi, this is bcoz the plugin its for server that have different modalities and do with worlds, in 1 server bcoz they cant afford for bungee, so a group of worlds would act like one server, thats the point. For the hub i am using HubBasics. I dont understad what do you say at the end, but if you mean that press the quit button, you can detect when a player leave server with PlayerQuitEvent
     
  4. Offline

    KarimAKL

    @kechufonzo I still don't see why the groups are necessary, you could just save the last location they were at, and then teleport them there.

    Also, i mean when you select the world to teleport to, we can't really detect that without an API.
     
  5. Offline

    kechufonzo

    I think you didnt understand, you need groups because they are like different servers, you need a last location for every group of worlds, if you only save a global last location instead of have a last location per group, if you quit on survival worlds and then enter again to the server and go to prison it will teleport to de survival worlds, that is where you quit, so you need to separete last location for every group of worlds. Did you read the in game example and the group.yml example? About the selected world, i think that can be done getting the world when a player change worlds and if the previous worlds is on the same group that the actual world woudl do anything, but if they are in different groups would teleport to the last location on the actual world. Or could be done setting in the config the lobby world so whenever the PlayerChangedWorldEvent().getFrom() its equals to the lobby world would teleport to the last location of the player in the group of the actual world, and obviously you would do this whenever he is on the lobby world, to dont be analyzing every command of the entire server. Also came to my mind this one, for change worlds i use the command executed by console /mvtp {playername} {world-name} so i dont know if you would need to hook with multiverse but you can analyze the the arguments of the commands so you can know who is gonna be teleported, from what worlds and where he is going to.
     
  6. Offline

    KarimAKL

    @kechufonzo I'm still unsure of the groups but, i attempted to make what i imagined you want.
    Download: https://www.dropbox.com/s/7lk1a4ssd64nyye/LastLocation.jar?dl=0

    It sounds to me like you know a little about it, have you tried creating it yourself?

    I'm pretty sure i've done some tests in the past that revealed that the PlayerCommandPreprocessEvent & ServerCommandEvent isn't called when the command is executed using Bukkit#dispatchCommand(CommandSender, String)
     
  7. Offline

    kechufonzo

    Hi! i test the jar and work fine, have no errors and the location is saved and tp me to my last location, only misses that the location saves when player return to the lobby. I need the groups because i want that for a group of world save only 1 location in only 1 worlds of all that worlds, for example, if "world", and "world_nether" is in the same group so if i am in "world_nether" and do /lobby or quiting server will save my last location on "world_nether", so if i am in lobby and want to go again to my survivals worlds would use the my item that uses /mvtp {playername} "world" ,(use "world" bcoz its my principal world in survival), and would tp me to the "world_nether" instead of "world", because bought are in same group and i did /lobby or quit while i was in world_nether.

    Yes i know a little because i am learning how to develop plugins to make my owns but i am far from make some of this plugins, i am now learning about how to do configs
     
  8. Offline

    KarimAKL

    Last edited by a moderator: Jan 4, 2020
    kechufonzo likes this.
  9. Offline

    kechufonzo

    Hi man, thanks for all you are doing, the plugin works great until a player quit, the plugin save the location but when enter again to the server instantaneally the location saved on the UUID.yml change to the location of the spawn of that world for example:

    i left server on "world" on x:300 y:64 z:13, the plugin lastlocation save it, then when i enter again to the server and login on "lobby" the plugin lastlocation change my location in "world" to the spawn of "world". Do you know why can be this?
     
    Last edited: Jan 5, 2020
  10. Offline

    kechufonzo

    Hi man, thank you soo much, seems that its working perfectly now, the problem was because i hadnt a defined spawn with essentials. Thanks again, i own you my server:D
     
    KarimAKL likes this.
  11. Offline

    KarimAKL

    @kechufonzo Glad you solved the problem, i was about to try creating a new local server with a new plugin just for testing that problem. :7

    Btw, i found an error on my part, the plugin still functions the same but, it'll throw an error in the console.
    I'll edit this post with the updated version later.

    EDIT: Here you go: https://www.dropbox.com/s/7lk1a4ssd64nyye/LastLocation.jar?dl=0
    This should stop the error from occuring. (You don't need to delete the folder for this update)
     
    Last edited by a moderator: Jan 7, 2020
    kechufonzo likes this.
Thread Status:
Not open for further replies.

Share This Page