copygirl / WearableBackpacks

Minecraft mod which adds beautiful, balanced backpacks
MIT License
61 stars 35 forks source link

Add blacklist/whitelist to chest armor slot functionality. #130

Open CartBeats opened 4 years ago

CartBeats commented 4 years ago

It would be neat if I could whitelist/blacklist exactly which chestplates a backpack can be worn over.

For example, I want to allow vanilla chestplates to be worn simultaneously with a backpack. However, I'd like to disable the backpack if you're using a Simply Jetpacks 2 Jetpack (as the "back slot" is essentially in use). In the current implementation, wearing a Jetpack and a Backpack at the same time is possible, and the two models overlap each other and it looks odd (see screenshot).

2020-02-05_14 26 04

Right now, I have to choose between not allowing chestplates and backpacks at all, or having weird stuff like this happen. A blacklist would solve that problem.

copygirl commented 4 years ago

Unfortunately there's little we could do to prevent an item from being equipped in the chestplate slot while you already have a backpack on. Even if we override the default chestplate slot in the survival inventory, there's still Baubles and other inventory screens, right-click-to-equip, dispensers and other blocks that allow access to user inventory / equipment.

What we could do is to drop the backpack at the player's feet whenever a blacklisted item is equipped, but this doesn't seem like an elegant solution at all. Heck, a player might not notice, though hopefully they would with a chat message.

CartBeats commented 4 years ago

What we could do is to drop the backpack at the player's feet whenever a blacklisted item is equipped, but this doesn't seem like an elegant solution at all.

I mean, why do you say this is not an "elegant solution?" This would actually be a perfect fix for my needs at least.

Add the option for an item blacklist in the config. When equipping the backpack, check if the player has any of the blacklisted items equipped. If they do, drop the bag on the ground with a chat message that said something like "you cannot equip a backpack with that chest armor."

It might even be worthwhile to say in the chat message exactly what equipment is conflicting. "You cannot equip a backpack and simplejetpacks:resonantjetplate at the same time."

[Edit] I misinterpreted your original response, I was thinking from the perspective of already having a chestplate equipped and attempting to put on the backpack, not the other way around. I can see now why you'd say dropping the backpack on the ground wouldn't be an ideal solution.

That said, even the blacklist idea I mentioned would still offer more finely tuned control than we have now. If players want to cheat the system by having a dispenser put their shirt on, then that's their choice.

copygirl commented 4 years ago

For the record, the elegant solution would be to have pre-equipment hooks so trying to equip a blacklisted item in ANY way wasn't possible. This is something I've actually tried to get into Forge a long while ago, but received no feedback so I lost interest and the pull request eventually got closed.

I just wanted to add my thoughts. Dropping the bag is definitely an acceptable workaround. You would just have to hope that the current maintainer finds the motivation and time to implement this.