Goldorion / File-Manager-MCreator

A MCreator plugin to manage files for Minecraft
GNU Lesser General Public License v2.1
8 stars 7 forks source link

Unable to set Global Variables from configuration file #67

Open smmmadden opened 5 months ago

smmmadden commented 5 months ago

Issue description

I'm trying to create a procedure that will check the configuration file and read the properties, get their values and then set global variable values to them. The global variables would then be used with Cloth-Config Plugin that I can provide an in-game option to change configuration settings, but I need to get the latest values first to ensure the player sees the right settings. What's happening is, if I use the Read JSON file and get values, I get a stack overflow and the Set Global elements return null. I also tried using the for each line of the file get the text and do...element and still the global variables are not getting set. To prove that the global variables are not getting set (or reading the properties to do so), I added a logger to print out the value. The game errors on load with a null value. image image

How to reproduce this issue?

Created a config.json file Added Global Variables to support Cloth-Config image Attempted to read the properties and set global variables in a procedure Ran Client option Fails

Operating system

Windows

Details

FileManager 5.10 MCreator 2024.1.17319 neoforge-1.20.4

Example workspace

No response

Logs

https://pastebin.com/4diu03L0

Issue tracker rule checks (please read carefully)

smmmadden commented 5 months ago

So I did some further testing and can confirm that the use of Global variables with FileManager is definitely not supported. I created some local variables and set the values and confirmed that the variable was set correctly. But doing the same with a Global Variable causes minecraft to crash. You can see the two global variable entries added. Without those two, Minecraft client loads fine and works. With them, it did not. image image