Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ public void scoop(Player p, ItemStack ladle) {
// ---------- BUILD RESULT ----------
CompositionResult composed = CompositionQualityResolver.compose(p, slots.values(), CompositionContext.SOUP_SCOOP);
CompositionApplier.apply(soup, composed);
soup.setBaseFood(scoopFood(soup.getBaseFood(), soupScoops()));
soup.setBaseFood(scoopFood(soup.getBaseFood()));
int quality = composed.getFinalQuality();

ItemStack output = ItemBuilder.buildSingleWithQuality(soup, ladle, quality);
Expand Down Expand Up @@ -565,9 +565,9 @@ public void rebuildFromFurniture() {
applySoupLevel();
}

/** Whole-pot food split across scoops. Nutrition stays the template level. */
public static double scoopFood(double templateFood, int scoops) {
return templateFood / Math.max(1, scoops);
/** Each scoop keeps the soup template food. Serving count does not scale it. */
public static double scoopFood(double templateFood) {
return templateFood;
}

private static int soupScoops() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@ void plainRoastFoodFollowsCutsAndNutritionStaysAtBase() throws Exception {
}

@Test
void soupScoopDividesFoodOnly() {
void soupScoopKeepsTemplateFoodAndNutrition() {
FoodItem soup = new FoodItem("soup", "Soup", true);
soup.setBaseNutrition(8);
soup.setBaseFood(PotReference.scoopFood(26, 3));
soup.setBaseFood(PotReference.scoopFood(26));

assertEquals(26.0 / 3, soup.getBaseFood());
assertEquals(26, soup.getBaseFood());
assertEquals(8, soup.getBaseNutrition());
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package net.tfminecraft.cooking.item;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;

Expand All @@ -9,7 +8,6 @@

import org.junit.jupiter.api.Test;

import net.tfminecraft.cooking.cooking.PotReference;
import net.tfminecraft.cooking.utils.StationAddonRules;

class ValuableIngredientTest {
Expand All @@ -26,11 +24,6 @@ void detectsValuableIngredientAndIgnoresVanilla() throws Exception {
assertFalse(StationAddonRules.hasValuable(Map.of()));
}

@Test
void soupScoopFoodIsUnchangedByValuableFlag() {
assertEquals(26.0 / 3, PotReference.scoopFood(26, 3));
}

private static void setValuable(FoodItem item, boolean valuable) throws Exception {
Field field = FoodItem.class.getDeclaredField("valuable");
field.setAccessible(true);
Expand Down