SuperMartijn642 / TrashCans

2 stars 12 forks source link

Allow users to specify filters by dragging items/fluids from JEI #6

Closed Parker8283 closed 3 years ago

Parker8283 commented 3 years ago

Added a JEI GhostIngredientHandler to allow for simpler filter setting. This allows users to drag items/fluids/gases from JEI into the filter slots, without needed them in their inventory.

While setting up the JEIPlugin, I noticed that DRY principles were not adhered to with respect to the mod id. As such, I just couldn't help myself and created one central constant to hold the modid :). On the plus-side, ObjectHolders will pull the modid prefix from the Mod annotation, so that code was extraneous.

SuperMartijn642 commented 3 years ago

I didn't even realize JEI had that feature, I thought it was only in NEI. 😅

I do agree it is better to have a constant field for the modid, but I just don't feel like carefully changing it in all branches and otherwise I would constantly have a lot of differences when comparing branches. So for now I reverted that.

Thank you for the addition! 🙂 I really like how easy this makes the filtering. It is available now in 1.0.7 for all the supported Minecraft versions.

Parker8283 commented 3 years ago

To be honest, I didn't either until I saw someone do it in a video, haha.

Fair enough, I just do the constant because I've definitely mistyped things like that before and spent hours trying to figure out what the heck I did wrong, haha. I didn't realize you still support older versions, otherwise I would have made those PRs too. And in the future, you can leave reviews or comments on PRs for changes before merging so merging is easier for you. I personally would have been happy to revert it and get the formatting correct.

Also, I saw that you reverted the network version change. I don't 100% remember the details here, but I do believe that it needs to be increased because new packets were added. Otherwise it will report as "network compatible" with the older versions of the mod that don't have them, and thus unknown packets will arrive on the server side. Though you may be able to change the acceptable versions function for either the client or server to allow one to accept the other. Or something like that. It's been a minute since I truly modded, so I could be wrong.

Anyways, glad I could help!

SuperMartijn642 commented 3 years ago

Yeah I didn't want you to have to put in extra effort, because I am too lazy to change stuff and I couldn't find a way to edit a pull request myself.

About the network stuff, I actually didn't realize you changed the version, I must have reverted it by accident. Anyways, the version there doesn't matter much for this mod as it already requires the same mod version on both the client and server.