Lottery+

Lottery+

47.5k Downloads

everytime a user clicks on a lottery sign

frenchtoaster11 opened this issue ยท 25 comments

commented

it says invalid number the transaction canceled
the in-game command doesn't work either
any fixes? im using vault

here is the error:

[20:18:09] [Server thread/WARN]: java.lang.NullPointerException
[20:18:09] [Server thread/WARN]: at com.randude14.lotteryplus.util.Utils.lambda$0(Utils.java:147)
[20:18:09] [Server thread/WARN]: at java.util.TimSort.binarySort(Unknown Source)
[20:18:09] [Server thread/WARN]: at java.util.TimSort.sort(Unknown Source)
[20:18:09] [Server thread/WARN]: at java.util.Arrays.sort(Unknown Source)
[20:18:09] [Server thread/WARN]: at com.randude14.lotteryplus.util.Utils.getOfflinePlayer(Utils.java:168)
[20:18:09] [Server thread/WARN]: at com.randude14.register.economy.VaultEconomy.hasAccount(VaultEconomy.java:53)
[20:18:09] [Server thread/WARN]: at com.randude14.register.economy.VaultEconomy.hasAccount(VaultEconomy.java:78)
[20:18:09] [Server thread/WARN]: at com.randude14.lotteryplus.lottery.Lottery.buyTickets(Lottery.java:1007)
[20:18:09] [Server thread/WARN]: at com.randude14.lotteryplus.command.BuyCommand.buyTickets(BuyCommand.java:66)
[20:18:09] [Server thread/WARN]: at com.randude14.lotteryplus.command.BuyCommand.execute(BuyCommand.java:17)
[20:18:09] [Server thread/WARN]: at com.randude14.lotteryplus.command.CommandManager.onCommand(CommandManager.java:84)
[20:18:09] [Server thread/WARN]: at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45)
[20:18:09] [Server thread/WARN]: at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:148)
[20:18:09] [Server thread/WARN]: at org.bukkit.craftbukkit.v1_14_R1.CraftServer.dispatchCommand(CraftServer.java:689)
[20:18:09] [Server thread/WARN]: at net.minecraft.server.v1_14_R1.PlayerConnection.handleCommand(PlayerConnection.java:1590)
[20:18:09] [Server thread/WARN]: at net.minecraft.server.v1_14_R1.PlayerConnection.a(PlayerConnection.java:1444)
[20:18:09] [Server thread/WARN]: at net.minecraft.server.v1_14_R1.PacketPlayInChat.a(SourceFile:37)
[20:18:09] [Server thread/WARN]: at net.minecraft.server.v1_14_R1.PacketPlayInChat.a(SourceFile:9)
[20:18:09] [Server thread/WARN]: at net.minecraft.server.v1_14_R1.PlayerConnectionUtils.lambda$0(PlayerConnectionUtils.java:19)
[20:18:09] [Server thread/WARN]: at net.minecraft.server.v1_14_R1.TickTask.run(SourceFile:18)
[20:18:09] [Server thread/WARN]: at net.minecraft.server.v1_14_R1.IAsyncTaskHandler.executeTask(SourceFile:144)
[20:18:09] [Server thread/WARN]: at net.minecraft.server.v1_14_R1.IAsyncTaskHandlerReentrant.executeTask(SourceFile:23)
[20:18:09] [Server thread/WARN]: at net.minecraft.server.v1_14_R1.IAsyncTaskHandler.executeNext(SourceFile:118)
[20:18:09] [Server thread/WARN]: at net.minecraft.server.v1_14_R1.MinecraftServer.aX(MinecraftServer.java:867)
[20:18:09] [Server thread/WARN]: at net.minecraft.server.v1_14_R1.MinecraftServer.executeNext(MinecraftServer.java:860)
[20:18:09] [Server thread/WARN]: at net.minecraft.server.v1_14_R1.IAsyncTaskHandler.executeAll(SourceFile:103)
[20:18:09] [Server thread/WARN]: at net.minecraft.server.v1_14_R1.MinecraftServer.sleepForTick(MinecraftServer.java:843)
[20:18:09] [Server thread/WARN]: at net.minecraft.server.v1_14_R1.MinecraftServer.run(MinecraftServer.java:784)
[20:18:09] [Server thread/WARN]: at java.lang.Thread.run(Unknown Source)

commented

Hmmmmmm a quick research reveals that apparently the server sometimes does not know the names of all the players. Sounds silly to me but unfortunately, I can't control that. I'll try to get a version uploaded tomorrow. Thanks for bringing this to my intention.

commented

Just uploaded the new version. Hopefully they'll approve it tonight or early in the morning. Please let me know if it fixes it.

