Skip to content

Commit

Permalink
Fix RecipeType
Browse files Browse the repository at this point in the history
  • Loading branch information
Intybyte authored and gurrrrrrett3 committed Nov 25, 2024
1 parent e46f17c commit f00bfd5
Showing 1 changed file with 4 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import java.util.HashSet;
import java.util.List;
import java.util.Locale;
import java.util.Optional;
import java.util.Set;
import java.util.function.BiConsumer;

Expand Down Expand Up @@ -99,21 +100,12 @@ public RecipeType(NamespacedKey key, ItemStack item, BiConsumer<ItemStack[], Ite
this.key = key;
this.consumer = callback;

SlimefunItem slimefunItem = SlimefunItem.getByItem(item);

if (slimefunItem != null) {
this.machine = slimefunItem.getId();
} else {
this.machine = "";
}
Optional<String> itemId = Slimefun.getItemDataService().getItemData(item);
this.machine = itemId.orElse("");
}

public RecipeType(NamespacedKey key, ItemStack item) {
this.key = key;
this.item = item;

SlimefunItem slimefunItem = SlimefunItem.getByItem(item);
this.machine = slimefunItem != null ? slimefunItem.getId() : "";
this(key, item, null);
}

public RecipeType(MinecraftRecipe<?> recipe) {
Expand Down

0 comments on commit f00bfd5

Please sign in to comment.