Hwyla

Hwyla

86M Downloads

[1.11.2] HWYLA not working like WAILA

capnkirok opened this issue · 17 comments

commented

Issue Description:

HWYLA is showing incorrect values for animals (always Hungry / Thirsty) on 1.11.2. When using WAILA they are alway correct

https://github.com/capnkirok/animania/issues/484

What happens:

What you expected to happen:

Show correct values

Steps to reproduce:

  1. Install animania, crafstudio, HWYLA,
  2. See animals always hungry, thirsty
  3. Install WAILA instead. Rejoice.
    ...

Affected Versions (Do not use "latest"):

  • Hwyla: Hwyla-1.8.17-B31_1.11.jar
  • Minecraft: 1.11.2
  • Forge: latest recommended

Possible Conflicting Mods (Provide their version, as well)

commented

breaks out the decompiler again

commented

Can you set a breakpoint at line 70 in WailaEntityAnimalProviderBase and make sure the entity tag has the proper data?

commented

Alternatively could you hop on Discord to make this easier to figure out?

commented

Hey @TehNut my friend. I will reach out once I close a hot burning fire of a bug I'm working on now. Will do some testing before I do. Thx.

commented

@capnkirok Any updates?

commented

Hey ... FYI, I finally opened up Animania:
https://github.com/capnkirok/animaniamod

commented

I rewrote packet handling mid-1.11 which may have removed your edge case. Either way, the current code is "invalid" in both Waila and Hwyla since the client is not guaranteed to know the proper data.

commented

If you cant get it working, I'd be happy to submit a PR

commented

In here, https://github.com/capnkirok/animaniamod/blob/1.12/src/main/java/com/animania/compat/waila/provider/WailaEntityAnimalProviderBase.java, why are you overriding the fed and watered vales sent by the server? All the checks you do (which could easily be cleaned up by using an interface, btw) should be done in getNBTData instead of getWailaBody. getWailaBody is only called client-side, so your getters are relying on whatever the client knows, which is probably wrong.

commented

Hey @TehNut. Well, I didn't write this particular piece of code, but I see your point. What's strange to me, even with this oversight, is that this implementation works with WAILA but not with HWYLA, which was the original post.

Let me see if I can fix it based on your tip (no pun intended).

commented

@TehNut I will take you up on your offer. I tried a few different methods and came up with nothing. And it works in WAILA, like I said. So, I am guessing your packet fix is probably what did it, as you suggest.

commented

Okay I did some digging and spotted the issue. This is a fun one.

So first off, Entity#getEntityData() is custom data. Not what you're serializing in Entity#writeEntityToNBT(). If you look inside getEntityData(), you can see it nullchecks itself and if it's null, it sets itself to a new empty compound and returns that. Otherwise it returns whatever was there. Unless somebody else has called that before, it will always be null, so you will always get an empty tag from it.

The reason it works with Waila is because Waila is missing the Entity NBT provider call here. Like, it literally never makes use of it. Ever. This means that you setting Fed and Watered to default values from an empty tag here are never called.

The reason it doesn't work in Hwyla is because I do make the provider calls. So your provider is setting the values to 0 since that is the default.

commented

Well, technically, the issue will be closed on my side, and doesn't have to do with your code. And the issue is still open on my side.

I feel like we are those two chipmunks who are being too polite too each other...
image

commented

Hey, we should have closed this. So I'm closing it :)

commented

Oh I didn't know you released the fix. 🤷

commented
commented

Ah. I generally don't close issues until a fix has been released. It combats duplicate issues.