Fix VillagerTypeTestMod not working (#10426)

This commit is contained in:
Jonathing authored and GitHub committed 2025-02-18 12:01:28 -08:00
1 parent dbd7da6885
commit 43288f79e3
2 files changed
+25 -3

No files matched your search

@@ -5,6 +5,7 @@
package net.minecraftforge.common.extensions;
import java.util.Objects;
import java.util.UUID;
import java.util.function.Consumer;
import java.util.function.Supplier;
@@ -61,6 +62,13 @@ public interface IForgeGameTestHelper {
throw new GameTestAssertException(message.get());
}
/** Backported from 1.20.6 */
default <N> void assertValueEqual(N expected, N actual, String name) {
if (!Objects.equals(expected, actual)) {
throw new GameTestAssertException("Expected " + name + " to be " + expected + ", but was " + actual);
}
}
// Backported from 1.20.6
default Player makeMockPlayer(final GameType p_333981_) {
return new Player(this.self().getLevel(), BlockPos.ZERO, 0.0F, new GameProfile(UUID.randomUUID(), "test-mock-player")) {