HyperMerchant

21k Downloads

Player can't open GUI

MidnightSugar opened this issue · 20 comments

commented

One of my player cannot open the GUI to the shop, and is getting this error. Other players are using it fine.

https://pastebin.com/Mzqd7gHn

commented

Unfortunately that error message does not offer many clues. Can you have that player clear their inventory and then try? I suspect they may be holding an item that is somehow related to this.. But I don't know for sure.

commented

I am currently working on a way to make HyperConomy and in turn this plugin versionless (database wise) previously i've just used SQL as my backend and replaced the objects that way when new objects were added

commented

@writeescape good luck with that. You will need to translate everything for all versions and you can’t be sure they change something like ByteCode. You’re better off making a version-updater. 1.14 will have Transmutable block states for the items for example, I really want to see you pull that off without having to change anything the next version

commented

OK,

I updated the items to the best of my ability, and was able to create shops and populate them. I wasn't able to add enchantments (I don't know how) and for some reason both potions and the different types of arrows would not populate with names other than "object 1, object 2, etc" so I deleted them. Otherwise, there are about 850 items available and the majority of 1.13 items have been added. Let me know when you have an update.

Thanks.

import_export.zip

commented

@brooklynstarr I havent seen any issues with my fork of the Plugin so far. It just bugs me that I wasnt able to reliably make a conversion tool (HyperConomy is a damn tank, if I ever do that it will be a seperate plugin.....)

commented
commented
commented

Also @writeescape you don’t need to reverse engineer anything, the source code for all this is public? HyperConomy, HyperMerchant and the bukkit/spigot api are all open source projects

commented

Interestingly, when I tried to re-create some of the shops with existing hypermerchants, I ran into the same error again. I removed the NPC and re-created them (giving them a new name) they worked fine. This was only the case with shops that had category limited items. If I created a server shop, or regular shops that contained all items, it always worked without having to delete the NPC. This wasn't true before.

There may be something buried deep in the citizens/hypermerchant config per NPC that may be causing this to happen. I'll keep an eye on your developments- as always I appreciate the help.

commented

Heh, I wouldn't be surprised if it was just me. I've been moving the code and config around for the last 4 years with tons of hypermerchants created and deleted over time. I suspect something may have carried over that finally decided to break everything else. I'll drop you an email, not much of a discord user.

Thanks.

commented

I know this is an old issue, but it exists in 1.13- here is the error we're getting when players are trying to open the shop GUI

Could not pass event NPCRightClickEvent to Citizens v2.0.24-SNAPSHOT (build 1574)
org.bukkit.event.EventException: null
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:308) ~[spigot-1.13.1.jar:git-Spigot-f6a273b-68588da]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[spigot-1.13.1.jar:git-Spigot-f6a273b-68588da]
at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:500) ~[spigot-1.13.1.jar:git-Spigot-f6a273b-68588da]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:485) ~[spigot-1.13.1.jar:git-Spigot-f6a273b-68588da]
at net.citizensnpcs.EventListen.onPlayerInteractEntity(EventListen.java:431) ~[?:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_181]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_181]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_181]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_181]
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:304) ~[spigot-1.13.1.jar:git-Spigot-f6a273b-68588da]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[spigot-1.13.1.jar:git-Spigot-f6a273b-68588da]
at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:500) ~[spigot-1.13.1.jar:git-Spigot-f6a273b-68588da]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:485) ~[spigot-1.13.1.jar:git-Spigot-f6a273b-68588da]
at net.minecraft.server.v1_13_R2.PlayerConnection.a(PlayerConnection.java:1828) ~[spigot-1.13.1.jar:git-Spigot-f6a273b-68588da]
at net.minecraft.server.v1_13_R2.PacketPlayInUseEntity.a(SourceFile:69) ~[spigot-1.13.1.jar:git-Spigot-f6a273b-68588da]
at net.minecraft.server.v1_13_R2.PacketPlayInUseEntity.a(SourceFile:13) ~[spigot-1.13.1.jar:git-Spigot-f6a273b-68588da]
at net.minecraft.server.v1_13_R2.PlayerConnectionUtils.a(SourceFile:10) ~[spigot-1.13.1.jar:git-Spigot-f6a273b-68588da]
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_181]
at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_181]
at net.minecraft.server.v1_13_R2.SystemUtils.a(SourceFile:199) [spigot-1.13.1.jar:git-Spigot-f6a273b-68588da]
at net.minecraft.server.v1_13_R2.MinecraftServer.b(MinecraftServer.java:900) [spigot-1.13.1.jar:git-Spigot-f6a273b-68588da]
at net.minecraft.server.v1_13_R2.DedicatedServer.b(DedicatedServer.java:417) [spigot-1.13.1.jar:git-Spigot-f6a273b-68588da]
at net.minecraft.server.v1_13_R2.MinecraftServer.a(MinecraftServer.java:835) [spigot-1.13.1.jar:git-Spigot-f6a273b-68588da]
at net.minecraft.server.v1_13_R2.MinecraftServer.run(MinecraftServer.java:733) [spigot-1.13.1.jar:git-Spigot-f6a273b-68588da]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_181]
Caused by: java.lang.NullPointerException
at grokswell.hypermerchant.ShopMenu.UpdateSortingIcon(ShopMenu.java:314) ~[?:?]
at grokswell.hypermerchant.ShopMenu.(ShopMenu.java:96) ~[?:?]
at grokswell.hypermerchant.HyperMerchantTrait.onRightClick(HyperMerchantTrait.java:366) ~[?:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_181]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_181]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_181]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_181]
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:304) ~[spigot-1.13.1.jar:git-Spigot-f6a273b-68588da]
... 24 more
[14:59:22]

