Custom GUI procedure doesnt seem to work the way it should...

Published by CBGenius on
Status
Outdated
Issue description

I have seen similar issues to this on other threads, but I could not find a workaround to this error I would come across. Any help would be highly appreciated!

I'll explain the issue as best I can.

So I have a custom GUI that is similar to that of the crafting table interface, though I should explain what it is first before I mention the bug.

I made a block called the 'Shield Mend Table' which would increase the durability of the shield by infusing it with a material of some kind (For example, a Serpentine Gem) with the cost of a lapis lazuli. The reason being because there are powerful enemies that break shields like twigs in my mod.

I still have to figure out how to use procedures to increase the maximum durability of items, even if it means trying to code (which I am not afraid to do, but also not very fluent on yet;) but I think I can worry about that after I resolve the problem I have been having.

 

So the problem:

When I run the test environment and try to use the Shield Mend Table, it would seem to work at first as when I place the items in the input slots, the result shows up in the output slot. However, when I try to take the shield that appears in the output slot... *POOF!* the item is gone. Can't place it back in the player inventory because it vanishes like the volunteer in a magicians show during the disappearing act. This renders the Shield Mend Table useless because of this.

Now, here are some things I have already tried but did not work:

 - Changing the GUI procedures into Block procedures

Changing the GUI procedures into Block procedures just does not work as when the test environment is run, the console prints "[Server thread/INFO] [STDERR]: [net.mcreator.the_shademantel.MCreatorShieldMendCheck:executeProcedure:21 Failed to load dependency x for procedure MCreatorShieldMendCheck!", therefor not detecting the items in the input slots, nor does it set the item in the output slot

 - Trying other versions(?)

I have tried other versions such as the latest versions but alas, it still had happened when I ran the test environment. Considering how many different versions there are that could have worked, I am not sure if this would be the solution or not since I do want to keep working with the current version I am using.

- Other methods

There were other methods I have thought of, like having a crafting recipe that does the same thing. Unfortunately, making a crafting recipe did not work as shields are not modifiable this way. I even considered a potion effect that rapidly repairs the shield, but it fails to work as the itemstack dependency would be missing. I even tried possibly getting a procedure done that enchants the shield with unbreaking, but have not found a solution that I think would be viable

 

Anyone who can help out with this anyway they can will get a HUGE thanks.

~CBGenius

Issue comments

I will check back tomorrow after online schooling to reply to any responses I may receive. I am counting on ya'll.

First, make sure the block is bound to the GUI.

Second, this error:

Changing the GUI procedures into Block procedures just does not work as when the test environment is run, the console prints "[Server thread/INFO] [STDERR]: [net.mcreator.the_shademantel.MCreatorShieldMendCheck:executeProcedure:21 Failed to load dependency x for procedure MCreatorShieldMendCheck!", therefor not detecting the items in the input slots, nor does it set the item in the output slot

To fix this, open the settings of "Mend" button and reselect the procedure.

Keep in mind that the procedure you defined will not take items from input slots and is missing some other checks too.

Hmm. I see. I'll check and make sure. I'll be back if this situation still presents itself.

Okay, so I have double checked the GUI, and the GUI was bound to the correct block. I also tried re-entering the procedure into the "Mend" button. I have tried this with both GUI and Block procedures. The only difference is that when I try the block procedures for the GUI, nothing actually happened. The error in the console was no longer there, but there was still no result in the output slot. As of right now, the GUI procedure I have went with still shows the most promise.

If there are any workarounds, I am open. As I have said, I am not afraid of a little coding but I am also not very fluent at it. A step-by-step of what I need to change in the code would be helpful. Any other suggestions I won't mind.

If there are any workarounds, I am open. As I have said, I am not afraid of a little coding but I am also not very fluent at it. A step-by-step of what I need to change in the code would be helpful. Any other suggestions I won't mind.

This should work without any workarounds. Please attach your workspace and slip a comment when you do so so I will check it fist-hand and try to assist.

There's my workspace. As the title suggests, the procedures, GUI, and block that the GUI is bound to should be at the bottom.

And thanks to you for willing to help. I really appreciate it. Thank you.

I'm having the exact same issue. I have a custom crafting table for putting together spell tomes and scrolls, with presumably a similar procedure setup, and I have gotten both "Failed to load dependency x" and "Failed to load dependency entity", both of which have stopped appearing after fiddling with it a bit. Despite that, no item shows up in the gui's output slot. I have also tried changing it to block-based inventory checking, with the same results, and back to gui-based inventory still with no results.

This is the GUI: https://i.imgur.com/S5EbMot.png
When you click Infuse, it is meant to check the input slots 1-3 and put a spell tome/scroll in output slot 0 if the items are correct. Nothing happens.
This is the procedure called by the button: https://i.imgur.com/TZHbRIS.png

I can send you my workspace if you need it, just tell me how.

So the GUI you have is the same as mine; Three input slots and an output slot. I'm sure that soon enough, both our predicaments will be solved. Time will tell.

"Failed to load dependency x" and "Failed to load dependency entity", both of which have stopped appearing after fiddling with it a bit.

If you add new dependency to the procedure, you need to reselect this procedure in GUI to update the dependencies passed to the procedure by the GUI.

You are using MCreator 1.9.1. This is an outdated version. You also mislead us by saying you use version 2020.2. Update your MCreator to 2020.2.

Ah.. I'm sorry. I clicked 1.12 thinking it might've been any of the MCreators suited for 1.9.1. Please forgive me, I am still new to the website, though I have been working with MCreator for about 3 years now. In those earlier times, I never did much in the forums, sites, etc. as I am getting used to now.

Yes, I'll try the 2020.2 version, see what I can do there. If there's anything else I need to do, let me know.

Ah.. I'm sorry. I clicked 1.12 thinking it might've been any of the MCreators suited for 1.9.1. Please forgive me, I am still new to the website, though I have been working with MCreator for about 3 years now. In those earlier times, I never did much in the forums, sites, etc. as I am getting used to now.

I see what you mean, we need to improve the UI there ;)

And yes, update to 2020.2 this problem will be most likely gone.

Switching to MCreator 2020.2 caused a whole whack of compilation errors in the mod, but nothing I can't manage. I'll get back to the main topic here at hand if anything changes.

Switching to MCreator 2020.2 caused a whole whack of compilation errors in the mod, but nothing I can't manage. I'll get back to the main topic here at hand if anything changes.

You had some mod elements locked so this was expected

Alright, made the switch... And it does work to my surprise. A big thank you to y 'all. Also, about figuring out how to increase max durability of the shield in the output... How can I do that?

Alrighty, I figured it out. Thanks for helping me. It means a lot to me.

You are welcome! I am glad I could help :) If you like what we do, consider donating to us to help us keep this project up.