Skip to content

Commit

Permalink
Fix RecipeType
Browse files Browse the repository at this point in the history
  • Loading branch information
Intybyte committed Nov 4, 2024
1 parent 2a89562 commit 1a88959
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,9 @@ public RecipeType(NamespacedKey key, ItemStack item, BiConsumer<ItemStack[], Ite
this.key = key;
this.consumer = callback;

if (item instanceof SlimefunItemStack slimefunItemStack) {
this.machine = slimefunItemStack.getItemId();
SlimefunItem machineItem = SlimefunItem.getByItem(item);
if (machineItem != null) {
this.machine = machineItem.getId();
} else {
this.machine = "";
}
Expand All @@ -109,7 +110,8 @@ public RecipeType(NamespacedKey key, ItemStack item, BiConsumer<ItemStack[], Ite
public RecipeType(NamespacedKey key, ItemStack item) {
this.key = key;
this.item = item;
this.machine = item instanceof SlimefunItemStack slimefunItemStack ? slimefunItemStack.getItemId() : "";
SlimefunItem machineItem = SlimefunItem.getByItem(item);
this.machine = machineItem != null ? machineItem.getId() : "";
}

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

0 comments on commit 1a88959

Please sign in to comment.