Thanks.

commented

The Sorting Icon or any involved item is null and there is no not null check to catch it, though I was unable to reproduce this :/

commented

It's odd that I feel this is only happening to me, even though i'm using the current build of hypermerchant. Everything worked fine until the 1.13 update. Also I should note that i'm using a fork of hyperconomy located here: https://github.com/Pingger/HyperConomy since the original version of HC I was using stopped working in 1.13.

Curiously I see that you have your own fork so I'll build yours and see if I have the same issue, otherwise you can let me know what version of HC you are using if it is indeed functional on your side. This is one issue that's been a thorn on my side for a few months now.

Update: i see you've got a fork of Hypermerchant as well- I'll use both and report back.
Update: both failed to compile. If you have a build I could use handy let me know where to get it.

Thanks!

commented

While it sucks to have to recreate all my shops, if that's what it takes to get this working, then I have no issue. I can always try to reimport what I had previously into the database and hope it doesn't hose everything afterward.

Much appreciated.

commented

Sure, I’ll drop you a link tomorrow, I just realized that my HyperConomy updated version has a few crucial fixes missing though, I’ll push them tomorrow too. As for the crash, my fork of HyperMerchant is compatible with 1.13.x, I’ll send a link to a build of that too. Keep in mind for both that you need to start with a fresh new clean/empty database, that means deleting all old configs and having them regenerate too

commented

@brooklynstarr

MerchantAndConomy.zip

Try the HyperMerchant (let it generate a new config/plugin folder) only first
If that doesn't work try with the HyperConomy I included and a fresh database too

My discord ID is Angel of Light Julia#3114 if you want to write with me directly, cheers!

commented

Okay, so I have some good news (kinda). I used both plugins and was able to finally get the shop screen up and running. The key was to start with a new Hyperconomy database, unfortunately. I had tried this with the older version, but it didn't work. It's probably because your version has all valid items- I think this is the problem- there may be invalid items in HC that are being called by hypermerchant when it opens up the shop screen, particularly the stained glass panes, amongst other things. It's my theory anyway.

The other issue is that there are very few items in the database, as in for sale- when I create a server shop, for example, there's only apple, baked potato, and a few enchantments. I guess I have to reimport everything manually?

commented
commented

Thanks- I've downloaded today and will give it a shot. I'll post up my results after I try both methods if necessary.

commented

Thanks, yes I definitely want to try it if you get it working. In the meantime I'm thinking about taking the old csv export and editing it in excel to see if I can do this manually. I'll try importing the data until it works, then I can post it here for building. I can also try the java editor too.. Ok I'll play around a bit and let you know.