BG-Software-LLC / WildInspect

Custom inspect-mode with CoreProtect hookup!
https://bg-software.com/wildinspect/
GNU General Public License v3.0
8 stars 16 forks source link

Update Towny support. #20

Closed LlmDl closed 2 years ago

LlmDl commented 2 years ago

Towny deprecated getResident(String) in the TownyDataSource a while back and the last release saw the removal of this method.

This PR replaces it with what will be the final method to get a Resident from a player.

This may also be of use:

repositories {
    maven {
        name = 'glaremasters repo'
        url = 'https://repo.glaremasters.me/repository/towny/'
    }

dependencies {
    compileOnly 'com.palmergames.bukkit.towny:towny:0.98.0.0'
}
OmerBenGera commented 2 years ago

Does this method exist in older versions of Towny as well?

LlmDl commented 2 years ago

The .getUniqueID() might have to be switched over to .getName(), what versions of MC are you supporting currently?

OmerBenGera commented 2 years ago

This patch must work on older versions of Towny from 1.8 up to 1.18. If it doesn't, then you'll have to support both old and new methods.

LlmDl commented 2 years ago

The legacy versions of Towny that's for 1.8, 1.9, 1.10, 1.11, 1.13 don't have a TownyAPI class, so its already not working on versions that old.

Our legacy 1.12 version does have TownyAPI.getInstance().getResident(player.getName()).

Towny currently supports 1.14 and onwards but in the next release we're switching to MC 1.16 and onwards only.

bStats tells us that everything older than 1.16 is a very, very small percentage of our user-base.

OmerBenGera commented 2 years ago

I see. One thing needs to be done is to update the build.gradle with your repository and I'll merge it :)

LlmDl commented 2 years ago

Cheers, you'll make our mutual users very happy!

OmerBenGera commented 2 years ago

Cheers, you'll make our mutual users very happy!

Haha :) Let me know once you made the changes to the build.gradle so I can merge

LlmDl commented 2 years ago

I think that did it, I'm unable to build it to test though.