Skip to content

Commit

Permalink
runGametest BUILD SUCCESSFUL
Browse files Browse the repository at this point in the history
  • Loading branch information
Phoupraw committed Oct 21, 2023
1 parent 3e2388d commit 6a1c4ed
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand All @@ -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());
Expand Down

0 comments on commit 6a1c4ed

Please sign in to comment.