MobHunting

MobHunting

114k Downloads

NPE on auto-migration 5.4.6 > 5.4.7-b572

SlimeDog opened this issue ยท 11 comments

commented

Spigot 1.12.2
MH 5.4.7-b572

First test:

  • Download and install MH 5.4.7-b572 over the top of MH 5.4.6
  • Start server

40 of these:

[06:42:59] [Server thread/ERROR]: Could not pass event CreatureSpawnEvent to MobHunting v5.4.7-SNAPSHOT-B572
org.bukkit.event.EventException: null
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[spigot-1.12.2.jar-2018-02-19-0914:git-Spigot-4bd94dc-fb414fe]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[spigot-1.12.2.jar-2018-02-19-0914:git-Spigot-4bd94dc-fb414fe]
        at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:500) [spigot-1.12.2.jar-2018-02-19-0914:git-Spigot-4bd94dc-fb414fe]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:485) [spigot-1.12.2.jar-2018-02-19-0914:git-Spigot-4bd94dc-fb414fe]
        at org.bukkit.craftbukkit.v1_12_R1.event.CraftEventFactory.callCreatureSpawnEvent(CraftEventFactory.java:284) [spigot-1.12.2.jar-2018-02-19-0914:git-Spigot-4bd94dc-fb414fe]
        at net.minecraft.server.v1_12_R1.World.addEntity(World.java:1033) [spigot-1.12.2.jar-2018-02-19-0914:git-Spigot-4bd94dc-fb414fe]
        at net.minecraft.server.v1_12_R1.WorldServer.addEntity(WorldServer.java:1112) [spigot-1.12.2.jar-2018-02-19-0914:git-Spigot-4bd94dc-fb414fe]
        at net.citizensnpcs.nms.v1_12_R1.util.NMSImpl.addEntityToWorld(NMSImpl.java:230) [citizens-2.0.22-b1505.jar:?]
        at net.citizensnpcs.util.NMS.addEntityToWorld(NMS.java:43) [citizens-2.0.22-b1505.jar:?]
        at net.citizensnpcs.npc.CitizensNPC.spawn(CitizensNPC.java:202) [citizens-2.0.22-b1505.jar:?]
        at net.citizensnpcs.npc.CitizensNPC.load(CitizensNPC.java:142) [citizens-2.0.22-b1505.jar:?]
        at net.citizensnpcs.api.npc.SimpleNPCDataStore.loadInto(SimpleNPCDataStore.java:59) [citizens-2.0.22-b1505.jar:?]
        at net.citizensnpcs.Citizens$2.run(Citizens.java:305) [citizens-2.0.22-b1505.jar:?]
        at org.bukkit.craftbukkit.v1_12_R1.scheduler.CraftTask.run(CraftTask.java:71) [spigot-1.12.2.jar-2018-02-19-0914:git-Spigot-4bd94dc-fb414fe]
        at org.bukkit.craftbukkit.v1_12_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:353) [spigot-1.12.2.jar-2018-02-19-0914:git-Spigot-4bd94dc-fb414fe]
        at net.minecraft.server.v1_12_R1.MinecraftServer.D(MinecraftServer.java:739) [spigot-1.12.2.jar-2018-02-19-0914:git-Spigot-4bd94dc-fb414fe]
        at net.minecraft.server.v1_12_R1.DedicatedServer.D(DedicatedServer.java:406) [spigot-1.12.2.jar-2018-02-19-0914:git-Spigot-4bd94dc-fb414fe]
        at net.minecraft.server.v1_12_R1.MinecraftServer.C(MinecraftServer.java:679) [spigot-1.12.2.jar-2018-02-19-0914:git-Spigot-4bd94dc-fb414fe]
        at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:577) [spigot-1.12.2.jar-2018-02-19-0914:git-Spigot-4bd94dc-fb414fe]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_151]
