DutchJelly / CraftEnhance

A Minecraft Plugin that allows server owners to create custom recipes in-game
Apache License 2.0
13 stars 10 forks source link

problem with using recipes on restart - 1.17.1 #55

Open amirparsadd opened 11 months ago

amirparsadd commented 11 months ago

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]: [CraftEnhance] The correct version is installed. [16:20:14] [Server thread/INFO]: [CraftEnhance] Error -- Recipe with key recipe1 has issues: recipe cannot have null result [16:20:14] [Server thread/INFO]: [CraftEnhance] Error -- This recipe will not be cached and loaded.

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); } }

broken1arrow commented 11 months ago

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.