ksafin / DynamicEconomy

A Virtual Economy for your Minecraft Server
http://dev.bukkit.org/server-mods/dynamiceconomy-v-01/
12 stars 7 forks source link

Found cause of internal errors when buying/selling #92

Closed neg-0 closed 12 years ago

neg-0 commented 12 years ago

Found a bug that leads to an internal error when buying/selling. Here is the error:

2012-05-02 01:03:15 [SEVERE] org.bukkit.command.CommandException: Unhandled exception executing command 'sell' in plugin DynamicEconomy v.8.5 2012-05-02 01:03:15 [SEVERE] at org.bukkit.command.PluginCommand.execute(PluginCommand.java:40) 2012-05-02 01:03:15 [SEVERE] at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:166) 2012-05-02 01:03:15 [SEVERE] at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:479) 2012-05-02 01:03:15 [SEVERE] at net.minecraft.server.NetServerHandler.handleCommand(NetServerHandler.java:821) 2012-05-02 01:03:15 [SEVERE] at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:781) 2012-05-02 01:03:15 [SEVERE] at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:764) 2012-05-02 01:03:15 [SEVERE] at net.minecraft.server.Packet3Chat.handle(Packet3Chat.java:34) 2012-05-02 01:03:15 [SEVERE] at net.minecraft.server.NetworkManager.b(NetworkManager.java:229) 2012-05-02 01:03:15 [SEVERE] at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:113) 2012-05-02 01:03:15 [SEVERE] at net.minecraft.server.NetworkListenThread.a(NetworkListenThread.java:78) 2012-05-02 01:03:15 [SEVERE] at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:551) 2012-05-02 01:03:15 [SEVERE] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:449) 2012-05-02 01:03:15 [SEVERE] at net.minecraft.server.ThreadServerApplication.run(SourceFile:492) 2012-05-02 01:03:15 [SEVERE] Caused by: java.lang.NullPointerException 2012-05-02 01:03:15 [SEVERE] at me.ksafin.DynamicEconomy.dataSigns.checkForUpdates(dataSigns.java:142) 2012-05-02 01:03:15 [SEVERE] at me.ksafin.DynamicEconomy.Transaction.sell(Transaction.java:927) 2012-05-02 01:03:15 [SEVERE] at me.ksafin.DynamicEconomy.DynamicEconomyCommandExecutor.onCommand(DynamicEconomyCommandExecutor.java:279) 2012-05-02 01:03:15 [SEVERE] at org.bukkit.command.PluginCommand.execute(PluginCommand.java:40) 2012-05-02 01:03:15 [SEVERE] at com.earth2me.essentials.Essentials.onCommandEssentials(Essentials.java:303) 2012-05-02 01:03:15 [SEVERE] at com.earth2me.essentials.Essentials.onCommand(Essentials.java:288) 2012-05-02 01:03:15 [SEVERE] ... 13 more

I took a look around signs.yml and found these entries that are causing it.

24 67 -30: WORLD: Genesis ITEM: GOLDHELMET TYPE: price 24 65 -19: WORLD: Genesis 24 65 -18: WORLD: Genesis 24 67 -19: WORLD: Genesis 24 67 -18: WORLD: Genesis 26 67 -19: WORLD: Genesis 5 67 -36: WORLD: Genesis ITEM: TNT TYPE: price 5 66 -36: WORLD: Genesis ITEM: DIAMONDBLOCK TYPE: price

It seems I have 5 broken entries. Once they are deleted, I don't get the error when buying or selling. I think those signs were deleted by world edit and not unregistered by the plugin. Perhaps make it so the plugin automatically cleans up the sign entries if a sign is not found at that position?

ObsceneNameHere commented 12 years ago

Thanks for this, It helped with me, It was breaking /sell inventory

ksafin commented 12 years ago

Fixed;

I don't know what exactly your particular problem was coming from, because I find it VERY ODD that those entries had no ITEM or TYPE, but I made it so that if the coordinates no longer contain a sign, the entry is removed from the sign config file.