Caused by: java.lang.NumberFormatException: For input string: "_10"
        at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:2043) ~[?:1.8.0_151]
        at sun.misc.FloatingDecimal.parseDouble(FloatingDecimal.java:110) ~[?:1.8.0_151]
        at java.lang.Double.parseDouble(Double.java:538) ~[?:1.8.0_151]
        at java.lang.Double.valueOf(Double.java:502) ~[?:1.8.0_151]
        at one.lindegaard.MobHunting.rewards.RewardManager.getPrice(RewardManager.java:788) ~[?:?]
        at one.lindegaard.MobHunting.rewards.RewardManager.getBaseKillPrize(RewardManager.java:746) ~[?:?]
        at one.lindegaard.MobHunting.MobHuntingManager.spawnerMobSpawn(MobHuntingManager.java:1965) ~[?:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_151]
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_151]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_151]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_151]
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:302) ~[spigot-1.12.2.jar-2018-02-19-0914:git-Spigot-4bd94dc-fb414fe]
        ... 19 more

5.4.6 config.yml
http://whitedog.straight8.com/drops/config.yml

commented

Sorry. I didnt get that? What is it you want me to do? There is no "default config.yml" in the JAR. The config.yml is generated / build when the JAR is run. MobHuting has a special AutoConfig.java which works differently from "normal" plugins. This has the advantage that I can update #comments in the file and insert new settings without a problem. I dont want to change this part of the plugin.

commented

The "wolf" and the "zombie_horse" has the error "_10"

I have made a new build now
https://fractal.lindegaard.one:8181/job/MobHunting/573/

but this is the only change.

I will start fixing other bugs on the issue list now.

commented

Spigot 1.12.2
MH 5.4.7-b573

Conversion from MH 5.4.6 to MH 5.4.7-b573 config.yml

Did not convert world lists:

  • general.disabled-in-worlds
  • achievements.disable-achievements-in-worlds
  • grinding.disable-grinding-detection-in-worlds

Did not convert:

  • mobs.* -> mobs.*.money.amount
  • mobs.-cmd-run-chance -> mobs..commands.chance
  • mobs.-head-prize -> mobs..head.chance ?
  • achievement_levels._level1 -> achievements.hunter._level1
commented

Ahh. I know whats wrong. Check settings for the Wolf. Im sure money is "_10" instead of "-10"

I made a auto search and replace from "-" to "_" because I wanted to align th way I wrote the names

Ex. "ender_dragon" instead of ender-dragon.

I will fix it when I get om in 1-2 hours but you can search for "_10" in the config.yml and "fix" this bug.

commented

Please generate the default config.yml as part of the JAR payload. It would make it a lot easier to compare versions. At present I have to:

  • Stop the server.
  • Backup the plugins/MobHunting directory
  • Remove the plugins/MobHunting directory
  • Update MH (eg., to 5.4.7-b572)
  • Start the server to generate config.yml
  • Stop the server
  • Move the generated files (except mobhunting.db) to plugins/MobHunting/releases/5.4.7/
  • Compare files to those previously saved in plugins/MobHunting/releases/5.4.6/

Better process:

  • Unzip JAR in temporary location
  • Move config.yml, lang/*, etc. to plugins/MobHunting/releases/5.4.7/
  • Compare files to those previously saved in plugins/MobHunting/releases/5.4.6/
commented

@ysl3000 i dont have a config.yml in the jar, i dont it would have been easier to do the changes using regex

commented

Ahh. yes the auto conversion was broken. Please try build 577 or newer....

Thank you your help with the testing!!! I thought I fixed this issue yesterday.

commented

@Rocologo Did you use Regex for your task?

commented

Conversion much better with MH-5.4.7-b577. Thanks.

commented

@ysl3000 no, my config.yml is not "just" a textfile in my jar, so I did not use Regex to change the settings.

commented

@Rocologo A config.yml is just a textfile. U can use Regex in IntelliJ Idea e.g.