Skip to content

Commit

Permalink
Null pointer fix
Browse files Browse the repository at this point in the history
  • Loading branch information
paulevsGitch committed Jun 7, 2021
1 parent cfaf826 commit 1e20595
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ yarn_mappings=6
loader_version=0.11.3

# Mod Properties
mod_version = 0.1.18
mod_version = 0.1.19
maven_group = ru.bclib
archives_base_name = bclib

Expand Down
8 changes: 4 additions & 4 deletions src/main/java/ru/bclib/mixin/common/ServerLevelMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,19 @@

@Mixin(ServerLevel.class)
public abstract class ServerLevelMixin extends Level {
private static String be_lastWorld = null;
private static String bcl_lastWorld = null;

protected ServerLevelMixin(WritableLevelData writableLevelData, ResourceKey<Level> resourceKey, DimensionType dimensionType, Supplier<ProfilerFiller> supplier, boolean bl, boolean bl2, long l) {
super(writableLevelData, resourceKey, dimensionType, supplier, bl, bl2, l);
}

@Inject(method = "<init>*", at = @At("TAIL"))
private void be_onServerWorldInit(MinecraftServer server, Executor workerExecutor, LevelStorageSource.LevelStorageAccess session, ServerLevelData properties, ResourceKey<Level> registryKey, DimensionType dimensionType, ChunkProgressListener worldGenerationProgressListener, ChunkGenerator chunkGenerator, boolean debugWorld, long l, List<CustomSpawner> list, boolean bl, CallbackInfo info) {
if (be_lastWorld != null && be_lastWorld.equals(session.getLevelId())) {
private void bcl_onServerWorldInit(MinecraftServer server, Executor workerExecutor, LevelStorageSource.LevelStorageAccess session, ServerLevelData properties, ResourceKey<Level> registryKey, DimensionType dimensionType, ChunkProgressListener worldGenerationProgressListener, ChunkGenerator chunkGenerator, boolean debugWorld, long l, List<CustomSpawner> list, boolean bl, CallbackInfo info) {
if (bcl_lastWorld != null && bcl_lastWorld.equals(session.getLevelId())) {
return;
}

be_lastWorld = session.getLevelId();
bcl_lastWorld = session.getLevelId();

ServerLevel world = ServerLevel.class.cast(this);
File dir = session.getDimensionPath(world.dimension());
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/ru/bclib/world/biomes/BCLBiome.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ public boolean containsSubBiome(BCLBiome biome) {
}

public BCLBiome getSubBiome(Random random) {
return subbiomes.get(random);
BCLBiome biome = subbiomes.get(random);
return biome == null ? this : biome;
}

public BCLBiome getParentBiome() {
Expand Down

0 comments on commit 1e20595

Please sign in to comment.