From 7175165d152c8ca40b635616dae23df561f429dd Mon Sep 17 00:00:00 2001 From: Player Date: Fri, 11 Apr 2014 06:33:36 +0200 Subject: [PATCH] Registry: Crash earlier with conflicting name/object registrations. --- .../common/registry/FMLControlledNamespacedRegistry.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fml/src/main/java/cpw/mods/fml/common/registry/FMLControlledNamespacedRegistry.java b/fml/src/main/java/cpw/mods/fml/common/registry/FMLControlledNamespacedRegistry.java index edc29855ae..6c27d1ceaa 100644 --- a/fml/src/main/java/cpw/mods/fml/common/registry/FMLControlledNamespacedRegistry.java +++ b/fml/src/main/java/cpw/mods/fml/common/registry/FMLControlledNamespacedRegistry.java @@ -307,13 +307,13 @@ public class FMLControlledNamespacedRegistry extends RegistryNamespaced { FMLLog.bigWarning("The object %s has been registered twice for the same name %s.", thing, name); return getId(thing); } - if (getRaw(name) != null) // duplicate name, will crash later due to the BiMap + if (getRaw(name) != null) // duplicate name { - FMLLog.bigWarning("The name %s has been registered twice, for %s and %s.", name, getRaw(name), thing); + throw new IllegalArgumentException(String.format("The name %s has been registered twice, for %s and %s.", name, getRaw(name), thing)); } - if (getId(thing) >= 0) // duplicate object, will crash later due to the BiMap + if (getId(thing) >= 0) // duplicate object { - FMLLog.bigWarning("The object %s has been registered twice, using the names %s and %s.", thing, getNameForObject(thing), name); + throw new IllegalArgumentException(String.format("The object %s has been registered twice, using the names %s and %s.", thing, getNameForObject(thing), name)); } if (GameData.isFrozen(this)) {