mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-19 11:59:25 +00:00
Merge branch '1.7.10'
Conflicts: fml/src/main/java/net/minecraftforge/fml/common/MinecraftDummyContainer.java fml/src/main/java/net/minecraftforge/fml/common/registry/FMLControlledNamespacedRegistry.java fml/src/main/java/net/minecraftforge/fml/common/registry/LanguageRegistry.java
This commit is contained in:
commit
114ac38910
8 files changed
+91
-19
No files matched your search
@@ -266,10 +266,17 @@ public class LoadController
|
||||
|
||||
public void printModStates(StringBuilder ret)
|
||||
{
|
||||
ret.append("\n\tStates:");
|
||||
for (ModState state : ModState.values())
|
||||
ret.append(" '").append(state.getMarker()).append("' = ").append(state.toString());
|
||||
|
||||
for (ModContainer mc : loader.getModList())
|
||||
{
|
||||
ret.append("\n\t").append(mc.getModId()).append("{").append(mc.getVersion()).append("} [").append(mc.getName()).append("] (").append(mc.getSource().getName()).append(") ");
|
||||
Joiner.on("->"). appendTo(ret, modStates.get(mc.getModId()));
|
||||
ret.append("\n\t");
|
||||
for (ModState state : modStates.get(mc.getModId()))
|
||||
ret.append(state.getMarker());
|
||||
|
||||
ret.append("\t").append(mc.getModId()).append("{").append(mc.getVersion()).append("} [").append(mc.getName()).append("] (").append(mc.getSource().getName()).append(") ");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.net.MalformedURLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedHashMap;
|
||||
@@ -504,10 +505,30 @@ public class Loader
|
||||
}
|
||||
modController.transition(LoaderState.CONSTRUCTING, false);
|
||||
modController.distributeStateMessage(LoaderState.CONSTRUCTING, modClassLoader, discoverer.getASMTable(), reverseDependencies);
|
||||
|
||||
List<ModContainer> mods = Lists.newArrayList();
|
||||
mods.addAll(getActiveModList());
|
||||
Collections.sort(mods, new Comparator<ModContainer>()
|
||||
{
|
||||
@Override
|
||||
public int compare(ModContainer o1, ModContainer o2)
|
||||
{
|
||||
return o1.getModId().compareTo(o2.getModId());
|
||||
}
|
||||
});
|
||||
|
||||
FMLLog.fine("Mod signature data");
|
||||
FMLLog.fine(" \tValid Signatures:");
|
||||
for (ModContainer mod : getActiveModList())
|
||||
{
|
||||
FMLLog.fine("\t%s(%s:%s): %s (%s)", mod.getModId(), mod.getName(), mod.getVersion(), mod.getSource().getName(), CertificateHelper.getFingerprint(mod.getSigningCertificate()));
|
||||
if (mod.getSigningCertificate() != null)
|
||||
FMLLog.fine("\t\t(%s) %s\t(%s\t%s)\t%s", CertificateHelper.getFingerprint(mod.getSigningCertificate()), mod.getModId(), mod.getName(), mod.getVersion(), mod.getSource().getName());
|
||||
}
|
||||
FMLLog.fine(" \tMissing Signatures:");
|
||||
for (ModContainer mod : getActiveModList())
|
||||
{
|
||||
if (mod.getSigningCertificate() == null)
|
||||
FMLLog.fine("\t\t%s\t(%s\t%s)\t%s", mod.getModId(), mod.getName(), mod.getVersion(), mod.getSource().getName());
|
||||
}
|
||||
if (getActiveModList().isEmpty())
|
||||
{
|
||||
|
||||
@@ -94,21 +94,23 @@ public enum LoaderState
|
||||
}
|
||||
public enum ModState
|
||||
{
|
||||
UNLOADED("Unloaded"),
|
||||
LOADED("Loaded"),
|
||||
CONSTRUCTED("Constructed"),
|
||||
PREINITIALIZED("Pre-initialized"),
|
||||
INITIALIZED("Initialized"),
|
||||
POSTINITIALIZED("Post-initialized"),
|
||||
AVAILABLE("Available"),
|
||||
DISABLED("Disabled"),
|
||||
ERRORED("Errored");
|
||||
UNLOADED ("Unloaded", "U"),
|
||||
LOADED ("Loaded", "L"),
|
||||
CONSTRUCTED ("Constructed", "C"),
|
||||
PREINITIALIZED ("Pre-initialized", "H"),
|
||||
INITIALIZED ("Initialized", "I"),
|
||||
POSTINITIALIZED("Post-initialized", "J"),
|
||||
AVAILABLE ("Available", "A"),
|
||||
DISABLED ("Disabled", "D"),
|
||||
ERRORED ("Errored", "E");
|
||||
|
||||
private String label;
|
||||
private String marker;
|
||||
|
||||
private ModState(String label)
|
||||
private ModState(String label, String marker)
|
||||
{
|
||||
this.label = label;
|
||||
this.marker = marker;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -116,5 +118,10 @@ public enum LoaderState
|
||||
{
|
||||
return this.label;
|
||||
}
|
||||
|
||||
public String getMarker()
|
||||
{
|
||||
return this.marker;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,8 +12,12 @@
|
||||
|
||||
package net.minecraftforge.fml.common;
|
||||
|
||||
import java.security.cert.Certificate;
|
||||
|
||||
import net.minecraftforge.fml.common.versioning.VersionParser;
|
||||
import net.minecraftforge.fml.common.versioning.VersionRange;
|
||||
import net.minecraftforge.fml.relauncher.FMLLaunchHandler;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
|
||||
public class MinecraftDummyContainer extends DummyModContainer
|
||||
{
|
||||
@@ -33,4 +37,20 @@ public class MinecraftDummyContainer extends DummyModContainer
|
||||
{
|
||||
return staticRange;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Certificate getSigningCertificate()
|
||||
{
|
||||
if (FMLLaunchHandler.side() != Side.CLIENT)
|
||||
return null;
|
||||
|
||||
try
|
||||
{
|
||||
Class<?> cbr = Class.forName("net.minecraft.client.ClientBrandRetriever", false, getClass().getClassLoader());
|
||||
Certificate[] certificates = cbr.getProtectionDomain().getCodeSource().getCertificates();
|
||||
return certificates != null ? certificates[0] : null;
|
||||
}
|
||||
catch (Exception e){} // Errors don't matter just return null.
|
||||
return null;
|
||||
}
|
||||
}
|
||||
+9
-3
@@ -27,6 +27,7 @@ import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.Iterators;
|
||||
|
||||
public class FMLControlledNamespacedRegistry<I> extends RegistryNamespacedDefaultedByKey {
|
||||
public static final boolean DEBUG = Boolean.parseBoolean(System.getProperty("fml.debugRegistryEntries", "false"));
|
||||
private final Class<I> superType;
|
||||
private Object optionalDefaultKey;
|
||||
private I optionalDefaultObject;
|
||||
@@ -431,14 +432,16 @@ public class FMLControlledNamespacedRegistry<I> extends RegistryNamespacedDefaul
|
||||
}
|
||||
addObjectRaw(idToUse, new ResourceLocation(name), thing);
|
||||
|
||||
FMLLog.finer("Registry add: %s %d %s (req. id %d)", name, idToUse, thing, id);
|
||||
if (DEBUG)
|
||||
FMLLog.finer("Registry add: %s %d %s (req. id %d)", name, idToUse, thing, id);
|
||||
return idToUse;
|
||||
}
|
||||
|
||||
void addAlias(String from, String to)
|
||||
{
|
||||
aliases.put(from, to);
|
||||
FMLLog.finer("Registry alias: %s -> %s", from, to);
|
||||
if (DEBUG)
|
||||
FMLLog.finer("Registry alias: %s -> %s", from, to);
|
||||
}
|
||||
|
||||
Map<String,Integer> getEntriesNotIn(FMLControlledNamespacedRegistry<I> registry)
|
||||
@@ -461,6 +464,9 @@ public class FMLControlledNamespacedRegistry<I> extends RegistryNamespacedDefaul
|
||||
|
||||
void dump()
|
||||
{
|
||||
if (!DEBUG)
|
||||
return;
|
||||
|
||||
List<Integer> ids = new ArrayList<Integer>();
|
||||
|
||||
for (I thing : this.typeSafeIterable())
|
||||
@@ -474,7 +480,7 @@ public class FMLControlledNamespacedRegistry<I> extends RegistryNamespacedDefaul
|
||||
for (int id : ids)
|
||||
{
|
||||
I thing = getRaw(id);
|
||||
FMLLog.finer("Registry: %s %d %s", getNameForObject(thing), id, thing);
|
||||
FMLLog.finer("Registry: %d %s %s", id, getNameForObject(thing), thing);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -771,7 +771,8 @@ public class GameData {
|
||||
}
|
||||
else // ItemBlock after its Block
|
||||
{
|
||||
FMLLog.fine("Found matching Block %s for ItemBlock %s at id %d, original id requested: %d", block, item, id, idHint);
|
||||
if (FMLControlledNamespacedRegistry.DEBUG)
|
||||
FMLLog.fine("Found matching Block %s for ItemBlock %s at id %d, original id requested: %d", block, item, id, idHint);
|
||||
freeSlot(id, item); // temporarily free the slot occupied by the Block for the item registration
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ import static net.minecraftforge.common.ForgeVersion.revisionVersion;
|
||||
import static net.minecraftforge.common.config.Configuration.CATEGORY_GENERAL;
|
||||
|
||||
import java.io.File;
|
||||
import java.security.cert.Certificate;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
@@ -380,4 +381,13 @@ public class ForgeModContainer extends DummyModContainer implements WorldAccessC
|
||||
"net.minecraftforge.transformers"
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public Certificate getSigningCertificate()
|
||||
{
|
||||
Certificate[] certificates = getClass().getProtectionDomain().getCodeSource().getCertificates();
|
||||
return certificates != null ? certificates[0] : null;
|
||||
}
|
||||
}
|
||||
@@ -146,7 +146,7 @@ public class MinecraftForge
|
||||
else
|
||||
handlers = ObjectArrays.concat(handlers, server, String.class);
|
||||
|
||||
FMLLog.info("Preloading CrashReport classes", ForgeVersion.getVersion());
|
||||
//FMLLog.info("Preloading CrashReport classes", ForgeVersion.getVersion());
|
||||
for (String s : handlers)
|
||||
{
|
||||
//FMLLog.info("\t" + s);
|
||||
@@ -155,7 +155,7 @@ public class MinecraftForge
|
||||
Class cls = Class.forName(s, false, MinecraftForge.class.getClassLoader());
|
||||
if (cls != null && !Callable.class.isAssignableFrom(cls))
|
||||
{
|
||||
FMLLog.info("\t% s is not a instance of callable!", s);
|
||||
//FMLLog.info("\t% s is not a instance of callable!", s);
|
||||
}
|
||||
}
|
||||
catch (Exception e){}
|
||||
|
||||
Reference in new issue
Block a user