2025-11-24 22:52:51 +03:00

35 lines
1.6 KiB
Java

/*
* Decompiled with CFR 0.152.
*/
package net.minecraft.gametest.framework;
import java.util.function.Consumer;
import net.minecraft.core.Holder;
import net.minecraft.core.HolderGetter;
import net.minecraft.core.registries.Registries;
import net.minecraft.data.worldgen.BootstrapContext;
import net.minecraft.gametest.framework.BuiltinTestFunctions;
import net.minecraft.gametest.framework.FunctionGameTestInstance;
import net.minecraft.gametest.framework.GameTestEnvironments;
import net.minecraft.gametest.framework.GameTestHelper;
import net.minecraft.gametest.framework.GameTestInstance;
import net.minecraft.gametest.framework.TestData;
import net.minecraft.gametest.framework.TestEnvironmentDefinition;
import net.minecraft.resources.Identifier;
import net.minecraft.resources.ResourceKey;
public interface GameTestInstances {
public static final ResourceKey<GameTestInstance> ALWAYS_PASS = GameTestInstances.create("always_pass");
public static void bootstrap(BootstrapContext<GameTestInstance> context) {
HolderGetter<Consumer<GameTestHelper>> functions = context.lookup(Registries.TEST_FUNCTION);
HolderGetter<TestEnvironmentDefinition> batches = context.lookup(Registries.TEST_ENVIRONMENT);
context.register(ALWAYS_PASS, new FunctionGameTestInstance(BuiltinTestFunctions.ALWAYS_PASS, new TestData<Holder<TestEnvironmentDefinition>>(batches.getOrThrow(GameTestEnvironments.DEFAULT_KEY), Identifier.withDefaultNamespace("empty"), 1, 1, false)));
}
private static ResourceKey<GameTestInstance> create(String id) {
return ResourceKey.create(Registries.TEST_INSTANCE, Identifier.withDefaultNamespace(id));
}
}