Fix BrandingControl caching text through resource reload

This commit is contained in:
tterrag committed 2019-03-29 16:29:26 -04:00
1 parent 98a470d813
commit 98ef5049f4
2 files changed
+21

No files matched your search

@@ -21,11 +21,16 @@ package net.minecraftforge.fml;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Lists;
import net.minecraft.resources.IResourceManager;
import net.minecraftforge.resource.IResourceType;
import net.minecraftforge.resource.VanillaResourceType;
import net.minecraftforge.versions.forge.ForgeVersion;
import net.minecraftforge.versions.mcp.MCPVersion;
import java.util.List;
import java.util.function.BiConsumer;
import java.util.function.Predicate;
import java.util.stream.IntStream;
public class BrandingControl
@@ -70,4 +75,11 @@ public class BrandingControl
public static String getServerBranding() {
return "forge";
}
public static void clearCaches(IResourceManager resourceManager, Predicate<IResourceType> resourcePredicate) {
if (resourcePredicate.test(VanillaResourceType.LANGUAGES)) {
brandings = null;
brandingsNoMC = null;
}
}
}