andersblomqvist / enhanced-mob-spawners

Mod for Minecraft (Fabric). Adding new features to the Spawner
https://www.curseforge.com/minecraft/mc-mods/enhanced-mob-spawners
Creative Commons Zero v1.0 Universal
9 stars 14 forks source link

Feature Request: Configurable blacklist for right click interaction with spawners #59

Closed Raidobw2 closed 2 years ago

Raidobw2 commented 2 years ago

Hi! This is a suggestion for the 1.18.2 version of the mod.

At https://github.com/FTBTeam/FTB-Modpack-Issues/issues/1221 a user noticed a compat issue between Soul Shards and Enhanced Mob Spawners.

If a player holds a Soul Shard and right clicks a spawner with Enhanced Mob Spawners, it kind of bugs out. My suggestion would be to have a blacklist by item id within Enhanced Mob Spawners to be able to prevent some held items to "pop" the spawn egg out of the spawner. I assume this would allow normal interactions between the spawners and the other mods, such as Soul Shards.

Here's a small video explaining the issue and why I'm suggesting this change (souls are being duped, normally the spawner is consumed in the process):

https://user-images.githubusercontent.com/17010632/185017397-0fb4cb4e-024f-4331-8f27-9b1be32fc24c.mp4

Thanks for reading and have a nice day!

andersblomqvist commented 2 years ago

I've added support for blacklisting item ids through the config. You can add items like this:

"item_id_blacklist": [
    1103,
    767
],

When starting with the new version, the mod will generate two new fields inside the config file if they are missing: item_id_blacklist and display_item_id_from_right_click_in_log. The display in log tag will print the item id which the player is holding in the minecraft log window.

New version: https://www.curseforge.com/minecraft/mc-mods/enhanced-mob-spawners/files/3940481

Please report back if this works, then I will change the file from beta-version to a release.

Raidobw2 commented 2 years ago

Wow that was quick haha. I've just tested it! Works like a charm :)

I've checked the item id first and added it to the list, then relaunched and added a mod in (Quark) to make sure it was persistent, and it is!

https://user-images.githubusercontent.com/17010632/185582014-16ac1f39-8dc7-4fdb-8439-b3183bf686e6.mp4

I can confirm it works, feel free to make it a release and thank you very much!

Raidobw2 commented 2 years ago

Hi again, just wanted to know if you would be disposed to revise the implementation of this feature. I've started using it more in development builds for modpack maintenance and it seems everytime there is a registry change (e.g. item removed or added) the item ids (integer) change.

Currently it does work well, although I have to remind myself before every release to the public to check if the interaction still works well.

I thank you again for this feature so quickly added to your mod, that was a lifesaver for some spawner interactions.

If you do want to revise it at some point, maybe you can use the item's localized resource name, such as minecraft:apple, minecraft:carrot, soulshards:soul_shard, etc.

Have a good day in any case!

andersblomqvist commented 2 years ago

Well that's annoying. I will look into it.

andersblomqvist commented 2 years ago

I've changed to registry names now. It's a much better solution for the user as well.

Now you should remove all of the existing ids (they don't do any known damage if left) and write as following:

"item_id_blacklist": [
    "minecraft:apple",
    "minecraft:carrot",
    "soulshards:soul_shard"
],

Forge version 1.8.17 is found here: https://www.curseforge.com/minecraft/mc-mods/enhanced-mob-spawners/files/3957300

Raidobw2 commented 2 years ago

Thank you so much! Have a good day