diff --git a/fabric/game-test/server.properties b/fabric/game-test/server.properties index a893c65c1..6512ff3b8 100644 --- a/fabric/game-test/server.properties +++ b/fabric/game-test/server.properties @@ -1,5 +1,5 @@ #Minecraft server properties -#Sun Dec 01 00:54:35 JST 2024 +#Sat Dec 07 23:11:08 JST 2024 accepts-transfers=false allow-flight=true allow-nether=true diff --git a/fabric/src/gameTest/java/com/yogpc/qp/fabric/EnchantmentTest.java b/fabric/src/gameTest/java/com/yogpc/qp/fabric/EnchantmentTest.java new file mode 100644 index 000000000..57d98fba0 --- /dev/null +++ b/fabric/src/gameTest/java/com/yogpc/qp/fabric/EnchantmentTest.java @@ -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(); + } +} diff --git a/fabric/src/gameTest/java/com/yogpc/qp/fabric/LoadTest.java b/fabric/src/gameTest/java/com/yogpc/qp/fabric/LoadTest.java index 92c17c513..4be61c5ac 100644 --- a/fabric/src/gameTest/java/com/yogpc/qp/fabric/LoadTest.java +++ b/fabric/src/gameTest/java/com/yogpc/qp/fabric/LoadTest.java @@ -47,6 +47,7 @@ public static void register() { field.setAccessible(true); var map = (Map, String>) field.get(null); map.put(LoadTest.class, QuarryPlus.modID); + map.put(EnchantmentTest.class, QuarryPlus.modID); GameTestRegistry.register(LoadTest.class); QuarryPlus.LOGGER.info("Registered GameTest for Fabric"); diff --git a/forge/game-test/server.properties b/forge/game-test/server.properties index 69dfccd4a..0372ec5e2 100644 --- a/forge/game-test/server.properties +++ b/forge/game-test/server.properties @@ -1,5 +1,5 @@ #Minecraft server properties -#Sun Dec 01 00:54:38 JST 2024 +#Sat Dec 07 23:11:09 JST 2024 accepts-transfers=false allow-flight=true allow-nether=true diff --git a/neoforge/game-test/server.properties b/neoforge/game-test/server.properties index 3549c5dd9..681ecd383 100644 --- a/neoforge/game-test/server.properties +++ b/neoforge/game-test/server.properties @@ -1,5 +1,5 @@ #Minecraft server properties -#Sun Dec 01 00:54:36 JST 2024 +#Sat Dec 07 23:11:33 JST 2024 accepts-transfers=false allow-flight=true allow-nether=true