commented

If you would like to and don't mind, I could provide a dropbox link to the updated Jar so I can make sure this is fixed for sure.

commented

sure that would be great!

commented

do you know why this is an issue for my server?

commented

The first time, the server couldn't find the names of some players for some reason, so it was throwing a NullPointerException (players .dat files being erased?).

Second time is a little concerning. This means Lottery+ couldn't find the person buying the tickets.

It should be fixed this time but I am a little concerned with Lottery+ saving the tickets bought by players and being rewarded though so I would keep an eye on that.

You can use '/lottery info ' to double check tickets were bought correctly.

commented
commented

alright. the commands work now but the signs do not. everyone can use the commands but it looks like im the only one that actually buys tickets when i use the command. everyone else uses the command and they are entered but no tickets seem to show up when /lottery info is typed.

if you need any extra info let me know.

thanks for all you have done so far

commented

never mind the tickets are entered they just dont show up people can win them. again though signs do not work they say invalid number but the commands do work.

commented

Hmmmmmmm the invalid number part is really odd to me. Are you absolutely sure they are only entering the numbers only with no spaces or weird characters?

commented

well its not them im trying it my self. i enter the numbers with no spaces, no special characters just the numbers thats it. nothing appears in the server logs either. so that also makes it harder to diagnose. so far though everything else seems to be working. also im very impressed with the cool lottery creator(Guic command) its really useful.

commented

also only so may people can enter the lottery before the they get a lottery.error.players.nomore in chat when trying to join. the max players is set to 40 though.

commented

Ugh are you trying to make me rage x.x haha jkjk. Yeah the gui creator was a big thing I wanted to make when I started adding too many options and I knew trying to make lotteries was going to be a big pain if you wanted to do something crazy. Wish I could look more into it but I'm going to be super busy over the next few months between school and work. I was just happy to get project updated during the summer.

commented

i just tried the new V1.2.1 and it errors out in a similar way
if you need anything else let me know. thanks.

heres the error:

[09:33:07] [Server thread/WARN]: java.lang.NullPointerException
[09:33:07] [Server thread/WARN]: at net.milkbowl.vault.economy.AbstractEconomy.hasAccount(AbstractEconomy.java:10)
[09:33:07] [Server thread/WARN]: at com.randude14.register.economy.VaultEconomy.hasAccount(VaultEconomy.java:54)
[09:33:07] [Server thread/WARN]: at com.randude14.register.economy.VaultEconomy.hasAccount(VaultEconomy.java:78)
[09:33:07] [Server thread/WARN]: at com.randude14.lotteryplus.lottery.Lottery.buyTickets(Lottery.java:1007)
[09:33:07] [Server thread/WARN]: at com.randude14.lotteryplus.command.BuyCommand.buyTickets(BuyCommand.java:66)
[09:33:07] [Server thread/WARN]: at com.randude14.lotteryplus.command.BuyCommand.execute(BuyCommand.java:17)
[09:33:07] [Server thread/WARN]: at com.randude14.lotteryplus.command.CommandManager.onCommand(CommandManager.java:84)
[09:33:07] [Server thread/WARN]: at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45)
[09:33:07] [Server thread/WARN]: at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:148)
[09:33:07] [Server thread/WARN]: at org.bukkit.craftbukkit.v1_14_R1.CraftServer.dispatchCommand(CraftServer.java:689)
[09:33:07] [Server thread/WARN]: at net.minecraft.server.v1_14_R1.PlayerConnection.handleCommand(PlayerConnection.java:1590)
[09:33:07] [Server thread/WARN]: at net.minecraft.server.v1_14_R1.PlayerConnection.a(PlayerConnection.java:1444)
[09:33:07] [Server thread/WARN]: at net.minecraft.server.v1_14_R1.PacketPlayInChat.a(SourceFile:37)
[09:33:07] [Server thread/WARN]: at net.minecraft.server.v1_14_R1.PacketPlayInChat.a(SourceFile:9)
[09:33:07] [Server thread/WARN]: at net.minecraft.server.v1_14_R1.PlayerConnectionUtils.lambda$0(PlayerConnectionUtils.java:19)
[09:33:07] [Server thread/WARN]: at net.minecraft.server.v1_14_R1.TickTask.run(SourceFile:18)
[09:33:07] [Server thread/WARN]: at net.minecraft.server.v1_14_R1.IAsyncTaskHandler.executeTask(SourceFile:144)
[09:33:07] [Server thread/WARN]: at net.minecraft.server.v1_14_R1.IAsyncTaskHandlerReentrant.executeTask(SourceFile:23)
[09:33:07] [Server thread/WARN]: at net.minecraft.server.v1_14_R1.IAsyncTaskHandler.executeNext(SourceFile:118)
[09:33:07] [Server thread/WARN]: at net.minecraft.server.v1_14_R1.MinecraftServer.aX(MinecraftServer.java:867)
[09:33:07] [Server thread/WARN]: at net.minecraft.server.v1_14_R1.MinecraftServer.executeNext(MinecraftServer.java:860)
[09:33:07] [Server thread/WARN]: at net.minecraft.server.v1_14_R1.IAsyncTaskHandler.awaitTasks(SourceFile:127)
[09:33:07] [Server thread/WARN]: at net.minecraft.server.v1_14_R1.MinecraftServer.sleepForTick(MinecraftServer.java:844)
[09:33:07] [Server thread/WARN]: at net.minecraft.server.v1_14_R1.MinecraftServer.run(MinecraftServer.java:784)
[09:33:07] [Server thread/WARN]: at java.lang.Thread.run(Unknown Source)

