Skip to content

Commit

Permalink
Fix TestBootstrap error
Browse files Browse the repository at this point in the history
Down to 165.
  • Loading branch information
Pokechu22 committed Aug 4, 2020
1 parent 8c0542c commit 43a5cc4
Show file tree
Hide file tree
Showing 12 changed files with 73 additions and 0 deletions.
1 change: 1 addition & 0 deletions 1.14.0/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ sourceSets {
runtimeClasspath += api.output
srcDir project(':share_14').file("src/test/java")
exclude "wdl/MixinTest.java"
exclude "wdl/TestBootstrap_1_16.java"
exclude "wdl/DelegateChunkManager_1_14_3.java"
exclude "wdl/DelegateChunkManager_1_14_4.java"
exclude "wdl/ExtWorld_1_14_4.java"
Expand Down
1 change: 1 addition & 0 deletions 1.14.1/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ sourceSets {
runtimeClasspath += api.output
srcDir project(':share_14').file("src/test/java")
exclude "wdl/MixinTest.java"
exclude "wdl/TestBootstrap_1_16.java"
exclude "wdl/DelegateChunkManager_1_14_3.java"
exclude "wdl/DelegateChunkManager_1_14_4.java"
exclude "wdl/ExtWorld_1_14_4.java"
Expand Down
1 change: 1 addition & 0 deletions 1.14.2/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ sourceSets {
runtimeClasspath += api.output
srcDir project(':share_14').file("src/test/java")
exclude "wdl/MixinTest.java"
exclude "wdl/TestBootstrap_1_16.java"
exclude "wdl/DelegateChunkManager_1_14_3.java"
exclude "wdl/DelegateChunkManager_1_14_4.java"
exclude "wdl/ExtWorld_1_14_4.java"
Expand Down
1 change: 1 addition & 0 deletions 1.14.3/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ sourceSets {
runtimeClasspath += api.output
srcDir project(':share_14').file("src/test/java")
exclude "wdl/MixinTest.java"
exclude "wdl/TestBootstrap_1_16.java"
exclude "wdl/DelegateChunkManager_1_14.java"
exclude "wdl/DelegateChunkManager_1_14_4.java"
exclude "wdl/ExtWorld_1_14_4.java"
Expand Down
1 change: 1 addition & 0 deletions 1.14.4-forge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ sourceSets {
runtimeClasspath += api.output
srcDir project(':share_14').file("src/test/java")
exclude "wdl/NoMixinTest.java"
exclude "wdl/TestBootstrap_1_16.java"
exclude "wdl/DelegateChunkManager_1_14.java"
exclude "wdl/DelegateChunkManager_1_14_3.java"
exclude "wdl/ExtWorld_1_14.java"
Expand Down
1 change: 1 addition & 0 deletions 1.14.4/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ sourceSets {
runtimeClasspath += api.output
srcDir project(':share_14').file("src/test/java")
exclude "wdl/MixinTest.java"
exclude "wdl/TestBootstrap_1_16.java"
exclude "wdl/DelegateChunkManager_1_14.java"
exclude "wdl/DelegateChunkManager_1_14_3.java"
exclude "wdl/ExtWorld_1_14.java"
Expand Down
1 change: 1 addition & 0 deletions 1.15.0/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ sourceSets {
runtimeClasspath += api.output
srcDir project(':share_14').file("src/test/java")
exclude "wdl/MixinTest.java"
exclude "wdl/TestBootstrap_1_16.java"
exclude "wdl/DelegateChunkManager_1_14.java"
exclude "wdl/DelegateChunkManager_1_14_3.java"
exclude "wdl/ExtWorld_1_14.java"
Expand Down
1 change: 1 addition & 0 deletions 1.15.1/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ sourceSets {
runtimeClasspath += api.output
srcDir project(':share_14').file("src/test/java")
exclude "wdl/MixinTest.java"
exclude "wdl/TestBootstrap_1_16.java"
exclude "wdl/DelegateChunkManager_1_14.java"
exclude "wdl/DelegateChunkManager_1_14_3.java"
exclude "wdl/ExtWorld_1_14.java"
Expand Down
1 change: 1 addition & 0 deletions 1.15.2-forge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ sourceSets {
runtimeClasspath += api.output
srcDir project(':share_14').file("src/test/java")
exclude "wdl/NoMixinTest.java"
exclude "wdl/TestBootstrap_1_16.java"
exclude "wdl/DelegateChunkManager_1_14.java"
exclude "wdl/DelegateChunkManager_1_14_3.java"
exclude "wdl/ExtWorld_1_14.java"
Expand Down
1 change: 1 addition & 0 deletions 1.15.2/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ sourceSets {
runtimeClasspath += api.output
srcDir project(':share_14').file("src/test/java")
exclude "wdl/MixinTest.java"
exclude "wdl/TestBootstrap_1_16.java"
exclude "wdl/DelegateChunkManager_1_14.java"
exclude "wdl/DelegateChunkManager_1_14_3.java"
exclude "wdl/ExtWorld_1_14.java"
Expand Down
1 change: 1 addition & 0 deletions 1.16.1/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ sourceSets {
runtimeClasspath += api.output
srcDir project(':share_14').file("src/test/java")
exclude "wdl/MixinTest.java"
exclude "wdl/TestBootstrap_1_14.java"
exclude "wdl/DelegateChunkManager_1_14.java"
exclude "wdl/DelegateChunkManager_1_14_3.java"
exclude "wdl/ExtWorld_1_14.java"
Expand Down
62 changes: 62 additions & 0 deletions share_14/src/test/java/wdl/TestBootstrap_1_16.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/*
* This file is part of World Downloader: A mod to make backups of your multiplayer worlds.
* https://www.minecraftforum.net/forums/mapping-and-modding-java-edition/minecraft-mods/2520465-world-downloader-mod-create-backups-of-your-builds
*
* Copyright (c) 2014 nairol, cubic72
* Copyright (c) 2018-2020 Pokechu22, julialy
*
* This project is licensed under the MMPLv2. The full text of the MMPL can be
* found in LICENSE.md, or online at https://github.com/iopleke/MMPLv2/blob/master/LICENSE.md
* For information about this the MMPLv2, see https://stopmodreposts.org/
*
* Do not redistribute (in modified or unmodified form) without prior permission.
*/
package wdl;

import java.io.IOException;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import net.minecraft.client.resources.LanguageManager;
import net.minecraft.resources.IResourcePack;
import net.minecraft.resources.ResourcePackType;
import net.minecraft.resources.SimpleReloadableResourceManager;
import net.minecraft.resources.VanillaPack;
import net.minecraft.util.registry.Bootstrap;

/**
* This class initializes Minecraft's bootstrap and language files.
*/
final class TestBootstrap {
private TestBootstrap() { throw new AssertionError(); }

private static final Logger LOGGER = LogManager.getLogger();
private static boolean ran = false;

static void init() {
if (ran) {
return;
}
ran = true;
//SharedConstants.developmentMode = true;
LOGGER.debug("Initializing bootstrap...");
Bootstrap.register();
LOGGER.debug("Initialized bootstrap.");

LOGGER.debug("Setting up I18n...");
// Prepare I18n by constructing a LanguageManager and preparing it...
// (some tests depend on it)
LanguageManager languageManager = new LanguageManager("en_us");
SimpleReloadableResourceManager resourceManager = new SimpleReloadableResourceManager(ResourcePackType.CLIENT_RESOURCES);
IResourcePack pack = new VanillaPack("minecraft", "realms", "wdl");
resourceManager.addResourcePack(pack);
languageManager.onResourceManagerReload(resourceManager);
try {
pack.close(); // Does nothing (call is only present to suppress warnings)
} catch (IOException ex) {
throw new AssertionError(ex); // Should not happen
}
LOGGER.debug("Set up I18n.");
}
}

0 comments on commit 43a5cc4

Please sign in to comment.