diff --git a/fabric-item-api-v1/src/testmod/java/net/fabricmc/fabric/test/item/gametest/FoodGameTest.java b/fabric-item-api-v1/src/testmod/java/net/fabricmc/fabric/test/item/gametest/FoodGameTest.java index 1eb04718a9..adbec29986 100644 --- a/fabric-item-api-v1/src/testmod/java/net/fabricmc/fabric/test/item/gametest/FoodGameTest.java +++ b/fabric-item-api-v1/src/testmod/java/net/fabricmc/fabric/test/item/gametest/FoodGameTest.java @@ -41,7 +41,8 @@ public void damageFoodTest(TestContext context) { HungerManager hungerManager = player.getHungerManager(); for (int damage : new int[]{0, 1, 10, 19}) { - hungerManager.add(-hungerManager.getFoodLevel(), 0.5f); + hungerManager.setFoodLevel(0); + hungerManager.setSaturationLevel(0); ItemStack foodStack = FoodGameInitializer.DAMAGE.getDefaultStack(); foodStack.setDamage(damage); player.eatFood(player.getWorld(), foodStack.copy()); @@ -61,7 +62,8 @@ public void damageFoodTest(TestContext context) { public void nameFoodTest(TestContext context) { PlayerEntity player = context.createMockSurvivalPlayer(); HungerManager hungerManager = player.getHungerManager(); - hungerManager.add(-hungerManager.getFoodLevel(), 0.5f); + hungerManager.setFoodLevel(0); + hungerManager.setSaturationLevel(0); ItemStack foodStack = FoodGameInitializer.NAME.getDefaultStack(); foodStack.setCustomName(Text.literal("enchanted_golden_apple")); player.eatFood(player.getWorld(), foodStack.copy());