Essentials icon indicating copy to clipboard operation
Essentials copied to clipboard

API - Getting Homes Name From Location

Open TagCraftMC opened this issue 10 years ago • 2 comments

Greetings EssX devs,

Would it be possible to get the home name via it's location? Currently the only way to delete a home is via it's name #delHome(String); However you can get a home via it's name or location which allows me to compare the location I have to a homes location.

It would be great if either #delhome(String) accepted a location as well as the string and/or I was able to get the name of the home via #getHome(Location).

Thanks.

//Shit Code Example
if (#getHome(Location) != null)
{
    //checks here
    //if true
    #delHome(Location);
    //or as an example
    #delHome(#getHome(Location).getName());
}

TagCraftMC avatar Jun 27 '16 03:06 TagCraftMC

If he doesn't add this, you could always loop trough all homes and check if the home's location is the same as your location

JonathanBrouwer avatar Jun 27 '16 07:06 JonathanBrouwer

^ is what you should do because that's what the implementation would end up being.

drtshock avatar Jun 27 '16 17:06 drtshock