Quests (Inactive)

150k Downloads

Custom objective loses data on restart

Briggybros opened this issue ยท 8 comments

commented

I have created a custom objective and added a data called id. I set the value when making the custom objective and it works fine. However, when the server is restarted, the value is reset, causing NullPointerExceptions as the value is no longer held in the map.

commented

Please post your configuration as well as the error.

commented

language: en
allow-command-questing: true
allow-command-quests-with-npcs: false
show-requirements: true
allow-quitting: true
ignore-locked-quests: false
debug-mode: false
generate-files-on-join: true
kill-delay: 600
accept-timeout: 20
show-npc-effects: true
npc-effect: note
max-quests: 0
convert-data-on-startup: false
quester-blacklist:

  • UUID
  • UUID
  • UUID
  • UUID
commented

Sorry, by "configuration" I meant the quest involved (from quests.yml).

Also, the error?

commented

custom11:
name: Become a member
npc-giver-id: 155
ask-message: Do you want to become a member?
finish-message: Well done, you are now a member. Welcome to TMM!
stages:
ordered:
'1':
custom-objectives:
custom1:
name: RegisterObjective
count: -999
data:
npc-id: '155'
rewards:
commands:
- member

It is the value of npc-id that seems to not be loaded. There is no error logged which I can see.

commented

I cannot duplicate the issue you described. If you can find one of the NullPointerExceptions you mentioned in your first post, that would help. Or I could try loading your entire quests.yml.

commented

Here:

Console : [23:19:26 ERROR]: Could not pass event NPCRightClickEvent to Quests v2.3.4
Console : org.bukkit.event.EventException
Console : at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:305) ~[spigot.jar:git-Spigot-bf0ac55-3ee97a3]
Console : at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[spigot.jar:git-Spigot-bf0ac55-3ee97a3]
Console : at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:502) [spigot.jar:git-Spigot-bf0ac55-3ee97a3]
Console : at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:487) [spigot.jar:git-Spigot-bf0ac55-3ee97a3]
Console : at net.citizensnpcs.EventListen.onPlayerInteractEntity(EventListen.java:275) [Citizens.jar:?]
Console : at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_75]
Console : at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[?:1.7.0_75]
Console : at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.7.0_75]
Console : at java.lang.reflect.Method.invoke(Method.java:606) ~[?:1.7.0_75]
Console : at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:301) [spigot.jar:git-Spigot-bf0ac55-3ee97a3]
Console : at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) [spigot.jar:git-Spigot-bf0ac55-3ee97a3]
Console : at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:502) [spigot.jar:git-Spigot-bf0ac55-3ee97a3]
Console : at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:487) [spigot.jar:git-Spigot-bf0ac55-3ee97a3]
Console : at net.minecraft.server.v1_8_R1.PlayerConnection.a(PlayerConnection.java:1268) [spigot.jar:git-Spigot-bf0ac55-3ee97a3]
Console : at net.minecraft.server.v1_8_R1.PacketPlayInUseEntity.a(SourceFile:52) [spigot.jar:git-Spigot-bf0ac55-3ee97a3]
Console : at net.minecraft.server.v1_8_R1.PacketPlayInUseEntity.a(SourceFile:11) [spigot.jar:git-Spigot-bf0ac55-3ee97a3]
Console : at net.minecraft.server.v1_8_R1.PacketHandleTask.run(SourceFile:13) [spigot.jar:git-Spigot-bf0ac55-3ee97a3]
Console : at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [?:1.7.0_75]
Console : at java.util.concurrent.FutureTask.run(FutureTask.java:262) [?:1.7.0_75]
Console : at net.minecraft.server.v1_8_R1.MinecraftServer.z(MinecraftServer.java:696) [spigot.jar:git-Spigot-bf0ac55-3ee97a3]
Console : at net.minecraft.server.v1_8_R1.DedicatedServer.z(DedicatedServer.java:316) [spigot.jar:git-Spigot-bf0ac55-3ee97a3]
Console : at net.minecraft.server.v1_8_R1.MinecraftServer.y(MinecraftServer.java:634) [spigot.jar:git-Spigot-bf0ac55-3ee97a3]
Console : at net.minecraft.server.v1_8_R1.MinecraftServer.run(MinecraftServer.java:537) [spigot.jar:git-Spigot-bf0ac55-3ee97a3]
Console : at java.lang.Thread.run(Thread.java:745) [?:1.7.0_75]
Console : Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integer
Console : at RegisterObjective.onNPCRightClick(RegisterObjective.java:75) ~[?:?]
Console : at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_75]
Console : at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[?:1.7.0_75]
Console : at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.7.0_75]
Console : at java.lang.reflect.Method.invoke(Method.java:606) ~[?:1.7.0_75]
Console : at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:301) ~[spigot.jar:git-Spigot-bf0ac55-3ee97a3]
Console : ... 23 more

commented

Try removing the single-quotes around the npc-id (so "npc-id: 155" instead of "npc-id: '155'")? If that doesn't work please post/send your entire quests.yml for testing.

commented

Closing due to lack of response from OP. If the issue persists, please open a new ticket.