Shopkeepers

Shopkeepers

2M Downloads

MythicMobs compatibility

blablubbabcDEV opened this issue ยท 11 comments

commented

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

Originally posted by MasterMithrandir (May 21, 2015):

(Issues in this ticket may concern MythicMobs & Spawner plugins)MythicMob Items whith special atributes seem to resist being traded, the full description is in the video which should be public and is fully uploaded:https://www.youtube.com/watch?v=KLUeww8X9Es&feature=youtu.beEdit: Reporting this to mythicmobs dev.

commented

Originally commented by blablubbabc (May 21, 2015):

You can either check the debug log of the trade, or use the command /shopkeeper check to compare the currently held item with the item in the next slot. It should tell you why the plugin thinks that the items are not the same.
If it says 'differing attributes' you might want to manually compare the inernal attribute data of those items for example with the help of the plugin PowerNBT. Shopkeepers is comparing the number of AttributeModifiers, their Name, their AttributeName, their Amount and their Operation. It is ignoring the attribute UUIDs though.
Regarding the mob spawner going lost when opening the shopkeeper editor menu: Is that something which only happens to those mob spawner items? Also does it only happen in certain inventory slots? Is it reproducible?

commented

Originally commented by blablubbabc (May 22, 2015):

Okay I tried this out and noticed the following:
On my test server running spigot 1.8.4 I setup a trade which requires an item from mythic mobs with attributes.

When I now let mythic mobs give me a second of those custom items and I try to use it in the trade, the result item won't show up in the trading menu.

If I however create an exact copy of the item, by going in creative mode and middle-mouse-clicking the item, and then use that exact copy, the result item will show up and the trading will work.
Now the bad thing is:

The shopkeepers plugin simply opens minecraft's default trading menu. So all core trading mechanics, like the switching between the trades, or in this case, showing up the result item (unlocking the trade) when the correct items are offered, are coming from minecraft itself.

The shopkeepers plugin only additionally blocks the trading in certain conditions, but it does not modify those core mechanics (which would probably be way more complicated to do.. if at all possible, no idea about that).
My guess is now that in 1.8.x something was changed in those core trading mechanics, which causes minecraft's default trading to differ between items with attributes, if the attribute uuids are not the same. So basically in the past minecraft did only compare item types, and now it also seems to take internal data of the attributes into account for some reason (maybe as a result of the changes made for resolving this MC ticket).
One could try to verify my theory by creating a normal villager with custom trades containing attributes via minecraft's summon command and see if it has the same problem. I might do that if I have some more time to check how the correct command for that would be.
When I have some more time I might also search through the 1.8.4 minecraft source code and check if I find something related to this.
Edit: Okay, I checked the 1.8 MC source code it it does indeed perform a equals-check on the item's internal nbt data, if the item required for the trade has custom data (like attributes)..
I know that in the past the shopkeepers plugin was taking those uuid's into account and therefore had problems with items from MythicMobs, because they give each of their attributes a random, fresh uuid, in order to allow that the attributes from different items, which the player is carrying, are properly stacking / properly affecting the player (as far as I remember and understand the explanation from the MythicMobs dev).

I made some changes in the past to let shopkeepers ignore those attribute uuids.
However I doubt that I can (easily) do much if minecraft now compares those attribute uuids itself.. and doesn't allow the trade if they don't match.
It might be a good idea to contact the MythicMobs dev(s) again and ask if they are aware of any minecraft changes and issues regarding trading mechanics and attributes with different uuids.
Regarding the spawner item going missing: If this is only happening when opening the shopkeepers menu, and you think this might be an issue with shopkeepers, then please create a sperate ticket for this, and leave some information there how you obtain such entity spawner and what steps I need to do in order to (hopefully reliably) reproduce this.

        Edited May 22, 2015
commented

Originally commented by MasterMithrandir (May 21, 2015):

The trades I show on the video where possible in previous versions of Shopkeepers + MythicMobs, so it's strange that now they're not.

This is what I get in debug mode when I attempt to trade whith an item that has atributes (and this happens whith other items whith atrubutes made whith mythic mobs):

http://pastebin.com/pBEDV8yd

MythicMobs doesn't keep track of the items dropped by it's bosses & made through config.

That should just make them Vanilla items whith vanilla attributes.

As for the spawners, it happens whith any kind of them: Vanilla Item number 52 and any kind of Spawner obtained through the plugin command for obtaining specific entity spawners.

But I think it's the vanilla item that goes away, I've seen similar behaviours whith other items in the past...

commented

Originally commented by blablubbabc (May 23, 2015):

[at]MasterMithrandir:
I removed the custom item comparison, which fixed this issue on 1.7.x, in the latest version, because it is no longer of use if running on MC 1.8.x.

commented

Originally commented by MasterMithrandir (May 24, 2015):

Woah man, you mean you've overwritten the actual Vanilla Minecraft item compairson code? U'r awesome :D

I'll be testing it, thanks a lot.

commented

Originally commented by blablubbabc (May 24, 2015):

[at]MasterMithrandir:
Nope I haven't. I have removed the old fix (which made MythicMobs items work before 1.8.x), because it is no longer of use in MC 1.8.x. :(
Trying to overwrite minecraft's item comparison would be way to complicated for me, as far as I can tell.

        Edited May 24, 2015
commented

Originally commented by MasterMithrandir (May 22, 2015):

Thank you for the detailed response.

MythicMobs dev Xikage is quite a buisy person, I don't know how much interest he'll be willing to pay to this compatibility issue, but I've already reported it to him.

Allthough it should be fairly easy to solve on his behalf if I am not mistaken, and I've seen some other people asking for Shopkeepers compatibility on MythicMobs.

The thing whith spawners dissapearing is that I must determine if it's a Spawner plugin issue, or just a Vanilla issue.

Best way for me would be to test the same on a blank Spigot server whith just your plugin.

Still, if it turns out the issue is still present in this case, It could still be an issue whith Shopkeepers right?

commented

Originally commented by blablubbabc (May 23, 2015):

[at]MasterMithrandir:
Unfortunately I don't think this issue is solved easily without problems.. :(
It is basically the same issue shopkeepers had in the past with MythicMobs items.

But now it's more like an incompatibility between minecraft's default trading and MythicMobs items (unrelated to shopkeepers), making it harder/impossible for me to find an easy fix for which I can add to shopkeepers..

The fix I have/had in place for this in shopkeepers in the past is no longer working, because the problem is now inside of miencraft's code..
One remaining, easy solution might maybe be for MythicMobs to always use the same attribute uuids when creating a certain type of their special items. So that those items are considered similar again by minecraft itself. And maybe this won't be a problem for MythicMobs because players usually don't need the effects of the same items twice.
However the dev(s) of MythicMobs can probably tell better if this would cause any issues.

        Edited May 23, 2015
commented

Originally closed by blablubbabc (Jun 12, 2015)

commented

Originally commented by MasterMithrandir (May 24, 2015):

hahaha ok, pardon my gullibility.

I have tested the shops which have mythicmob items using 1.56-ALPHA and the issue persists.

  1. I get the same item twice using the MythicMobs command.

  2. I set one of them as trading requirement, and the other as imput.

  3. Nothing happens, The output item doesn't even show up.
    Edited May 24, 2015

commented

Originally commented by blablubbabc (Jun 12, 2015):

I will close this ticket as declined. For me this seems to be something for the MythicMobs dev(s) to fix.