mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-18 19:39:22 +00:00
Fix Language Registry, closes #163
This commit is contained in:
1 parent
047de02402
commit
d25d70d59d
1 file changed
+19
-1
@@ -12,6 +12,8 @@ import java.util.logging.Level;
|
||||
import com.google.common.base.Charsets;
|
||||
|
||||
import cpw.mods.fml.common.FMLLog;
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.ModContainer;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
@@ -122,7 +124,23 @@ public class LanguageRegistry
|
||||
|
||||
public void loadLocalization(String localizationFile, String lang, boolean isXML)
|
||||
{
|
||||
loadLocalization(this.getClass().getResource(localizationFile), lang, isXML);
|
||||
URL urlResource = this.getClass().getResource(localizationFile);
|
||||
if (urlResource != null)
|
||||
{
|
||||
loadLocalization(urlResource, lang, isXML);
|
||||
}
|
||||
else
|
||||
{
|
||||
ModContainer activeModContainer = Loader.instance().activeModContainer();
|
||||
if (activeModContainer!=null)
|
||||
{
|
||||
FMLLog.log(activeModContainer.getModId(), Level.SEVERE, "The language resource %s cannot be located on the classpath. This is a programming error.", localizationFile);
|
||||
}
|
||||
else
|
||||
{
|
||||
FMLLog.log(Level.SEVERE, "The language resource %s cannot be located on the classpath. This is a programming error.", localizationFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void loadLocalization(URL localizationFile, String lang, boolean isXML)
|
||||
|
||||
Reference in new issue
Block a user