Some tweaks for signing and ID matching
This commit is contained in:
parent
484a673b1f
commit
052d798970
3 changed files with 13 additions and 2 deletions
|
@ -14,6 +14,7 @@
|
||||||
|
|
||||||
package cpw.mods.fml.common;
|
package cpw.mods.fml.common;
|
||||||
|
|
||||||
|
import java.security.cert.Certificate;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
@ -116,4 +117,11 @@ public class FMLDummyContainer extends DummyModContainer implements WorldAccessC
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Certificate getSigningCertificate()
|
||||||
|
{
|
||||||
|
Certificate[] certificates = getClass().getProtectionDomain().getCodeSource().getCertificates();
|
||||||
|
return certificates != null ? certificates[0] : null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -431,7 +431,7 @@ public class FMLModContainer implements ModContainer
|
||||||
String expectedFingerprint = (String) descriptor.get("certificateFingerprint");
|
String expectedFingerprint = (String) descriptor.get("certificateFingerprint");
|
||||||
|
|
||||||
fingerprintNotPresent = true;
|
fingerprintNotPresent = true;
|
||||||
if (expectedFingerprint != "" && !sourceFingerprints.contains(expectedFingerprint))
|
if (expectedFingerprint!=null && expectedFingerprint != "" && !sourceFingerprints.contains(expectedFingerprint))
|
||||||
{
|
{
|
||||||
Level warnLevel = Level.SEVERE;
|
Level warnLevel = Level.SEVERE;
|
||||||
if (source.isDirectory())
|
if (source.isDirectory())
|
||||||
|
|
|
@ -87,8 +87,11 @@ public class GameData {
|
||||||
FMLLog.info("[ItemTracker] The mod %s is overwriting existing item at %d (%s from %s) with %s", mc.getModId(), id.getItemId(), id.getItemType(), id.getModId(), itemType);
|
FMLLog.info("[ItemTracker] The mod %s is overwriting existing item at %d (%s from %s) with %s", mc.getModId(), id.getItemId(), id.getItemType(), id.getModId(), itemType);
|
||||||
}
|
}
|
||||||
idMap.put(item.field_77779_bT, itemData);
|
idMap.put(item.field_77779_bT, itemData);
|
||||||
|
if (!"Minecraft".equals(mc.getModId()))
|
||||||
|
{
|
||||||
FMLLog.fine("[ItemTracker] Adding item %s(%d) owned by %s", item.getClass().getName(), item.field_77779_bT, mc.getModId());
|
FMLLog.fine("[ItemTracker] Adding item %s(%d) owned by %s", item.getClass().getName(), item.field_77779_bT, mc.getModId());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static void validateWorldSave(Set<ItemData> worldSaveItems)
|
public static void validateWorldSave(Set<ItemData> worldSaveItems)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue