use of net.minecraft.world.level.storage.ServerLevelData in project SpongeCommon by SpongePowered.
the class PrimaryLevelDataMixin method bridge$world.
@Override
@Nullable
public ServerLevel bridge$world() {
if (!Sponge.isServerAvailable()) {
return null;
}
final ServerLevel world = SpongeCommon.server().getLevel(SpongeWorldManager.createRegistryKey(this.impl$key));
if (world == null) {
return null;
}
final ServerLevelData levelData = (ServerLevelData) world.getLevelData();
if (levelData != this) {
return null;
}
return world;
}
Aggregations