Towny Integration Error
Describe the bug When attempting to load Movecraft v7.0.0_for_1.8.8-1.15.2_beta_22 with Towny 0.96.1.0 or 0.96.1.8 the following StackTrace appears:
` [18:36:32 INFO]: [Movecraft] Found a compatible version of Towny. Enabling Towny integration. [18:36:32 ERROR]: Error occurred while enabling Movecraft v7.0.0_for_1.8.8-1.15.2_beta_22 (Is it up to date?) java.lang.NullPointerException: null at net.countercraft.movecraft.utils.TownyUtils.getTownyWorld(TownyUtils.java:45) ~[?:?] at net.countercraft.movecraft.utils.TownyUtils.getTownyConfigFromUniverse(TownyUtils.java:156) ~[?:?] at net.countercraft.movecraft.utils.TownyUtils.initTownyConfig(TownyUtils.java:148) ~[?:?] at net.countercraft.movecraft.Movecraft.onEnable(Movecraft.java:380) ~[?:?] at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:263) ~[patched_1.15.2.jar:git-Paper-229] at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:364) ~[patched_1.15.2.jar:git-Paper-229] at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:483) ~[patched_1.15.2.jar:git-Paper-229] at org.bukkit.craftbukkit.v1_15_R1.CraftServer.enablePlugin(CraftServer.java:471) ~[patched_1.15.2.jar:git-Paper-229] at org.bukkit.craftbukkit.v1_15_R1.CraftServer.enablePlugins(CraftServer.java:385) ~[patched_1.15.2.jar:git-Paper-229] at net.minecraft.server.v1_15_R1.MinecraftServer.a(MinecraftServer.java:488) ~[patched_1.15.2.jar:git-Paper-229] at net.minecraft.server.v1_15_R1.DedicatedServer.init(DedicatedServer.java:298) ~[patched_1.15.2.jar:git-Paper-229] at net.minecraft.server.v1_15_R1.MinecraftServer.run(MinecraftServer.java:895) ~[patched_1.15.2.jar:git-Paper-229] at java.lang.Thread.run(Thread.java:834) [?:?]
[18:36:32 INFO]: [Movecraft] Disabling Movecraft v7.0.0_for_1.8.8-1.15.2_beta_22`
To Reproduce Steps to reproduce the behavior:
- Use Paper 1.15.2 (Error should be independent of server software, caused by Towny hook)
- Use Towny 0.96.1.0 or 0.96.1.8 (Error occurs with both)
- Use Movecraft v7.0.0_for_1.8.8-1.15.2_beta_22
- Start server
Expected behavior Movecraft loads and functions
Versions (please complete the following information):
- Movecraft v7.0.0_for_1.8.8-1.15.2_beta_22
- Towny 0.96.1.0 or 0.96.1.8
- openjdk version "11.0.3"
- Paper version git-Paper-229 (MC: 1.15.2)
Have you tried with Towny 0.96.1.9? I tested it with that version and no error appeared
Issue persists
Towny 0.96.1.9 Movecraft beta 24 Paper 262
Console Error: http://prntscr.com/sdhrlq
Versions: http://prntscr.com/sdhru1
Can you post:
- Towny startup log
- Your Towny configs ?
I have tested Movecraft with Towny and I have no issue. Also, how do you store towny world data?
I believe I've found the issue: Movecraft is being enabled before Towny despite Towny being marked as a soft-depend of Movecraft
Relevant startup logs, timestamps, and requested configuration.
I'm using flatfile for storage in Towny as Townys MySQL handling corrupts more often than flatfile and the developers suggested we remedy this by switching to flatfile around a year ago.
https://paste.gg/p/anonymous/989ce9e0cde44dd6b5885f6690782ccf
I've found out some very bizarre information:
- Movecraft and Towny seem to be enabling arbitrarily
- Movecraft is not depended on by any plugin on my server, and as such should be perfectly fine to enable after Towny
- Setting Movecraft to load postworld does not fix the issue
- Setting Towny to "loadbefore: [Movecraft]" does not fix the issue
I've performed the following test in order:
- Disable LuckPerms Result: Movecraft enables perfectly fine
- Enable LuckPerms Result: Movecraft does not enable after Towny and throws the aforementioned error
- Disable ActionHealth Result: Movecraft does not enable
- Disable ArtMap Result: Movecraft does not enable
- Disable AsyncWorldEdit Result: Movecraft does not enable
- Disable AuctionHouse Result: Movecraft does not enable
- Disable Brewery Result: Movecraft does not enable
- Disable BungeeGuard Result: Movecraft enables perfectly fine with no issues
- Enable ActionHealth, ArtMap, AsyncWorldEdit, AuctionHouse, Brewery Result: Movecraft does not enable
Notable conclusions:
- There is no specific plugin causing Movecraft to improperly load
- Only Movecraft is being impacted by this as no other towny-dependent plugin is having fatal errors or any error related to this at all
- Neither LuckPerms or BungeeGuard rely on Movecraft or even care about its existence
- None of the plugins disabled during this test rely on Movecraft
- There is no "set method" of reproducing this as the error is occuring under multiple different plugin lists, none of which make any particular sense
That seems to be a very strange issue. Also, are all those plugins apart from Movecraft depending on Towny in some way?
Out of that specific plugin list, none require Towny in any way during load/enable. Their dependencies are as follow:
LuckPerms:
softdepend: [LilyPad-Connect, Vault]
loadbefore: [Vault]
ActionHealth:
softdepend: [PlaceholderAPI, MVdWPlaceholderAPI, WorldGuard, mcMMO, MythicMobs, LangUtils]
ArtMap:
depend: [ProtocolLib]
softdepend: [WorldGuard, Factions, Denizen, GriefPrevention, RedProtect, Landlord, iDisguise, ASkyBlock, Residence, MarriageMaster]
AsyncWorldEdit:
loadbefore: [WorldGuard, PlotSquared]
depend: [WorldEdit]
AuctionHouse:
softdepend: [Vault, HeadDatabase, DiscordSRV]
Brewery:
softdepend: [LWC, LogBlock, WorldGuard, GriefPrevention, Vault, ChestShop]
BungeeGuard:
- No dependencies
Out of the dependencies here, we have installed:
Vault, WorldGuard, mcMMO, ProtocolLib, WorldEdit, LWC, ChestShop
Out of this list, only LWC depends on Towny
Modern-LWC: softdepend: [Vault, WorldEdit, Towny, WorldGuard]
Considering the lack of link between LuckPerms and LWC, or really LuckPerms and any other plugin, it makes no sense why removing LuckPerms allows Movecraft to properly enable.
Despite this, I've disabled only LWC, and still Movecraft does not enable.