Skip to content

Commit

Permalink
Try to fix issue with wrong registred recipes
Browse files Browse the repository at this point in the history
  • Loading branch information
Ste3et committed Oct 1, 2024
1 parent 4fd0ed8 commit 5ce31c0
Showing 1 changed file with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -174,16 +174,17 @@ public List<JsonObject> loadFunction(final YamlConfiguration configuration) {
}

private boolean isKeyisKeyRegistered(org.bukkit.NamespacedKey key) {
Iterator<Recipe> it = Bukkit.getServer().recipeIterator();
while (it.hasNext()) {
Recipe recipe = it.next();
if(ShapedRecipe.class.isInstance(recipe)) {
if(ShapedRecipe.class.cast(recipe).getKey().equals(key)) {
return true;
}
}
}
return false;
return Objects.nonNull(Bukkit.getRecipe(key));
// Iterator<Recipe> it = Bukkit.getServer().recipeIterator();
// while (it.hasNext()) {
// Recipe recipe = it.next();
// if(ShapedRecipe.class.isInstance(recipe)) {
// if(ShapedRecipe.class.cast(recipe).getKey().equals(key)) {
// return true;
// }
// }
// }
// return false;
}

public PlaceableSide getPlaceAbleSide(YamlConfiguration configuration) {
Expand Down

0 comments on commit 5ce31c0

Please sign in to comment.