Shopkeepers

Shopkeepers

2M Downloads

Shopkeepers v1.25 Bug report.

blablubbabcDEV opened this issue · 26 comments

commented

Migrated from: https://dev.bukkit.org/projects/shopkeepers/issues/256

Originally posted by MasterMithrandir (Aug 30, 2014):

Using  Shopkeepers Plugin v1.25 + Spigot for mc 1.7.10Issues encountered:* Some players find that they cannot interact with certain shopkeepers. I really can't provide any more information about this, and console says nothing when this happens.* Players cannot sell special mob heads on admin shopkeepers that buy them.
Explination: On my server I use a currently outdated plugin called HeadDrops. This plugin adds aditional mob head drops to the already existing, like Cave Spider head, Golem Head, Chicken Head, Blaze Head... etc. Allthough HeadDrops is now outdated, and some flaws are starting to appear in some of it's functions, heads still do drop, and players try to sell them to shopkeepers who buy them, with a negative result. Sometimes their emeralds dissapear, or they just can't trade. I'm quite sure this is a Shopkeepers issue and not a HeadDrops issue, but I may be wrong. The issue with shopkeepers would consist in a problem with head owner ID's. (PD: I also updated all the heads inside the admin shopkeepers again, just in case their internal ID broke or something)* Imposible to establish a price when creating a player normal selling shop. Emeralds simply do not appear on shift/edit mode. Possibly other issues with other shop modes.Please try to fix these things. I cry at night when I see these bugs. :(

commented

Originally commented by blablubbabc (Aug 31, 2014):

'cannot interact with certain shopkeepers' in the sense that they don't know how to setup their own shops, or that they can't open certain (admin) shops? If later one is the case you should try to get some player showing you exactly where he cannot open the shop and then check your server log with debug mode enabled (/shopkeepers debug): if it says something like 'interaction cancelled by some other plugin' then you might be able to get it working by turning 'bypass interaction blocking' (or something like that) on in the config, or you find out which other of your plugins is blocking entity interaction there and search for a setting for that plugin to disable that.

I don't know if and what might have changed regarding heads, however if I let HeadDrops give me some heads of myself or some mob I can setup an admin shopkeeper with those and sucessfully trade other head items I get via HeadDrops there without problems.. Maybe you could test this out again on your server and also check that the items are 100% equal regarding item name etc.

setting up the normal player selling shopkeepers is also working fine for me..: note that you have to insert the items you want to sell into the chest first, then if you open the shopkeeper in edit mode those items appear there together with slime balls, which you can click to increase or decrease the emerald amount.

        Edited Aug 31, 2014
commented

Originally commented by MasterMithrandir (Aug 31, 2014):

[at]blablubbabc:
I'll do further investigation on this.

I've changed to a more updated plugin for head drop management. I'll be observing how it works

This is the main issue I'd say... Have you seen the screenshot I've taken? I first put the items in the chest, and when I open edit mode, no slime balls appear. I will also make further testing on this.

commented

Originally commented by blablubbabc (Aug 31, 2014):

[at]MasterMithrandir:
I already tested with sign shop types as well earlier this day and it worked fine for me.. I also tested with other mob types shops. Make sure you really have selected the 'normal selling player shop' type when creating the shop.

What do you mean by 'Witch Shopkeeper somehow shows the same issue as previous.'?

It got replaced with 'shopkeeper.entity.creeper' in the alpha builds. However it should still work as it is still listed as alias for this permission.

        Edited Aug 31, 2014
commented

Originally commented by MasterMithrandir (Aug 31, 2014):

BRINGING BACK THE SECOND ERROR I mentioned with mob heads.
I've just established an admin shopkeeper which buys a mob head. When I bring the same head and try to sell it to this shopkeeper, I can't.
The result is the same as with ''Head Drops''. Currently using ''More Mob Heads''
As you have just told me that you got it to work... I can only figure that there is something wrong on my server.
Should I try debug mode and see what happens in console when the item gets rejected?
ABOUT THE THIRD ERROR:
I am very sure that is what I selected... This issue seem's unique, so I'll doo the following: -Making sure that I'm doing this as you say
-Testing the same on a localhosted server. (But I'm quite sure I'm doing it right, as this issue was reported by players.)

By that I mean that Witch Shopkeepers show the same issue as Sign shop keepers, issue being that no slimeballs appear to select price.

I think it isn't working. But maybe I'm doing something wrong here, I'll check deeper.

        Edited Aug 31, 2014
commented

Originally commented by MasterMithrandir (Aug 31, 2014):

THIRD ERROR:
I've just tried it again, making sure everything was as you said, and It worked.
However, I reloaded the plugin minutes ago, that may be what made it work.
I'll keep on checking after next server restart in order to confirm that the system doesn't break.

commented

Originally commented by blablubbabc (Aug 31, 2014):

Make sure that the head you used for the trade is the same as the one you try to trade.

commented

Originally commented by blablubbabc (Aug 31, 2014):

[at]MasterMithrandir:
Ok.
Well, HeadDrop worked fine for me during my testings.. Not completely sure how your new plugin would work differently..
Well, then make sure that you are putting the enderpearls in the correct chest and that the shopkeeper is really a normal selling player shopkeeper..

commented

Originally commented by MasterMithrandir (Aug 31, 2014):

[at]blablubbabc:
It's a SIGN shopkeeper. I'm testing right now with other variables.

commented

Originally commented by MasterMithrandir (Aug 31, 2014):

[at]blablubbabc:
Ok, I can confirm the following:

  • Sign Shopkeeper edit mode does not show any slime balls for price selecting. The chest is definetly correctly joined to the player shop.

  • Witch Shopkeeper somehow shows the same issue as previous.

  • Villager Shopkeeper DOES show the edit mode correctly.

  • What happened to the ''shopkeeper.creeper'' permission? Is this no longer available?
    I noticed some configuration changes... I'm checking if there is something wrong, but I doubt there would be anything new that would cause this rignt? ...

          Edited Aug 31, 2014
    
commented

Originally commented by MasterMithrandir (Sep 1, 2014):

Debug results when attempting to sell the same head that is being bought by the shopkeeper:
http://pastebin.com/5xCk0Xx6

commented

Originally commented by blablubbabc (Sep 1, 2014):

[at]MasterMithrandir:
So something besides displayname and lore and skull owner must be different between those skulls..

You could compare the items complete internal data with the plugin PowerNBT

"/nbt item . full" shows you the top layer of data of the item you are holding in hand.

With "/nbt item " you can go deeper and investigate the actual values.

Something there has to differ between the item you are trying to sell and the item in the shop..

        Edited Sep 1, 2014
commented

Originally commented by MasterMithrandir (Sep 1, 2014):

[at]blablubbabc:
This issue wasn't happening before the UUID changes, I can't remember if I also updated your plugin when I updated the server (I'd risk it and say I didn't).
This issue is present on my Spigot 1.7.10 server. You haven't been able to reproduce it, so maybe you where using another server version? (the issue might be related to spigot)
Firstly, How can I compare the internal data of an item I don't have on my hand? Because the only way I think data values difer, is when the items are in diferent positions.
I could just try examining the data value of two identical items on my hand, or spawning a head, and then retrieving that same head from a shopkeeper to compair them.
But let's say that the data values are diferent... what could be done about it? specially when the problem is also present with other head plugins, and not in your server.
I'll be testing as you said anyway...

commented

Originally commented by blablubbabc (Sep 1, 2014):

[at]MasterMithrandir:
Okay I just tested with the latest spigot build and am now able to reproduce this issue.

It seems like spigot additionally adds 3 other attributes to the head item:

some uuid and 2 other values under Properties.textures

http://prntscr.com/4iqv0e
And those additional nbt doesn't get stored in the save file of shopkeepers. So after the next reload those values are gone and the items differ.
I am not yet sure how exactly those values are created and used by spigot and if that is something that could be fixed by them for example by properly storing those values in the itemstack serialization (which the shopkeepers plugin uses to store and load the items). I will let you know once I find out more on that.

However in the end it's very likely something that the spigot team can/has to fix.

        Edited Nov 1, 2014
commented

Originally commented by MasterMithrandir (Sep 1, 2014):

[at]blablubbabc:
Definetly. As they both came out from the same command. They are basically the same head.

commented

Originally commented by MasterMithrandir (Sep 1, 2014):

[at]blablubbabc:
About the heads. They seem to get stuck ocasionally. It looks like the shop has trouble recognising them, but I've tried to sell them a couple of times with successfull results, allthough must of the time it rejects the same head.
The trick seem's to be to open and close the shop a few times, but this is a newscense.
When refreshing the head (re adding the same head I am later going to sell to the shop) It seem's to fix this issue. But I think it may break again eventually. I will report if this breaks again. (maybe breaks on restarts?)

        Edited Sep 1, 2014
commented

Originally commented by blablubbabc (Sep 1, 2014):

[at]MasterMithrandir:
The next time the head is no longer accepted turn on debug mode and check if and what it says in the log when the trade fails.

commented

Originally commented by MasterMithrandir (Nov 19, 2014):

Nope false alarm, the bug is still present... I will report this to the new plugin dev.

commented

Originally commented by blablubbabc (Nov 19, 2014):

[at]MasterMithrandir:
It's something related to spigot, not the plugin dev. I will very likely have to rewrite item comparison for this, which will then need to be updated for every new item meta data which gets added to minecraft in the future.

commented

Originally commented by meiskam (Nov 20, 2014):

Author of PlayerHeads here
That Id is the UUID of the player who's skin is being displayed, all checks for equivalency should ideally be based on it instead of the Name, because the Name could technically change, but the Id of that Name shouldn't. The values inside of Properties.textures will most likely change on a daily basis, IIRC textures have a 24hour timeout and must be resigned (the value of Signature changed) by the Mojang servers after that, so they should never be compared against.
Now when I say the Id shouldn't change, I have a method in my plugin that will convert from one player's head to another player's (when dealing with mob heads) because people changed their skins on me and I had to find a different player with the proper skin to display. But there's no reason to include logic for this in your plugin.
I've just sent you a pull request of a little code I threw together (without really reading much of your existing code) which edits TradingHandler.itemEqualsAtLeast() .. which seems to be the function for item comparison.
Good luck!

commented

Originally commented by MasterMithrandir (Sep 1, 2014):

[at]blablubbabc:
Hm yes I thought so. Thanks a lot blablubbabc for your endless help x)

commented

Originally commented by MasterMithrandir (Nov 18, 2014):

Hello. I just wanted to let you know that I think I have avoided this problem completely by using PlayerHeads plugin. Which is updated to 1.7.9.
Thank you for your assistance on this issue :)

commented

Originally commented by MasterMithrandir (Nov 21, 2014):

[at]blablubbabc:
Ok, the head Issue seem's solved right now, but I'll try again soon and see if the fix persists.

commented

Originally commented by blablubbabc (Nov 21, 2014):

[at]MasterMithrandir:
Please try out with v1.27 instead (which I will upload any moment now): the item comparison in v1.26 actually has a bug which causes item meta comparison to be skipped (skull data is not checked in v1.26 because of that.. sorry about that).

commented

Originally commented by blablubbabc (Nov 20, 2014):

[at]MasterMithrandir:
Please check out v1.26: I completely changed how items are compared. This should hopefully also resolve the issues you had regarding items with attributes being considered 'non-equal' in the past. Though I didn't yet test this very much..

commented

Originally commented by MasterMithrandir (Nov 21, 2014):

[at]blablubbabc:
Will test, right now.

commented

Originally closed by blablubbabc (Nov 20, 2014)