averixus / floristics

Minecraft spigot server plugin to regrow plants naturally over time.
8 stars 7 forks source link

Floristics incompatible with Towny #30

Open LcyDev opened 1 year ago

LcyDev commented 1 year ago
[16:36:17 WARN]: [Floristics] Task #2298 for Floristics v2.5.1 generated an exception
java.lang.NoSuchMethodError: 'java.util.HashSet com.palmergames.bukkit.towny.object.Town.getMetadata()'
        at land.jay.floristics.compat.TownyWrapper.canGrow(TownyWrapper.java:51) ~[Floristics-2.5.1-1.15.jar:?]
        at land.jay.floristics.Floristics.hasPermission(Floristics.java:124) ~[Floristics-2.5.1-1.15.jar:?]
        at land.jay.floristics.plants.BushGrower.placeBush(BushGrower.java:90) ~[Floristics-2.5.1-1.15.jar:?]
        at land.jay.floristics.plants.BushGrower.grow(BushGrower.java:51) ~[Floristics-2.5.1-1.15.jar:?]
        at land.jay.floristics.BiomeGrower.growSomething(BiomeGrower.java:365) ~[Floristics-2.5.1-1.15.jar:?]
        at land.jay.floristics.BiomeGrower.handleGrowth(BiomeGrower.java:371) ~[Floristics-2.5.1-1.15.jar:?]
        at land.jay.floristics.Floristics.growCycle(Floristics.java:105) ~[Floristics-2.5.1-1.15.jar:?]
        at land.jay.floristics.Floristics.lambda$0(Floristics.java:91) ~[Floristics-2.5.1-1.15.jar:?]
        at org.bukkit.craftbukkit.v1_17_R1.scheduler.CraftTask.run(CraftTask.java:101) ~[patched_1.17.1.jar:git-Paper-411]
        at org.bukkit.craftbukkit.v1_17_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:483) ~[patched_1.17.1.jar:git-Paper-411]
        at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1567) ~[patched_1.17.1.jar:git-Paper-411]
        at net.minecraft.server.dedicated.DedicatedServer.tickChildren(DedicatedServer.java:490) ~[patched_1.17.1.jar:git-Paper-411]
        at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1483) ~[patched_1.17.1.jar:git-Paper-411]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1282) ~[patched_1.17.1.jar:git-Paper-411]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:319) ~[patched_1.17.1.jar:git-Paper-411]
        at java.lang.Thread.run(Thread.java:833) ~[?:?]
TheFlagCourier commented 1 year ago

Towny changed the way in which plugin devs should get a Resident; deprecating the old method in Jan. 2021, and removed it entirely in Feb. 2022. You'll need a version of Towny prior to 0.98.0.0 - this being the last development release before the deprecated code was removed.

Since this repository has been inactive for a little over two years, and last targeted MC 1.15, I would assume it's abandoned by now. The following changes could be applied to the TownyWrapper.java file, if someone wants to fix this in the main tree and compile it. Not doing so myself as there is already a fork with this fix, and this plugin seems to not be explicitly attached to an OSS license.

Old method:

TownyAPI.getInstance().getDataSource().getResident(player.getName());

New methods:

TownyUniverse.getInstance().getResident(player.getName());
-or-
TownyUniverse.getInstance().getResident(player.getUUID()); //preferred