Turned minecraft into a proper Mod, with a "dummy" language provider.

Also fixed the "translations" not being available early if an exception occurs
by force loading the forge and MC ones. Closes #5984

Signed-off-by: cpw <[email protected]>
This commit is contained in:
cpw committed 2019-08-04 20:16:01 -04:00
1 parent 44f3f9e2d0
commit 5048739b7f
18 files changed
+257 -134

No files matched your search

@@ -304,7 +304,7 @@ public class ForgeRegistry<V extends IForgeRegistryEntry<V>> implements IForgeRe
int add(int id, V value)
{
final String owner = ModLoadingContext.get().getActiveContainer().getNamespace();
final String owner = ModLoadingContext.get().getActiveNamespace();
return add(id, value, owner);
}
@@ -936,7 +936,7 @@ public class GameData
int index = name.lastIndexOf(':');
String oldPrefix = index == -1 ? "" : name.substring(0, index).toLowerCase(Locale.ROOT);
name = index == -1 ? name : name.substring(index + 1);
String prefix = ModLoadingContext.get().getActiveContainer().getNamespace();
String prefix = ModLoadingContext.get().getActiveNamespace();
if (warnOverrides && !oldPrefix.equals(prefix) && oldPrefix.length() > 0)
{
LogManager.getLogger().info("Potentially Dangerous alternative prefix `{}` for name `{}`, expected `{}`. This could be a intended override, but in most cases indicates a broken mod.", oldPrefix, name, prefix);
@@ -105,7 +105,7 @@ public class ObjectHolderRegistry
// double pass - get all the class level annotations first, then the field level annotations
annotations.stream().filter(a -> OBJECT_HOLDER.equals(a.getAnnotationType())).filter(a -> a.getTargetType() == ElementType.TYPE)
.forEach(data -> scanTarget(classModIds, classCache, data.getClassType(), null, (String)data.getAnnotationData().get("value"), true, data.getClassType().getClassName().startsWith("net.minecraft.")));
.forEach(data -> scanTarget(classModIds, classCache, data.getClassType(), null, (String)data.getAnnotationData().get("value"), true, data.getClassType().getClassName().startsWith("net.minecraft.")));
annotations.stream().filter(a -> OBJECT_HOLDER.equals(a.getAnnotationType())).filter(a -> a.getTargetType() == ElementType.FIELD)
.forEach(data -> scanTarget(classModIds, classCache, data.getClassType(), data.getMemberName(), (String)data.getAnnotationData().get("value"), false, false));