EnigmaticaModpacks / Enigmatica6

The official repository and issue-tracker for Enigmatica 6
https://www.curseforge.com/minecraft/modpacks/enigmatica6
242 stars 516 forks source link

Omnidirectional hoppers with entity tracker upgrades have bugged interactions with villagers #5028

Closed Vashal0 closed 2 years ago

Vashal0 commented 2 years ago

Modpack Version

1.3.0

Describe your issue.

Placing an omnidirectional hopper with an entity tracking upgrade under a villager, and then holding emeralds in your hand will take the item that they show. In addition, the trade for the item that they show's stack size will increase each time until max stack size. ae390da6b58d9d945ded3233136c952b

Placing a chest under the hopper, or any other inventory, causes the items to instead decrease in stack size strangely enough, removing the trade from the villager entirely so they just trade emeralds for nothing at all j8PkPfo

Crash Report

No response

Latest Log

No response

Have you modified the modpack?

No

User Modifications

No response

Did the issue happen in singleplayer or on a server?

Singleplayer

NielsPilgaard commented 2 years ago

Oh boy that's weird 😄

... @desht halp? :D

desht commented 2 years ago

Interesting. I'll do some debugging, but I might just need to blacklist villagers from being interacted with...

desht commented 2 years ago

So I did some testing, and I can see the hopper pull items from the villager's hand (which is expected - getting the item capability handler for a villager on a vertical axis gets the 2-slot hands inventory of the villager).

But I definitely don't see any change to the stack size of the traded item in the trade gui (and stepping through with my IDE debugger doesn't give any indication that this should happen - it's just pulling items from the villager's hands, that's all). It's possible some other mod is having an effect here, perhaps?

NielsPilgaard commented 2 years ago

Oh no, that's gonna be impossible to track down 😅 thanks for debugging this!

Vashal0 commented 2 years ago

By any chance when you did your testing, did the villager have two in stock trades for emeralds? I tried to reproduce it with different villagers, and found some things that may help you track things down.

If a villager has only one trade for emeralds, AND the item is naturally a single item(i.e. emeralds for pumpkin pie), the hopper takes it nothing happens. If a villager has two in stock trades for emeralds, the villager will rotate between the items and the bug will occur eventually, takes longer to happen with multi item trades (i.e. emeralds for 6 bread), speed upgrades in the hopper make it happen sooner If a villager has only one trade for emeralds, AND the item is naturally a single item, and you swap the emeralds back and forth from your hand after the item is taken, the bug activates.

Easy to test with villagers are PNC villagers, which always have two for-emerald base trades, farmer which has a multi item trade early(bread), and butcher which has a reliable 1 for-emerald trade early(rabbit stew)

desht commented 2 years ago

OK, managed to reproduce it - thanks for the pointers.

As for why... no idea :( I can try to debug further, but I feel like excluding villagers from this is the best option. It's a bit exploity even when not bugging out.

MuteTiefling commented 2 years ago

Wonder if you'd consider making that blacklist a tag actually.

It's not a big deal for E6, but I could see people wanting to blacklist things like raccoons from Alex's mobs.

desht commented 2 years ago

Yeah, probably a good idea!

MuteTiefling commented 2 years ago

these are blacklisted by default in PNC now.