diff --git a/src/main/java/net/minecraftforge/event/RegistryEvent.java b/src/main/java/net/minecraftforge/event/RegistryEvent.java index 718ed6045..4cf220c06 100644 --- a/src/main/java/net/minecraftforge/event/RegistryEvent.java +++ b/src/main/java/net/minecraftforge/event/RegistryEvent.java @@ -122,9 +122,20 @@ public class RegistryEvent> extends GenericEven return this.registry; } + /* + * This used to be fired on the Mod specific bus, and we could tell which mod was asking for mappings. + * It no longer is, so this method is useless and just returns getAllMappings. + * TODO: Ask cpw how if he wants to re-enable the ModBus rethrow. + */ + @Deprecated public ImmutableList> getMappings() { - return ImmutableList.copyOf(this.mappings.stream().filter(e -> e.key.getNamespace().equals(this.activeMod.getModId())).collect(Collectors.toList())); + return this.activeMod == null ? getAllMappings() : getMappings(this.activeMod.getModId()); + } + + public ImmutableList> getMappings(String modid) + { + return ImmutableList.copyOf(this.mappings.stream().filter(e -> e.key.getNamespace().equals(modid)).collect(Collectors.toList())); } public ImmutableList> getAllMappings()