Solved Hooking into Essentials for /back problematic..

Discussion in 'Plugin Development' started by ti07shadow, Mar 27, 2015.

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

    ti07shadow

    Hello, ive been working on a plugin for a server im on. Actually 2. well the issue im having is both use teleporting, and I need them to be able to work with essentials /back without enabling the back listenr, due to the issue with the server allowing the compass /jumpto for special ranked players. Due to this issue players that /back after /jumpto go back to from where they were before jumpto. So instead im wanting to hook and essentially tell essentials using its own interface that im wanting to store the players previous location for /back.

    any ideas? I mean the plugins are done other than the issue with hooking into essentials and well telling it to /back without having to use back listener in the config..
     
  2. Offline

    mine-care

    @ti07shadow you can do this without hookin into essentials. override the back command?
     
  3. Offline

    ti07shadow

    I could do that but the server im on uses tpa and tpahere for their special ranked players, not to mention mods/admins for tp, tpo, etc. Id rather just hook for it if possible. Otherwise if there's a way to listen to essentials teleports then yea. XD
     
    Last edited: Mar 28, 2015
  4. Offline

    mine-care

    @ti07shadow sorry i dont think i can help because i never have experienced with this^ :(
     
  5. Offline

    ti07shadow

    Funny thing, I havent had much issues with other plugins. But then again the void of documentation of essentials api's and such doesnt help XD. The only thing I found that was remotley helpful was https://bukkit.org/threads/factions-teleport-help.291311/ But the hook into essentials returns Null.... XD

    EDIT:
    Figured it out also found something that helped. In case anyone else needs this here it is

    The imports ( You will need to make essentials a reference library )
    Code:
    import com.earth2me.essentials.Essentials;
    import com.earth2me.essentials.User;

    put somewhere before onEnable(), perhaps first thing in your main class.
    Code:
    public static Essentials ess3 = null;
    put in onEnable()
    Code:
    ess3 = (Essentials)getServer().getPluginManager().getPlugin("Essentials");
    Put the following just before the player teleports..
    Code:
    if (ess3 != null){
    this.ess3.getUser(player).setLastLocation();
    }
     
    Last edited: Mar 28, 2015
  6. @ti07shadow Wow. I definently wouldn't have thought of that (never worked with the Essentials API either, but ya' know...). Glad that your problem is solved. (Cudos for solving it yourself). Please set this thread to solved by going to Thread Tools (at the top) > Edit Title > Prefix > Solved. :)
     
Thread Status:
Not open for further replies.

Share This Page