problem with using recipes on restart - 1.17.1
amirparsadd opened this issue · 2 comments
Describe the bug
after reloading the plugin and restarting, everything in the config files become null characters
happens in 1.17.1
To Reproduce
Steps to reproduce the behavior:
1.Create A recipe
2.Reload The Plugin
Show console logs
[16:20:14] [Server thread/INFO]: �[0;37;22m[�[0;36;1mCraft�[0;35;1mEnhance�[0;37;22m] �[mThe correct version is installed.�[m
[16:20:14] [Server thread/INFO]: �[0;37;22m[�[0;36;1mCraft�[0;35;1mEnhance�[0;37;22m] �[m�[0;31;22m�[21mError�[m -- Recipe with key recipe1 has issues: recipe cannot have null result�[m
[16:20:14] [Server thread/INFO]: �[0;37;22m[�[0;36;1mCraft�[0;35;1mEnhance�[0;37;22m] �[m�[0;31;22m�[21mError�[m -- This recipe will not be cached and loaded.�[m
THE PROBLEM IS HAPPENING HERE:
public void cacheRecipes(){ Debug.Send("The file manager is caching recipes..."); IEnhancedRecipe keyValue; recipesConfig = getYamlConfig(recipesFile); recipes.clear(); for(String key : recipesConfig.getKeys(false)){ Debug.Send("Caching recipe with key " + key); keyValue = (IEnhancedRecipe)recipesConfig.get(key); String validation = keyValue.validate(); if(validation != null){ Messenger.Error("Recipe with key " + key + " has issues: " + validation); Messenger.Error("This recipe will not be cached and loaded."); continue; } keyValue.setKey(key); recipes.add(keyValue); } }
Describe the bug after reloading the plugin and restarting, everything in the config files become null characters happens in 1.17.1
To Reproduce Steps to reproduce the behavior: 1.Create A recipe 2.Reload The Plugin
Show console logs [16:20:14] [Server thread/INFO]: �[0;37;22m[�[0;36;1mCraft�[0;35;1mEnhance�[0;37;22m] �[mThe correct version is installed.�[m [16:20:14] [Server thread/INFO]: �[0;37;22m[�[0;36;1mCraft�[0;35;1mEnhance�[0;37;22m] �[m�[0;31;22m�[21mError�[m -- Recipe with key recipe1 has issues: recipe cannot have null result�[m [16:20:14] [Server thread/INFO]: �[0;37;22m[�[0;36;1mCraft�[0;35;1mEnhance�[0;37;22m] �[m�[0;31;22m�[21mError�[m -- This recipe will not be cached and loaded.�[m
THE PROBLEM IS HAPPENING HERE:
public void cacheRecipes(){ Debug.Send("The file manager is caching recipes..."); IEnhancedRecipe keyValue; recipesConfig = getYamlConfig(recipesFile); recipes.clear(); for(String key : recipesConfig.getKeys(false)){ Debug.Send("Caching recipe with key " + key); keyValue = (IEnhancedRecipe)recipesConfig.get(key); String validation = keyValue.validate(); if(validation != null){ Messenger.Error("Recipe with key " + key + " has issues: " + validation); Messenger.Error("This recipe will not be cached and loaded."); continue; } keyValue.setKey(key); recipes.add(keyValue); } }
What plugin version do you use? and recommend you check the source here https://github.com/broken1arrow/CraftEnhance newer version on spigot use this fork.