Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vault services providers (Economy/Permissions) aren't properly accessed #409

Open
Phoenix616 opened this issue Feb 1, 2021 · 0 comments

Comments

@Phoenix616
Copy link

Description

When starting the server it is possible that the accessed service providing plugins (e.g. for Vault's Economy or Permissions) are loader after Guilds.

Expected Behavior

It to enable properly.

Actual Behavior

Fails to enable (and prints database error on subsequent disable):

[15:28:24] [Server thread/INFO]: [Guilds] Enabling Guilds v3.5.5.6
[15:28:24] [Server thread/INFO]:   ________ 
[15:28:24] [Server thread/INFO]:  /  _____/ 
[15:28:24] [Server thread/INFO]: /   \  ___   Guilds v3.5.5.6
[15:28:24] [Server thread/INFO]: \    \_\  \  Server Version: git-Spigot-f011ca2-3af81c7 (MC: 1.16.4)
[15:28:24] [Server thread/INFO]:  \______  /
[15:28:24] [Server thread/INFO]:         \/ 
[15:28:24] [Server thread/WARN]: It looks like you don't have an Economy plugin on your server! Stopping plugin..
[15:28:24] [Server thread/INFO]: [Guilds] Disabling Guilds v3.5.5.6
[15:28:24] [Server thread/INFO]: Shutting down database...
[15:28:24] [Server thread/ERROR]: Error occurred while disabling Guilds v3.5.5.6 (Is it up to date?)
java.lang.NullPointerException: Cannot invoke "me.glaremasters.guilds.database.DatabaseAdapter.close()" because "this.database" is null
	at me.glaremasters.guilds.Guilds.onDisable(Guilds.java:114) ~[?:?]
	at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:265) ~[spigot.jar:git-Spigot-f011ca2-3af81c7]
	at org.bukkit.plugin.java.JavaPluginLoader.disablePlugin(JavaPluginLoader.java:376) ~[spigot.jar:git-Spigot-f011ca2-3af81c7]
	at org.bukkit.plugin.SimplePluginManager.disablePlugin(SimplePluginManager.java:501) ~[spigot.jar:git-Spigot-f011ca2-3af81c7]
	at me.glaremasters.guilds.Guilds.onEnable(Guilds.java:160) ~[?:?]
	at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:263) ~[spigot.jar:git-Spigot-f011ca2-3af81c7]
	at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:351) ~[spigot.jar:git-Spigot-f011ca2-3af81c7]
	at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:480) ~[spigot.jar:git-Spigot-f011ca2-3af81c7]
	at org.bukkit.craftbukkit.v1_16_R3.CraftServer.enablePlugin(CraftServer.java:494) ~[spigot.jar:git-Spigot-f011ca2-3af81c7]
	at org.bukkit.craftbukkit.v1_16_R3.CraftServer.enablePlugins(CraftServer.java:408) ~[spigot.jar:git-Spigot-f011ca2-3af81c7]
	at net.minecraft.server.v1_16_R3.MinecraftServer.loadWorld(MinecraftServer.java:435) ~[spigot.jar:git-Spigot-f011ca2-3af81c7]
	at net.minecraft.server.v1_16_R3.DedicatedServer.init(DedicatedServer.java:218) ~[spigot.jar:git-Spigot-f011ca2-3af81c7]
	at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:808) ~[spigot.jar:git-Spigot-f011ca2-3af81c7]
	at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$0(MinecraftServer.java:164) ~[spigot.jar:git-Spigot-f011ca2-3af81c7]
	at java.lang.Thread.run(Thread.java:832) [?:?]

Possible Fix

Properly hook into the Economy service provider by using the service register and unregister events. (See how ChestShop does it)

Steps to Reproduce

  1. Install Vault, FakeEconomy plugin and Guilds
  2. Start server
  3. Hope that the plugin load order somehow ends up with the correct order to cause the bug
  4. Done

Context

Your Environment

  • Guilds version: Guilds v3.5.5.6
  • MC Version: git-Spigot-f011ca2-3af81c7 (MC: 1.16.4)
  • Plugin List: RedstoneClockDetector, ServerClustersBukkit, ShowItem, ServerListPlus, Vault, NamechangeSimulator, Pipes, Multiverse-Core, Testplugin, Guilds, FakeEconomy, Multiverse-NetherPortals, LWC, ChestShop, ChestShopNotifier
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant