Instant pickup causes issues with fake players (for example Ars Nouveau)
copygirl opened this issue · 18 comments
Some mods' fake players don't check their fake player inventory when doing certain things. As such, forcing fake players to pick up items could cause issues.
In the case of Ars Nouveau, when using spells to break blocks, and the instant pickup feature from Forgery is enabled, making the fake player pick up the dropped items causes them to essentially get voided. This could likely cause issues with other mods that use fake players to break blocks, but I'm not currently aware of any.
One possible solution to this would be to ensure the feature really only works with real players, so making sure fake players are entirely excluded from the feature. There might be instances where a fake player is used to act on the player's behalf so you'd want it to work (if properly handled by the mod). Is it possible to provide an allow/deny list for this purpose?
(To be fair, Ars Nouveau should fix this on their end. It should either not be able to insert items into its player inventory, or handle them appropriately when they do.)
Versions
- Minecraft
1.20.1 - Forge
47.4.2 - Forgery
3.6.2+1.20 - Ars Nouveau
4.12.6 - Curios API
5.14.1+1.20.1
Reproduction steps
- Create a new instance with the above versions / mods
- Go to Forgery config to enable instant pickup
- Get a Novice Spell Book
- Select it, press
Cto craft spell - Select "Touch" and "Break", then hit "Create"
- Right click a block, like grass, to cast spell
- See the block pickup particle move to the player
- Notice the drops have not appeared in your inventory
prerelease.zip
try turning on taggable players and set:
[weird_tweaks]
instant_pickup=untagged_players_only
[!player_uuid]
7400926d-1007-4e53-880f-b43e67f2bf29.weird_tweaks.instant_pickup=true
Adding that to taggable_players.ini was correct, right? I get this error when the game starts up:
java.lang.NullPointerException: Cannot invoke "java.lang.Integer.intValue()" because the return value of "com.google.common.collect.ImmutableMap.get(Object)" is null
at com.unascribed.fabrication.features.FeatureTaggablePlayers.add(FeatureTaggablePlayers.java:86) ~[forgery-3.6.4+1.20.jar%23420!/:3.6.4+1.20] {re:mixin,re:classloading}
at com.unascribed.fabrication.loaders.LoaderTaggablePlayers.load(LoaderTaggablePlayers.java:104) ~[forgery-3.6.4+1.20.jar%23420!/:3.6.4+1.20] {re:classloading}
[...]
Unfortunately that didn't work. If I add myself to the [!player_uuid] list, I can exclude myself as expected, but somehow Ars' fake player doesn't appear to be affected. The item is still voided as before.
oh, ye sry i may have rushed a bit in the morning. compleatly forgot to make instant_pickup support taggable_players.
good news i guess is fabrication gets slightly more robust logging (because that error needs to be more clear)
maybe either of these would work?
[!player]
Ars_Nouveau.weird_tweaks.instant_pickup=true
or
[weird_tweaks]
instant_pickup=untagged_players
main reason i'm bothering you is i really don't wish to re-learn what i assume is ars magicka, so if you could send me a world with the spell or a command to make the item or something that'd work aswell
I tried both of those with no success, still.
The instructions to get a book with the spell are in the issue description. It doesn't require much setup at all. The NBT of the resulting spell book is a bit long so dunno if you can spawn it from a command.
Turns out the fakeplayer class is instanced with the UUID and name of the real player?? then changed somewhere??
i don't know, this seems very very jank on first glance.
also thanks for being mindfull n putting instructions, i just compleatly missed em..
i do not have the patiance to figure out what hidden nonsense forge does with fake players.
fake players are being turned off for instant pickup following Una advice. (still don't like it)
a simmilar exception exists item side, not player side for another mod. L19
so it can be done fairly easily.
(To be fair, Ars Nouveau should fix this on their end. It should either not be able to insert items into its player inventory, or handle them appropriately when they do.)
but i'm of the same opinion here.
if for some reason they'd prefer the jank of scoreboards we can go that route
Cross-reported to baileyholl/Ars-Nouveau#1843.
Mod author responded and closed the issue on their side:
All ars is doing is checking for nearby item entities and inserting their contents into the casters inventory. We fire the
EntityItemPickupEventfor compatibility. Forgery should just ignore fake players instead of blindly inserting contents into the inventory.
Is there still the possibility of a denylist by player UUID? (this is Ars Nouveau's)
taggable players allows you to enable/disable some features per player.
the solution i'm thinking of is a new feature: taggable fake players.
i'll see if that's simple to do.
(also techically you can already do this on fabrication via fscript but that doesn't really help you here)
i think this is the better aproach because there are probably other features that behave in wierd ways with fake players and these kinds of conflics can vary from pack to pack.
i'd if all possible prefer to leave this up to the config and not hard code it.
i still have some hope the ars dev make the sensable decision.
but we'll see might end up hardcoding it
Here it is hardcoded for now, since i suspect it'll be a while before i touch this:
could you check if taggable players works with fakeplayers? (the ars fake player specificly)
