eirikh1996 / Movecraft

The original movement plugin for Bukkit. Reloaded. Again.
GNU General Public License v3.0
33 stars 7 forks source link

Towny Integration Error #46

Open Ineusia opened 4 years ago

Ineusia commented 4 years ago

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:

  1. Use Paper 1.15.2 (Error should be independent of server software, caused by Towny hook)
  2. Use Towny 0.96.1.0 or 0.96.1.8 (Error occurs with both)
  3. Use Movecraft v7.0.0_for_1.8.8-1.15.2_beta_22
  4. Start server

Expected behavior Movecraft loads and functions

Versions (please complete the following information):

eirikh1996 commented 4 years ago

Have you tried with Towny 0.96.1.9? I tested it with that version and no error appeared

Ineusia commented 4 years ago

Issue persists

Towny 0.96.1.9 Movecraft beta 24 Paper 262

Console Error: http://prntscr.com/sdhrlq

Versions: http://prntscr.com/sdhru1

eirikh1996 commented 4 years ago

Can you post:

  1. Towny startup log
  2. Your Towny configs ?

I have tested Movecraft with Towny and I have no issue. Also, how do you store towny world data?

Ineusia commented 4 years ago

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

Ineusia commented 4 years ago

I've found out some very bizarre information:

1) Movecraft and Towny seem to be enabling arbitrarily 2) Movecraft is not depended on by any plugin on my server, and as such should be perfectly fine to enable after Towny 3) Setting Movecraft to load postworld does not fix the issue 3) Setting Towny to "loadbefore: [Movecraft]" does not fix the issue

I've performed the following test in order:

1) Disable LuckPerms Result: Movecraft enables perfectly fine 2) Enable LuckPerms Result: Movecraft does not enable after Towny and throws the aforementioned error 3) Disable ActionHealth Result: Movecraft does not enable 4) Disable ArtMap Result: Movecraft does not enable 5) Disable AsyncWorldEdit Result: Movecraft does not enable 6) Disable AuctionHouse Result: Movecraft does not enable 7) Disable Brewery Result: Movecraft does not enable 7) Disable BungeeGuard Result: Movecraft enables perfectly fine with no issues 8) Enable ActionHealth, ArtMap, AsyncWorldEdit, AuctionHouse, Brewery Result: Movecraft does not enable

Notable conclusions: 1) There is no specific plugin causing Movecraft to improperly load 2) 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 3) Neither LuckPerms or BungeeGuard rely on Movecraft or even care about its existence 4) None of the plugins disabled during this test rely on Movecraft 5) 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

eirikh1996 commented 4 years ago

That seems to be a very strange issue. Also, are all those plugins apart from Movecraft depending on Towny in some way?

Ineusia commented 4 years ago

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.