Jarada / WuufusWaygates

Spigot Plugin: Wuufu's Waygates is a gate plugin inspired by Creative Gates and Stargate that allows players to connect gates into networks using any material and without any commands
https://www.spigotmc.org/resources/wuufus-waygates.80094/
GNU General Public License v3.0
8 stars 4 forks source link

Getting an error at startup - Gate connected to Creative #10

Closed 4L0N50asd closed 2 years ago

4L0N50asd commented 3 years ago

I'm having this error every time the server starts

[12:13:02] [Server thread/INFO]: [WuufusWaygates] Enabling WuufusWaygates v1.3.1
[12:13:03] [Server thread/ERROR]: Error occurred while enabling WuufusWaygates v1.3.1 (Is it up to date?)
java.lang.NullPointerException: Cannot invoke "org.bukkit.block.Block.getLocation()" because the return value of "com.github.jarada.waygates.data.Gate.getCenterBlock()" is null
    at com.github.jarada.waygates.data.GateActivationEffect$3.activateGate(GateActivationEffect.java:90) ~[WuufusWaygates-1.3.1.jar:?]
    at com.github.jarada.waygates.data.Gate.open(Gate.java:611) ~[WuufusWaygates-1.3.1.jar:?]
    at com.github.jarada.waygates.data.Gate.activateOnLoad(Gate.java:340) ~[WuufusWaygates-1.3.1.jar:?]
    at com.github.jarada.waygates.WaygateManager.loadGates(WaygateManager.java:125) ~[WuufusWaygates-1.3.1.jar:?]
    at com.github.jarada.waygates.data.DataManager.loadWaygates(DataManager.java:355) ~[WuufusWaygates-1.3.1.jar:?]
    at com.github.jarada.waygates.PluginMain.onEnable(PluginMain.java:36) ~[WuufusWaygates-1.3.1.jar:?]
    at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[spigot.jar:git-Paper-214]
    at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:370) ~[spigot.jar:git-Paper-214]
    at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:500) ~[spigot.jar:git-Paper-214]
    at org.bukkit.craftbukkit.v1_17_R1.CraftServer.enablePlugin(CraftServer.java:535) ~[spigot.jar:git-Paper-214]
    at org.bukkit.craftbukkit.v1_17_R1.CraftServer.enablePlugins(CraftServer.java:449) ~[spigot.jar:git-Paper-214]
    at net.minecraft.server.MinecraftServer.loadWorld(MinecraftServer.java:654) ~[spigot.jar:git-Paper-214]
    at net.minecraft.server.dedicated.DedicatedServer.init(DedicatedServer.java:306) ~[spigot.jar:git-Paper-214]
    at net.minecraft.server.MinecraftServer.x(MinecraftServer.java:1141) ~[spigot.jar:git-Paper-214]
    at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:318) ~[spigot.jar:git-Paper-214]
    at java.lang.Thread.run(Thread.java:831) [?:?]
[12:13:03] [Server thread/INFO]: [WuufusWaygates] Disabling WuufusWaygates v1.3.1

It is happening because one of my gates goes to the Creative World, which is a PlotSquared plugin world. If i don't set up that gate, the plugin works fine. Also, when i set up that gate, there's no problem with it. This issue happens only when i restart my server. If that gate doesn't exists, it won't show that issue.

Jarada commented 3 years ago

Hey there... this is an odd error to get. If you check the code, you'll see it returns null whenever the blocks provided aren't present.

In the function above which deals with this, this only happens when the world of the exit block cannot be found. So the plugin cannot find the world in which the gate exists.

Can you check that in Waygates plugin folder, in worlds folder, that:

  1. The world folder is accurately named after your PlotSquared Creative World.
  2. Inside the JSON files related to gates, that following the "worldname", the appropriate world name is also set correctly.

This is so the plugin can find the world named after your world.

4L0N50asd commented 3 years ago

Hi .. Sorry for late reply, I found that this issue it's because Multiverse-Core is enabling after WuufusWaygates does.

When Multiverse-Core gets enabled, loads all worlds in my server. I'm talking about a plugin enabled, not when loading.

So when WuufusWaygates gets enabled and looks for all the gates, it cannot find my creative world because it's not loaded yet, because Multiverse-Core it's not enabled yet.

And yes, the world folder is correctly named and also the Json file.

Jarada commented 3 years ago

Hey, sorry for the late reply myself haha. I keep forgetting to reply to this issue.

Thanks for the update... not had that one before because I've not experienced Multiverse loading after Waygates. I will look into getting Waygates to soft depend on Multiverse so that the plugin architecture loads it in the right order.