NichtStudioCode/InvUI

Strange behaviour when trying to update an item inside Anvil result slot

Closed this issue · 0 comments

Hi, I'm having trouble using the AnvilWindow and I don't know why...
In the past versions this system worked well, but now all the anvil GUI just have a really strange behaviour.

I'm trying to make and AnvilGUI that takes an input, but also validates it.
So, when you see the X icon, the player can't confirm, when you see the V icon, the player can confirm and a function will be executed.

In this case, just for testing, it will check if the input is a number and if its != 1.

The code is working, the problem is the anvil GUI itself...

This is the functions to request an input from the user:
https://pastebin.com/mFQshPhq

This is the class AnvilItem used to update the result slot of the anvil:
https://pastebin.com/q9072SZx

This is what happens every time I change the text of the anvil:
https://imgur.com/a/RbXz26d

The player inventory should remain untouched, but this strange bug occurs and I tried everything to fix this, with no success, as the icon should be only in the result slot of the anvil.

And if the player closed the GUI, all the items remains in its inventory...