From 8200f393981fd86300d665739525044d1cb915d0 Mon Sep 17 00:00:00 2001 From: Justinas Launikonis <95593194+JustinasLa@users.noreply.github.com> Date: Wed, 28 Oct 2026 03:56:30 +0200 Subject: [PATCH] feat: count a poured brew as fresh so brew sauces can be Fresh A sauce is Fresh when its main ingredients are. A bottled brew never spoils but had no freshness, so a wine reduction could never be Fresh and fell well behind a milk sauce on nutrition. Co-Authored-By: Claude Opus 5.5 --- .../net/tfminecraft/cooking/cooking/SauceReference.java | 8 +++++++- .../cooking/cooking/SauceReferenceBrewTest.java | 3 ++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/tfminecraft/cooking/cooking/SauceReference.java b/src/main/java/net/tfminecraft/cooking/cooking/SauceReference.java index b0b6bc0..f96aeb1 100644 --- a/src/main/java/net/tfminecraft/cooking/cooking/SauceReference.java +++ b/src/main/java/net/tfminecraft/cooking/cooking/SauceReference.java @@ -476,12 +476,18 @@ private void pourBrew(Player p, BrewLiquid poured) { f.getLoc().getWorld().playSound(f.getLoc(), Sound.ITEM_BOTTLE_EMPTY, 1f, 1f); } - /** The brew counts toward the sauce's stars like the water or milk it replaces. */ + /** The brew counts toward the sauce's stars like the milk it replaces. A bottled brew never spoils, so it is fresh. */ private static FoodItem brewIngredient(BrewLiquid poured) { FoodItem ingredient = FoodParser.parse("sauce(type=sauce;origin=Mixed)").template; ingredient.setCategory("alcohol"); ingredient.setOrigin(poured.name()); ingredient.setQualityRange(poured.stars(), poured.stars()); + TagTrack fresh = TrackLoader.getByString("freshness"); + if (fresh != null) { + fresh = new TagTrack(fresh); + fresh.setValue(0); + ingredient.addOrModifyTrack(fresh); + } return ingredient; } diff --git a/src/test/java/net/tfminecraft/cooking/cooking/SauceReferenceBrewTest.java b/src/test/java/net/tfminecraft/cooking/cooking/SauceReferenceBrewTest.java index df38787..092d440 100644 --- a/src/test/java/net/tfminecraft/cooking/cooking/SauceReferenceBrewTest.java +++ b/src/test/java/net/tfminecraft/cooking/cooking/SauceReferenceBrewTest.java @@ -87,7 +87,8 @@ void anAlcoholicBrewBecomesTheLiquidAndLeavesBothAddInSlotsFree() { env.composer.verify(() -> CompositionQualityResolver.compose(any(), argThat(inputs -> { FoodItem liquid = inputs.iterator().next(); return inputs.size() == 3 && "alcohol".equals(liquid.getCategory()) - && "Red Wine".equals(liquid.getOrigin()) && liquid.getQualityMin() == 5; + && "Red Wine".equals(liquid.getOrigin()) && liquid.getQualityMin() == 5 + && "fresh".equals(liquid.getTagTrack("freshness").getCurrentStep().getId()); }), any())); assertTrue(sauce.isEmpty()); assertFalse(env.variables.containsKey("sauce.brew"));