mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-11 15:57:32 +00:00
Prevent registering null tiers (#9895)
Makes it easier to identify broken mods, as it moves the crash to when the broken mod in question registers the tier, rather than when any mod tries getting the tier.
This commit is contained in:
1 parent
a6adc58655
commit
e094eee54d
1 file changed
+2
@@ -64,6 +64,8 @@ public class TierSortingRegistry {
|
||||
* @param before List of tiers to place this tier before (the tiers in the list will be considered better tiers)
|
||||
*/
|
||||
public static synchronized Tier registerTier(Tier tier, ResourceLocation name, List<Object> after, List<Object> before) {
|
||||
if (tier == null)
|
||||
throw new NullPointerException("Registering a new Tier requires a nonnull tier! ResourceLocation name: " + name);
|
||||
if (tiers.containsKey(name))
|
||||
throw new IllegalStateException("Duplicate tier name " + name);
|
||||
|
||||
|
||||
Reference in new issue
Block a user