Quiet FMLControlledNamespacedRegistry debug spam by default. Reenable using -Dfml.debugRegistryEntries=true.
This commit is contained in:
parent
b985384fab
commit
847c0246cd
2 changed files with 11 additions and 4 deletions
|
@ -23,6 +23,7 @@ import cpw.mods.fml.common.FMLLog;
|
|||
import cpw.mods.fml.common.functions.GenericIterableFactory;
|
||||
|
||||
public class FMLControlledNamespacedRegistry<I> extends RegistryNamespaced {
|
||||
public static final boolean DEBUG = Boolean.parseBoolean(System.getProperty("fml.debugRegistryEntries", "false"));
|
||||
private final Class<I> superType;
|
||||
private String optionalDefaultName;
|
||||
private I optionalDefaultObject;
|
||||
|
@ -396,14 +397,16 @@ public class FMLControlledNamespacedRegistry<I> extends RegistryNamespaced {
|
|||
}
|
||||
addObjectRaw(idToUse, 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)
|
||||
|
@ -426,6 +429,9 @@ public class FMLControlledNamespacedRegistry<I> extends RegistryNamespaced {
|
|||
|
||||
void dump()
|
||||
{
|
||||
if (!DEBUG)
|
||||
return;
|
||||
|
||||
List<Integer> ids = new ArrayList<Integer>();
|
||||
|
||||
for (I thing : this.typeSafeIterable())
|
||||
|
@ -439,7 +445,7 @@ public class FMLControlledNamespacedRegistry<I> extends RegistryNamespaced {
|
|||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -834,7 +834,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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue