mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-08-01 20:15:28 +02:00
Fixing some issues with reloading
This commit is contained in:
@@ -367,4 +367,23 @@ public class SkillUtils {
|
||||
|
||||
return quantity;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if a recipe has already been registered
|
||||
* @param recipe target recipe
|
||||
* @return true if the recipe has already been registered
|
||||
*/
|
||||
public static boolean hasRecipeBeenRegistered(Recipe recipe) {
|
||||
for(Iterator<? extends Recipe> recipeIterator = Bukkit.getServer().recipeIterator(); recipeIterator.hasNext();) {
|
||||
Recipe bukkitRecipe = recipeIterator.next();
|
||||
|
||||
if(bukkitRecipe.getResult().isSimilar(recipe.getResult())) {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user