Skip to content

Commit

Permalink
how to game test?
Browse files Browse the repository at this point in the history
  • Loading branch information
Phoupraw committed Oct 21, 2023
1 parent 0b9d444 commit 261c821
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public final class FoodGameTest implements FabricGameTest, ModInitializer {

@GameTest(templateName = EMPTY_STRUCTURE)
public void damageFoodTest(TestContext context) {
var player = context.getWorld().getPlayers().get(0);
var player = context.createMockSurvivalPlayer();
HungerManager hungerManager = player.getHungerManager();
for (int damage : new int[]{0, 1, 10, 19}) {
hungerManager.add(-hungerManager.getFoodLevel(), 0.5f);
Expand All @@ -50,7 +50,7 @@ public void damageFoodTest(TestContext context) {

@GameTest(templateName = EMPTY_STRUCTURE)
public void nameFoodTest(TestContext context) {
var player = context.getWorld().getPlayers().get(0);
var player = context.createMockSurvivalPlayer();
HungerManager hungerManager = player.getHungerManager();
hungerManager.add(-hungerManager.getFoodLevel(), 0.5f);
ItemStack foodStack = NAME.getDefaultStack();
Expand All @@ -68,7 +68,7 @@ public void nameFoodTest(TestContext context) {

@GameTest(templateName = EMPTY_STRUCTURE)
public void nameMeatTest(TestContext context) {
var player = context.getWorld().getPlayers().get(0);
var player = context.createMockSurvivalPlayer();
WolfEntity wolf = context.spawnEntity(EntityType.WOLF, context.getRelative(Vec3d.ZERO));
wolf.setTamed(true);
wolf.setOwner(player);
Expand All @@ -82,7 +82,7 @@ public void nameMeatTest(TestContext context) {
context.complete();
}

@GameTest(templateName = EMPTY_STRUCTURE)
//@GameTest(templateName = EMPTY_STRUCTURE)
public void giveItems(TestContext context) {
var player = context.getWorld().getPlayers().get(0);
for (int damage : new int[]{0, 1, 10, 19}) {
Expand Down

0 comments on commit 261c821

Please sign in to comment.