From 052d798970ba58d102accbc26feaa4a1e38a0a47 Mon Sep 17 00:00:00 2001 From: Christian Date: Sun, 23 Dec 2012 22:27:02 -0500 Subject: [PATCH] Some tweaks for signing and ID matching --- fml/common/cpw/mods/fml/common/FMLDummyContainer.java | 8 ++++++++ fml/common/cpw/mods/fml/common/FMLModContainer.java | 2 +- fml/common/cpw/mods/fml/common/registry/GameData.java | 5 ++++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/fml/common/cpw/mods/fml/common/FMLDummyContainer.java b/fml/common/cpw/mods/fml/common/FMLDummyContainer.java index 0a7715054..a0f56a99b 100644 --- a/fml/common/cpw/mods/fml/common/FMLDummyContainer.java +++ b/fml/common/cpw/mods/fml/common/FMLDummyContainer.java @@ -14,6 +14,7 @@ package cpw.mods.fml.common; +import java.security.cert.Certificate; import java.util.Arrays; import java.util.Map; 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; + } } diff --git a/fml/common/cpw/mods/fml/common/FMLModContainer.java b/fml/common/cpw/mods/fml/common/FMLModContainer.java index c9e28d2b6..fb2d132eb 100644 --- a/fml/common/cpw/mods/fml/common/FMLModContainer.java +++ b/fml/common/cpw/mods/fml/common/FMLModContainer.java @@ -431,7 +431,7 @@ public class FMLModContainer implements ModContainer String expectedFingerprint = (String) descriptor.get("certificateFingerprint"); fingerprintNotPresent = true; - if (expectedFingerprint != "" && !sourceFingerprints.contains(expectedFingerprint)) + if (expectedFingerprint!=null && expectedFingerprint != "" && !sourceFingerprints.contains(expectedFingerprint)) { Level warnLevel = Level.SEVERE; if (source.isDirectory()) diff --git a/fml/common/cpw/mods/fml/common/registry/GameData.java b/fml/common/cpw/mods/fml/common/registry/GameData.java index f603b25c0..3929d3787 100644 --- a/fml/common/cpw/mods/fml/common/registry/GameData.java +++ b/fml/common/cpw/mods/fml/common/registry/GameData.java @@ -87,7 +87,10 @@ 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); } idMap.put(item.field_77779_bT, itemData); - FMLLog.fine("[ItemTracker] Adding item %s(%d) owned by %s", item.getClass().getName(), item.field_77779_bT, mc.getModId()); + if (!"Minecraft".equals(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 worldSaveItems)