Prevent NPE and deprecated MissingMappings.getMappings function. Closes #6252
This commit is contained in:
parent
b6a9274870
commit
c4b148b84b
1 changed files with 12 additions and 1 deletions
|
@ -122,9 +122,20 @@ public class RegistryEvent<T extends IForgeRegistryEntry<T>> extends GenericEven
|
||||||
return this.registry;
|
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<Mapping<T>> getMappings()
|
public ImmutableList<Mapping<T>> 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<Mapping<T>> getMappings(String modid)
|
||||||
|
{
|
||||||
|
return ImmutableList.copyOf(this.mappings.stream().filter(e -> e.key.getNamespace().equals(modid)).collect(Collectors.toList()));
|
||||||
}
|
}
|
||||||
|
|
||||||
public ImmutableList<Mapping<T>> getAllMappings()
|
public ImmutableList<Mapping<T>> getAllMappings()
|
||||||
|
|
Loading…
Reference in a new issue