commented

ahh i understand. well thanks for all the help you have given me so far.

commented

Do you run any other plugins? The only thing I can think of is another plugin is editing the chat before lottery+ reaches it.

commented

yes i run chatcolor 2, chestshop, coreprotect, craftbay, craftenhance, creaturecapture, chris treecapitator, deadchest, essentialsX, lockettePro, lotteryplus, minepacks, openinv, permissionsEx, PlayerMagnet, SleepTight, SilkSpawner, Vault, Worldedit, WorldGuard. these are the plugins on the server the only one that might receive chat differently is chatcolor2 other then that im not too sure.

commented

heres another error im getting when starting the server :

[19:19:07] [Server thread/ERROR]: Could not pass event BlockPhysicsEvent to LotteryPlus v1.2.1
org.bukkit.event.EventException: null
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:312) ~[craftbukkit.jar:git-Bukkit-e5e8eec]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[craftbukkit.jar:git-Bukkit-e5e8eec]
at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:528) ~[craftbukkit.jar:git-Bukkit-e5e8eec]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:513) ~[craftbukkit.jar:git-Bukkit-e5e8eec]
at net.minecraft.server.v1_14_R1.World.a(World.java:446) ~[craftbukkit.jar:git-Bukkit-e5e8eec]
at net.minecraft.server.v1_14_R1.World.applyPhysics(World.java:405) ~[craftbukkit.jar:git-Bukkit-e5e8eec]
at net.minecraft.server.v1_14_R1.TileEntityChest.onOpen(TileEntityChest.java:253) ~[craftbukkit.jar:git-Bukkit-e5e8eec]
at net.minecraft.server.v1_14_R1.TileEntityChest.startOpen(TileEntityChest.java:223) ~[craftbukkit.jar:git-Bukkit-e5e8eec]
at net.minecraft.server.v1_14_R1.InventoryLargeChest.startOpen(InventoryLargeChest.java:130) ~[craftbukkit.jar:git-Bukkit-e5e8eec]
at net.minecraft.server.v1_14_R1.ContainerChest.(ContainerChest.java:77) ~[craftbukkit.jar:git-Bukkit-e5e8eec]
at net.minecraft.server.v1_14_R1.ContainerChest.b(ContainerChest.java:69) ~[craftbukkit.jar:git-Bukkit-e5e8eec]
at com.lishid.openinv.internal.v1_14_R1.AnySilentContainer$1.createMenu(AnySilentContainer.java:237) ~[?:?]
at net.minecraft.server.v1_14_R1.EntityPlayer.openContainer(EntityPlayer.java:1040) ~[craftbukkit.jar:git-Bukkit-e5e8eec]
at com.lishid.openinv.internal.v1_14_R1.AnySilentContainer.activateContainer(AnySilentContainer.java:266) ~[?:?]
at com.lishid.openinv.listeners.PlayerListener.onPlayerInteract(PlayerListener.java:74) ~[?:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_221]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_221]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_221]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_221]
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:310) ~[craftbukkit.jar:git-Bukkit-e5e8eec]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[craftbukkit.jar:git-Bukkit-e5e8eec]
at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:528) ~[craftbukkit.jar:git-Bukkit-e5e8eec]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:513) ~[craftbukkit.jar:git-Bukkit-e5e8eec]
at org.bukkit.craftbukkit.v1_14_R1.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:427) ~[craftbukkit.jar:git-Bukkit-e5e8eec]
at net.minecraft.server.v1_14_R1.PlayerInteractManager.a(PlayerInteractManager.java:432) ~[craftbukkit.jar:git-Bukkit-e5e8eec]
at net.minecraft.server.v1_14_R1.PlayerConnection.a(PlayerConnection.java:1202) ~[craftbukkit.jar:git-Bukkit-e5e8eec]
at net.minecraft.server.v1_14_R1.PacketPlayInUseItem.a(SourceFile:36) ~[craftbukkit.jar:git-Bukkit-e5e8eec]
at net.minecraft.server.v1_14_R1.PacketPlayInUseItem.a(SourceFile:10) ~[craftbukkit.jar:git-Bukkit-e5e8eec]
at net.minecraft.server.v1_14_R1.PlayerConnectionUtils.lambda$0(PlayerConnectionUtils.java:19) ~[craftbukkit.jar:git-Bukkit-e5e8eec]
at net.minecraft.server.v1_14_R1.TickTask.run(SourceFile:18) [craftbukkit.jar:git-Bukkit-e5e8eec]
at net.minecraft.server.v1_14_R1.IAsyncTaskHandler.executeTask(SourceFile:144) [craftbukkit.jar:git-Bukkit-e5e8eec]
at net.minecraft.server.v1_14_R1.IAsyncTaskHandlerReentrant.executeTask(SourceFile:23) [craftbukkit.jar:git-Bukkit-e5e8eec]
at net.minecraft.server.v1_14_R1.IAsyncTaskHandler.executeNext(SourceFile:118) [craftbukkit.jar:git-Bukkit-e5e8eec]
at net.minecraft.server.v1_14_R1.MinecraftServer.aX(MinecraftServer.java:867) [craftbukkit.jar:git-Bukkit-e5e8eec]
at net.minecraft.server.v1_14_R1.MinecraftServer.executeNext(MinecraftServer.java:860) [craftbukkit.jar:git-Bukkit-e5e8eec]
at net.minecraft.server.v1_14_R1.IAsyncTaskHandler.executeAll(SourceFile:103) [craftbukkit.jar:git-Bukkit-e5e8eec]
at net.minecraft.server.v1_14_R1.MinecraftServer.sleepForTick(MinecraftServer.java:843) [craftbukkit.jar:git-Bukkit-e5e8eec]
at net.minecraft.server.v1_14_R1.MinecraftServer.run(MinecraftServer.java:784) [craftbukkit.jar:git-Bukkit-e5e8eec]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_221]
Caused by: java.lang.ClassCastException: org.bukkit.material.MaterialData cannot be cast to org.bukkit.material.Sign
at com.randude14.lotteryplus.listeners.SignProtectorListener.canBreakBlock(SignProtectorListener.java:53) ~[?:?]
at com.randude14.lotteryplus.listeners.SignProtectorListener.checkBlockBroken(SignProtectorListener.java:45) ~[?:?]
at com.randude14.lotteryplus.listeners.SignProtectorListener.onBlockPhysics(SignProtectorListener.java:92) ~[?:?]
at sun.reflect.GeneratedMethodAccessor34.invoke(Unknown Source) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_221]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_221]
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:310) ~[craftbukkit.jar:git-Bukkit-e5e8eec]

