MobHunting

MobHunting

114k Downloads

Failed to display NaN: null Messing with EssentialsX Eco

TomLewis opened this issue ยท 9 comments

commented

EssentialsX is spamming the utter hell out of my console, because of MobHunting doing something.

All are on the latest
Paper Spigot 12.2 1298 (latest)
EssentialsX b570 (latest)
MobHunting 540 (latest)

[17:37:39] [Server thread/WARN]: [Essentials] Failed to display NaN: null
java.lang.NumberFormatException: null
	at java.math.BigDecimal.<init>(BigDecimal.java:494) ~[?:1.8.0_151]
	at java.math.BigDecimal.<init>(BigDecimal.java:383) ~[?:1.8.0_151]
	at java.math.BigDecimal.<init>(BigDecimal.java:806) ~[?:1.8.0_151]
	at java.math.BigDecimal.valueOf(BigDecimal.java:1274) ~[?:1.8.0_151]
	at com.earth2me.essentials.api.Economy.format(Economy.java:330) ~[EssentialsX-2.0.1.jar:?]
	at net.milkbowl.vault.economy.plugins.Economy_Essentials.format(Economy_Essentials.java:207) ~[Vault.jar:?]
	at one.lindegaard.MobHunting.MobHuntingManager.onMobDeath(MobHuntingManager.java:1383) ~[MobHunting.jar:?]
	at com.destroystokyo.paper.event.executor.MethodHandleEventExecutor.execute(MethodHandleEventExecutor.java:35) ~[patched_1.12.2.jar:git-Paper-1298]
	at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:78) ~[patched_1.12.2.jar:git-Paper-1298]
	at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[patched_1.12.2.jar:git-Paper-1298]
	at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:515) ~[patched_1.12.2.jar:git-Paper-1298]
	at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:500) ~[patched_1.12.2.jar:git-Paper-1298]
	at org.bukkit.craftbukkit.v1_12_R1.event.CraftEventFactory.callEntityDeathEvent(CraftEventFactory.java:396) ~[patched_1.12.2.jar:git-Paper-1298]
	at net.minecraft.server.v1_12_R1.EntityLiving.die(EntityLiving.java:1137) ~[patched_1.12.2.jar:git-Paper-1298]
	at net.minecraft.server.v1_12_R1.EntityLiving.damageEntity(EntityLiving.java:979) ~[patched_1.12.2.jar:git-Paper-1298]
	at net.minecraft.server.v1_12_R1.EntityMonster.damageEntity(EntityMonster.java:44) ~[patched_1.12.2.jar:git-Paper-1298]
	at net.minecraft.server.v1_12_R1.EntityHuman.attack(EntityHuman.java:1021) ~[patched_1.12.2.jar:git-Paper-1298]
	at net.minecraft.server.v1_12_R1.EntityPlayer.attack(EntityPlayer.java:1352) ~[patched_1.12.2.jar:git-Paper-1298]
	at net.minecraft.server.v1_12_R1.PlayerConnection.a(PlayerConnection.java:1703) ~[patched_1.12.2.jar:git-Paper-1298]
	at net.minecraft.server.v1_12_R1.PacketPlayInUseEntity.a(PacketPlayInUseEntity.java:49) ~[patched_1.12.2.jar:git-Paper-1298]
	at net.minecraft.server.v1_12_R1.PacketPlayInUseEntity.a(PacketPlayInUseEntity.java:6) ~[patched_1.12.2.jar:git-Paper-1298]
	at net.minecraft.server.v1_12_R1.PlayerConnectionUtils.lambda$ensureMainThread$0(PlayerConnectionUtils.java:14) ~[patched_1.12.2.jar:git-Paper-1298]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_151]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_151]
	at net.minecraft.server.v1_12_R1.SystemUtils.a(SourceFile:46) [patched_1.12.2.jar:git-Paper-1298]
	at net.minecraft.server.v1_12_R1.MinecraftServer.D(MinecraftServer.java:843) [patched_1.12.2.jar:git-Paper-1298]
	at net.minecraft.server.v1_12_R1.DedicatedServer.D(DedicatedServer.java:426) [patched_1.12.2.jar:git-Paper-1298]
	at net.minecraft.server.v1_12_R1.MinecraftServer.C(MinecraftServer.java:767) [patched_1.12.2.jar:git-Paper-1298]
	at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:665) [patched_1.12.2.jar:git-Paper-1298]
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_151]
commented

Why do you think it is MobHunting? The error is provoked here in Essentials:

at com.earth2me.essentials.api.Economy.format(Economy.java:330)

and it seems like it is something with your formatting which is wrong. Please test your formatting in Essentials config file.

To be sure I downloaded PaperClip 1.12.2 build 1301 and Updated Esstials to B570 and MobHunting to newest version. And I dont get any errors in the console, when I kill a mob, like you do...

commented
  1. Because both people say it is: EssentialsX/Essentials#1765
  2. Your plugin is mentioned at the bottom of the error. it only happened once I updated MobHunting.
  3. formatting WHERE? In essentials or MH?

Something to do with this?

# The format of currency, excluding symbols. See currency-sumbol-format-locale for symbol configuration.
#
# "#,##0.00" is how the majority of countries display currency.
#currency-format: "#,##0.00"

# Format currency symbols. Some locales use , and . interchangeably.
# For 1,234.50 use en-US
# For 1'234,50 use fr-ch
currency-symbol-format-locale: en-US
commented

I have changed the way I use format in my plugin. I hope this fixes your bug, although I dont understrand why it would :-) Please test build 555 or never

https://fractal.lindegaard.one:8181/job/MobHunting/

commented
  1. Its very easy to say that it is another plugin... I downloaded paperclips and tested MobHunting. No errors. :-) So I guess this in a configuration issue in either Essentials or MobHunting.

  2. Essentials formatting is mentions before MobHunting.

  3. Actually both. I cant remember where you choose the format in Essentials? My guess is that you have chnaged a format somewhere. Have you changed anything lately?

This is line 1383 in MobHunting:

Messages.debug("RecordKill: %s killed a %s (%s) Cash=%s", getPlayer(killer, killed).getName(),
						mob.getMobName(), mob.getMobPlugin().name(),
						plugin.getRewardManager().getEconomy().format(cash));

And the format command which is called is:

public String format(double amount) {
		if (BagOfGoldCompat.isSupported())
			return mEconomy.format(Misc.round(amount));
		else
			return Misc.format(amount);
}

And Misc.format looks like this. Have you change any for

public static String format(double money) {
		Locale locale = new Locale("en", "UK");
		String pattern = "#.#####";
		DecimalFormat decimalFormat = (DecimalFormat) NumberFormat.getNumberInstance(locale);
		decimalFormat.applyPattern(pattern);
		return decimalFormat.format(money);
}

I cant see any errors and I have no reports from anyone else, so it is something on your server or only a few servers. It could be that you have entered a wrong format somewhere?

Where is the currency example from? I notice the example is different from the format used in my Misc.format command.

commented

I have one idea I can try later tonight when I get back from home to see it this is something with the Misc.format command.

commented

Just to be sure... You dont use my BagOfGold plugin, right?

commented

This seems to have fixed it :) No more spamming the console! The essentials developer also stated that it was because of an improperly formatted value being sent to essentials.

commented

Perfect. I have released new versions of MobHunting and BagOfGold tonight... I still dont understand it makes a different and why you saw an error and i didnt ???? But the good thing is that it works.

Case closed :-)

commented

It was happening when my players interacted with something, something triggered it that only happend when players did something, maybe when they killed mobs?