@@ -36,17 +36,17 @@ public abstract class AbstractTestingBase {
|
||||
public static final TagRegistry TAG_REGISTRY;
|
||||
|
||||
static {
|
||||
SharedConstants.a();
|
||||
DispenserRegistry.init();
|
||||
SharedConstants.tryDetectVersion();
|
||||
DispenserRegistry.bootStrap();
|
||||
// Set up resource manager
|
||||
ResourceManager resourceManager = new ResourceManager(EnumResourcePackType.SERVER_DATA);
|
||||
// add tags and loot tables for unit tests
|
||||
resourceManager.a(TAG_REGISTRY = new TagRegistry(IRegistryCustom.a()));
|
||||
resourceManager.a(LOOT_TABLE_REGISTRY = new LootTableRegistry(new LootPredicateManager()));
|
||||
resourceManager.registerReloadListener(TAG_REGISTRY = new TagRegistry(IRegistryCustom.builtin()));
|
||||
resourceManager.registerReloadListener(LOOT_TABLE_REGISTRY = new LootTableRegistry(new LootPredicateManager()));
|
||||
// Register vanilla pack
|
||||
resourceManager.a(MoreExecutors.directExecutor(), MoreExecutors.directExecutor(), Collections.singletonList(new ResourcePackVanilla(ResourcePackSourceVanilla.BUILT_IN_METADATA, "minecraft")), CompletableFuture.completedFuture(Unit.INSTANCE)).join();
|
||||
resourceManager.reload(MoreExecutors.directExecutor(), MoreExecutors.directExecutor(), Collections.singletonList(new ResourcePackVanilla(ResourcePackSourceVanilla.BUILT_IN_METADATA, "minecraft")), CompletableFuture.completedFuture(Unit.INSTANCE)).join();
|
||||
// Bind tags
|
||||
TAG_REGISTRY.a().bind();
|
||||
TAG_REGISTRY.getTags().bindToGlobal();
|
||||
|
||||
DummyServer.setup();
|
||||
DummyEnchantments.setup();
|
||||
|
||||
@@ -93,7 +93,7 @@ public final class DummyServer implements InvocationHandler {
|
||||
@Override
|
||||
public Object handle(DummyServer server, Object[] args) {
|
||||
NamespacedKey key = (NamespacedKey) args[0];
|
||||
return new CraftLootTable(key, AbstractTestingBase.LOOT_TABLE_REGISTRY.getLootTable(CraftNamespacedKey.toMinecraft(key)));
|
||||
return new CraftLootTable(key, AbstractTestingBase.LOOT_TABLE_REGISTRY.get(CraftNamespacedKey.toMinecraft(key)));
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user