kcrca / philter

Minecraft mod for a filtering hopper for (otherwise vanilla) minecraft
Other
0 stars 0 forks source link

1.19.3: Incompatible with Lithium #2

Closed Harvle closed 1 year ago

Harvle commented 1 year ago

Hi, i've just been doing some testing with my mods list, and it appears after testing every mod, Philter does not work correctly when using Lithium. The mod loads and there aren't any errors, however weird sorting behaviour happens with these. The behaviour seems to change a little between each game load, however the basic outline is: When attempting to sort, the item will just go through the "accepted" route, no matter what, or it will go through the "rejected" route, no matter what, basically rendering this mod useless when Lithium is used. If you could look into this, i'd appreciate it. Thanks :)

Harvle commented 1 year ago

Also another slight bug i found: the language key for the item name doesn't exist in your lang file, so the item appears like this: image

Harvle commented 1 year ago

(sorry for the issue spam) I've noticed as well when you're typing in the "Match" page, if you use the letter E (or whatever key used for opening/closing inventories, the gui will close, so typing something like "white" will not work.

Harvle commented 1 year ago

One more bug i've found, when the hopper is in a setup like the below example, the item will always be sucked downward, no matter if the filter matches. I've also included the filter RegExes i used, which in an online tester parsed as a successful match.

Here's an example setup. Above these 6 Philter hoppers, there is 1 hopper that has the following match statement: ^oak.*, which will ultimately let anything that is an oak item pass. The 6 hoppers after that will split those items up into separate categories. Hoppers 1 and 2 are oak logs, and hopper 3 is where the issue is. When trying to use the below filter RegExes in hopper 3, it will always be sucked into the hopper below, no matter the outcome of the filter. When removing the hopper below, the filter works correctly.

The third image provided shows the items that i'm trying to pass into the filter, which when testing their item ID against the provided RegExes, they all pass at least 1, if not more, therefore should pass through the filter into the chest. I believe this means there's just an issue where a normal hopper will always pull from above, no matter what.

image image image

kcrca commented 1 year ago

(1) Thanks for all the info! I may split this into separate bugs, if any of them take a while. (2) I haven't done much playing with extensions, hadn't even hear of Lithium. I had to play a bit to try to re-use hopper code, and maybe lithium doesn't ticks some way that's causing problems. (The hopper code has lots of static functions so I can't override them and reuse them, ugh.) (3) With the "pulling down", can you check which version of Philter you're using? 1.3 should have disabled all pull-down actions (making it much easier to use).

Again, thanks!

kcrca commented 1 year ago

I'm also thinking that the "getting sucked downward" might be intended behavior? IIUC, it is the hopper that is doing the sucking, and that's how hoppers work -- they immediately suck an item out of the container above it if they can. Maybe there's some way to defeat that, but then the filter would be a container unlike any other. Right?

Harvle commented 1 year ago

Now you mention it, yeah that does seem like vanilla behaviour... Hoppers always pull down before they pull across so it's more of a flaw in my design than the mod itself, i'll rework my hopper layout. Ignore that one, apologies!

kcrca commented 1 year ago

Cool. What version are you running?

Harvle commented 1 year ago

philter: v1.3 fabric-api: v0.75.1 MC 1.19.3

kcrca commented 1 year ago

Oh well, so much for the easy answer :-) I'll look into it, thanks again for the bug report!

kcrca commented 1 year ago

Oh, which version of Lithium?

Harvle commented 1 year ago

Lithium was v0.11.0 when I tested it, i think that's still the latest version.

kcrca commented 1 year ago

I now understand the basic problem with Lithium -- it has a bunch of mixins and the like for the hopper specifically. And (obviously) not for the filter. I'll have to figure out how to plug into their system, or just document this doesn't work. I'll get in touch with the developers. (Remember when Minecraft was going to get a real API? This kind of stuff is just going to happen until it does.)

kcrca commented 1 year ago

OK, I think it's fixed. Can you try the version at https://claritypack.com/philter/philter-1.3.1.jar

Thanks to the lithium author, who helped me figure out what needed to happen!

Harvle commented 1 year ago

Hi, yep it seems to work fine now! Thanks for the speedy fixes! Just curious, were you able to look into this as this still seems to happen:

I've noticed as well when you're typing in the "Match" page, if you use the letter E (or whatever key used for opening/closing inventories, the gui will close, so typing something like "white" will not work.

kcrca commented 1 year ago

Not yet, next on the list.

kcrca commented 1 year ago

Oy, that's weird. It turns out that this is how text fields work with handled screens: The screen gets first crack at the character, and pulls it down with the inventory character even if the focus is in a text field, which would like to get that 'e'. To have a text field work properly, your screen has to do special weird magic with handling pressed keys. WTF? Anyway, fixed in 1.3.1, I'll have the real release up shortly to replace the early release you got earlier today.

kcrca commented 1 year ago

So I'm marking this closed.

Thanks for the reports. In the future, can you make different reports of each bug? It makes it a little easier to track.

Harvle commented 1 year ago

Thanks for the speedy bug fixes! Sorry, i'll make sure to do that next time. Thanks again : )