EssentialsX

EssentialsX

2M Downloads

Unable to sell spawners

timbru31 opened this issue ยท 3 comments

commented

Hi there,

I'm having some reports that spawners mined via SilkSpawners can't be sold back to signs .
I've took a closer look into this. ๐Ÿ˜„

In the Trade class you check in L93 (https://github.com/drtshock/Essentials/blob/2.x/Essentials/src/com/earth2me/essentials/Trade.java#L93) for the same item via .containsAtLeast

Here is an image with the differences in the NBT tags
nbt_tags

The first spawner is obtained via a Buy sign, the second spawner is obtained after mining the placed spawner (i.e. from SilkSpawners).

It seems that the .containsAtLeast is checking for the exact same NBT tags, too.
Modifying e.g. the Delay to 19 makes the spawner unsellable too. (containsAtLeast results to false)

In my opinion the spawner should be sellable regardless of the amount of NBT tags, except the BlockEntityTag -> EntityID tag must match.

Since you already created the SpawnerProvider (prior it was the SpawnerUtil class) it could be extended for a comparison of spawners, too? (Checking for the same NBT tag or legacy durability value).

I'm currently too busy for a PR, just wanted to add my 2 cents and maybe give a pointer in the right direction.

Cheers & thanks,
Tim

commented

I want to avoid having NMS for future Spigot versions, so I'm heavily against introducing additional NMS in the BlockStateMeta SpawnerProvider. Might add special handling for spawners in those areas you pointed out.

commented

Seems like this probably won't get fixed, as it would be pretty hacky. Also with the evidence provided, it seems like this is something that could/should be fixed in CraftBukkit.