[Change] Added compiler hint for possible null return

This commit is contained in:
Frank 2023-06-23 08:06:45 +02:00
parent 1c61c0e3cc
commit 522e472e03

View file

@ -529,9 +529,9 @@ public class BiomeAPI {
* Get {@link BCLBiome} from given {@link ResourceLocation}. * Get {@link BCLBiome} from given {@link ResourceLocation}.
* *
* @param biomeID - biome {@link ResourceLocation}. * @param biomeID - biome {@link ResourceLocation}.
* @return {@link BCLBiome} or {@code BiomeAPI.EMPTY_BIOME}. * @return {@link BCLBiome} or {@code null}.
*/ */
public static BCLBiome getBiome(ResourceLocation biomeID) { public static @Nullable BCLBiome getBiome(ResourceLocation biomeID) {
return BCLBiomeRegistry.getBiomeOrNull(biomeID, BCLBiomeRegistry.registryOrNull()); return BCLBiomeRegistry.getBiomeOrNull(biomeID, BCLBiomeRegistry.registryOrNull());
} }
@ -539,9 +539,9 @@ public class BiomeAPI {
* Get {@link BCLBiome} from given {@link Biome}. * Get {@link BCLBiome} from given {@link Biome}.
* *
* @param biome - biome {@link Biome}. * @param biome - biome {@link Biome}.
* @return {@link BCLBiome} or {@code BiomeAPI.EMPTY_BIOME}. * @return {@link BCLBiome} or {@code null}.
*/ */
public static BCLBiome getBiome(Biome biome) { public static @Nullable BCLBiome getBiome(Biome biome) {
return getBiome(BiomeAPI.getBiomeID(biome)); return getBiome(BiomeAPI.getBiomeID(biome));
} }
@ -549,9 +549,9 @@ public class BiomeAPI {
* Get {@link BCLBiome} from given {@link Biome}. * Get {@link BCLBiome} from given {@link Biome}.
* *
* @param biome - biome {@link Biome}. * @param biome - biome {@link Biome}.
* @return {@link BCLBiome} or {@code BiomeAPI.EMPTY_BIOME}. * @return {@link BCLBiome} or {@code null}.
*/ */
public static BCLBiome getBiome(Holder<Biome> biome) { public static @Nullable BCLBiome getBiome(Holder<Biome> biome) {
return getBiome(BiomeAPI.getBiomeID(biome)); return getBiome(BiomeAPI.getBiomeID(biome));
} }