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"));