Fix BiomeWrapper warning about null level on startup

This commit is contained in:
James Seibel
2024-02-11 20:24:36 -06:00
parent f4f234a159
commit 2da444d03c
2 changed files with 9 additions and 3 deletions
@@ -65,7 +65,7 @@ public class BiomeWrapper implements IBiomeWrapper
#endif
public static final String EMPTY_STRING = "EMPTY";
public static final BiomeWrapper EMPTY_WRAPPER = new BiomeWrapper(null, null);
public static final BiomeWrapper EMPTY_WRAPPER = new BiomeWrapper();
/** keep track of broken biomes so we don't log every time */
private static final HashSet<String> brokenResourceLocationStrings = new HashSet<>();
@@ -115,7 +115,6 @@ public class BiomeWrapper implements IBiomeWrapper
return newWrapper;
}
}
private BiomeWrapper(#if MC_VER < MC_1_18_2 Biome #else Holder<Biome> #endif biome, ILevelWrapper levelWrapper)
{
this.biome = biome;
@@ -123,6 +122,13 @@ public class BiomeWrapper implements IBiomeWrapper
LOGGER.trace("Created BiomeWrapper ["+this.serialString+"] for ["+biome+"]");
}
/** should only be used to create {@link BiomeWrapper#EMPTY_WRAPPER} */
private BiomeWrapper()
{
this.biome = null;
this.serialString = EMPTY_STRING;
}
//=========//