From 0dc73bf46229860ef374df02b9ed20c291df40b7 Mon Sep 17 00:00:00 2001 From: XxFran10xX <318299142+XxFran10xX@users.noreply.github.com> Date: Fri, 13 Nov 2026 13:27:28 +0100 Subject: [PATCH] tune: ingredients keep a week, soup and sauce three days Owner rule (2026-11-13): raw ingredients last at least a week before they turn Stale, and cooked soup and sauce go from 2 to 3 days. age.freshness is days until Stale (Rotten at 1.25 times that): milk_bucket and cup_of_milk 0.5 -> 7, dough 1 -> 7, yeast 4 -> 7, egg 4 -> 7, soup 2 -> 3, sauce 2 -> 3. Co-Authored-By: Claude Opus 5.5 --- src/main/resources/types.yml | 14 ++++---- .../cooking/item/ShelfLifeDefaultsTest.java | 35 +++++++++++++++++++ 2 files changed, 42 insertions(+), 7 deletions(-) create mode 100644 src/test/java/net/tfminecraft/cooking/item/ShelfLifeDefaultsTest.java diff --git a/src/main/resources/types.yml b/src/main/resources/types.yml index b5dc5d8..05af395 100644 --- a/src/main/resources/types.yml +++ b/src/main/resources/types.yml @@ -530,7 +530,7 @@ yeast: nutrition: 4 age: warmth: 450 - freshness: 4 + freshness: 7 tag-labels: freshness: rotten: "#8B7355Mouldy" @@ -542,7 +542,7 @@ dough: nutrition: 4 age: warmth: 450 - freshness: 1 + freshness: 7 rising: 1 tag-labels: freshness: @@ -624,7 +624,7 @@ sushi: sauce: age: warmth: 450 - freshness: 2 + freshness: 3 name: "{colour}{prefixes}{fillers}Sauce" food: 6 nutrition: 5 @@ -650,7 +650,7 @@ roux: soup: age: warmth: 450 - freshness: 2 + freshness: 3 name: "{colour}{prefixes}{fillers}Soup" food: 26 nutrition: 8 @@ -663,7 +663,7 @@ cup_of_milk: nutrition: 6 age: warmth: 450 - freshness: 0.5 + freshness: 7 tag-labels: freshness: stale: "#c3db81Sour" @@ -676,7 +676,7 @@ milk_bucket: nutrition: 6 age: warmth: 450 - freshness: 0.5 + freshness: 7 tag-labels: freshness: stale: "#c3db81Sour" @@ -817,7 +817,7 @@ egg: burn: 25 age: warmth: 450 - freshness: 4 + freshness: 7 tag-labels: freshness: stale: "#c3db81Stale" diff --git a/src/test/java/net/tfminecraft/cooking/item/ShelfLifeDefaultsTest.java b/src/test/java/net/tfminecraft/cooking/item/ShelfLifeDefaultsTest.java new file mode 100644 index 0000000..27274dc --- /dev/null +++ b/src/test/java/net/tfminecraft/cooking/item/ShelfLifeDefaultsTest.java @@ -0,0 +1,35 @@ +package net.tfminecraft.cooking.item; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.io.File; + +import org.bukkit.configuration.file.YamlConfiguration; +import org.junit.jupiter.api.Test; + +/** + * Bundled shelf lives (age.freshness = days until Stale; Rotten comes at 1.25 times that, see tags.yml). + * Owner rule 2026-11-13: ingredients last at least a week, cooked soup and sauce three days. + */ +class ShelfLifeDefaultsTest { + + private static final YamlConfiguration TYPES = + YamlConfiguration.loadConfiguration(new File("src/main/resources/types.yml")); + + @Test + void ingredientsLastAWeek() { + for (String id : new String[] {"milk_bucket", "cup_of_milk", "dough", "yeast", "egg"}) { + assertEquals(7.0, freshness(id), id); + } + } + + @Test + void soupAndSauceLastThreeDays() { + assertEquals(3.0, freshness("soup")); + assertEquals(3.0, freshness("sauce")); + } + + private static double freshness(String id) { + return TYPES.getDouble(id + ".age.freshness", -1); + } +}