Betonquest: NPCDestinations loading issue

Created on 30 Nov 2017  路  15Comments  路  Source: BetonQuest/BetonQuest

Hey guys. I may have found another load order issue (thanks Co0sh for fixing the loading issue I previously had, you're awesome). This time its with a plugin called NPCDestinations that has compatibility on its side with BetonQuest. It seems that Beton is loading before NPC destinations making my locations based quests not work (instead my NPC "Rika" refuses to talk to anybody) after I reload the NPCDestinations plugin and Beton is hooked into, the quests work fine. I tried to modify the BetonQuest plugin.yml directly by adding a line.
loadafter: [NPCDestinations]
and my server wouldn't read the plugin. I tried adding
loadbefore: [BetonQuest]
into the NPCDestinations plugin.yml and that seemed to exacerbate the problem by disabling the NPCDestinations_Animations add-on for NPCDestinations. I could probably force a scheduled reload of NPCDestinations after the server restarts every 6 hours, but I'm not entirely confident in setting scheduled tasks on my server with our current host and the Animations add-on issue would still exist. Thanks for reading and any feedback in advance!

Most helpful comment

So I took 1.9.3 or less and pause till the first server tick, if it's version 1.9.4 or better I register right away. Fixes the issue and allows servers with older copies to function.

Version 2.1.16 will resolve this once I upload it.

All 15 comments

Ah a public plugin with betonquest integration! :o

https://www.spigotmc.org/resources/nunpcdestinations-create-living-npcs-1-8-3-1-12.13863/
@Co0sh add that somewhere on the page :) The more stuff like this is linked the better :3

Back to Topic:
Unfortunatly this plugin doesn't seem to be open source. This makes finding the issue a lot more difficult.

As this plugin doesn't do too crazy stuff with betonquest it should just work if the softdepend is set properly. ( I think there is no thing such as "loadafter")
Also I think your logic is reversed: "loadbefore" means this plugin should be loaded before the plugins that are specified.
So it would be loadbefore in betonquest or softdepend in npcdestinations. I would go with the latter :)

Yes as its the Plugin which hooks into BetonQuest and not the other way arround is the author of the plugin who should fix it...

Yeah I made sure to post this in the NPCDestinations GitHub too since it does seem like it would make sense for them to fix the problem. I just figured having Co0sh know about it might help too. I'll have to try the softdepend method (if the other author doesn't reply before I get around to doing so. Thanks MWFIAE for the help! I'll let you guys know if it works.

You're welcome :+1:

Here the link to the issue created in the npcdestination repo:
https://github.com/Nutty101/NPC_Destinations2/issues/10

i commented on the issue on my side. most of my plugins are broke with the newer version if betonquest. it's a timing issue. i used to be able to wait then register events, etc. the new version you cant wait, so i need to do it sooner. the issue is old betonquest 1.9.x breaks if i do it in the onenable event without a delay. so its a catch 22 on that. I already do some funky stuff to manage 1.8 and 1.9 versioning as some users are only on the 1.8 versions of beton. time is an enemy at the moment.

it looks like the softdepend may have worked (I can't check it directly due to being away from my normal computer, but one of our admins did and the quest worked for him). If it turns out that it was a fluke, I think I figured out how to set a scheduled reload of Beton on our host so I can try that.

@Nutty101 I don't know what kind of compatibility stuff you are doing but for registering events, objectives, conditions,... I never needed a delay for my older plugins for 1.8/1.9. It always worked having softdepend: [BetonQuest] in my plugin.yml and registering in enable. This should still work with the last version.
For compatibillity with both 1.8 and 1.9 the best way to do it is having two constructors in your Events, Conditions,...
One to mach super(String instruction); and one to mach super(Instruction instruction);

@Nutty101 do you plan on keeping this plugin closed source?
To be honest I don't quite see the benefit and if it would be opensource the community could help out :)
Dealing with decompiled plugins doesn't really make things clearer/easier.

@MWFIAE https://github.com/Nutty101/nuNPC_Destinations

The problem is that Spigot's loading order doesn't work reliably. Sometimes it will load plugins correctly, sometimes it won't, and there is no way to make it work. For NPC Destinations it wasn't working at all, so Nutty had to move type registering to the first server tick.

Now that BetonQuest loads add one of the first plugins on the server, it will also load all data on the first tick _before_ other plugins. That breaks NPC Destinations.

We already talked about this with @Nutty101, but I have one more suggestion. Try registering types both in onEnable() and on the first tick. Simply catch and discard any possible errors thrown by that first try. This should make it work for both versions.

I'm sorry for such a breaking change in a minor release, I hadn't realized it would break other plugins' integrations.

This seems to be the old plugin though. 1.x instead of 2.x

I never heard that spigots loading order doesn't work.
For my projects (>100 Plugins all depend on one or more other plugins) I've never encountered such an issue...

I'm strongly suspecting it to be an issue because the depends are not properly set.

Maybe, but these bugs are hard to debug. Besides all BetonQuest dependencies are set up correctly, so it would be caused by other plugins I suppose.

I just need time to look at it, gotta give me time for that. 99.999% of the time, stuff like this is fixed in a hour if that. Just due to a major decision in my life, i have been a bit disconnected and in a position where I can not do anything atm. Pretty much simple as that.

So I took 1.9.3 or less and pause till the first server tick, if it's version 1.9.4 or better I register right away. Fixes the issue and allows servers with older copies to function.

Version 2.1.16 will resolve this once I upload it.

You can close this one out. ;)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

NotJustPizza picture NotJustPizza  路  3Comments

MentosVagabond picture MentosVagabond  路  4Comments

digital-r picture digital-r  路  6Comments

SirMittens picture SirMittens  路  4Comments

Namnodorel picture Namnodorel  路  6Comments