sorry if im giving you a lot to look at. i just wanna help in any way that i can.

commented

No it's all good. Tried fixing the block breaking event but can't get it to work. I'll look at it some other time.

commented

Okay. I think I got something going now. Should fix that weird error from last night and hopefully (fingers crossed!) the chat bug to. It should be telling Bukkit to let Lottery+ look at the chat first but we'll see. Anyways here's the link: https://www.dropbox.com/s/m1so17rjuiaoldc/LotteryPlus_BETA_v1.2.1.jar?dl=0

commented

Also I'm an idiot. I update the jar files to my GitHub, so you could have just been uploading from here the entire time lmao. If you go the source, it's under the versions folder (Version 1.2.1). The file has been updated and should fix the max players bug.

commented

looks like you fixed it. everything seems to be working now. if you dont mind me asking what did you do to fix it, im curious. i used to do some java myself. thanks again!

commented
  1. The max players bug was a silly mistake. Instead of counting the players, I was counting the total tickets bought.

  2. I changed my chat listener to lowest priority so it should be one of the first plugins to see the chat.

  3. The sign problem was due to a change in the Bukkit API being updated so it required a change here and there. I'm super glad that it works for all signs (jungle, oak, birch, etc..) and not just the oak plank. That would be annoying lol.

Edit: you can also check out my commits on my code if you want to see the details.

On that note I consider this issue closed and will upload later tonight. Thanks for the help! You can always DM me on bukkit dev if you want to talk more.

commented

so it looks like the signs work now but theres still the issue of the lottery.error.players.nomore. other then that everything else seems to work. thanks

commented

Smh I can already see where I screwed up on that. I'll get that up later tonight. Thanks for all the help. It makes me wonder how long some of these errors have existed and nobody said nothing.