Added some nullability annotations in BlueprintsManager

This commit is contained in:
Florian CUNY 2020-01-11 11:21:15 +01:00
parent b2c96b16a0
commit 31d92961b7

View File

@ -141,6 +141,7 @@ public class BlueprintsManager {
* *
* @param addon the {@link GameModeAddon} to get the blueprint bundles. * @param addon the {@link GameModeAddon} to get the blueprint bundles.
*/ */
@NonNull
public Map<String, BlueprintBundle> getBlueprintBundles(@NonNull GameModeAddon addon) { public Map<String, BlueprintBundle> getBlueprintBundles(@NonNull GameModeAddon addon) {
if (!blueprintBundles.containsKey(addon)) { if (!blueprintBundles.containsKey(addon)) {
return new HashMap<>(); return new HashMap<>();
@ -154,6 +155,7 @@ public class BlueprintsManager {
* @return the default blueprint bundle or null if none * @return the default blueprint bundle or null if none
* @since 1.8.0 * @since 1.8.0
*/ */
@Nullable
public BlueprintBundle getDefaultBlueprintBundle(@NonNull GameModeAddon addon) { public BlueprintBundle getDefaultBlueprintBundle(@NonNull GameModeAddon addon) {
if (blueprintBundles.containsKey(addon)) { if (blueprintBundles.containsKey(addon)) {
return blueprintBundles.get(addon).stream().filter(bb -> bb.getUniqueId().equals(DEFAULT_BUNDLE_NAME)).findFirst().orElse(null); return blueprintBundles.get(addon).stream().filter(bb -> bb.getUniqueId().equals(DEFAULT_BUNDLE_NAME)).findFirst().orElse(null);