Skip to content

Commit 1623bc0

Browse files
fix: keep mixing bowl flour and yeast stars when the last item is used (#37)
Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent bc59526 commit 1623bc0

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

‎src/main/java/net/tfminecraft/cooking/mixing/MixingBowlHandler.java‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -254,9 +254,13 @@ private void handleIngredientAdd(Furniture furniture, Player player, FurnitureIn
254254

255255
}
256256

257+
FoodItem ingredient = null;
258+
257259
if (MixingBowlSlots.FLOUR.equals(expectedSlot) || MixingBowlSlots.YEAST.equals(expectedSlot)) {
258260

259-
if (FoodItem.fromItem(hand) == null) {
261+
ingredient = FoodItem.fromItem(hand);
262+
263+
if (ingredient == null) {
260264

261265
player.sendMessage("§cUse converted cooking ingredients.");
262266

@@ -294,7 +298,7 @@ private void handleIngredientAdd(Furniture furniture, Player player, FurnitureIn
294298

295299

296300

297-
storeIngredientQuality(furniture, expectedSlot, hand);
301+
storeIngredientQuality(furniture, expectedSlot, ingredient);
298302

299303
MixingBowlState.setStage(furniture, stage.advance());
300304

@@ -407,9 +411,7 @@ private void handleMixinAdd(Furniture furniture, Player player, FurnitureInterac
407411

408412

409413

410-
private void storeIngredientQuality(Furniture furniture, String slotId, ItemStack hand) {
411-
412-
FoodItem foodItem = FoodItem.fromItem(hand);
414+
private void storeIngredientQuality(Furniture furniture, String slotId, FoodItem foodItem) {
413415

414416
if (foodItem == null) {
415417

0 commit comments

Comments
 (0)