-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
42 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
fabric/src/gameTest/java/com/yogpc/qp/fabric/EnchantmentTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package com.yogpc.qp.fabric; | ||
|
||
import com.yogpc.qp.PlatformAccess; | ||
import com.yogpc.qp.gametest.GameTestFunctions; | ||
import net.fabricmc.fabric.api.gametest.v1.FabricGameTest; | ||
import net.minecraft.gametest.framework.GameTest; | ||
import net.minecraft.gametest.framework.GameTestHelper; | ||
import net.minecraft.world.item.ItemStack; | ||
import net.minecraft.world.item.enchantment.Enchantments; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertTrue; | ||
|
||
public final class EnchantmentTest implements FabricGameTest { | ||
|
||
@GameTest(template = EMPTY_STRUCTURE) | ||
public void quarryEnchantmentEfficiency(GameTestHelper helper) { | ||
var enchantment = GameTestFunctions.getEnchantment(helper, Enchantments.EFFICIENCY); | ||
var stack = new ItemStack(PlatformAccess.getAccess().registerObjects().quarryBlock().get()); | ||
assertTrue(enchantment.value().canEnchant(stack)); | ||
helper.succeed(); | ||
} | ||
|
||
@GameTest(template = EMPTY_STRUCTURE) | ||
public void quarryEnchantmentUnbreaking(GameTestHelper helper) { | ||
var enchantment = GameTestFunctions.getEnchantment(helper, Enchantments.UNBREAKING); | ||
var stack = new ItemStack(PlatformAccess.getAccess().registerObjects().quarryBlock().get()); | ||
assertTrue(enchantment.value().canEnchant(stack)); | ||
helper.succeed(); | ||
} | ||
|
||
@GameTest(template = EMPTY_STRUCTURE) | ||
public void quarryEnchantmentFortune(GameTestHelper helper) { | ||
var enchantment = GameTestFunctions.getEnchantment(helper, Enchantments.FORTUNE); | ||
var stack = new ItemStack(PlatformAccess.getAccess().registerObjects().quarryBlock().get()); | ||
assertTrue(enchantment.value().canEnchant(stack)); | ||
helper.succeed(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters